Class WorkflowEntity
java.lang.Object
ai.nervemind.app.database.model.WorkflowEntity
JPA Entity for Workflow.
Stores workflow definition including nodes and connections as JSON.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for JPA.WorkflowEntity(String name) Creates a new workflow with the specified name. -
Method Summary
Modifier and TypeMethodDescriptionGets the serialized connections JSON.Gets the creation timestamp.Gets the cron expression.Gets the workflow description.getId()Gets the workflow ID.Gets the last execution timestamp.getName()Gets the workflow name.Gets the serialized nodes JSON.Gets the serialized settings JSON.ai.nervemind.common.enums.TriggerTypeGets the trigger type.Gets the update timestamp.intGets the version.booleanisActive()Checks if the workflow is active.protected voidonCreate()Lifecycle callback executed before the entity is persisted.protected voidonUpdate()Lifecycle callback executed before the entity is updated.voidsetActive(boolean active) Sets the active status of the workflow.voidsetConnectionsJson(String connectionsJson) Sets the serialized connections JSON.voidsetCreatedAt(Instant createdAt) Sets the creation timestamp.voidsetCronExpression(String cronExpression) Sets the cron expression.voidsetDescription(String description) Sets the workflow description.voidSets the workflow ID.voidsetLastExecuted(Instant lastExecuted) Sets the last execution timestamp.voidSets the workflow name.voidsetNodesJson(String nodesJson) Sets the serialized nodes JSON.voidsetSettingsJson(String settingsJson) Sets the serialized settings JSON.voidsetTriggerType(ai.nervemind.common.enums.TriggerType triggerType) Sets the trigger type.voidsetUpdatedAt(Instant updatedAt) Sets the update timestamp.voidsetVersion(int version) Sets the version.
-
Constructor Details
-
WorkflowEntity
protected WorkflowEntity()Default constructor for JPA. -
WorkflowEntity
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
-
setId
-
getName
-
setName
Sets the workflow name.- Parameters:
name- the workflow name to set
-
getDescription
-
setDescription
Sets the workflow description.- Parameters:
description- the workflow description to set
-
getNodesJson
-
setNodesJson
Sets the serialized nodes JSON.- Parameters:
nodesJson- the nodes JSON to set
-
getConnectionsJson
Gets the serialized connections JSON.- Returns:
- the serialized connections JSON
-
setConnectionsJson
Sets the serialized connections JSON.- Parameters:
connectionsJson- the connections JSON to set
-
getSettingsJson
Gets the serialized settings JSON.- Returns:
- the serialized settings JSON
-
setSettingsJson
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
-
setCronExpression
Sets the cron expression.- Parameters:
cronExpression- the cron expression to set
-
getCreatedAt
-
setCreatedAt
Sets the creation timestamp.- Parameters:
createdAt- the creation timestamp to set
-
getUpdatedAt
-
setUpdatedAt
Sets the update timestamp.- Parameters:
updatedAt- the update timestamp to set
-
getLastExecuted
Gets the last execution timestamp.- Returns:
- the last execution timestamp
-
setLastExecuted
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
-