Core

Core


The core supports the following basic workflow functions:

  • Creating processes
  • Defining the current state
  • Receiving commands accessible to the user
  • Executing commands
  • Forcing set state
  • Impersonation
  • Schema versioning
  • Localization

A document scheme is presented as an XML that can be modified manually or via a designer.

The engine uses two-stage scheme processing: a basic schema and a schema of process.

The schema is used as a basic processing method. The schema are stored in the WorkflowScheme table.

The schema of process is generated based on the workflow group scheme processes with the help of IWorkflowGenerator. The group of processes can be differentiated by the scheme code and the set of parameters for generation. The schema of processes are stored in the WorkflowProcessScheme table.

For impersonation (i.e. to execute commands on behalf of another person), use an additional parameter: impersonatedIdentityId.

The route is specified by a set of Activities and Transitions. In Activity, indicate the document status, a set of methods that must be executed when a document reaches a specific Activity. In Transition, indicate possible transitions between Activities, transition limitations, and events that cause a transition.

The rules for changing Activities:

  1. To execute a route, begin with an Activity marked as “Initial”. The system changes the status of the process to this Activity.
  2. To set the status in Activity, the system consistently calls all Actions from “Implementation” block (“Pre-ExecutionImplementation” in Pre-Execution mode).
  3. Each outgoing Transition requires a check for an automatic change. For this, the system uses the “Conditions” block to look for Transitions with an “Auto” type. If such a transition is possible, the system automatically moves the document into a linked Activity. If a transition is not possible, the document remains in the same Activity.
  4. If an Activity is marked as “Final” or an Activity has no outgoing Transitions, then the process changes its status to “Finalized.” Otherwise the process becomes “Idle.”
  5. At each stage, the available commands are defined on the basis of the current Activity and conditions for Restrictions in linked Transitions.
  6. When executing a command (or by using a trigger), the system checks the possibility for a specified user to make a transition based on the data from “Conditions” block. If a transition is possible, the document moves into the next Activity.
  7. In the event of process errors, the document changes its status to “Terminated”.
  8. You can change the “Finalized” or “Terminated” processes by calling the SetState method.