Package io.nflow.engine.service
Class WorkflowDefinitionService
- java.lang.Object
-
- io.nflow.engine.service.WorkflowDefinitionService
-
@Component @Singleton public class WorkflowDefinitionService extends Object
Service for managing workflow definitions.
-
-
Constructor Summary
Constructors Constructor Description WorkflowDefinitionService(WorkflowDefinitionDao workflowDefinitionDao, Environment env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWorkflowDefinition(WorkflowDefinition wd)Add given workflow definition to managed definitions.WorkflowDefinitiongetWorkflowDefinition(String type)Return the workflow definition that matches the give workflow type name.List<WorkflowDefinition>getWorkflowDefinitions()Return all managed workflow definitions.voidpostProcessWorkflowDefinitions()Persist all loaded workflow definitions if nflow.autoinit is false and nflow.definition.persist is true.
-
-
-
Constructor Detail
-
WorkflowDefinitionService
@Inject public WorkflowDefinitionService(WorkflowDefinitionDao workflowDefinitionDao, Environment env)
-
-
Method Detail
-
getWorkflowDefinition
public WorkflowDefinition getWorkflowDefinition(String type)
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
public List<WorkflowDefinition> 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
public void addWorkflowDefinition(WorkflowDefinition wd)
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.
-
-