Class WorkflowManager
- java.lang.Object
-
- org.alfresco.repo.processor.BaseProcessorExtension
-
- org.alfresco.repo.jscript.BaseScopableProcessorExtension
-
- org.alfresco.repo.workflow.jscript.WorkflowManager
-
- All Implemented Interfaces:
org.alfresco.processor.ProcessorExtension,Scopeable
public class WorkflowManager extends BaseScopableProcessorExtension
The Workflow Manager serves as the main entry point for scripts to create and interact with workflows. It is made available in the root scripting scope- Author:
- glenj
-
-
Constructor Summary
Constructors Constructor Description WorkflowManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScriptNodecreatePackage()Create a workflow package (a container of content to route through a workflow)org.mozilla.javascript.ScriptablegetAllDefinitions()Gets all versions of the deployed workflow definitionsorg.mozilla.javascript.ScriptablegetAssignedTasks()Get tasks assigned to the current user.org.mozilla.javascript.ScriptablegetCompletedTasks()Get completed tasks assigned to the current user.JscriptWorkflowDefinitiongetDefinition(java.lang.String id)Get deployed workflow definition by IDJscriptWorkflowDefinitiongetDefinitionByName(java.lang.String name)Get deployed workflow definition by NameJscriptWorkflowInstancegetInstance(java.lang.String workflowInstanceID)Get Workflow Instance by IDorg.mozilla.javascript.ScriptablegetLatestDefinitions()Gets the latest versions of the deployed, workflow definitionsintgetMaxGroupReviewers()org.mozilla.javascript.ScriptablegetPooledTasks(java.lang.String authority)Get pooled tasksJscriptWorkflowTaskgetTask(java.lang.String id)Get task by idJscriptWorkflowTaskgetTaskById(java.lang.String id)Get task by id.voidsetMaxGroupReviewers(int maxGroupReviewers)voidsetServiceRegistry(ServiceRegistry services)Sets the Service Registry property-
Methods inherited from class org.alfresco.repo.jscript.BaseScopableProcessorExtension
getScope, setScope
-
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension
getExtensionName, register, setExtensionName, setProcessor
-
-
-
-
Method Detail
-
setServiceRegistry
public void setServiceRegistry(ServiceRegistry services)
Sets the Service Registry property- Parameters:
services- the service registry
-
setMaxGroupReviewers
public void setMaxGroupReviewers(int maxGroupReviewers)
-
getMaxGroupReviewers
public int getMaxGroupReviewers()
-
getDefinition
public JscriptWorkflowDefinition getDefinition(java.lang.String id)
Get deployed workflow definition by ID- Parameters:
id- the workflow definition ID- Returns:
- the workflow definition matching the given ID
-
getDefinitionByName
public JscriptWorkflowDefinition getDefinitionByName(java.lang.String name)
Get deployed workflow definition by Name- Parameters:
name- the workflow definition name- Returns:
- the workflow definition matching the given name
-
getAssignedTasks
public org.mozilla.javascript.Scriptable getAssignedTasks()
Get tasks assigned to the current user. Note that this will only return in-progress tasks.- Returns:
- the list of assigned (in-progress) tasks
-
getCompletedTasks
public org.mozilla.javascript.Scriptable getCompletedTasks()
Get completed tasks assigned to the current user.- Returns:
- the list of completed tasks
-
getInstance
public JscriptWorkflowInstance getInstance(java.lang.String workflowInstanceID)
Get Workflow Instance by ID- Parameters:
workflowInstanceID- ID of the workflow instance to retrieve- Returns:
- the workflow instance for the given ID
-
getPooledTasks
public org.mozilla.javascript.Scriptable getPooledTasks(java.lang.String authority)
Get pooled tasks- Parameters:
authority- the authority- Returns:
- the list of assigned tasks
-
getTask
public JscriptWorkflowTask getTask(java.lang.String id)
Get task by id- Parameters:
id- task id- Returns:
- the task (null if not found)
-
getTaskById
public JscriptWorkflowTask getTaskById(java.lang.String id)
Get task by id. Alternative method signature togetTask(String id)for those used to the Template API- Parameters:
id- task id- Returns:
- the task (null if not found)
-
getLatestDefinitions
public org.mozilla.javascript.Scriptable getLatestDefinitions()
Gets the latest versions of the deployed, workflow definitions- Returns:
- the latest versions of the deployed workflow definitions
-
getAllDefinitions
public org.mozilla.javascript.Scriptable getAllDefinitions()
Gets all versions of the deployed workflow definitions- Returns:
- all versions of the deployed workflow definitions
-
createPackage
public ScriptNode createPackage()
Create a workflow package (a container of content to route through a workflow)- Returns:
- the created workflow package
-
-