public class WorkflowServiceImpl extends Object implements WorkflowService
| Constructor and Description |
|---|
WorkflowServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
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 workflowTaskQuery)
Get the number of tasks matching the given query
|
long |
countWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
Get count of workflow instances
|
org.alfresco.service.cmr.repository.NodeRef |
createPackage(org.alfresco.service.cmr.repository.NodeRef container)
Create a Workflow Package (a container of content to route through the Workflow).
|
WorkflowInstance |
deleteWorkflow(String workflowId)
Delete a Workflow instance.
|
WorkflowDeployment |
deployDefinition(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.
|
WorkflowDeployment |
deployDefinition(String engineId,
InputStream workflowDefinition,
String mimetype)
Deploy a Workflow Definition to the Alfresco Repository
|
WorkflowDeployment |
deployDefinition(String engineId,
InputStream workflowDefinition,
String mimetype,
String name)
Deploy a Workflow Definition to the Alfresco Repository
|
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 active workflow instances.
|
List<WorkflowInstance> |
getActiveWorkflows(String workflowDefinitionId)
Gets all 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)
Gets all tasks assigned to the specified authority
|
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 completed workflow instances of the specified Workflow Definition
|
WorkflowDefinition |
getDefinitionById(String workflowDefinitionId)
Gets a Workflow Definition by unique Id
|
WorkflowDefinition |
getDefinitionByName(String workflowName)
Gets the latest Workflow Definition by unique name
|
byte[] |
getDefinitionImage(String workflowDefinitionId)
Gets a graphical view of the Workflow Definition
|
List<WorkflowDefinition> |
getDefinitions()
Gets latest deployed Workflow Definitions
|
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.
|
List<org.alfresco.service.cmr.repository.NodeRef> |
getPackageContents(String taskId)
Get a list of node refs to all the package contents for the given task id.
|
Map<org.alfresco.service.namespace.QName,Serializable> |
getPathProperties(String pathId)
Gets the properties associated with the specified path (and parent paths)
|
List<WorkflowTask> |
getPooledTasks(String authority)
Gets the pooled tasks available to the specified authority
|
List<WorkflowTask> |
getPooledTasks(String authority,
boolean lazyinitialization)
Gets the pooled tasks available to the specified authority
|
WorkflowTask |
getStartTask(String workflowInstanceId)
Gets the start task instance for the given workflow instance.
|
List<WorkflowTask> |
getStartTasks(List<String> workflowInstanceIds,
boolean sameSession)
Gets the start task instances for the given workflow instances.
|
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 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
Get maxItems and skipCount parameters form request
|
List<WorkflowInstance> |
getWorkflowsForContent(org.alfresco.service.cmr.repository.NodeRef packageItem,
boolean active)
Gets the Workflows that act upon the specified Repository content.
|
boolean |
hasWorkflowImage(String workflowInstanceId)
Determines if a graphical view of the workflow instance exists
|
boolean |
isDefinitionDeployed(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.
|
boolean |
isDefinitionDeployed(String engineId,
InputStream workflowDefinition,
String mimetype)
Is the specified Workflow Definition already deployed?
Note: the notion of "already deployed" may differ between bpm engines.
|
boolean |
isMultiTenantWorkflowDeploymentEnabled() |
boolean |
isTaskClaimable(WorkflowTask task,
String username)
Determines if the given user can claim the given task
|
boolean |
isTaskClaimable(WorkflowTask task,
String username,
boolean refreshTask)
Determines if the given user can claim the given task
|
boolean |
isTaskEditable(WorkflowTask task,
String username)
Determines if the given user can edit the given task
|
boolean |
isTaskEditable(WorkflowTask task,
String username,
boolean refreshTask)
Determines if the given user can edit the given task
|
boolean |
isTaskReassignable(WorkflowTask task,
String username)
Determines if the given user can reassign the given task
|
boolean |
isTaskReassignable(WorkflowTask task,
String username,
boolean refreshTask)
Determines if the given user can reassign the given task
|
boolean |
isTaskReleasable(WorkflowTask task,
String username)
Determines if the given user can release the given task
|
boolean |
isTaskReleasable(WorkflowTask task,
String username,
boolean refreshTask)
Determines if the given user can release the given task
|
List<WorkflowTask> |
queryTasks(WorkflowTaskQuery query) |
List<WorkflowTask> |
queryTasks(WorkflowTaskQuery query,
boolean sameSession)
Query for tasks
|
void |
setAuthorityService(AuthorityService authorityService)
Sets the Authority Service
|
void |
setBPMEngineRegistry(BPMEngineRegistry registry)
Sets the BPM Engine Registry
|
void |
setContentService(ContentService contentService)
Sets the Content Service
|
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service
|
void |
setMaxAuthoritiesForPooledTasks(int maxAuthoritiesForPooledTasks)
Sets the maximum number of groups to check for pooled tasks.
|
void |
setMaxPooledTasks(int maxPooledTasks)
Sets the maximum number of pooled tasks to return in a query.
|
void |
setMultiTenantWorkflowDeploymentEnabled(boolean deployWorkflowsInTenant) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the Node Service
|
void |
setProtectedNodeService(org.alfresco.service.cmr.repository.NodeService protectedNodeService)
Set the node service which applies permissions
|
void |
setTransactionService(TransactionService transactionService) |
void |
setWorkflowAdminService(WorkflowAdminService workflowAdminService) |
void |
setWorkflowNotification(WorkflowNotificationUtils service)
Set the workflow notification utils
|
void |
setWorkflowPackageComponent(WorkflowPackageComponent workflowPackageComponent)
Sets the Workflow Package Component
|
WorkflowPath |
signal(String pathId,
String transition)
Signal the transition from one Workflow Node to another
|
WorkflowPath |
startWorkflow(String workflowDefinitionId,
Map<org.alfresco.service.namespace.QName,Serializable> parameters)
Start a Workflow Instance
|
WorkflowPath |
startWorkflowFromTemplate(org.alfresco.service.cmr.repository.NodeRef templateDefinition)
Start a Workflow Instance from an existing "Start Task" template node held in the
Repository.
|
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
|
public void setTransactionService(TransactionService transactionService)
transactionService - service that tells if the server is read-only or notpublic void setAuthorityService(AuthorityService authorityService)
authorityService - AuthorityServicepublic void setBPMEngineRegistry(BPMEngineRegistry registry)
registry - bpm engine registrypublic void setWorkflowAdminService(WorkflowAdminService workflowAdminService)
workflowAdminService - the workflowAdminService to setpublic void setWorkflowPackageComponent(WorkflowPackageComponent workflowPackageComponent)
workflowPackageComponent - workflow package componentpublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService - NodeServicepublic void setContentService(ContentService contentService)
contentService - ContentServicepublic void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService - DictionaryServicepublic void setProtectedNodeService(org.alfresco.service.cmr.repository.NodeService protectedNodeService)
protectedNodeService - NodeServicepublic void setWorkflowNotification(WorkflowNotificationUtils service)
service - workflow notification utilspublic void setMaxAuthoritiesForPooledTasks(int maxAuthoritiesForPooledTasks)
maxAuthoritiesForPooledTasks - the limit to set. If this is less than or equal to zero then there is no limit.public void setMaxPooledTasks(int maxPooledTasks)
maxPooledTasks - the limit to set. If this is less than or equal to zero then there is no limit.public WorkflowDeployment deployDefinition(String engineId, InputStream workflowDefinition, String mimetype)
WorkflowServicedeployDefinition in interface WorkflowServiceengineId - the bpm engine idworkflowDefinition - the workflow definitionmimetype - the mimetype of the workflow definitionpublic WorkflowDeployment deployDefinition(String engineId, InputStream workflowDefinition, String mimetype, String name)
WorkflowServicedeployDefinition in interface WorkflowServiceengineId - the bpm engine idworkflowDefinition - the workflow definitionmimetype - the mimetype of the workflow definitionname - a name representing the deploymentpublic boolean isDefinitionDeployed(org.alfresco.service.cmr.repository.NodeRef workflowDefinition)
WorkflowServiceisDefinitionDeployed in interface WorkflowServiceworkflowDefinition - the content object containing the definitionpublic boolean isDefinitionDeployed(String engineId, InputStream workflowDefinition, String mimetype)
WorkflowServiceisDefinitionDeployed in interface WorkflowServiceengineId - the bpm engine idworkflowDefinition - the definition to checkmimetype - the mimetype of the definitionpublic WorkflowDeployment deployDefinition(org.alfresco.service.cmr.repository.NodeRef definitionContent)
WorkflowServicedeployDefinition in interface WorkflowServicedefinitionContent - the content object containing the definitionpublic void undeployDefinition(String workflowDefinitionId)
WorkflowServiceundeployDefinition in interface WorkflowServiceworkflowDefinitionId - the id of the definition to undeploypublic List<WorkflowDefinition> getDefinitions()
WorkflowServicegetDefinitions in interface WorkflowServicepublic List<WorkflowDefinition> getAllDefinitions()
WorkflowServicegetAllDefinitions in interface WorkflowServicepublic WorkflowDefinition getDefinitionById(String workflowDefinitionId)
WorkflowServicegetDefinitionById in interface WorkflowServiceworkflowDefinitionId - the workflow definition idpublic WorkflowDefinition getDefinitionByName(String workflowName)
WorkflowServicegetDefinitionByName in interface WorkflowServiceworkflowName - workflow name e.g. activiti$activitiReviewpublic List<WorkflowDefinition> getAllDefinitionsByName(String workflowName)
WorkflowServicegetAllDefinitionsByName in interface WorkflowServiceworkflowName - workflow name e.g. activiti$activitiReviewpublic byte[] getDefinitionImage(String workflowDefinitionId)
WorkflowServicegetDefinitionImage in interface WorkflowServiceworkflowDefinitionId - the workflow definition idpublic List<WorkflowTaskDefinition> getTaskDefinitions(String workflowDefinitionId)
WorkflowServicegetTaskDefinitions in interface WorkflowServiceworkflowDefinitionId - the workflow definition idpublic WorkflowPath startWorkflow(String workflowDefinitionId, Map<org.alfresco.service.namespace.QName,Serializable> parameters)
WorkflowServicestartWorkflow in interface WorkflowServiceworkflowDefinitionId - the workflow definition idparameters - the initial set of parameters used to populate the "Start Task" propertiespublic WorkflowPath startWorkflowFromTemplate(org.alfresco.service.cmr.repository.NodeRef templateDefinition)
WorkflowServicestartWorkflowFromTemplate in interface WorkflowServicetemplateDefinition - the node representing the Start Task propertiespublic List<WorkflowInstance> getActiveWorkflows(String workflowDefinitionId)
getActiveWorkflows in interface WorkflowServiceworkflowDefinitionId - the workflow definition idpublic List<WorkflowInstance> getCompletedWorkflows(String workflowDefinitionId)
getCompletedWorkflows in interface WorkflowServiceworkflowDefinitionId - the workflow definition idpublic List<WorkflowInstance> getWorkflows(String workflowDefinitionId)
getWorkflows in interface WorkflowServiceworkflowDefinitionId - the workflow definition idpublic List<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
WorkflowServicegetWorkflows in interface WorkflowServiceworkflowInstanceQuery - WorkflowInstanceQuerypublic List<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery, int maxItems, int skipCount)
WorkflowServicegetWorkflows in interface WorkflowServiceworkflowInstanceQuery - WorkflowInstanceQuerymaxItems - intskipCount - intpublic long countWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
WorkflowServicecountWorkflows in interface WorkflowServiceworkflowInstanceQuery - WorkflowInstanceQuerypublic long countTasks(WorkflowTaskQuery workflowTaskQuery)
WorkflowServicecountTasks in interface WorkflowServiceworkflowTaskQuery - the filter by which tasks are queriedpublic List<WorkflowInstance> getActiveWorkflows()
getActiveWorkflows in interface WorkflowServicepublic List<WorkflowInstance> getCompletedWorkflows()
getCompletedWorkflows in interface WorkflowServicepublic List<WorkflowInstance> getWorkflows()
getWorkflows in interface WorkflowServicepublic WorkflowInstance getWorkflowById(String workflowId)
getWorkflowById in interface WorkflowServiceworkflowId - the id of the workflow to retrievepublic List<WorkflowPath> getWorkflowPaths(String workflowId)
WorkflowServicegetWorkflowPaths in interface WorkflowServiceworkflowId - workflow instance idpublic Map<org.alfresco.service.namespace.QName,Serializable> getPathProperties(String pathId)
WorkflowServicegetPathProperties in interface WorkflowServicepathId - workflow path idpublic WorkflowInstance cancelWorkflow(String workflowId)
WorkflowServicecancelWorkflow in interface WorkflowServiceworkflowId - the workflow instance to cancelpublic List<WorkflowInstance> cancelWorkflows(List<String> workflowIds)
WorkflowServicecancelWorkflows in interface WorkflowServiceworkflowIds - List of the workflow instances to cancelpublic void setMultiTenantWorkflowDeploymentEnabled(boolean deployWorkflowsInTenant)
public boolean isMultiTenantWorkflowDeploymentEnabled()
isMultiTenantWorkflowDeploymentEnabled in interface WorkflowServicepublic WorkflowInstance deleteWorkflow(String workflowId)
WorkflowServicedeleteWorkflow in interface WorkflowServiceworkflowId - the workflow instance to cancelpublic WorkflowPath signal(String pathId, String transition)
WorkflowServicesignal in interface WorkflowServicepathId - the workflow path to signal ontransition - the transition id to follow (or null, for the default transition)public WorkflowPath fireEvent(String pathId, String event)
WorkflowServicefireEvent in interface WorkflowServicepathId - the workflow path to fire event onevent - name of eventpublic List<WorkflowTimer> getTimers(String workflowId)
WorkflowServicegetTimers in interface WorkflowServicepublic List<WorkflowTask> getTasksForWorkflowPath(String pathId)
WorkflowServicegetTasksForWorkflowPath in interface WorkflowServicepathId - the path idpublic WorkflowTask getStartTask(String workflowInstanceId)
getStartTask in interface WorkflowServiceworkflowInstanceId - Stringpublic List<WorkflowTask> getStartTasks(List<String> workflowInstanceIds, boolean sameSession)
WorkflowServicegetStartTasks in interface WorkflowServicesameSession - 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 boolean hasWorkflowImage(String workflowInstanceId)
WorkflowServicehasWorkflowImage in interface WorkflowServiceworkflowInstanceId - the workflow instance idpublic InputStream getWorkflowImage(String workflowInstanceId)
WorkflowServicegetWorkflowImage in interface WorkflowServiceworkflowInstanceId - the workflow instance idpublic List<WorkflowTask> getAssignedTasks(String authority, WorkflowTaskState state)
WorkflowServicegetAssignedTasks in interface WorkflowServiceauthority - the authoritystate - filter by specified workflow task statepublic List<WorkflowTask> getAssignedTasks(String authority, WorkflowTaskState state, boolean lazyInitialization)
WorkflowServicegetAssignedTasks in interface WorkflowServiceauthority - the authoritystate - filter by specified workflow task statelazyInitialization - hint to the underlying workflow-engine to allow returning WorkflowTasks which
aren't fully initialized but will be when the required values are required. If true, the
returned enities should be used inside of the transaction-boundaries of this service-call.
If false, fully initialized entities are returned, just as with WorkflowService.getAssignedTasks(String, WorkflowTaskState).
public List<WorkflowTask> getPooledTasks(String authority)
WorkflowServicegetPooledTasks in interface WorkflowServiceauthority - the authoritypublic List<WorkflowTask> getPooledTasks(String authority, boolean lazyinitialization)
WorkflowServicegetPooledTasks in interface WorkflowServiceauthority - the authoritylazyinitialization - hint to the underlying workflow-engine to allow returning WorkflowTasks which
aren't fully initialized but will be when the required values are required. If true, the
returned enities should be used inside of the transaction-boundaries of this service-call.
If false, fully initialized entities are returned, just as with WorkflowService.getPooledTasks(String).
public List<WorkflowTask> queryTasks(WorkflowTaskQuery query)
queryTasks in interface WorkflowServicepublic List<WorkflowTask> queryTasks(WorkflowTaskQuery query, boolean sameSession)
WorkflowServicequeryTasks in interface WorkflowServicequery - 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 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)
WorkflowServiceupdateTask in interface WorkflowServicetaskId - 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 WorkflowTask endTask(String taskId, String transition)
WorkflowServiceendTask in interface WorkflowServicetaskId - the task id to endtransition - the task transition id to take on completion (or null, for the default transition)public boolean isTaskEditable(WorkflowTask task, String username)
WorkflowServiceisTaskEditable in interface WorkflowServicetask - The task to checkusername - The user to checkpublic boolean isTaskEditable(WorkflowTask task, String username, boolean refreshTask)
WorkflowServiceisTaskEditable in interface WorkflowServicetask - The task to checkusername - The user to checkrefreshTask - Whether or not to refresh the WorkflowTask before check is perfromedpublic boolean isTaskReassignable(WorkflowTask task, String username)
WorkflowServiceisTaskReassignable in interface WorkflowServicetask - The task to checkusername - The user to checkpublic boolean isTaskReassignable(WorkflowTask task, String username, boolean refreshTask)
WorkflowServiceisTaskReassignable in interface WorkflowServicetask - The task to checkusername - The user to checkrefreshTask - Whether or not to refresh the WorkflowTask before check is perfromedpublic boolean isTaskClaimable(WorkflowTask task, String username)
WorkflowServiceisTaskClaimable in interface WorkflowServicetask - The task to checkusername - The user to checkpublic boolean isTaskClaimable(WorkflowTask task, String username, boolean refreshTask)
WorkflowServiceisTaskClaimable in interface WorkflowServicetask - The task to checkusername - The user to checkrefreshTask - Whether or not to refresh the WorkflowTask before check is perfromedpublic boolean isTaskReleasable(WorkflowTask task, String username)
WorkflowServiceisTaskReleasable in interface WorkflowServicetask - The task to checkusername - The user to checkpublic boolean isTaskReleasable(WorkflowTask task, String username, boolean refreshTask)
WorkflowServiceisTaskReleasable in interface WorkflowServicetask - The task to checkusername - The user to checkrefreshTask - Whether or not to refresh the WorkflowTask before check is perfromedpublic WorkflowTask getTaskById(String taskId)
WorkflowServicegetTaskById in interface WorkflowServicetaskId - the task idpublic org.alfresco.service.cmr.repository.NodeRef createPackage(org.alfresco.service.cmr.repository.NodeRef container)
WorkflowServicecreatePackage in interface WorkflowServicecontainer - (optional) a pre-created container (e.g. folder, versioned folder or layered folder)public List<WorkflowInstance> getWorkflowsForContent(org.alfresco.service.cmr.repository.NodeRef packageItem, boolean active)
WorkflowServicegetWorkflowsForContent in interface WorkflowServicepackageItem - the repository content item to get workflows foractive - true => active workflows only, false => completed workflows onlypublic List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents(String taskId)
WorkflowServicegetPackageContents in interface WorkflowServicetaskId - - the task idpublic List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents(org.alfresco.service.cmr.repository.NodeRef packageRef)
WorkflowServicegetPackageContents in interface WorkflowServicepackageRef - the nodeRef to the packageCopyright © 2005–2018 Alfresco Software. All rights reserved.