Package io.nflow.engine.service
Class WorkflowDefinitionService
java.lang.Object
io.nflow.engine.service.WorkflowDefinitionService
Service for managing workflow definitions.
-
Constructor Summary
ConstructorsConstructorDescriptionWorkflowDefinitionService(WorkflowDefinitionDao workflowDefinitionDao, Environment env) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd given workflow definition to managed definitions.getWorkflowDefinition(String type) Return the workflow definition that matches the give workflow type name.Return all managed workflow definitions.voidPersist all loaded workflow definitions if nflow.autoinit is false and nflow.definition.persist is true.
-
Constructor Details
-
WorkflowDefinitionService
@Inject public WorkflowDefinitionService(WorkflowDefinitionDao workflowDefinitionDao, Environment env)
-
-
Method Details
-
getWorkflowDefinition
Return the workflow definition that matches the give workflow type name.- Parameters:
type- Workflow definition type.- Returns:
- The workflow definition or null if not found.
-
getWorkflowDefinitions
Return all managed workflow definitions.- Returns:
- List of workflow definitions.
-
postProcessWorkflowDefinitions
public void postProcessWorkflowDefinitions()Persist all loaded workflow definitions if nflow.autoinit is false and nflow.definition.persist is true. If nflow.autoinit is true, definitions are persisted when they are added to managed definitions. -
addWorkflowDefinition
Add given workflow definition to managed definitions. Persist given definition if nflow.autoinit and nflow.definition.persist are true.- Parameters:
wd- The workflow definition to be added.- Throws:
IllegalStateException- When a definition with the same type has already been added.
-