Daisy Open Source CMS

org.outerj.daisy.workflow
Interface WorkflowManager


public interface WorkflowManager

The main interface for accessing Daisy's workflow functionality.

This is an optional repository extension component.

All workflow operations are performed through this interface. The returned objects are pure value objects (data snapshots), with no active behaviour.

The WorkflowManager is obtained from the Repository as follows:

 WorkflowManager wfManager = (WorkflowManager)repository.getExtension("WorkflowManager");
 

In the remote repository API, the WorkflowManager extension can be registered as follows:

 RemoteRepositoryManager repositoryManager = ...;
 repositoryManager.registerExtension("WorkflowManager",
     new Packages.org.outerj.daisy.workflow.clientimpl.RemoteWorkflowManagerProvider());
 


Method Summary
 WfTask assignTask(String taskId, WfActorKey actor, boolean overwriteSwimlane, Locale locale)
          Assigns (possibly re-assigns) a task to the given actor (user or pools).
 void deleteProcess(String processInstanceId)
           
 void deleteProcessDefinition(String processDefinitionId)
          Deletes a workflow definition.
 WfProcessDefinition deployProcessDefinition(InputStream is, String mimeType, Locale locale)
          Defines (deploys) a new workflow definition.
 WfTask endTask(String taskId, TaskUpdateData taskUpdateData, String transitionName, Locale locale)
           
 List<WfProcessDefinition> getAllLatestProcessDefinitions(Locale locale)
          Gets a list of the latest versions of all workflow definitions defined in the system.
 List<WfProcessDefinition> getAllProcessDefinitions(Locale locale)
          Gets a list of all workflow definitions (in all versions) defined in the system.
 List<WfVariable> getInitialVariables(String processDefinitionId, WfVersionKey contextDocument)
          Calculates initial values for start-state task variables.
 WfProcessDefinition getLatestProcessDefinition(String workflowName, Locale locale)
           
 List<WfTask> getMyTasks(Locale locale)
          Gets the open tasks for the current user.
 List<WfTask> getPooledTasks(Locale locale)
           
 WfPoolManager getPoolManager()
           
 WfProcessInstance getProcess(String processInstanceId, Locale locale)
           
 WfProcessDefinition getProcessDefinition(String processDefinitionId, Locale locale)
           
 List<WfProcessInstance> getProcesses(QueryConditions queryConditions, List<QueryOrderByItem> orderByItems, int chunkOffset, int chunkLength, Locale locale)
           
 Map<String,Integer> getProcessInstanceCounts()
          Returns the number of process instances of each process definition.
 WfTask getTask(String taskId, Locale locale)
           
 List<WfTask> getTasks(QueryConditions queryConditions, List<QueryOrderByItem> orderByItems, int chunkOffset, int chunkLength, Locale locale)
           
 WfTimer getTimer(String timerId, Locale locale)
           
 List<WfTimer> getTimers(QueryConditions queryConditions, List<QueryOrderByItem> orderByItems, int chunkOffset, int chunkLength, Locale locale)
           
 void loadSampleWorkflows()
          Re-installs the built-in sample workflows.
 WfTask requestPooledTask(String taskId, Locale locale)
           
 WfProcessInstance resumeProcess(String processInstanceId, Locale locale)
           
 org.outerx.daisy.x10Workflow.SearchResultDocument searchProcesses(List<QuerySelectItem> selectItems, QueryConditions queryConditions, List<QueryOrderByItem> orderByItems, int chunkOffset, int chunkLength, Locale locale)
           
 org.outerx.daisy.x10Workflow.SearchResultDocument searchTasks(List<QuerySelectItem> selectItems, QueryConditions queryConditions, List<QueryOrderByItem> orderByItems, int chunkOffset, int chunkLength, Locale locale)
           
 org.outerx.daisy.x10Workflow.SearchResultDocument searchTimers(List<QuerySelectItem> selectItems, QueryConditions queryConditions, List<QueryOrderByItem> orderByItems, int chunkOffset, int chunkLength, Locale locale)
           
 WfExecutionPath signal(String processInstanceId, String executionPathFullName, String transitionName, Locale locale)
           
 WfProcessInstance startProcess(String processDefinitionId, TaskUpdateData startTaskData, String initialTransition, Locale locale)
           
 WfProcessInstance suspendProcess(String processInstanceId, Locale locale)
           
 WfTask unassignTask(String taskId, Locale locale)
          Unassigns a task from its current assignee, putting it back in the pool.
 WfTask updateTask(String taskId, TaskUpdateData taskUpdateData, Locale locale)
           
 

Method Detail

getPoolManager

WfPoolManager getPoolManager()

deployProcessDefinition

WfProcessDefinition deployProcessDefinition(InputStream is,
                                            String mimeType,
                                            Locale locale)
                                            throws RepositoryException
Defines (deploys) a new workflow definition.

It is the responsibility of the caller to close the input stream.

Parameters:
mimeType - Use application/zip for zipped workflow archives, or text/xml for XML-described workflows.
Throws:
RepositoryException

loadSampleWorkflows

void loadSampleWorkflows()
                         throws RepositoryException
Re-installs the built-in sample workflows. Can be useful after upgrading.

Throws:
RepositoryException

deleteProcessDefinition

void deleteProcessDefinition(String processDefinitionId)
                             throws RepositoryException
Deletes a workflow definition.

Warning: this removes all process instances that use this workflow definition.

Throws:
RepositoryException

getProcessDefinition

WfProcessDefinition getProcessDefinition(String processDefinitionId,
                                         Locale locale)
                                         throws RepositoryException
Throws:
ProcessDefinitionNotFoundException - in case the workflow definition does not exist.
RepositoryException

getLatestProcessDefinition

WfProcessDefinition getLatestProcessDefinition(String workflowName,
                                               Locale locale)
                                               throws RepositoryException
Throws:
RepositoryException

getAllLatestProcessDefinitions

List<WfProcessDefinition> getAllLatestProcessDefinitions(Locale locale)
                                                         throws RepositoryException
Gets a list of the latest versions of all workflow definitions defined in the system.

Throws:
RepositoryException

getAllProcessDefinitions

List<WfProcessDefinition> getAllProcessDefinitions(Locale locale)
                                                   throws RepositoryException
Gets a list of all workflow definitions (in all versions) defined in the system.

See getAllLatestProcessDefinitions(Locale) to only get the latest versions.

Throws:
RepositoryException

getProcessInstanceCounts

Map<String,Integer> getProcessInstanceCounts()
                                             throws RepositoryException
Returns the number of process instances of each process definition. The key in the map is the process definition id, the value the instance count.

Throws:
RepositoryException

getInitialVariables

List<WfVariable> getInitialVariables(String processDefinitionId,
                                     WfVersionKey contextDocument)
                                     throws RepositoryException
Calculates initial values for start-state task variables.

Throws:
RepositoryException

startProcess

WfProcessInstance startProcess(String processDefinitionId,
                               TaskUpdateData startTaskData,
                               String initialTransition,
                               Locale locale)
                               throws RepositoryException
Parameters:
startTaskData - parameters for the start task of the workflow
initialTransition - the transition to take from the start node
Throws:
RepositoryException

signal

WfExecutionPath signal(String processInstanceId,
                       String executionPathFullName,
                       String transitionName,
                       Locale locale)
                       throws RepositoryException
Parameters:
executionPathFullName - fullName property of the execution path
transitionName - allowed to be null
Throws:
RepositoryException

getProcess

WfProcessInstance getProcess(String processInstanceId,
                             Locale locale)
                             throws RepositoryException
Throws:
RepositoryException

updateTask

WfTask updateTask(String taskId,
                  TaskUpdateData taskUpdateData,
                  Locale locale)
                  throws RepositoryException
Throws:
RepositoryException

endTask

WfTask endTask(String taskId,
               TaskUpdateData taskUpdateData,
               String transitionName,
               Locale locale)
               throws RepositoryException
Throws:
RepositoryException

getTask

WfTask getTask(String taskId,
               Locale locale)
               throws RepositoryException
Throws:
RepositoryException

getMyTasks

List<WfTask> getMyTasks(Locale locale)
                        throws RepositoryException
Gets the open tasks for the current user.

Throws:
RepositoryException

getPooledTasks

List<WfTask> getPooledTasks(Locale locale)
                            throws RepositoryException
Throws:
RepositoryException

requestPooledTask

WfTask requestPooledTask(String taskId,
                         Locale locale)
                         throws RepositoryException
Throws:
RepositoryException

unassignTask

WfTask unassignTask(String taskId,
                    Locale locale)
                    throws RepositoryException
Unassigns a task from its current assignee, putting it back in the pool. Unassignment is not allowed if there are no pooled actors to fall back too.

Throws:
RepositoryException

assignTask

WfTask assignTask(String taskId,
                  WfActorKey actor,
                  boolean overwriteSwimlane,
                  Locale locale)
                  throws RepositoryException
Assigns (possibly re-assigns) a task to the given actor (user or pools).

Parameters:
overwriteSwimlane - if the task is associated with a swimlane, should the swimlane be reassigned too? Usually yes.
Throws:
RepositoryException

getTasks

List<WfTask> getTasks(QueryConditions queryConditions,
                      List<QueryOrderByItem> orderByItems,
                      int chunkOffset,
                      int chunkLength,
                      Locale locale)
                      throws RepositoryException
Parameters:
chunkOffset - specify -1 to ignore
chunkLength - specify -1 to ignore
Throws:
RepositoryException

searchTasks

org.outerx.daisy.x10Workflow.SearchResultDocument searchTasks(List<QuerySelectItem> selectItems,
                                                              QueryConditions queryConditions,
                                                              List<QueryOrderByItem> orderByItems,
                                                              int chunkOffset,
                                                              int chunkLength,
                                                              Locale locale)
                                                              throws RepositoryException
Throws:
RepositoryException

getProcesses

List<WfProcessInstance> getProcesses(QueryConditions queryConditions,
                                     List<QueryOrderByItem> orderByItems,
                                     int chunkOffset,
                                     int chunkLength,
                                     Locale locale)
                                     throws RepositoryException
Throws:
RepositoryException

searchProcesses

org.outerx.daisy.x10Workflow.SearchResultDocument searchProcesses(List<QuerySelectItem> selectItems,
                                                                  QueryConditions queryConditions,
                                                                  List<QueryOrderByItem> orderByItems,
                                                                  int chunkOffset,
                                                                  int chunkLength,
                                                                  Locale locale)
                                                                  throws RepositoryException
Throws:
RepositoryException

deleteProcess

void deleteProcess(String processInstanceId)
                   throws RepositoryException
Throws:
RepositoryException

suspendProcess

WfProcessInstance suspendProcess(String processInstanceId,
                                 Locale locale)
                                 throws RepositoryException
Throws:
RepositoryException

resumeProcess

WfProcessInstance resumeProcess(String processInstanceId,
                                Locale locale)
                                throws RepositoryException
Throws:
RepositoryException

getTimer

WfTimer getTimer(String timerId,
                 Locale locale)
                 throws RepositoryException
Throws:
RepositoryException

getTimers

List<WfTimer> getTimers(QueryConditions queryConditions,
                        List<QueryOrderByItem> orderByItems,
                        int chunkOffset,
                        int chunkLength,
                        Locale locale)
                        throws RepositoryException
Throws:
RepositoryException

searchTimers

org.outerx.daisy.x10Workflow.SearchResultDocument searchTimers(List<QuerySelectItem> selectItems,
                                                               QueryConditions queryConditions,
                                                               List<QueryOrderByItem> orderByItems,
                                                               int chunkOffset,
                                                               int chunkLength,
                                                               Locale locale)
                                                               throws RepositoryException
Throws:
RepositoryException

Daisy Open Source CMS