apache > lenya
 

Workflow Terms

Terms

Workflow Schema
A workflow schema defines a state machine (deterministic finite automaton - DFA), consisting of
  • states, including a marked initial state,
  • transitions, and
  • state variables.
Workflow Instance
A workflow instance is an incarnation of a workflow schema. It consists of
  • a current state,
  • a mapping which assigns values to all state variables.
Transition
A transition describes the switching of a workflow instance from one state to another. A transition has
  • a source state,
  • a destination state,
  • an event,
  • a set of conditions,
  • a set of assignments.
Additionally, a transition can be marked as synchronized.
History
The history of a workflow instance contains a list of all versions of the instance. A version contains
  • the state,
  • the event that caused the transition (omitted in the first version),
  • a description of the identity that invoked the event (username and IP address)
State Variable
A workflow schema can contain a set of state variables. For each instance, the state variables hold certain values. Values can be assigned during transitions, so a variable can change its value when a transition fires. Currently, Lenya supports only boolean state variables.
Condition
A condition can prevent a transition from firing, based on the current situation. Examples:
  • Does the current user have a certain role on the current URL? (RoleCondition, included in Lenya)
  • Does a certain state variable have a certain value (e.g., is the document published)? (BooleanVariableCondition, included in Lenya)
  • Is the sun shining? (e.g., if the weather report may only be published on sunny days)
Situation
A situation defines the state of the environment of a workflow instance. Examples are:
  • the current user ID
  • the roles of the current user on the current URL
Synchronization

A set of workflow instances with the same workflow schema can be synchronized. If a transition in this schema is marked as synchronized, it can only be invoked on all instances in the set at the same time.

When a workflow event is invoked on a set of synchronized workflow instances, the transition is invoked only if

  • all instances are in the source state of the transition, and
  • all conditions of the transition are complied for all instances.

Then the transition is invoked for all instances in the set.

A common usecase of this concept is the simultaneous publishing of a set of documents (all language versions of a document, a section, ...).