During the execution of a Workflow, such as during the signature, there is a rich context available, in the form of variable classes and local on-line variables. This context depends on the Workflow type and the process that is underway (Original Workflow, signature, Workflow following on from the first Workflow) This annex describes the algorithm used by the Workflow engine and details the variables used at this stage.
It should be noted that the formula assistant supplies a list of variables coming from the context to construct the formulas in the best way possible.
A Workflow of the type object breaks down in a series of steps as follows :
This stage consists of assigning the global variables. In particular the variable USRWRK is available, which corresponds to the current user for the original workflow.
In this stage, the formulas given in the rule are evaluated and they are stored in a dimensioned variable named VALEXP. This is used notably to have available aggregated values that are not strictly used as a criterion for the definition of the recipients, but simply used late in the Workflow (for example to decide the sending of a message as a function of the minimum, maximum and average values for an element).
The number of values calculated is identified by the variable NBCOL.
Then a search is carried out from the calculated values, the line of the rule that corresponds, to assign the grid of USER variables (indexed from 1 to 10 maximum).
This stage breaks down into several sub-stages. Firstly, determine a certain number of values :
Then, verify the execution conditions in the Workflow header. If these conditions are achieved, the following operations are then carried out :
This stage is carried out on the following operations :
This stage carries out the update of the line for the receipt to be carried out in the table AWRKHISSUI. The corresponding transaction is separated from the previous ones (but it is only executed if the previous ones have been processed correctly).
A workflow of the signature type is triggered following a signature action (either manually from the workbench, or automatically via another Workflow event or a notification via a click on the link).
The corresponding stages are as follows :
The inherited variables for the context of the signature are assigned in this phase. This includes the following variables
NUMORG | chrono number for the original. |
USRORG | recipient for the original event. |
NUMSIG | chrono in which a signature process has been triggered. |
USRDES | recipient of the chrono in which a signature process has been triggered. |
USRWRK | user that signs it. |
MAIWRK | email address for the signatory, when the signature is made by an external http link. |
LEVSIG | Level of the signature (the original event carries the number 0, the events that carry on from this carries the successive numbers from 1). |
RETORG | Key for the object on which the original Workflow has been triggered. |
CONTXT | Reference the return icon. |
CLEOBJ | Signed chrono number. |
CTX(1..15) | Variables for the context. |
S_USER | Recipient having triggered the original Workflow. |
S_CLEOBJ | Key for the triggering (object or regrouping). |
S_ABREV | Abbreviation of the object for the original Workflow. |
S_NBRUSR | Number of users defined in the original Workflow rule. |
he signature phase for an event is made by the following process :
Then, the signature transaction in the proper sense is carried out :
When a user signs a receipt, the available variables in the context are as follows :
CHRONO | chrono for the event in which a signature has been carried out. |
USRDES | user code for the recipient. |
USRSIG | User code for signatory. |
USRMAIL | email address for the signatory, when the signature is made by an external http link. |
NUMORG | Chrono for the original event in which the first signature is carried out. |
USRORG | Recipient for this event. |
LEVSIG | Level of the signature (the original event carries the number 0, the events that carry on from this carries the successive numbers from 1). |
USRTOP | Principal recipient (the others are delegates). |
NUMGRP | Group of the event to be signed. |
CTX(1..15) | Variables for the context. |
S_USER | Recipient having triggered the original Workflow. |
S_CLEOBJ | Key for the triggering (object or regrouping). |
S_ABREV | Abbreviation of the object for the original Workflow. |
S_NBRUSR | Number of users defined in the original Workflow rule. |
The variables grid REPCHR is used to identify if other recipients for the same event have already signed. The number of groups is counted (a group is equal to a line in the signatory grid, once a delegate has signed, the event is signed and cannot be signed a second tome by another member of the group).
The situation is then :
REPCHR(0) = number of responses that remain to be carried out : if for example if there are 4 lines of signatories in the event description and that only one has signed, this value is equal to 3.
REPCHR(NO), where NO can be a value between 1 and 10, gives the number of signatories that have responded with the response placed in the line number NO in the responses grid.
These variables are then notably used to condition the follow on stages by the fact that the last signature is waiting a response or to work on the majority logic for the signature.