public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
Modifier and Type | Field and Description |
---|---|
protected static String |
ERR_FIND_COMPLETED_TASK_INSTS |
protected static String |
ERR_FIRE_EVENT_NOT_SUPPORTED |
static org.alfresco.service.namespace.QName |
QNAME_INITIATOR |
Constructor and Description |
---|
ActivitiWorkflowEngine() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
WorkflowInstance |
cancelWorkflow(String workflowId)
Cancel an "in-flight" Workflow instance
|
List<WorkflowInstance> |
cancelWorkflows(List<String> workflowIds)
Cancel a batch of "in-flight" Workflow instances
|
long |
countTasks(WorkflowTaskQuery query)
Count the number of active tasks that match the given query.
|
long |
countWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
Get count of workflow instances
|
WorkflowInstance |
deleteWorkflow(String workflowId)
Delete an "in-flight" Workflow instance
|
WorkflowDeployment |
deployDefinition(InputStream workflowDefinition,
String mimetype)
Deploy a Workflow Definition
|
WorkflowDeployment |
deployDefinition(InputStream workflowDefinition,
String mimetype,
String name)
Deploy a Workflow Definition
|
void |
dispatchPackageUpdatedEvent(Object variableValue,
String taskId,
String executionId,
String processInstanceId,
String processDefinitionId) |
WorkflowTask |
endTask(String taskId,
String transition)
End the Task (i.e.
|
WorkflowPath |
fireEvent(String pathId,
String event)
Fire custom event against specified path
|
List<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 Definition
|
List<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 name
|
List<WorkflowTask> |
getAssignedTasks(String authority,
WorkflowTaskState state,
boolean lazyInitialization)
Gets all tasks assigned to the specified authority
|
List<WorkflowInstance> |
getCompletedWorkflows()
Gets all completed workflow instances.
|
List<WorkflowInstance> |
getCompletedWorkflows(String workflowDefinitionId)
Gets all "in-flight" completed workflow instances of the specified Workflow Definition
|
WorkflowDefinition |
getDefinitionById(String workflowDefinitionId)
Gets a Workflow Definition by unique Id
|
WorkflowDefinition |
getDefinitionByName(String workflowName)
Gets a Workflow Definition by unique name
|
byte[] |
getDefinitionImage(String workflowDefinitionId)
Gets a graphical view of the Workflow Definition
|
List<WorkflowDefinition> |
getDefinitions()
Gets all deployed Workflow Definitions
|
Map<org.alfresco.service.namespace.QName,Serializable> |
getPathProperties(String pathId)
Gets the properties associated with the specified path (and parent paths)
|
List<WorkflowTask> |
getPooledTasks(List<String> authorities,
boolean lazyInitialization)
Gets the pooled tasks available to the specified authority
|
WorkflowTask |
getStartTask(String workflowInstanceId)
Gets all active timers for the specified workflow
|
List<WorkflowTask> |
getStartTasks(List<String> workflowInstanceIds,
boolean sameSession)
Gets all start tasks for the specified workflow
|
WorkflowTask |
getTaskById(String taskId)
Gets a Task by unique Id
|
List<WorkflowTaskDefinition> |
getTaskDefinitions(String workflowDefinitionId)
Gets the Task Definitions for the given Workflow Definition
|
List<WorkflowTask> |
getTasksForWorkflowPath(String pathId)
Gets all Tasks associated with the specified path
|
List<WorkflowTimer> |
getTimers(String workflowId)
Gets all active timers for the specified workflow
|
WorkflowInstance |
getWorkflowById(String workflowId)
Gets a specific workflow instances
|
InputStream |
getWorkflowImage(String workflowInstanceId)
Gets a graphical view of the workflow instance
|
List<WorkflowPath> |
getWorkflowPaths(String workflowId)
Gets all Paths for the specified Workflow instance
|
List<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 Definition
|
List<WorkflowInstance> |
getWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
Gets all "in-flight" workflow instances according to the specified workflowInstanceQuery parameter
|
List<WorkflowInstance> |
getWorkflows(WorkflowInstanceQuery workflowInstanceQuery,
int maxItems,
int skipCount)
Gets maxItems "in-flight" workflow instances according to the specified workflowInstanceQuery parameter
|
boolean |
hasWorkflowImage(String workflowInstanceId)
Determines if a graphical view of the workflow instance exists
|
boolean |
isDefinitionDeployed(InputStream workflowDefinition,
String mimetype)
Is the specified Workflow Definition already deployed?
Note: the notion of "already deployed" may differ between bpm engines.
|
List<WorkflowTask> |
queryTasks(WorkflowTaskQuery query) |
List<WorkflowTask> |
queryTasks(WorkflowTaskQuery query,
boolean sameSession)
Query for tasks
Hint: use
WorkflowTaskQuery setLimit() method to limit the number
of processed items if you don't really need to go through all of them |
void |
setActivitiUtil(ActivitiUtil activitiUtil) |
void |
setAuthorityManager(WorkflowAuthorityManager authorityManager)
Sets the Authority DAO
/**
|
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Sets the Dictionary Service
|
void |
setFactory(WorkflowObjectFactory factory) |
void |
setMessageService(MessageService messageService) |
void |
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService) |
void |
setNodeConverter(WorkflowNodeConverter nodeConverter) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the Node Service
|
void |
setPersonService(PersonService personService)
Sets the Person Service
|
void |
setPropertyConverter(ActivitiPropertyConverter propertyConverter) |
void |
setRepositoryHelper(Repository repositoryHelper) |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService) |
void |
setTypeConverter(ActivitiTypeConverter typeConverter) |
WorkflowPath |
signal(String pathId,
String transitionId)
Signal the transition from one Workflow Node to another within an "in-flight"
process.
|
WorkflowTask |
startTask(String taskId)
Start the specified Task
Note: this is an optional task operation.
|
WorkflowPath |
startWorkflow(String workflowDefinitionId,
Map<org.alfresco.service.namespace.QName,Serializable> parameters)
Start a Workflow Instance
|
WorkflowTask |
suspendTask(String taskId)
Suspend the specified Task
|
void |
undeployDefinition(String workflowDefinitionId)
Undeploy an exisiting Workflow Definition
TODO: Determine behaviour when "in-flight" workflow instances exist
|
WorkflowTask |
updateTask(String taskId,
Map<org.alfresco.service.namespace.QName,Serializable> properties,
Map<org.alfresco.service.namespace.QName,List<org.alfresco.service.cmr.repository.NodeRef>> add,
Map<org.alfresco.service.namespace.QName,List<org.alfresco.service.cmr.repository.NodeRef>> remove)
Update the Properties and Associations of a Task
|
createGlobalId, createLocalId, getEngineId, setBPMEngineRegistry, setEngineId
protected static final String ERR_FIRE_EVENT_NOT_SUPPORTED
protected static final String ERR_FIND_COMPLETED_TASK_INSTS
public static final org.alfresco.service.namespace.QName QNAME_INITIATOR
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class BPMEngine
Exception
public List<WorkflowInstance> cancelWorkflows(List<String> workflowIds)
WorkflowComponent
cancelWorkflows
in interface WorkflowComponent
workflowIds
- List of the workflow instances to cancelpublic WorkflowInstance cancelWorkflow(String workflowId)
cancelWorkflow
in interface WorkflowComponent
workflowId
- the workflow instance to cancelpublic WorkflowInstance deleteWorkflow(String workflowId)
deleteWorkflow
in interface WorkflowComponent
workflowId
- the workflow instance to cancelpublic WorkflowDeployment deployDefinition(InputStream workflowDefinition, String mimetype)
deployDefinition
in interface WorkflowComponent
workflowDefinition
- the content object containing the definitionmimetype
- (optional) the mime type of the workflow definitionpublic WorkflowDeployment deployDefinition(InputStream workflowDefinition, String mimetype, String name)
deployDefinition
in interface WorkflowComponent
workflowDefinition
- the content object containing the definitionmimetype
- (optional) the mime type of the workflow definitionname
- (optional) a name to represent the deploymentpublic WorkflowPath fireEvent(String pathId, String event)
fireEvent
in interface WorkflowComponent
pathId
- the workflow path to fire event onevent
- name of eventpublic List<WorkflowInstance> getActiveWorkflows()
getActiveWorkflows
in interface WorkflowComponent
public List<WorkflowInstance> getCompletedWorkflows()
getCompletedWorkflows
in interface WorkflowComponent
public List<WorkflowInstance> getWorkflows()
getWorkflows
in interface WorkflowComponent
public List<WorkflowInstance> getActiveWorkflows(String workflowDefinitionId)
getActiveWorkflows
in interface WorkflowComponent
workflowDefinitionId
- the workflow definition idpublic List<WorkflowDefinition> getAllDefinitions()
getAllDefinitions
in interface WorkflowComponent
public List<WorkflowDefinition> getAllDefinitionsByName(String workflowName)
getAllDefinitionsByName
in interface WorkflowComponent
workflowName
- workflow name e.g. activiti$activitiReviewpublic List<WorkflowInstance> getCompletedWorkflows(String workflowDefinitionId)
getCompletedWorkflows
in interface WorkflowComponent
workflowDefinitionId
- the workflow definition idpublic WorkflowDefinition getDefinitionById(String workflowDefinitionId)
getDefinitionById
in interface WorkflowComponent
workflowDefinitionId
- the workflow definition idpublic WorkflowDefinition getDefinitionByName(String workflowName)
getDefinitionByName
in interface WorkflowComponent
workflowName
- workflow name e.g. activiti$activitiReviewpublic byte[] getDefinitionImage(String workflowDefinitionId)
getDefinitionImage
in interface WorkflowComponent
workflowDefinitionId
- the workflow definition idpublic List<WorkflowDefinition> getDefinitions()
getDefinitions
in interface WorkflowComponent
public Map<org.alfresco.service.namespace.QName,Serializable> getPathProperties(String pathId)
getPathProperties
in interface WorkflowComponent
pathId
- workflow path idpublic List<WorkflowTaskDefinition> getTaskDefinitions(String workflowDefinitionId)
getTaskDefinitions
in interface WorkflowComponent
workflowDefinitionId
- the workflow definition idpublic List<WorkflowTask> getTasksForWorkflowPath(String pathId)
getTasksForWorkflowPath
in interface WorkflowComponent
pathId
- the path idpublic List<WorkflowTimer> getTimers(String workflowId)
getTimers
in interface WorkflowComponent
public WorkflowInstance getWorkflowById(String workflowId)
getWorkflowById
in interface WorkflowComponent
workflowId
- the id of the workflow to retrievepublic List<WorkflowPath> getWorkflowPaths(String workflowId)
getWorkflowPaths
in interface WorkflowComponent
workflowId
- workflow instance idpublic List<WorkflowInstance> getWorkflows(String workflowDefinitionId)
getWorkflows
in interface WorkflowComponent
workflowDefinitionId
- the workflow definition idpublic boolean isDefinitionDeployed(InputStream workflowDefinition, String mimetype)
isDefinitionDeployed
in interface WorkflowComponent
workflowDefinition
- the definition to checkmimetype
- the mimetype of the definitionpublic WorkflowPath signal(String pathId, String transitionId)
signal
in interface WorkflowComponent
pathId
- the workflow path to signal ontransitionId
- the transition id to follow (or null, for the default transition)public WorkflowPath startWorkflow(String workflowDefinitionId, Map<org.alfresco.service.namespace.QName,Serializable> parameters)
startWorkflow
in interface WorkflowComponent
workflowDefinitionId
- the workflow definition idparameters
- the initial set of parameters used to populate the "Start Task" propertiespublic void undeployDefinition(String workflowDefinitionId)
undeployDefinition
in interface WorkflowComponent
workflowDefinitionId
- the id of the definition to undeploypublic boolean hasWorkflowImage(String workflowInstanceId)
hasWorkflowImage
in interface WorkflowComponent
workflowInstanceId
- the workflow instance idpublic InputStream getWorkflowImage(String workflowInstanceId)
getWorkflowImage
in interface WorkflowComponent
workflowInstanceId
- the workflow instance idpublic void setPropertyConverter(ActivitiPropertyConverter propertyConverter)
propertyConverter
- the propertyConverter to setpublic void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService
- DictionaryServicepublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- NodeServicepublic void setRepositoryHelper(Repository repositoryHelper)
repositoryHelper
- the repositoryHelper to setpublic void setPersonService(PersonService personService)
personService
- PersonServicepublic void setAuthorityManager(WorkflowAuthorityManager authorityManager)
authorityManager
- the authorityManager to setpublic WorkflowTask endTask(String taskId, String transition)
endTask
in interface TaskComponent
taskId
- the task id to endtransition
- the task transition id to take on completion (or null, for the default transition)public List<WorkflowTask> getAssignedTasks(String authority, WorkflowTaskState state, boolean lazyInitialization)
getAssignedTasks
in interface TaskComponent
authority
- the authoritystate
- filter by specified workflow task statelazyInitialization
- hint in order to return partially-initialized entitiespublic List<WorkflowTask> getPooledTasks(List<String> authorities, boolean lazyInitialization)
getPooledTasks
in interface TaskComponent
authorities
- the list of authoritieslazyInitialization
- hint in order to return partially-initialized entitiespublic WorkflowTask getTaskById(String taskId)
getTaskById
in interface TaskComponent
taskId
- the task idpublic List<WorkflowTask> queryTasks(WorkflowTaskQuery query, boolean sameSession)
TaskComponent
WorkflowTaskQuery
setLimit() method to limit the number
of processed items if you don't really need to go through all of themqueryTasks
in interface TaskComponent
query
- the filter by which tasks are queriedsameSession
- indicates that the returned WorkflowTask
elements will
be used in the same session. If true
, the returned
List will be a lazy loaded list providing greater performance.public long countTasks(WorkflowTaskQuery query)
TaskComponent
countTasks
in interface TaskComponent
query
- the filter by which tasks are queriedpublic List<WorkflowTask> queryTasks(WorkflowTaskQuery query)
queryTasks
in interface TaskComponent
public List<WorkflowTask> getStartTasks(List<String> workflowInstanceIds, boolean sameSession)
TaskComponent
getStartTasks
in interface TaskComponent
public WorkflowTask getStartTask(String workflowInstanceId)
getStartTask
in interface TaskComponent
public WorkflowTask startTask(String taskId)
startTask
in interface TaskComponent
taskId
- the task to startpublic WorkflowTask suspendTask(String taskId)
suspendTask
in interface TaskComponent
taskId
- Stringpublic WorkflowTask updateTask(String taskId, Map<org.alfresco.service.namespace.QName,Serializable> properties, Map<org.alfresco.service.namespace.QName,List<org.alfresco.service.cmr.repository.NodeRef>> add, Map<org.alfresco.service.namespace.QName,List<org.alfresco.service.cmr.repository.NodeRef>> remove)
updateTask
in interface TaskComponent
taskId
- the task id to updateproperties
- the map of properties to set on the task (or null, if none to set)add
- the map of items to associate with the task (or null, if none to add)remove
- the map of items to dis-associate with the task (or null, if none to remove)public List<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
WorkflowComponent
getWorkflows
in interface WorkflowComponent
workflowInstanceQuery
- WorkflowInstanceQuerypublic List<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery, int maxItems, int skipCount)
WorkflowComponent
getWorkflows
in interface WorkflowComponent
workflowInstanceQuery
- WorkflowInstanceQuerymaxItems
- intskipCount
- intpublic long countWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
WorkflowComponent
countWorkflows
in interface WorkflowComponent
workflowInstanceQuery
- WorkflowInstanceQuerypublic void dispatchPackageUpdatedEvent(Object variableValue, String taskId, String executionId, String processInstanceId, String processDefinitionId)
public void setNodeConverter(WorkflowNodeConverter nodeConverter)
nodeConverter
- the nodeConverter to setpublic void setFactory(WorkflowObjectFactory factory)
factory
- the factory to setpublic void setMessageService(MessageService messageService)
messageService
- the messageService to setpublic void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
tenantService
- the tenantService to setpublic void setTypeConverter(ActivitiTypeConverter typeConverter)
typeConverter
- the typeConverter to setpublic void setActivitiUtil(ActivitiUtil activitiUtil)
activitiUtil
- the activitiUtil to setpublic void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
namespaceService
- the namespaceService to setCopyright © 2005–2017 Alfresco Software. All rights reserved.