Package org.alfresco.repo.workflow
Interface WorkflowComponent
-
- All Known Subinterfaces:
WorkflowEngine
- All Known Implementing Classes:
ActivitiWorkflowEngine
public interface WorkflowComponentSPI to be implemented by a BPM Engine that provides Workflow instance management.- Author:
- davidc
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WorkflowInstancecancelWorkflow(String workflowId)Cancel an "in-flight" Workflow instanceList<WorkflowInstance>cancelWorkflows(List<String> workflowIds)Cancel a batch of "in-flight" Workflow instanceslongcountWorkflows(WorkflowInstanceQuery workflowInstanceQuery)Get count of workflow instancesWorkflowInstancedeleteWorkflow(String workflowId)Delete an "in-flight" Workflow instanceWorkflowDeploymentdeployDefinition(InputStream workflowDefinition, String mimetype)Deploy a Workflow DefinitionWorkflowDeploymentdeployDefinition(InputStream workflowDefinition, String mimetype, String name)Deploy a Workflow DefinitionWorkflowPathfireEvent(String pathId, String event)Fire custom event against specified pathList<WorkflowInstance>getActiveWorkflows()Gets all "in-flight" active workflow instances.List<WorkflowInstance>getActiveWorkflows(String workflowDefinitionId)Gets all "in-flight" active workflow instances of the specified Workflow DefinitionList<WorkflowDefinition>getAllDefinitions()Gets all deployed Workflow Definitions (with all previous versions)List<WorkflowDefinition>getAllDefinitionsByName(String workflowName)Gets all (including previous) Workflow Definitions for the given unique nameList<WorkflowInstance>getCompletedWorkflows()Gets all completed workflow instances.List<WorkflowInstance>getCompletedWorkflows(String workflowDefinitionId)Gets all "in-flight" completed workflow instances of the specified Workflow DefinitionWorkflowDefinitiongetDefinitionById(String workflowDefinitionId)Gets a Workflow Definition by unique IdWorkflowDefinitiongetDefinitionByName(String workflowName)Gets a Workflow Definition by unique namebyte[]getDefinitionImage(String workflowDefinitionId)Gets a graphical view of the Workflow DefinitionList<WorkflowDefinition>getDefinitions()Gets all deployed Workflow DefinitionsMap<org.alfresco.service.namespace.QName,Serializable>getPathProperties(String pathId)Gets the properties associated with the specified path (and parent paths)List<WorkflowTaskDefinition>getTaskDefinitions(String workflowDefinitionId)Gets the Task Definitions for the given Workflow DefinitionList<WorkflowTask>getTasksForWorkflowPath(String pathId)Gets all Tasks associated with the specified pathList<WorkflowTimer>getTimers(String workflowId)Gets all active timers for the specified workflowWorkflowInstancegetWorkflowById(String workflowId)Gets a specific workflow instancesInputStreamgetWorkflowImage(String workflowInstanceId)Gets a graphical view of the workflow instanceList<WorkflowPath>getWorkflowPaths(String workflowId)Gets all Paths for the specified Workflow instanceList<WorkflowInstance>getWorkflows()Gets all workflow instances (both active and completed).List<WorkflowInstance>getWorkflows(String workflowDefinitionId)Gets all "in-flight" workflow instances (both active and completed) of the specified Workflow DefinitionList<WorkflowInstance>getWorkflows(WorkflowInstanceQuery workflowInstanceQuery)Gets all "in-flight" workflow instances according to the specified workflowInstanceQuery parameterList<WorkflowInstance>getWorkflows(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.WorkflowPathsignal(String pathId, String transitionId)Signal the transition from one Workflow Node to another within an "in-flight" process.WorkflowPathstartWorkflow(String workflowDefinitionId, Map<org.alfresco.service.namespace.QName,Serializable> parameters)Start a Workflow InstancevoidundeployDefinition(String workflowDefinitionId)Undeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances exist
-
-
-
Method Detail
-
deployDefinition
WorkflowDeployment deployDefinition(InputStream workflowDefinition, String mimetype)
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
WorkflowDeployment deployDefinition(InputStream workflowDefinition, String mimetype, String name)
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
-
isDefinitionDeployed
boolean isDefinitionDeployed(InputStream workflowDefinition, String mimetype)
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
-
undeployDefinition
void undeployDefinition(String workflowDefinitionId)
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
@Auditable List<WorkflowDefinition> getAllDefinitions()
Gets all deployed Workflow Definitions (with all previous versions)- Returns:
- the deployed (and previous) workflow definitions
-
getDefinitionById
WorkflowDefinition getDefinitionById(String workflowDefinitionId)
Gets a Workflow Definition by unique Id- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the deployed workflow definition
-
getDefinitionByName
WorkflowDefinition getDefinitionByName(String workflowName)
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
WorkflowPath startWorkflow(String workflowDefinitionId, Map<org.alfresco.service.namespace.QName,Serializable> parameters)
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
List<WorkflowInstance> getActiveWorkflows(String workflowDefinitionId)
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
List<WorkflowInstance> getCompletedWorkflows(String workflowDefinitionId)
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
List<WorkflowInstance> getWorkflows(String workflowDefinitionId)
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
List<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
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
long countWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
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
WorkflowInstance getWorkflowById(String workflowId)
Gets a specific workflow instances- Parameters:
workflowId- the id of the workflow to retrieve- Returns:
- the workflow instance
-
getWorkflowPaths
List<WorkflowPath> getWorkflowPaths(String workflowId)
Gets all Paths for the specified Workflow instance- Parameters:
workflowId- workflow instance id- Returns:
- the list of workflow paths
-
getPathProperties
Map<org.alfresco.service.namespace.QName,Serializable> getPathProperties(String pathId)
Gets the properties associated with the specified path (and parent paths)- Parameters:
pathId- workflow path id- Returns:
- map of path properties
-
cancelWorkflow
WorkflowInstance cancelWorkflow(String workflowId)
Cancel an "in-flight" Workflow instance- Parameters:
workflowId- the workflow instance to cancel- Returns:
- an updated representation of the workflow instance
-
cancelWorkflows
List<WorkflowInstance> cancelWorkflows(List<String> workflowIds)
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
WorkflowInstance deleteWorkflow(String workflowId)
Delete an "in-flight" Workflow instance- Parameters:
workflowId- the workflow instance to cancel- Returns:
- an updated representation of the workflow instance
-
signal
WorkflowPath signal(String pathId, String transitionId)
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
WorkflowPath fireEvent(String pathId, String event)
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
List<WorkflowTask> getTasksForWorkflowPath(String pathId)
Gets all Tasks associated with the specified path- Parameters:
pathId- the path id- Returns:
- the list of associated tasks
-
getTimers
List<WorkflowTimer> getTimers(String workflowId)
Gets all active timers for the specified workflow- Returns:
- the list of active timers
-
hasWorkflowImage
boolean hasWorkflowImage(String workflowInstanceId)
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
InputStream getWorkflowImage(String workflowInstanceId)
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
-
-