@AlfrescoPublicApi
public interface WorkflowService
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 workflowDefinition)
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 transitionId)
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)
Deprecated.
Use overloaded method with the
sameSession parameter
(this method defaults the parameter to false ). |
List<WorkflowTask> |
queryTasks(WorkflowTaskQuery query,
boolean sameSession)
Query for tasks
|
WorkflowPath |
signal(String pathId,
String transitionId)
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
|
@Auditable(parameters={"engineId","workflowDefinition","mimetype"}, recordable={true,false,true}) WorkflowDeployment deployDefinition(String engineId, InputStream workflowDefinition, String mimetype)
engineId
- the bpm engine idworkflowDefinition
- the workflow definitionmimetype
- the mimetype of the workflow definition@Auditable(parameters={"engineId","workflowDefinition","mimetype","name"}, recordable={true,false,true,true}) WorkflowDeployment deployDefinition(String engineId, InputStream workflowDefinition, String mimetype, String name)
engineId
- the bpm engine idworkflowDefinition
- the workflow definitionmimetype
- the mimetype of the workflow definitionname
- a name representing the deployment@Auditable(parameters="workflowDefinition") WorkflowDeployment deployDefinition(org.alfresco.service.cmr.repository.NodeRef workflowDefinition)
workflowDefinition
- the content object containing the definition@Auditable(parameters="definitionContent") boolean isDefinitionDeployed(org.alfresco.service.cmr.repository.NodeRef workflowDefinition)
workflowDefinition
- the content object containing the definition@Auditable(parameters={"engineId","workflowDefinition","mimetype"}, recordable={true,false,true}) boolean isDefinitionDeployed(String engineId, InputStream workflowDefinition, String mimetype)
engineId
- the bpm engine idworkflowDefinition
- the definition to checkmimetype
- the mimetype of the definition@Auditable(parameters="workflowDefinitionId") void undeployDefinition(String workflowDefinitionId)
workflowDefinitionId
- the id of the definition to undeploy@Auditable List<WorkflowDefinition> getDefinitions()
@Auditable List<WorkflowDefinition> getAllDefinitions()
@Auditable(parameters="workflowDefinitionId") WorkflowDefinition getDefinitionById(String workflowDefinitionId)
workflowDefinitionId
- the workflow definition id@Auditable(parameters="workflowName") WorkflowDefinition getDefinitionByName(String workflowName)
workflowName
- workflow name e.g. activiti$activitiReview@Auditable(parameters="workflowName") List<WorkflowDefinition> getAllDefinitionsByName(String workflowName)
workflowName
- workflow name e.g. activiti$activitiReview@Auditable(parameters="workflowDefinitionId") byte[] getDefinitionImage(String workflowDefinitionId)
workflowDefinitionId
- the workflow definition id@Auditable(parameters="workflowDefinitionId") List<WorkflowTaskDefinition> getTaskDefinitions(String workflowDefinitionId)
workflowDefinitionId
- the workflow definition id@Auditable(parameters={"workflowDefinitionId","parameters"}) WorkflowPath startWorkflow(String workflowDefinitionId, Map<org.alfresco.service.namespace.QName,Serializable> parameters)
workflowDefinitionId
- the workflow definition idparameters
- the initial set of parameters used to populate the "Start Task" properties@Auditable(parameters="templateDefinition") WorkflowPath startWorkflowFromTemplate(org.alfresco.service.cmr.repository.NodeRef templateDefinition)
templateDefinition
- the node representing the Start Task properties@Auditable(parameters="workflowDefinitionId") List<WorkflowInstance> getActiveWorkflows(String workflowDefinitionId)
workflowDefinitionId
- the workflow definition id@Auditable(parameters="workflowDefinitionId") List<WorkflowInstance> getCompletedWorkflows(String workflowDefinitionId)
workflowDefinitionId
- the workflow definition id@Auditable(parameters="workflowDefinitionId") List<WorkflowInstance> getWorkflows(String workflowDefinitionId)
workflowDefinitionId
- the workflow definition idList<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
workflowInstanceQuery
- WorkflowInstanceQueryList<WorkflowInstance> getWorkflows(WorkflowInstanceQuery workflowInstanceQuery, int maxItems, int skipCount)
workflowInstanceQuery
- WorkflowInstanceQuerymaxItems
- intskipCount
- intlong countWorkflows(WorkflowInstanceQuery workflowInstanceQuery)
workflowInstanceQuery
- WorkflowInstanceQuery@Auditable List<WorkflowInstance> getActiveWorkflows()
@Auditable List<WorkflowInstance> getCompletedWorkflows()
List<WorkflowInstance> getWorkflows()
@Auditable(parameters="workflowId") WorkflowInstance getWorkflowById(String workflowId)
workflowId
- the id of the workflow to retrieve@Auditable(parameters="workflowId") List<WorkflowPath> getWorkflowPaths(String workflowId)
workflowId
- workflow instance id@Auditable(parameters="pathId") Map<org.alfresco.service.namespace.QName,Serializable> getPathProperties(String pathId)
pathId
- workflow path id@Auditable(parameters="workflowId") WorkflowInstance cancelWorkflow(String workflowId)
workflowId
- the workflow instance to cancel@Auditable(parameters="workflowIds") List<WorkflowInstance> cancelWorkflows(List<String> workflowIds)
workflowIds
- List of the workflow instances to cancel@Auditable(parameters="workflowId") WorkflowInstance deleteWorkflow(String workflowId)
workflowId
- the workflow instance to cancel@Auditable(parameters={"pathId","transitionId"}) WorkflowPath signal(String pathId, String transitionId)
pathId
- the workflow path to signal ontransitionId
- the transition id to follow (or null, for the default transition)@Auditable(parameters={"pathId","event"}) WorkflowPath fireEvent(String pathId, String event)
pathId
- the workflow path to fire event onevent
- name of event@Auditable(parameters="pathId") List<WorkflowTask> getTasksForWorkflowPath(String pathId)
pathId
- the path id@Auditable(parameters="pathId") WorkflowTask getStartTask(String workflowInstanceId)
workflowInstanceId
- String@Auditable(parameters="pathIds") List<WorkflowTask> getStartTasks(List<String> workflowInstanceIds, boolean sameSession)
sameSession
- 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.@Auditable(parameters="workflowInstanceId") boolean hasWorkflowImage(String workflowInstanceId)
workflowInstanceId
- the workflow instance id@Auditable(parameters="workflowInstanceId", recordReturnedObject=false) InputStream getWorkflowImage(String workflowInstanceId)
workflowInstanceId
- the workflow instance id@Auditable(parameters="workflowId") List<WorkflowTimer> getTimers(String workflowId)
@Auditable(parameters="taskId") WorkflowTask getTaskById(String taskId)
taskId
- the task id@Auditable(parameters={"authority","state","lazyInitialization"}) List<WorkflowTask> getAssignedTasks(String authority, WorkflowTaskState state, boolean lazyInitialization)
authority
- the authoritystate
- filter by specified workflow task statelazyInitialization
- hint to the underlying workflow-engine to allow returning WorkflowTask
s 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 getAssignedTasks(String, WorkflowTaskState)
.
@Auditable(parameters={"authority","state","lazy"}) List<WorkflowTask> getAssignedTasks(String authority, WorkflowTaskState state)
authority
- the authoritystate
- filter by specified workflow task state@Auditable(parameters="authority") List<WorkflowTask> getPooledTasks(String authority)
authority
- the authority@Auditable(parameters="authority") List<WorkflowTask> getPooledTasks(String authority, boolean lazyinitialization)
authority
- the authoritylazyinitialization
- hint to the underlying workflow-engine to allow returning WorkflowTask
s 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 getPooledTasks(String)
.
List<WorkflowTask> queryTasks(WorkflowTaskQuery query)
sameSession
parameter
(this method defaults the parameter to false
).@Auditable(parameters="query") List<WorkflowTask> queryTasks(WorkflowTaskQuery query, boolean sameSession)
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.long countTasks(WorkflowTaskQuery workflowTaskQuery)
workflowTaskQuery
- the filter by which tasks are queried@Auditable(parameters={"taskId","properties","add","remove"}) 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)
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)@Auditable(parameters={"taskId","transitionId"}) WorkflowTask endTask(String taskId, String transitionId)
taskId
- the task id to endtransitionId
- the task transition id to take on completion (or null, for the default transition)@Auditable(parameters={"task","username"}) boolean isTaskEditable(WorkflowTask task, String username)
task
- The task to checkusername
- The user to check@Auditable(parameters={"task","username","refreshTask"}) boolean isTaskEditable(WorkflowTask task, String username, boolean refreshTask)
task
- The task to checkusername
- The user to checkrefreshTask
- Whether or not to refresh the WorkflowTask
before check is perfromed@Auditable(parameters={"task","username"}) boolean isTaskReassignable(WorkflowTask task, String username)
task
- The task to checkusername
- The user to check@Auditable(parameters={"task","username","refreshTask"}) boolean isTaskReassignable(WorkflowTask task, String username, boolean refreshTask)
task
- The task to checkusername
- The user to checkrefreshTask
- Whether or not to refresh the WorkflowTask
before check is perfromed@Auditable(parameters={"task","username"}) boolean isTaskClaimable(WorkflowTask task, String username)
task
- The task to checkusername
- The user to check@Auditable(parameters={"task","username","refreshTask"}) boolean isTaskClaimable(WorkflowTask task, String username, boolean refreshTask)
task
- The task to checkusername
- The user to checkrefreshTask
- Whether or not to refresh the WorkflowTask
before check is perfromed@Auditable(parameters={"task","username"}) boolean isTaskReleasable(WorkflowTask task, String username)
task
- The task to checkusername
- The user to check@Auditable(parameters={"task","username","refreshTask"}) boolean isTaskReleasable(WorkflowTask task, String username, boolean refreshTask)
task
- The task to checkusername
- The user to checkrefreshTask
- Whether or not to refresh the WorkflowTask
before check is perfromed@Auditable(parameters="container") org.alfresco.service.cmr.repository.NodeRef createPackage(org.alfresco.service.cmr.repository.NodeRef container)
container
- (optional) a pre-created container (e.g. folder, versioned folder or layered folder)@Auditable(parameters={"packageItem","active"}) List<WorkflowInstance> getWorkflowsForContent(org.alfresco.service.cmr.repository.NodeRef packageItem, boolean active)
packageItem
- the repository content item to get workflows foractive
- true => active workflows only, false => completed workflows only@Auditable(parameters={"packageItem","active"}) List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents(String taskId)
taskId
- - the task id@Auditable(parameters="packageRef") List<org.alfresco.service.cmr.repository.NodeRef> getPackageContents(org.alfresco.service.cmr.repository.NodeRef packageRef)
packageRef
- the nodeRef to the package@Auditable boolean isMultiTenantWorkflowDeploymentEnabled()
Copyright © 2005–2017 Alfresco Software. All rights reserved.