Class WorkflowEntity

java.lang.Object
ai.nervemind.app.database.model.WorkflowEntity

@Entity public class WorkflowEntity extends Object
JPA Entity for Workflow. Stores workflow definition including nodes and connections as JSON.
  • Constructor Details

    • WorkflowEntity

      protected WorkflowEntity()
      Default constructor for JPA.
    • WorkflowEntity

      public WorkflowEntity(String name)
      Creates a new workflow with the specified name. Initializes with empty nodes and connections arrays.
      Parameters:
      name - the name of the workflow
  • Method Details

    • onCreate

      protected void onCreate()
      Lifecycle callback executed before the entity is persisted. Initializes timestamps if not already set.
    • onUpdate

      protected void onUpdate()
      Lifecycle callback executed before the entity is updated. Updates the last modified timestamp.
    • getId

      public Long getId()
      Gets the workflow ID.
      Returns:
      the workflow ID
    • setId

      public void setId(Long id)
      Sets the workflow ID.
      Parameters:
      id - the workflow ID to set
    • getName

      public String getName()
      Gets the workflow name.
      Returns:
      the workflow name
    • setName

      public void setName(String name)
      Sets the workflow name.
      Parameters:
      name - the workflow name to set
    • getDescription

      public String getDescription()
      Gets the workflow description.
      Returns:
      the workflow description
    • setDescription

      public void setDescription(String description)
      Sets the workflow description.
      Parameters:
      description - the workflow description to set
    • getNodesJson

      public String getNodesJson()
      Gets the serialized nodes JSON.
      Returns:
      the serialized nodes JSON
    • setNodesJson

      public void setNodesJson(String nodesJson)
      Sets the serialized nodes JSON.
      Parameters:
      nodesJson - the nodes JSON to set
    • getConnectionsJson

      public String getConnectionsJson()
      Gets the serialized connections JSON.
      Returns:
      the serialized connections JSON
    • setConnectionsJson

      public void setConnectionsJson(String connectionsJson)
      Sets the serialized connections JSON.
      Parameters:
      connectionsJson - the connections JSON to set
    • getSettingsJson

      public String getSettingsJson()
      Gets the serialized settings JSON.
      Returns:
      the serialized settings JSON
    • setSettingsJson

      public void setSettingsJson(String settingsJson)
      Sets the serialized settings JSON.
      Parameters:
      settingsJson - the settings JSON to set
    • isActive

      public boolean isActive()
      Checks if the workflow is active.
      Returns:
      true if the workflow is active
    • setActive

      public void setActive(boolean active)
      Sets the active status of the workflow.
      Parameters:
      active - the active status to set
    • getTriggerType

      public ai.nervemind.common.enums.TriggerType getTriggerType()
      Gets the trigger type.
      Returns:
      the trigger type
    • setTriggerType

      public void setTriggerType(ai.nervemind.common.enums.TriggerType triggerType)
      Sets the trigger type.
      Parameters:
      triggerType - the trigger type to set
    • getCronExpression

      public String getCronExpression()
      Gets the cron expression.
      Returns:
      the cron expression
    • setCronExpression

      public void setCronExpression(String cronExpression)
      Sets the cron expression.
      Parameters:
      cronExpression - the cron expression to set
    • getCreatedAt

      public Instant getCreatedAt()
      Gets the creation timestamp.
      Returns:
      the creation timestamp
    • setCreatedAt

      public void setCreatedAt(Instant createdAt)
      Sets the creation timestamp.
      Parameters:
      createdAt - the creation timestamp to set
    • getUpdatedAt

      public Instant getUpdatedAt()
      Gets the update timestamp.
      Returns:
      the update timestamp
    • setUpdatedAt

      public void setUpdatedAt(Instant updatedAt)
      Sets the update timestamp.
      Parameters:
      updatedAt - the update timestamp to set
    • getLastExecuted

      public Instant getLastExecuted()
      Gets the last execution timestamp.
      Returns:
      the last execution timestamp
    • setLastExecuted

      public void setLastExecuted(Instant lastExecuted)
      Sets the last execution timestamp.
      Parameters:
      lastExecuted - the last execution timestamp to set
    • getVersion

      public int getVersion()
      Gets the version.
      Returns:
      the version
    • setVersion

      public void setVersion(int version)
      Sets the version.
      Parameters:
      version - the version to set