Stardust/Knowledge Base/Modeling/Pattern/Maker Checker

From Eclipsepedia

Jump to: navigation, search


The Maker-Checker principle states that important decisions are not to be made by a single person but by two people. The aim therefore is to reduce the risk of errors or misuse. In a Stardust model, this principle in general is implemented as follows: suppose there are two sequenced manual activities, A1 and A2. Further, suppose the user userX completes the first activity A1. Thus, according to the Maker-Checker principle, userX is not allowed to complete the second activity A2.

Note: The process model discussed below is available for download from here.

Excluding a previous Activity Performer

To illustrate the Maker-Checker pattern, the following model is implemented:

Stardust Modelling Patterns Maker Checker Model.jpg

In the first manual activity of the process Input Data, the user in the role Clerk (e.g., userX) is required to input some customer data (here: first name and last name) stored in the Structured Data Customer. Within the same activity the OID of the user that completed the activity is stored in the Primitive Data of Type java.lang.Long. The corresponding OUT Data Mapping is defined on the engine level:

Stardust Modelling Patterns Maker Checker Outdata.jpg

The corresponding access point is defined on Activity Instance method getPerformedByOID():

Stardust Modelling Patterns Maker Checker AccessPoint.jpg

According to the Maker-Checker principle, the next activity Approve Data cannot be completed by the userX. This restriction is modeled as follows:

  1. Open the properties of the activity Approve Data
  2. On the left hand side, select On Assignment
  3. On the right hand side, click Add and right afterwards Add Event
  4. In the dialog window that appears, select Exclude User in Action Type dropdown list
  5. In Data dropdown list, select LastUserOID
  6. Save the settings by clicking OK.

Thus, these settings ensure that the activity Approve Data cannot be assigned to the user with the OID equal to the value of LastUserOID (i.e. the OID of the user that completed Insert Data-activity).

When (after the model is deployed) the user completes the Insert Data activity and tries to execute the Approve Data activity, following message is displayed in Process Portal:

Stardust Modelling Patterns Maker Checker ErrorMessage.jpg

Excluding the Starting User

If you intend to exclude the user who started the process from an activity then you do not have to submit it on process start or explicity save that user's OID before. The process model conatins a default data called 'Starting User' which will automatically contain the strating user's information. To use this data in combination with an exclude user event action you need to select the data and then specify the data path 'getOID()'. This data path will return the engine's technical user identifier for that particular user as a long - the way it is expected by the event action.

Linking an Exclude User Event Action to the Starting User default Process Data

Attention, the 'Starting User' data holds the information for the current process instance. If this process instance is a sub process then the user may differ from the 'Starting User' of the super process insatnce or of the complete process hierarchy.