Package org.alfresco.repo.workflow
Interface WorkflowComponent
- All Known Subinterfaces:
WorkflowEngine
- All Known Implementing Classes:
ActivitiWorkflowEngine
public interface WorkflowComponent
SPI to be implemented by a BPM Engine that provides Workflow instance management.
- Author:
- davidc
-
Method Summary
Modifier and TypeMethodDescriptioncancelWorkflow(String workflowId) Cancel an "in-flight" Workflow instancecancelWorkflows(List<String> workflowIds) Cancel a batch of "in-flight" Workflow instancesvoidcheckDeploymentCategory(InputStream workflowDefinition) Sets the deployment category if applicable to allow the workflow to have full accesslongcountWorkflows(WorkflowInstanceQuery workflowInstanceQuery) Get count of workflow instancesdeleteWorkflow(String workflowId) Delete an "in-flight" Workflow instancedeployDefinition(InputStream workflowDefinition, String mimetype) Deploy a Workflow DefinitiondeployDefinition(InputStream workflowDefinition, String mimetype, String name) Deploy a Workflow DefinitiondeployDefinition(InputStream workflowDefinition, String mimetype, String name, boolean fullAccess) Deploy a Workflow DefinitionFire custom event against specified pathGets all "in-flight" active workflow instances.getActiveWorkflows(String workflowDefinitionId) Gets all "in-flight" active workflow instances of the specified Workflow DefinitionGets all deployed Workflow Definitions (with all previous versions)getAllDefinitionsByName(String workflowName) Gets all (including previous) Workflow Definitions for the given unique nameGets all completed workflow instances.getCompletedWorkflows(String workflowDefinitionId) Gets all "in-flight" completed workflow instances of the specified Workflow DefinitiongetDefinitionById(String workflowDefinitionId) Gets a Workflow Definition by unique IdgetDefinitionByName(String workflowName) Gets a Workflow Definition by unique namebyte[]getDefinitionImage(String workflowDefinitionId) Gets a graphical view of the Workflow DefinitionGets all deployed Workflow DefinitionsgetPathProperties(String pathId) Gets the properties associated with the specified path (and parent paths)getTaskDefinitions(String workflowDefinitionId) Gets the Task Definitions for the given Workflow DefinitiongetTasksForWorkflowPath(String pathId) Gets all Tasks associated with the specified pathGets all active timers for the specified workflowgetWorkflowById(String workflowId) Gets a specific workflow instancesgetWorkflowImage(String workflowInstanceId) Gets a graphical view of the workflow instancegetWorkflowPaths(String workflowId) Gets all Paths for the specified Workflow instanceGets all workflow instances (both active and completed).getWorkflows(String workflowDefinitionId) Gets all "in-flight" workflow instances (both active and completed) of the specified Workflow DefinitiongetWorkflows(WorkflowInstanceQuery workflowInstanceQuery) Gets all "in-flight" workflow instances according to the specified workflowInstanceQuery parametergetWorkflows(WorkflowInstanceQuery workflowInstanceQuery, int maxItems, int skipCount) Gets maxItems "in-flight" workflow instances according to the specified workflowInstanceQuery parameterbooleanhasWorkflowImage(String workflowInstanceId) Determines if a graphical view of the workflow instance existsbooleanisDefinitionDeployed(InputStream workflowDefinition, String mimetype) Is the specified Workflow Definition already deployed? Note: the notion of "already deployed" may differ between bpm engines.Signal the transition from one Workflow Node to another within an "in-flight" process.startWorkflow(String workflowDefinitionId, Map<QName, Serializable> parameters) Start a Workflow InstancevoidundeployDefinition(String workflowDefinitionId) Undeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances exist
-
Method Details
-
deployDefinition
Deploy a Workflow Definition- Parameters:
workflowDefinition- the content object containing the definitionmimetype- (optional) the mime type of the workflow definition- Returns:
- workflow deployment descriptor
-
deployDefinition
Deploy a Workflow Definition- Parameters:
workflowDefinition- the content object containing the definitionmimetype- (optional) the mime type of the workflow definitionname- (optional) a name to represent the deployment- Returns:
- workflow deployment descriptor
- Since:
- 4.0
-
deployDefinition
WorkflowDeployment deployDefinition(InputStream workflowDefinition, String mimetype, String name, boolean fullAccess) Deploy a Workflow Definition- Parameters:
workflowDefinition- the content object containing the definitionmimetype- (optional) the mime type of the workflow definitionname- (optional) a name to represent the deploymentfullAccess- true if category should be defined in order to consider the deployment secure- Returns:
- workflow deployment descriptor
- Since:
- 4.0
-
isDefinitionDeployed
Is the specified Workflow Definition already deployed? Note: the notion of "already deployed" may differ between bpm engines. For example, different versions of the same process may be considered equal.- Parameters:
workflowDefinition- the definition to checkmimetype- the mimetype of the definition- Returns:
- true => already deployed
-
checkDeploymentCategory
Sets the deployment category if applicable to allow the workflow to have full access- Parameters:
workflowDefinition- the definition to check
-
undeployDefinition
Undeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances exist- Parameters:
workflowDefinitionId- the id of the definition to undeploy
-
getDefinitions
List<WorkflowDefinition> getDefinitions()Gets all deployed Workflow Definitions- Returns:
- the deployed workflow definitions
-
getAllDefinitions
Gets all deployed Workflow Definitions (with all previous versions)- Returns:
- the deployed (and previous) workflow definitions
-
getDefinitionById
Gets a Workflow Definition by unique Id- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the deployed workflow definition
-
getDefinitionByName
Gets a Workflow Definition by unique name- Parameters:
workflowName- workflow name e.g. activiti$activitiReview- Returns:
- the deployed workflow definition
-
getAllDefinitionsByName
@Auditable(parameters="workflowName") List<WorkflowDefinition> getAllDefinitionsByName(String workflowName) Gets all (including previous) Workflow Definitions for the given unique name- Parameters:
workflowName- workflow name e.g. activiti$activitiReview- Returns:
- the deployed workflow definition (or null if not found)
-
getDefinitionImage
@Auditable(parameters="workflowDefinitionId") byte[] getDefinitionImage(String workflowDefinitionId) Gets a graphical view of the Workflow Definition- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- graphical image of workflow definition
-
getTaskDefinitions
@Auditable(parameters="workflowDefinitionId") List<WorkflowTaskDefinition> getTaskDefinitions(String workflowDefinitionId) Gets the Task Definitions for the given Workflow Definition- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the deployed task definitions (or null if not found)
-
startWorkflow
Start a Workflow Instance- Parameters:
workflowDefinitionId- the workflow definition idparameters- the initial set of parameters used to populate the "Start Task" properties- Returns:
- the initial workflow path
-
getActiveWorkflows
Gets all "in-flight" active workflow instances of the specified Workflow Definition- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the list of "in-flight" workflow instances
-
getCompletedWorkflows
Gets all "in-flight" completed workflow instances of the specified Workflow Definition- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the list of "in-flight" workflow instances
-
getWorkflows
Gets all "in-flight" workflow instances (both active and completed) of the specified Workflow Definition- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the list of "in-flight" workflow instances
-
getWorkflows
Gets all "in-flight" workflow instances according to the specified workflowInstanceQuery parameter- Parameters:
workflowInstanceQuery- WorkflowInstanceQuery- Returns:
- the list of "in-flight" workflow instances
-
getWorkflows
List<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery, int maxItems, int skipCount) Gets maxItems "in-flight" workflow instances according to the specified workflowInstanceQuery parameter- Parameters:
workflowInstanceQuery- WorkflowInstanceQuerymaxItems- intskipCount- int- Returns:
- maxItems workflow instances
-
countWorkflows
Get count of workflow instances- Parameters:
workflowInstanceQuery- WorkflowInstanceQuery- Returns:
- count of workflow instances
-
getActiveWorkflows
List<WorkflowInstance> getActiveWorkflows()Gets all "in-flight" active workflow instances.- Returns:
- the list of "in-flight" workflow instances
- Since:
- 4.0
-
getCompletedWorkflows
List<WorkflowInstance> getCompletedWorkflows()Gets all completed workflow instances.- Returns:
- the list of "in-flight" workflow instances
- Since:
- 4.0
-
getWorkflows
List<WorkflowInstance> getWorkflows()Gets all workflow instances (both active and completed).- Returns:
- the list of "in-flight" workflow instances
- Since:
- 4.0
-
getWorkflowById
Gets a specific workflow instances- Parameters:
workflowId- the id of the workflow to retrieve- Returns:
- the workflow instance
-
getWorkflowPaths
Gets all Paths for the specified Workflow instance- Parameters:
workflowId- workflow instance id- Returns:
- the list of workflow paths
-
getPathProperties
Gets the properties associated with the specified path (and parent paths)- Parameters:
pathId- workflow path id- Returns:
- map of path properties
-
cancelWorkflow
Cancel an "in-flight" Workflow instance- Parameters:
workflowId- the workflow instance to cancel- Returns:
- an updated representation of the workflow instance
-
cancelWorkflows
Cancel a batch of "in-flight" Workflow instances- Parameters:
workflowIds- List of the workflow instances to cancel- Returns:
- List of updated representations of the workflow instances
-
deleteWorkflow
Delete an "in-flight" Workflow instance- Parameters:
workflowId- the workflow instance to cancel- Returns:
- an updated representation of the workflow instance
-
signal
Signal the transition from one Workflow Node to another within an "in-flight" process.- Parameters:
pathId- the workflow path to signal ontransitionId- the transition id to follow (or null, for the default transition)- Returns:
- the updated workflow path
-
fireEvent
Fire custom event against specified path- Parameters:
pathId- the workflow path to fire event onevent- name of event- Returns:
- workflow path (it may have been updated as a result of firing the event
-
getTasksForWorkflowPath
Gets all Tasks associated with the specified path- Parameters:
pathId- the path id- Returns:
- the list of associated tasks
-
getTimers
Gets all active timers for the specified workflow- Returns:
- the list of active timers
-
hasWorkflowImage
Determines if a graphical view of the workflow instance exists- Parameters:
workflowInstanceId- the workflow instance id- Returns:
- true if there is a workflow instance diagram available
- Since:
- 4.0
-
getWorkflowImage
Gets a graphical view of the workflow instance- Parameters:
workflowInstanceId- the workflow instance id- Returns:
- image view of the workflow instance as an InputStream or null if a diagram is not available
- Since:
- 4.0
-