Skip to content
This repository was archived by the owner on Mar 31, 2019. It is now read-only.

State Machine

Andrew Branson edited this page Mar 21, 2016 · 20 revisions

WARNING: This page has been copied raw from the CRISTAL 2.x wiki for the purposes of preservation, so may be out-of-date, links may be broken, and the formatting is probably rubbish.

In CRISTAL 3.x, the hard-coded State Machine of CRISTAL 2.x was replaced with a described one, defined in StateMachine Items.

  • Each State and Transition are identified by integer ID, and have non-unique names.
  • Each State indicates whether it is a terminal state that triggers the Workflow to proceed.
  • Each Transition can:
  • Name a boolean activity property that can enable or disable it.
  • Name a role that may override the Activity assigned Role for that Transition
  • Indicate how it may change the Agent reservation: Set, clear or preserve
  • Specify a Script that must be run during the Transition.
  • Specify that an Outcome may be supplied, referencing its XMLSchema.
  • Indicate that the Outcome is required.

Values for these properties can be explicit, or reference Activity properties like this: ${SchemaType}. The referenced properties may also invoke data helpers to reference other Item data.

h3. Bundled State Machine Definitions

Three state machines are bundled with the kernel:

  • Default - a simplified version of the CRISTAL 2.x state machine, including only the Waiting, Started, Suspended and Finished states, and the Start, Done, Complete, Suspend and Resume transitions. DefaultStateMachine

  • PredefinedStep - a dummy state machine for PredefinedSteps. Features just one state, Available, and one transition, Done, which loops on it, allowing an Outcome of PredefinedStepOutcome v0.

  • CompositeActivity - a state machine for CompositeActivity. Can be Waiting, Started or Finished, and only Start then Complete. No outcome.

Each Activity sub-class specifies which state machine it uses by default with the getDefaultSMName method. They may all be overridden with the StateMachineName and StateMachineVersion Activity properties.

Clone this wiki locally