org.alfresco.repo.workflow
Interface WorkflowComponent

All Known Subinterfaces:
WorkflowEngine
All Known Implementing Classes:
ActivitiWorkflowEngine, JBPMEngine

public interface WorkflowComponent

SPI to be implemented by a BPM Engine that provides Workflow instance management.


Method Summary
 WorkflowInstance cancelWorkflow(java.lang.String workflowId)
          Cancel an "in-flight" Workflow instance
 WorkflowInstance deleteWorkflow(java.lang.String workflowId)
          Delete an "in-flight" Workflow instance
 WorkflowDeployment deployDefinition(java.io.InputStream workflowDefinition, java.lang.String mimetype)
          Deploy a Workflow Definition
 WorkflowDeployment deployDefinition(java.io.InputStream workflowDefinition, java.lang.String mimetype, java.lang.String name)
          Deploy a Workflow Definition
 WorkflowPath fireEvent(java.lang.String pathId, java.lang.String event)
          Fire custom event against specified path
 java.util.List getActiveWorkflows()
          Gets all "in-flight" active workflow instances.
 java.util.List getActiveWorkflows(java.lang.String workflowDefinitionId)
          Gets all "in-flight" active workflow instances of the specified Workflow Definition
 java.util.List getAllDefinitions()
          Gets all deployed Workflow Definitions (with all previous versions)
 java.util.List getAllDefinitionsByName(java.lang.String workflowName)
          Gets all (including previous) Workflow Definitions for the given unique name
 java.util.List getCompletedWorkflows()
          Gets all completed workflow instances.
 java.util.List getCompletedWorkflows(java.lang.String workflowDefinitionId)
          Gets all "in-flight" completed workflow instances of the specified Workflow Definition
 WorkflowDefinition getDefinitionById(java.lang.String workflowDefinitionId)
          Gets a Workflow Definition by unique Id
 WorkflowDefinition getDefinitionByName(java.lang.String workflowName)
          Gets a Workflow Definition by unique name
 byte[] getDefinitionImage(java.lang.String workflowDefinitionId)
          Gets a graphical view of the Workflow Definition
 java.util.List getDefinitions()
          Gets all deployed Workflow Definitions
 java.util.Map getPathProperties(java.lang.String pathId)
          Gets the properties associated with the specified path (and parent paths)
 java.util.List getTaskDefinitions(java.lang.String workflowDefinitionId)
          Gets the Task Definitions for the given Workflow Definition
 java.util.List getTasksForWorkflowPath(java.lang.String pathId)
          Gets all Tasks associated with the specified path
 java.util.List getTimers(java.lang.String workflowId)
          Gets all active timers for the specified workflow
 WorkflowInstance getWorkflowById(java.lang.String workflowId)
          Gets a specific workflow instances
 java.io.InputStream getWorkflowImage(java.lang.String workflowInstanceId)
          Gets a graphical view of the workflow instance
 java.util.List getWorkflowPaths(java.lang.String workflowId)
          Gets all Paths for the specified Workflow instance
 java.util.List getWorkflows()
          Gets all workflow instances (both active and completed).
 java.util.List getWorkflows(java.lang.String workflowDefinitionId)
          Gets all "in-flight" workflow instances (both active and completed) of the specified Workflow Definition
 boolean hasWorkflowImage(java.lang.String workflowInstanceId)
          Determines if a graphical view of the workflow instance exists
 boolean isDefinitionDeployed(java.io.InputStream workflowDefinition, java.lang.String mimetype)
          Is the specified Workflow Definition already deployed? Note: the notion of "already deployed" may differ between bpm engines.
 WorkflowPath signal(java.lang.String pathId, java.lang.String transitionId)
          Signal the transition from one Workflow Node to another within an "in-flight" process.
 WorkflowPath startWorkflow(java.lang.String workflowDefinitionId, java.util.Map parameters)
          Start a Workflow Instance
 void undeployDefinition(java.lang.String workflowDefinitionId)
          Undeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances exist
 

Method Detail

deployDefinition

WorkflowDeployment deployDefinition(java.io.InputStream workflowDefinition,
                                    java.lang.String mimetype)
Deploy a Workflow Definition

Parameters:
workflowDefinition - the content object containing the definition
mimetype - (optional) the mime type of the workflow definition
Returns:
workflow deployment descriptor

deployDefinition

WorkflowDeployment deployDefinition(java.io.InputStream workflowDefinition,
                                    java.lang.String mimetype,
                                    java.lang.String name)
Deploy a Workflow Definition

Parameters:
workflowDefinition - the content object containing the definition
mimetype - (optional) the mime type of the workflow definition
name - (optional) a name to represent the deployment
Returns:
workflow deployment descriptor
Since:
4.0

isDefinitionDeployed

boolean isDefinitionDeployed(java.io.InputStream workflowDefinition,
                             java.lang.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 check
mimetype - the mimetype of the definition
Returns:
true => already deployed

undeployDefinition

void undeployDefinition(java.lang.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

java.util.List getDefinitions()
Gets all deployed Workflow Definitions

Returns:
the deployed workflow definitions

getAllDefinitions

@Auditable
java.util.List getAllDefinitions()
Gets all deployed Workflow Definitions (with all previous versions)

Returns:
the deployed (and previous) workflow definitions

getDefinitionById

WorkflowDefinition getDefinitionById(java.lang.String workflowDefinitionId)
Gets a Workflow Definition by unique Id

Parameters:
workflowDefinitionId - the workflow definition id
Returns:
the deployed workflow definition

getDefinitionByName

WorkflowDefinition getDefinitionByName(java.lang.String workflowName)
Gets a Workflow Definition by unique name

Parameters:
workflowName - workflow name e.g. jbpm$wf:review
Returns:
the deployed workflow definition

getAllDefinitionsByName

@Auditable(parameters="workflowName")
java.util.List getAllDefinitionsByName(java.lang.String workflowName)
Gets all (including previous) Workflow Definitions for the given unique name

Parameters:
workflowName - workflow name e.g. jbpm$wf:review
Returns:
the deployed workflow definition (or null if not found)

getDefinitionImage

@Auditable(parameters="workflowDefinitionId")
byte[] getDefinitionImage(java.lang.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")
java.util.List getTaskDefinitions(java.lang.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(java.lang.String workflowDefinitionId,
                           java.util.Map parameters)
Start a Workflow Instance

Parameters:
workflowDefinitionId - the workflow definition id
parameters - the initial set of parameters used to populate the "Start Task" properties
Returns:
the initial workflow path

getActiveWorkflows

java.util.List getActiveWorkflows(java.lang.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

java.util.List getCompletedWorkflows(java.lang.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

java.util.List getWorkflows(java.lang.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

getActiveWorkflows

java.util.List getActiveWorkflows()
Gets all "in-flight" active workflow instances.

Returns:
the list of "in-flight" workflow instances
Since:
4.0

getCompletedWorkflows

java.util.List getCompletedWorkflows()
Gets all completed workflow instances.

Returns:
the list of "in-flight" workflow instances
Since:
4.0

getWorkflows

java.util.List getWorkflows()
Gets all workflow instances (both active and completed).

Returns:
the list of "in-flight" workflow instances
Since:
4.0

getWorkflowById

WorkflowInstance getWorkflowById(java.lang.String workflowId)
Gets a specific workflow instances

Parameters:
workflowId - the id of the workflow to retrieve
Returns:
the workflow instance

getWorkflowPaths

java.util.List getWorkflowPaths(java.lang.String workflowId)
Gets all Paths for the specified Workflow instance

Parameters:
workflowId - workflow instance id
Returns:
the list of workflow paths

getPathProperties

java.util.Map getPathProperties(java.lang.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(java.lang.String workflowId)
Cancel an "in-flight" Workflow instance

Parameters:
workflowId - the workflow instance to cancel
Returns:
an updated representation of the workflow instance

deleteWorkflow

WorkflowInstance deleteWorkflow(java.lang.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(java.lang.String pathId,
                    java.lang.String transitionId)
Signal the transition from one Workflow Node to another within an "in-flight" process.

Parameters:
pathId - the workflow path to signal on
transition - the transition to follow (or null, for the default transition)
Returns:
the updated workflow path

fireEvent

WorkflowPath fireEvent(java.lang.String pathId,
                       java.lang.String event)
Fire custom event against specified path

Parameters:
pathId - the workflow path to fire event on
event - name of event
Returns:
workflow path (it may have been updated as a result of firing the event

getTasksForWorkflowPath

java.util.List getTasksForWorkflowPath(java.lang.String pathId)
Gets all Tasks associated with the specified path

Parameters:
pathId - the path id
Returns:
the list of associated tasks

getTimers

java.util.List getTimers(java.lang.String workflowId)
Gets all active timers for the specified workflow

Returns:
the list of active timers

hasWorkflowImage

boolean hasWorkflowImage(java.lang.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

java.io.InputStream getWorkflowImage(java.lang.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


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.