Flow Configuration

Concepts

Status Machine Server uses the following concepts.

  • Flow: A flow is frame for one or many status. It serves as a namespace to allow status with the same name to exist in the system.
  • Status: A status is a named state that can take one value out of a set of possible values. It belongs to a flow.
  • Value: A value is one of the possible values of a status.
  • Role: A role is used to select available transitions for a user.
  • Transition: A transition is the possibility to change a status from a value to another value. This can be a different value, it can also be the same value which allows the status to be left unchanged. A transitions is specific for a role.
  • Transition Rule: A transition rule is a set of static or dynamic additions and removals applied to the set of possible values given by a transition. There can be many transition rules for a value, they are applied in a configurable order. A transition rule is not specific for roles.
  • Derived Status: A derived status has its value calculated based on the current value of another status.

Database Tables

Almost all configuration of flows is done in database tables. The important columns of tables are described below.

Table flow

  • id: The name identifying the flow.

Table flow_status

  • name: The name of the status, must be unique for all status belonging to the same flow.
  • flow_id: References the flow the status belongs to.
  • default_value_id: References the value that is the default value of the status. Optional
  • parent_id: References the parent status for a derived status.
  • is_primary: ???
  • simple_list: If this is true, no transitions have to be configured for this status. All of its values can mutually reach each other. Transitions rules can change this.

Table status_value

  • status_id: References the status the value belongs to.
  • value: The name of the value.
  • position: Position of this value among all other values belonging to the same status.
  • final: If this is true, the value is a final value of the status. There should be no transition away from this value.

Table role

  • id: The name identifying the role.

Table status_transition

  • old_status_id: References the value from which the transition is allowed.
  • new_status_id: References the value to which the transition is allowed.
  • role_id: The role for which the transition is allowed.

Table status_transition_rule

  • implementation: The Java class implementing this rule. Existing implementations are de.ecm4u.sbcs.sm.core.rule.StaticRule and de.ecm4u.sbcs.sm.core.rule.NashornRule. (see Status Transition Static Rules and Status Transition Rule Scripts)
  • method: Specifies where to look for the body of the rule implementation. Can be inline or url.
  • value: The implementation of the rule or a file URL to it.
  • status_value_id: References the value for which the rule is applied after the transitions have been read from the status_transition table.
  • position: Position of this rule among all other rules belonging to the same value.
  • terminate: true, if no other rule shall be executed after this rule.

Table derived_status_value

  • parent_value_id: References a value in the status that is the parent of a derived status.
  • status_value_id: References a value in the derived status.

Table label

  • id: A raw name, can be a flow, status, or value name.
  • locale: The locale for which the name has the translation given in text.
  • text: The translation to locale for the name.