The requirement from the customer was to ensure that every person completing their onboarding process was to complete one document in the ‘Work Permit’ portlet. This is relatively straight forward as you could us the cardinality functions to ensure they have at least one document.
An example of this rule would look like this.
The cardinality function is adding up how many values are in the ‘work permit’ portlet and raising a message if one is not entered. You can then add in other statements to the ‘If’ statement for a particular legal entity. Or if you only wanted this to trigger in onboarding, you could add in the following statement.
This solution can work on any portlet.
However, if you want to build logic based on specific values then you could do this by adding a ‘Variable’ to the rule. The variable allows you to specify a ‘where’ statement.
In our rule we have created a variable var_passport and var_residence, these allows us to refer to them in the ‘if’ condition.
So, in our first ‘if’ condition we have if the variable ‘var_passport’ is equal to null, i.e. is the value GBR-Passport is not added, and if variable var_residence (UK Resident card) is added, we can raise a message asking the using to add in a passport.
You can create any number of variables in the rule to use in the ‘if’ statements, in the example below we are saying if you employed in UK then you will need to add in a Passport.
During hiring you may have oninit rules pre-populating fields in national id portlet. During internal hire these rules will trigger again and overwrite the data. The rule below will use the cardinality function to prevent this.
Finally, another example of this the rule below were we add in a Variable for personal email address, and trigger an error message if a personal email address is not provided for certain users as defined on a generic object.
In summary the use of variables and cardinality give you flexibility to ensure hires in onboarding and employee central submit the correct information.