SWAMP Index Design
SWAMP
* Home
* Documentation
* License
* Demo Server
* Wiki
* Screenshots
* F A Q
* Downloads
* Contact
* Credits

SWAMP is supported by:
SourceForge.net Logo
and
Novell

How workflow tasks Work

What is a workflow task?

A workflow task consists of an action that has to be done within a workflow, and a result of this action. If it is an interactive or user task, it also has a user who is more or less responsible. It has a start and an end date, and a status.

What classes are involved in a task?

  • the action, a subclass of de.suse.swamp.core.workflow.Action

  • the result, a subclass of de.suse.swamp.core.workflow.Result (Actions and Results are paired)

  • de.suse.swamp.core.tasks.WorkflowTask itself, which holds references to the action, the task, the user, the workflow...

What is the life cycle of a workflow task?

  • When a node is entered, it loops over its actions and asks each one for a task (Action.getTask()). The Action class knows how to put together a workflow task for itself. The node then hands over the tasks to the TaskManager (TaskManager.addTask()). At this point, the task already has an empty result object.

  • The TaskManager stores the task into whatever storage is there, updates its own internal data structures and logs that a task has arrived. If it is a non-interactive or system task, it calls the subsystem that is responsible for handling these. If it is an interactive or user task, it waits for a frontend to come and ask for it.

  • A frontend (webapp, shell) calls one of the getTasks() methods of the taskmanager and gets back a list of tasks to display.

  • The user selects one of these tasks to work on. The frontend gets the information it has to present to the user from the Action object, and puts the data the user creates by completing the task into the Result object.

  • The frontend needs to know how to present and receive the data for each kind of Action/Result pair that exists in the system (i.e. Manualtask, Decision, DataEdit...).

  • The frontend can call the validate(result) method from the Action class to check if the task is indeed completed. If this test is successful, it calls TaskManager.finishTask(taskid) for the task.

  • The TaskManager asks the Task object (that has now a non-empty result object with validated data) for the events that should be sent, and hands these over to the EventManager (note: the frontend does not send any events any more!). It then logs whatever needs to be logged, marks the task as finished in storage and removes it from the list of active tasks.


Valid CSS! Valid XHTML 1.0!