Package org.alfresco.repo.workflow
Class WorkflowServiceImpl
- java.lang.Object
-
- org.alfresco.repo.workflow.WorkflowServiceImpl
-
- All Implemented Interfaces:
WorkflowService
public class WorkflowServiceImpl extends java.lang.Object implements WorkflowService
Default Alfresco Workflow Service whose implementation is backed by registered BPM Engine plug-in components.- Author:
- davidc
-
-
Constructor Summary
Constructors Constructor Description WorkflowServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowInstancecancelWorkflow(java.lang.String workflowId)Cancel an "in-flight" Workflow instancejava.util.List<WorkflowInstance>cancelWorkflows(java.util.List<java.lang.String> workflowIds)Cancel a batch of "in-flight" Workflow instanceslongcountTasks(WorkflowTaskQuery workflowTaskQuery)Get the number of tasks matching the given querylongcountWorkflows(WorkflowInstanceQuery workflowInstanceQuery)Get count of workflow instancesorg.alfresco.service.cmr.repository.NodeRefcreatePackage(org.alfresco.service.cmr.repository.NodeRef container)Create a Workflow Package (a container of content to route through the Workflow).WorkflowInstancedeleteWorkflow(java.lang.String workflowId)Delete a Workflow instance.WorkflowDeploymentdeployDefinition(java.lang.String engineId, java.io.InputStream workflowDefinition, java.lang.String mimetype)Deploy a Workflow Definition to the Alfresco RepositoryWorkflowDeploymentdeployDefinition(java.lang.String engineId, java.io.InputStream workflowDefinition, java.lang.String mimetype, java.lang.String name)Deploy a Workflow Definition to the Alfresco RepositoryWorkflowDeploymentdeployDefinition(org.alfresco.service.cmr.repository.NodeRef definitionContent)Deploy a Workflow Definition to the Alfresco Repository Note: The specified content object must be of type bpm:workflowdefinition.WorkflowTaskendTask(java.lang.String taskId, java.lang.String transition)End the Task (i.e.WorkflowPathfireEvent(java.lang.String pathId, java.lang.String event)Fire custom event against specified pathjava.util.List<WorkflowInstance>getActiveWorkflows()Gets all active workflow instances.java.util.List<WorkflowInstance>getActiveWorkflows(java.lang.String workflowDefinitionId)Gets all active workflow instances of the specified Workflow Definitionjava.util.List<WorkflowDefinition>getAllDefinitions()Gets all deployed Workflow Definitions (with all previous versions)java.util.List<WorkflowDefinition>getAllDefinitionsByName(java.lang.String workflowName)Gets all (including previous) Workflow Definitions for the given unique namejava.util.List<WorkflowTask>getAssignedTasks(java.lang.String authority, WorkflowTaskState state)Gets all tasks assigned to the specified authorityjava.util.List<WorkflowTask>getAssignedTasks(java.lang.String authority, WorkflowTaskState state, boolean lazyInitialization)Gets all tasks assigned to the specified authorityjava.util.List<WorkflowInstance>getCompletedWorkflows()Gets all completed workflow instances.java.util.List<WorkflowInstance>getCompletedWorkflows(java.lang.String workflowDefinitionId)Gets all completed workflow instances of the specified Workflow DefinitionWorkflowDefinitiongetDefinitionById(java.lang.String workflowDefinitionId)Gets a Workflow Definition by unique IdWorkflowDefinitiongetDefinitionByName(java.lang.String workflowName)Gets the latest Workflow Definition by unique namebyte[]getDefinitionImage(java.lang.String workflowDefinitionId)Gets a graphical view of the Workflow Definitionjava.util.List<WorkflowDefinition>getDefinitions()Gets latest deployed Workflow Definitionsjava.util.List<org.alfresco.service.cmr.repository.NodeRef>getPackageContents(java.lang.String taskId)Get a list of node refs to all the package contents for the given task id.java.util.List<org.alfresco.service.cmr.repository.NodeRef>getPackageContents(org.alfresco.service.cmr.repository.NodeRef packageRef)Get a list of node refs to all the package contents.java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>getPathProperties(java.lang.String pathId)Gets the properties associated with the specified path (and parent paths)java.util.List<WorkflowTask>getPooledTasks(java.lang.String authority)Gets the pooled tasks available to the specified authorityjava.util.List<WorkflowTask>getPooledTasks(java.lang.String authority, boolean lazyinitialization)Gets the pooled tasks available to the specified authorityWorkflowTaskgetStartTask(java.lang.String workflowInstanceId)Gets the start task instance for the given workflow instance.java.util.List<WorkflowTask>getStartTasks(java.util.List<java.lang.String> workflowInstanceIds, boolean sameSession)Gets the start task instances for the given workflow instances.WorkflowTaskgetTaskById(java.lang.String taskId)Gets a Task by unique Idjava.util.List<WorkflowTaskDefinition>getTaskDefinitions(java.lang.String workflowDefinitionId)Gets the Task Definitions for the given Workflow Definitionjava.util.List<WorkflowTask>getTasksForWorkflowPath(java.lang.String pathId)Gets all Tasks associated with the specified pathjava.util.List<WorkflowTimer>getTimers(java.lang.String workflowId)Gets all active timers for the specified workflowWorkflowInstancegetWorkflowById(java.lang.String workflowId)Gets a specific workflow instancesjava.io.InputStreamgetWorkflowImage(java.lang.String workflowInstanceId)Gets a graphical view of the workflow instancejava.util.List<WorkflowPath>getWorkflowPaths(java.lang.String workflowId)Gets all Paths for the specified Workflow instance.java.util.List<WorkflowInstance>getWorkflows()Gets all workflow instances (both active and completed).java.util.List<WorkflowInstance>getWorkflows(java.lang.String workflowDefinitionId)Gets all workflow instances (both active and completed) of the specified Workflow Definitionjava.util.List<WorkflowInstance>getWorkflows(WorkflowInstanceQuery workflowInstanceQuery)Gets all "in-flight" workflow instances according to the specified workflowInstanceQuery parameterjava.util.List<WorkflowInstance>getWorkflows(WorkflowInstanceQuery workflowInstanceQuery, int maxItems, int skipCount)Gets maxItems "in-flight" workflow instances according to the specified workflowInstanceQuery parameter Get maxItems and skipCount parameters form requestjava.util.List<WorkflowInstance>getWorkflowsForContent(org.alfresco.service.cmr.repository.NodeRef packageItem, boolean active)Gets the Workflows that act upon the specified Repository content.booleanhasWorkflowImage(java.lang.String workflowInstanceId)Determines if a graphical view of the workflow instance existsbooleanisDefinitionDeployed(java.lang.String engineId, 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.booleanisDefinitionDeployed(org.alfresco.service.cmr.repository.NodeRef workflowDefinition)Is the specified Workflow Definition already deployed? Note: the notion of "already deployed" may differ between bpm engines.booleanisMultiTenantWorkflowDeploymentEnabled()booleanisTaskClaimable(WorkflowTask task, java.lang.String username)Determines if the given user can claim the given taskbooleanisTaskClaimable(WorkflowTask task, java.lang.String username, boolean refreshTask)Determines if the given user can claim the given taskbooleanisTaskEditable(WorkflowTask task, java.lang.String username)Determines if the given user can edit the given taskbooleanisTaskEditable(WorkflowTask task, java.lang.String username, boolean refreshTask)Determines if the given user can edit the given taskbooleanisTaskReassignable(WorkflowTask task, java.lang.String username)Determines if the given user can reassign the given taskbooleanisTaskReassignable(WorkflowTask task, java.lang.String username, boolean refreshTask)Determines if the given user can reassign the given taskbooleanisTaskReleasable(WorkflowTask task, java.lang.String username)Determines if the given user can release the given taskbooleanisTaskReleasable(WorkflowTask task, java.lang.String username, boolean refreshTask)Determines if the given user can release the given taskjava.util.List<WorkflowTask>queryTasks(WorkflowTaskQuery query)java.util.List<WorkflowTask>queryTasks(WorkflowTaskQuery query, boolean sameSession)Query for tasksvoidsetAuthorityService(AuthorityService authorityService)Sets the Authority ServicevoidsetBPMEngineRegistry(BPMEngineRegistry registry)Sets the BPM Engine RegistryvoidsetContentService(ContentService contentService)Sets the Content ServicevoidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)Set the dictionary servicevoidsetMaxAuthoritiesForPooledTasks(int maxAuthoritiesForPooledTasks)Sets the maximum number of groups to check for pooled tasks.voidsetMaxPooledTasks(int maxPooledTasks)Sets the maximum number of pooled tasks to return in a query.voidsetMultiTenantWorkflowDeploymentEnabled(boolean deployWorkflowsInTenant)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)Sets the Node ServicevoidsetProtectedNodeService(org.alfresco.service.cmr.repository.NodeService protectedNodeService)Set the node service which applies permissionsvoidsetTransactionService(TransactionService transactionService)voidsetWorkflowAdminService(WorkflowAdminService workflowAdminService)voidsetWorkflowNotification(WorkflowNotificationUtils service)Set the workflow notification utilsvoidsetWorkflowPackageComponent(WorkflowPackageComponent workflowPackageComponent)Sets the Workflow Package ComponentWorkflowPathsignal(java.lang.String pathId, java.lang.String transition)Signal the transition from one Workflow Node to anotherWorkflowPathstartWorkflow(java.lang.String workflowDefinitionId, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> parameters)Start a Workflow InstanceWorkflowPathstartWorkflowFromTemplate(org.alfresco.service.cmr.repository.NodeRef templateDefinition)Start a Workflow Instance from an existing "Start Task" template node held in the Repository.voidundeployDefinition(java.lang.String workflowDefinitionId)Undeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances existWorkflowTaskupdateTask(java.lang.String taskId, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> properties, java.util.Map<org.alfresco.service.namespace.QName,java.util.List<org.alfresco.service.cmr.repository.NodeRef>> add, java.util.Map<org.alfresco.service.namespace.QName,java.util.List<org.alfresco.service.cmr.repository.NodeRef>> remove)Update the Properties and Associations of a Task
-
-
-
Method Detail
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
- Parameters:
transactionService- service that tells if the server is read-only or not
-
setAuthorityService
public void setAuthorityService(AuthorityService authorityService)
Sets the Authority Service- Parameters:
authorityService- AuthorityService
-
setBPMEngineRegistry
public void setBPMEngineRegistry(BPMEngineRegistry registry)
Sets the BPM Engine Registry- Parameters:
registry- bpm engine registry
-
setWorkflowAdminService
public void setWorkflowAdminService(WorkflowAdminService workflowAdminService)
- Parameters:
workflowAdminService- the workflowAdminService to set
-
setWorkflowPackageComponent
public void setWorkflowPackageComponent(WorkflowPackageComponent workflowPackageComponent)
Sets the Workflow Package Component- Parameters:
workflowPackageComponent- workflow package component
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the Node Service- Parameters:
nodeService- NodeService
-
setContentService
public void setContentService(ContentService contentService)
Sets the Content Service- Parameters:
contentService- ContentService
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service- Parameters:
dictionaryService- DictionaryService
-
setProtectedNodeService
public void setProtectedNodeService(org.alfresco.service.cmr.repository.NodeService protectedNodeService)
Set the node service which applies permissions- Parameters:
protectedNodeService- NodeService
-
setWorkflowNotification
public void setWorkflowNotification(WorkflowNotificationUtils service)
Set the workflow notification utils- Parameters:
service- workflow notification utils
-
setMaxAuthoritiesForPooledTasks
public void setMaxAuthoritiesForPooledTasks(int maxAuthoritiesForPooledTasks)
Sets the maximum number of groups to check for pooled tasks. For performance reasons, this is limited to 100 by default.- Parameters:
maxAuthoritiesForPooledTasks- the limit to set. If this is less than or equal to zero then there is no limit.
-
setMaxPooledTasks
public void setMaxPooledTasks(int maxPooledTasks)
Sets the maximum number of pooled tasks to return in a query. It may be necessary to limit this depending on UI limitations.- Parameters:
maxPooledTasks- the limit to set. If this is less than or equal to zero then there is no limit.
-
deployDefinition
public WorkflowDeployment deployDefinition(java.lang.String engineId, java.io.InputStream workflowDefinition, java.lang.String mimetype)
Description copied from interface:WorkflowServiceDeploy a Workflow Definition to the Alfresco Repository- Specified by:
deployDefinitionin interfaceWorkflowService- Parameters:
engineId- the bpm engine idworkflowDefinition- the workflow definitionmimetype- the mimetype of the workflow definition- Returns:
- workflow deployment descriptor
-
deployDefinition
public WorkflowDeployment deployDefinition(java.lang.String engineId, java.io.InputStream workflowDefinition, java.lang.String mimetype, java.lang.String name)
Description copied from interface:WorkflowServiceDeploy a Workflow Definition to the Alfresco Repository- Specified by:
deployDefinitionin interfaceWorkflowService- Parameters:
engineId- the bpm engine idworkflowDefinition- the workflow definitionmimetype- the mimetype of the workflow definitionname- a name representing the deployment- Returns:
- workflow deployment descriptor
-
isDefinitionDeployed
public boolean isDefinitionDeployed(org.alfresco.service.cmr.repository.NodeRef workflowDefinition)
Description copied from interface:WorkflowServiceIs 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.- Specified by:
isDefinitionDeployedin interfaceWorkflowService- Parameters:
workflowDefinition- the content object containing the definition- Returns:
- true => already deployed
-
isDefinitionDeployed
public boolean isDefinitionDeployed(java.lang.String engineId, java.io.InputStream workflowDefinition, java.lang.String mimetype)Description copied from interface:WorkflowServiceIs 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.- Specified by:
isDefinitionDeployedin interfaceWorkflowService- Parameters:
engineId- the bpm engine idworkflowDefinition- the definition to checkmimetype- the mimetype of the definition- Returns:
- true => already deployed
-
deployDefinition
public WorkflowDeployment deployDefinition(org.alfresco.service.cmr.repository.NodeRef definitionContent)
Description copied from interface:WorkflowServiceDeploy a Workflow Definition to the Alfresco Repository Note: The specified content object must be of type bpm:workflowdefinition. This type describes for which BPM engine the definition is appropriate.- Specified by:
deployDefinitionin interfaceWorkflowService- Parameters:
definitionContent- the content object containing the definition- Returns:
- workflow deployment descriptor
-
undeployDefinition
public void undeployDefinition(java.lang.String workflowDefinitionId)
Description copied from interface:WorkflowServiceUndeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances exist- Specified by:
undeployDefinitionin interfaceWorkflowService- Parameters:
workflowDefinitionId- the id of the definition to undeploy
-
getDefinitions
public java.util.List<WorkflowDefinition> getDefinitions()
Description copied from interface:WorkflowServiceGets latest deployed Workflow Definitions- Specified by:
getDefinitionsin interfaceWorkflowService- Returns:
- the latest deployed workflow definitions
-
getAllDefinitions
public java.util.List<WorkflowDefinition> getAllDefinitions()
Description copied from interface:WorkflowServiceGets all deployed Workflow Definitions (with all previous versions)- Specified by:
getAllDefinitionsin interfaceWorkflowService- Returns:
- the deployed (and previous) workflow definitions
-
getDefinitionById
public WorkflowDefinition getDefinitionById(java.lang.String workflowDefinitionId)
Description copied from interface:WorkflowServiceGets a Workflow Definition by unique Id- Specified by:
getDefinitionByIdin interfaceWorkflowService- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the deployed workflow definition (or null if not found)
-
getDefinitionByName
public WorkflowDefinition getDefinitionByName(java.lang.String workflowName)
Description copied from interface:WorkflowServiceGets the latest Workflow Definition by unique name- Specified by:
getDefinitionByNamein interfaceWorkflowService- Parameters:
workflowName- workflow name e.g. activiti$activitiReview- Returns:
- the deployed workflow definition (or null if not found)
-
getAllDefinitionsByName
public java.util.List<WorkflowDefinition> getAllDefinitionsByName(java.lang.String workflowName)
Description copied from interface:WorkflowServiceGets all (including previous) Workflow Definitions for the given unique name- Specified by:
getAllDefinitionsByNamein interfaceWorkflowService- Parameters:
workflowName- workflow name e.g. activiti$activitiReview- Returns:
- the deployed workflow definition (or null if not found)
-
getDefinitionImage
public byte[] getDefinitionImage(java.lang.String workflowDefinitionId)
Description copied from interface:WorkflowServiceGets a graphical view of the Workflow Definition- Specified by:
getDefinitionImagein interfaceWorkflowService- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- image view of the workflow definition
-
getTaskDefinitions
public java.util.List<WorkflowTaskDefinition> getTaskDefinitions(java.lang.String workflowDefinitionId)
Description copied from interface:WorkflowServiceGets the Task Definitions for the given Workflow Definition- Specified by:
getTaskDefinitionsin interfaceWorkflowService- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the deployed task definitions (or null if not found)
-
startWorkflow
public WorkflowPath startWorkflow(java.lang.String workflowDefinitionId, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> parameters)
Description copied from interface:WorkflowServiceStart a Workflow Instance- Specified by:
startWorkflowin interfaceWorkflowService- Parameters:
workflowDefinitionId- the workflow definition idparameters- the initial set of parameters used to populate the "Start Task" properties- Returns:
- the initial workflow path
-
startWorkflowFromTemplate
public WorkflowPath startWorkflowFromTemplate(org.alfresco.service.cmr.repository.NodeRef templateDefinition)
Description copied from interface:WorkflowServiceStart a Workflow Instance from an existing "Start Task" template node held in the Repository. The node must be of the Type as described in the Workflow Definition.- Specified by:
startWorkflowFromTemplatein interfaceWorkflowService- Parameters:
templateDefinition- the node representing the Start Task properties- Returns:
- the initial workflow path
-
getActiveWorkflows
public java.util.List<WorkflowInstance> getActiveWorkflows(java.lang.String workflowDefinitionId)
Gets all active workflow instances of the specified Workflow Definition- Specified by:
getActiveWorkflowsin interfaceWorkflowService- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the list of "in-flight" workflow instances
-
getCompletedWorkflows
public java.util.List<WorkflowInstance> getCompletedWorkflows(java.lang.String workflowDefinitionId)
Gets all completed workflow instances of the specified Workflow Definition- Specified by:
getCompletedWorkflowsin interfaceWorkflowService- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the list of "in-flight" workflow instances
-
getWorkflows
public java.util.List<WorkflowInstance> getWorkflows(java.lang.String workflowDefinitionId)
Gets all workflow instances (both active and completed) of the specified Workflow Definition- Specified by:
getWorkflowsin interfaceWorkflowService- Parameters:
workflowDefinitionId- the workflow definition id- Returns:
- the list of "in-flight" workflow instances
-
getWorkflows
public java.util.List<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
Description copied from interface:WorkflowServiceGets all "in-flight" workflow instances according to the specified workflowInstanceQuery parameter- Specified by:
getWorkflowsin interfaceWorkflowService- Parameters:
workflowInstanceQuery- WorkflowInstanceQuery
-
getWorkflows
public java.util.List<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery, int maxItems, int skipCount)
Description copied from interface:WorkflowServiceGets maxItems "in-flight" workflow instances according to the specified workflowInstanceQuery parameter Get maxItems and skipCount parameters form request- Specified by:
getWorkflowsin interfaceWorkflowService- Parameters:
workflowInstanceQuery- WorkflowInstanceQuerymaxItems- intskipCount- int- Returns:
- maxItems workflow instances
-
countWorkflows
public long countWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
Description copied from interface:WorkflowServiceGet count of workflow instances- Specified by:
countWorkflowsin interfaceWorkflowService- Parameters:
workflowInstanceQuery- WorkflowInstanceQuery- Returns:
- count of workflow instances
-
countTasks
public long countTasks(WorkflowTaskQuery workflowTaskQuery)
Description copied from interface:WorkflowServiceGet the number of tasks matching the given query- Specified by:
countTasksin interfaceWorkflowService- Parameters:
workflowTaskQuery- the filter by which tasks are queried- Returns:
- count of matching tasks
-
getActiveWorkflows
public java.util.List<WorkflowInstance> getActiveWorkflows()
Gets all active workflow instances.- Specified by:
getActiveWorkflowsin interfaceWorkflowService- Returns:
- the list of "in-flight" workflow instances
-
getCompletedWorkflows
public java.util.List<WorkflowInstance> getCompletedWorkflows()
Gets all completed workflow instances.- Specified by:
getCompletedWorkflowsin interfaceWorkflowService- Returns:
- the list of "in-flight" workflow instances
-
getWorkflows
public java.util.List<WorkflowInstance> getWorkflows()
Gets all workflow instances (both active and completed).- Specified by:
getWorkflowsin interfaceWorkflowService- Returns:
- the list of "in-flight" workflow instances
-
getWorkflowById
public WorkflowInstance getWorkflowById(java.lang.String workflowId)
Gets a specific workflow instances- Specified by:
getWorkflowByIdin interfaceWorkflowService- Parameters:
workflowId- the id of the workflow to retrieve- Returns:
- the workflow instance (or null if not found)
-
getWorkflowPaths
public java.util.List<WorkflowPath> getWorkflowPaths(java.lang.String workflowId)
Description copied from interface:WorkflowServiceGets all Paths for the specified Workflow instance. NOTE: It only returns information for an active Workflow instance.- Specified by:
getWorkflowPathsin interfaceWorkflowService- Parameters:
workflowId- workflow instance id- Returns:
- the list of workflow paths
-
getPathProperties
public java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> getPathProperties(java.lang.String pathId)
Description copied from interface:WorkflowServiceGets the properties associated with the specified path (and parent paths)- Specified by:
getPathPropertiesin interfaceWorkflowService- Parameters:
pathId- workflow path id- Returns:
- map of path properties
-
cancelWorkflow
public WorkflowInstance cancelWorkflow(java.lang.String workflowId)
Description copied from interface:WorkflowServiceCancel an "in-flight" Workflow instance- Specified by:
cancelWorkflowin interfaceWorkflowService- Parameters:
workflowId- the workflow instance to cancel- Returns:
- an updated representation of the workflow instance
-
cancelWorkflows
public java.util.List<WorkflowInstance> cancelWorkflows(java.util.List<java.lang.String> workflowIds)
Description copied from interface:WorkflowServiceCancel a batch of "in-flight" Workflow instances- Specified by:
cancelWorkflowsin interfaceWorkflowService- Parameters:
workflowIds- List of the workflow instances to cancel- Returns:
- List of updated representations of the workflow instances
-
setMultiTenantWorkflowDeploymentEnabled
public void setMultiTenantWorkflowDeploymentEnabled(boolean deployWorkflowsInTenant)
-
isMultiTenantWorkflowDeploymentEnabled
public boolean isMultiTenantWorkflowDeploymentEnabled()
- Specified by:
isMultiTenantWorkflowDeploymentEnabledin interfaceWorkflowService- Returns:
- true, if all workflows (in workflowDeployers) have a copy deployed per tenant and workflows can be deployed in tenant. False when workflows are shared system-wide, regardless of the tenant context.
-
deleteWorkflow
public WorkflowInstance deleteWorkflow(java.lang.String workflowId)
Description copied from interface:WorkflowServiceDelete a Workflow instance. NOTE: This will force a delete, meaning that the workflow instance may not go through all the appropriate cancel events.- Specified by:
deleteWorkflowin interfaceWorkflowService- Parameters:
workflowId- the workflow instance to cancel- Returns:
- an updated representation of the workflow instance
-
signal
public WorkflowPath signal(java.lang.String pathId, java.lang.String transition)
Description copied from interface:WorkflowServiceSignal the transition from one Workflow Node to another- Specified by:
signalin interfaceWorkflowService- Parameters:
pathId- the workflow path to signal ontransition- the transition id to follow (or null, for the default transition)- Returns:
- the updated workflow path
-
fireEvent
public WorkflowPath fireEvent(java.lang.String pathId, java.lang.String event)
Description copied from interface:WorkflowServiceFire custom event against specified path- Specified by:
fireEventin interfaceWorkflowService- 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
-
getTimers
public java.util.List<WorkflowTimer> getTimers(java.lang.String workflowId)
Description copied from interface:WorkflowServiceGets all active timers for the specified workflow- Specified by:
getTimersin interfaceWorkflowService- Returns:
- the list of active timers
-
getTasksForWorkflowPath
public java.util.List<WorkflowTask> getTasksForWorkflowPath(java.lang.String pathId)
Description copied from interface:WorkflowServiceGets all Tasks associated with the specified path- Specified by:
getTasksForWorkflowPathin interfaceWorkflowService- Parameters:
pathId- the path id- Returns:
- the list of associated tasks
-
getStartTask
public WorkflowTask getStartTask(java.lang.String workflowInstanceId)
Gets the start task instance for the given workflow instance.- Specified by:
getStartTaskin interfaceWorkflowService- Parameters:
workflowInstanceId- String- Returns:
- WorkflowTask
-
getStartTasks
public java.util.List<WorkflowTask> getStartTasks(java.util.List<java.lang.String> workflowInstanceIds, boolean sameSession)
Description copied from interface:WorkflowServiceGets the start task instances for the given workflow instances.- Specified by:
getStartTasksin interfaceWorkflowServicesameSession- indicates that the returnedWorkflowTaskelements will be used in the same session. Iftrue, the returned List will be a lazy loaded list providing greater performance.
-
hasWorkflowImage
public boolean hasWorkflowImage(java.lang.String workflowInstanceId)
Description copied from interface:WorkflowServiceDetermines if a graphical view of the workflow instance exists- Specified by:
hasWorkflowImagein interfaceWorkflowService- Parameters:
workflowInstanceId- the workflow instance id- Returns:
- true if there is a workflow instance diagram available
-
getWorkflowImage
public java.io.InputStream getWorkflowImage(java.lang.String workflowInstanceId)
Description copied from interface:WorkflowServiceGets a graphical view of the workflow instance- Specified by:
getWorkflowImagein interfaceWorkflowService- Parameters:
workflowInstanceId- the workflow instance id- Returns:
- image view of the workflow instance as an InputStream or null if a diagram is not available
-
getAssignedTasks
public java.util.List<WorkflowTask> getAssignedTasks(java.lang.String authority, WorkflowTaskState state)
Description copied from interface:WorkflowServiceGets all tasks assigned to the specified authority- Specified by:
getAssignedTasksin interfaceWorkflowService- Parameters:
authority- the authoritystate- filter by specified workflow task state- Returns:
- the list of assigned tasks
-
getAssignedTasks
public java.util.List<WorkflowTask> getAssignedTasks(java.lang.String authority, WorkflowTaskState state, boolean lazyInitialization)
Description copied from interface:WorkflowServiceGets all tasks assigned to the specified authority- Specified by:
getAssignedTasksin interfaceWorkflowService- Parameters:
authority- the authoritystate- filter by specified workflow task statelazyInitialization- hint to the underlying workflow-engine to allow returningWorkflowTasks which aren't fully initialized but will be when the required values are required. Iftrue, the returned enities should be used inside of the transaction-boundaries of this service-call. Iffalse, fully initialized entities are returned, just as withWorkflowService.getAssignedTasks(String, WorkflowTaskState).
It's a hint to the underlying workflow-engine and may be ignored by the actual implementation.- Returns:
- the list of assigned tasks
-
getPooledTasks
public java.util.List<WorkflowTask> getPooledTasks(java.lang.String authority)
Description copied from interface:WorkflowServiceGets the pooled tasks available to the specified authority- Specified by:
getPooledTasksin interfaceWorkflowService- Parameters:
authority- the authority- Returns:
- the list of pooled tasks
-
getPooledTasks
public java.util.List<WorkflowTask> getPooledTasks(java.lang.String authority, boolean lazyinitialization)
Description copied from interface:WorkflowServiceGets the pooled tasks available to the specified authority- Specified by:
getPooledTasksin interfaceWorkflowService- Parameters:
authority- the authoritylazyinitialization- hint to the underlying workflow-engine to allow returningWorkflowTasks which aren't fully initialized but will be when the required values are required. Iftrue, the returned enities should be used inside of the transaction-boundaries of this service-call. Iffalse, fully initialized entities are returned, just as withWorkflowService.getPooledTasks(String).
It's a hint to the underlying workflow-engine and may be ignored by the actual implementation.- Returns:
- the list of pooled tasks
-
queryTasks
public java.util.List<WorkflowTask> queryTasks(WorkflowTaskQuery query)
- Specified by:
queryTasksin interfaceWorkflowService
-
queryTasks
public java.util.List<WorkflowTask> queryTasks(WorkflowTaskQuery query, boolean sameSession)
Description copied from interface:WorkflowServiceQuery for tasks- Specified by:
queryTasksin interfaceWorkflowService- Parameters:
query- the filter by which tasks are queriedsameSession- indicates that the returnedWorkflowTaskelements will be used in the same session. Iftrue, the returned List will be a lazy loaded list providing greater performance.- Returns:
- the list of tasks matching the specified query
-
updateTask
public WorkflowTask updateTask(java.lang.String taskId, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> properties, java.util.Map<org.alfresco.service.namespace.QName,java.util.List<org.alfresco.service.cmr.repository.NodeRef>> add, java.util.Map<org.alfresco.service.namespace.QName,java.util.List<org.alfresco.service.cmr.repository.NodeRef>> remove)
Description copied from interface:WorkflowServiceUpdate the Properties and Associations of a Task- Specified by:
updateTaskin interfaceWorkflowService- Parameters:
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)- Returns:
- the update task
-
endTask
public WorkflowTask endTask(java.lang.String taskId, java.lang.String transition)
Description copied from interface:WorkflowServiceEnd the Task (i.e. complete the task)- Specified by:
endTaskin interfaceWorkflowService- Parameters:
taskId- the task id to endtransition- the task transition id to take on completion (or null, for the default transition)- Returns:
- the updated task
-
isTaskEditable
public boolean isTaskEditable(WorkflowTask task, java.lang.String username)
Description copied from interface:WorkflowServiceDetermines if the given user can edit the given task- Specified by:
isTaskEditablein interfaceWorkflowService- Parameters:
task- The task to checkusername- The user to check- Returns:
- true if the user can edit the task
-
isTaskEditable
public boolean isTaskEditable(WorkflowTask task, java.lang.String username, boolean refreshTask)
Description copied from interface:WorkflowServiceDetermines if the given user can edit the given task- Specified by:
isTaskEditablein interfaceWorkflowService- Parameters:
task- The task to checkusername- The user to checkrefreshTask- Whether or not to refresh theWorkflowTaskbefore check is perfromed- Returns:
- true if the user can edit the task
-
isTaskReassignable
public boolean isTaskReassignable(WorkflowTask task, java.lang.String username)
Description copied from interface:WorkflowServiceDetermines if the given user can reassign the given task- Specified by:
isTaskReassignablein interfaceWorkflowService- Parameters:
task- The task to checkusername- The user to check- Returns:
- true if the user can reassign the task
-
isTaskReassignable
public boolean isTaskReassignable(WorkflowTask task, java.lang.String username, boolean refreshTask)
Description copied from interface:WorkflowServiceDetermines if the given user can reassign the given task- Specified by:
isTaskReassignablein interfaceWorkflowService- Parameters:
task- The task to checkusername- The user to checkrefreshTask- Whether or not to refresh theWorkflowTaskbefore check is perfromed- Returns:
- true if the user can reassign the task
-
isTaskClaimable
public boolean isTaskClaimable(WorkflowTask task, java.lang.String username)
Description copied from interface:WorkflowServiceDetermines if the given user can claim the given task- Specified by:
isTaskClaimablein interfaceWorkflowService- Parameters:
task- The task to checkusername- The user to check- Returns:
- true if the user can claim the task
-
isTaskClaimable
public boolean isTaskClaimable(WorkflowTask task, java.lang.String username, boolean refreshTask)
Description copied from interface:WorkflowServiceDetermines if the given user can claim the given task- Specified by:
isTaskClaimablein interfaceWorkflowService- Parameters:
task- The task to checkusername- The user to checkrefreshTask- Whether or not to refresh theWorkflowTaskbefore check is perfromed- Returns:
- true if the user can claim the task
-
isTaskReleasable
public boolean isTaskReleasable(WorkflowTask task, java.lang.String username)
Description copied from interface:WorkflowServiceDetermines if the given user can release the given task- Specified by:
isTaskReleasablein interfaceWorkflowService- Parameters:
task- The task to checkusername- The user to check- Returns:
- true if the user can release the task
-
isTaskReleasable
public boolean isTaskReleasable(WorkflowTask task, java.lang.String username, boolean refreshTask)
Description copied from interface:WorkflowServiceDetermines if the given user can release the given task- Specified by:
isTaskReleasablein interfaceWorkflowService- Parameters:
task- The task to checkusername- The user to checkrefreshTask- Whether or not to refresh theWorkflowTaskbefore check is perfromed- Returns:
- true if the user can release the task
-
getTaskById
public WorkflowTask getTaskById(java.lang.String taskId)
Description copied from interface:WorkflowServiceGets a Task by unique Id- Specified by:
getTaskByIdin interfaceWorkflowService- Parameters:
taskId- the task id- Returns:
- the task (or null, if not found)
-
createPackage
public org.alfresco.service.cmr.repository.NodeRef createPackage(org.alfresco.service.cmr.repository.NodeRef container)
Description copied from interface:WorkflowServiceCreate a Workflow Package (a container of content to route through the Workflow). If an existing container is supplied, it's supplemented with the workflow package aspect.- Specified by:
createPackagein interfaceWorkflowService- Parameters:
container- (optional) a pre-created container (e.g. folder, versioned folder or layered folder)- Returns:
- the workflow package
-
getWorkflowsForContent
public java.util.List<WorkflowInstance> getWorkflowsForContent(org.alfresco.service.cmr.repository.NodeRef packageItem, boolean active)
Description copied from interface:WorkflowServiceGets the Workflows that act upon the specified Repository content.- Specified by:
getWorkflowsForContentin interfaceWorkflowService- Parameters:
packageItem- the repository content item to get workflows foractive- true => active workflows only, false => completed workflows only- Returns:
- list of workflows which act upon the specified content
-
getPackageContents
public java.util.List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents(java.lang.String taskId)
Description copied from interface:WorkflowServiceGet a list of node refs to all the package contents for the given task id.- Specified by:
getPackageContentsin interfaceWorkflowService- Parameters:
taskId- - the task id- Returns:
- - A list of NodeRefs
-
getPackageContents
public java.util.List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents(org.alfresco.service.cmr.repository.NodeRef packageRef)
Description copied from interface:WorkflowServiceGet a list of node refs to all the package contents.- Specified by:
getPackageContentsin interfaceWorkflowService- Parameters:
packageRef- the nodeRef to the package- Returns:
- A list of nodeRefs the package is referring to
-
-