How to write Rules

Introduction

Rules guide the processes of atfinity. They consist of:
  • a condition, describing one or several circumstances
  • one or more actions, telling atfinity what should be done if the rule's condition evaluates to true
To create a new rule, in the configuration overview screen of Rules simply click 'Add Rule'.
In the screen that pops up, give the new rule a key. It's most effective to choose a key that describes what the point of the rule is.
After you've named the rule, it will show up at the top of the overview screen Rules. Click on it to add a condition and one or more actions to it.

Writing a Condition

Conditions are made up of declarations and expressions. They are written in RuLa.
In a declaration, you introduce a variable to the rule. Only then can you use the variable elsewhere in the rule.
In an expression, you bring an ontology and a piece of information together. By adding an operator and a value, you describe a circumstance. atfinity will check if this circumstance exists in the case. If so, the condition evaluates to true and the action(s) attached to it will be executed.
Example of a condition for a rule:
1
p is Person
2
p.nationalities = uk
3
and
4
p.domicile = eu
Copied!
Line 1 is the declaration, introducing variable p to the rule.
Line 2 attaches the information nationality to the ontology Person, then describes this p 's nationality should be 'United Kingdom' for the condition to be partially true. Partially, because the operator and indicates the expression on line 4 also has to be true for the whole condition to evaluate to true.
This condition triggers actions only when a client in a case is British, and lives in an EU member state.
Add one or more actions, so atfinity knows what you want it to do when the condition evaluates to true.

Writing Actions: Issues, Warnings, Comments, Instances, and Values

You can add as many actions as you need to a single rule. They will all be executed if the condition at the top of the rule evaluates to true.
To add an action to a rule, click on the 'Add new action' button, right below the field that holds the name and condition for your rule. From the drop-down menu, choose which action you want to add.
For each type of action, the next steps are described below.

Create Issue

Add this action, if there is a condition under which you want to alert the user of the Case Manager to an issue that has to be taken care of, before the case can proceed.
In the example below, the issue is raised when we're dealing with a joint account, but fewer than two account holders. The issue will disappear once the number of account holders is at least two, as in that case, the Rule's condition is no longer true.

Create Warning

Add this action, if you want to warn the user of the case manager about something. The case can proceed, whether the user acts on the warning or not.
In the example below, a warning is issued when dealing with a UK citizen who lives in the EU. The warning states the new residence permit requirement does not take effect until 31-Dec-2021, so a warning about this requirement could be enough here. After 31-Dec-2021, this action could be converted to one that creates an issue, meaning it has to be acted upon for the case to proceed.

Create Comment

Add this action, if you want to add a comment to a case in the circumstance(s) described in the Rule's condition. Comments, once they appear in a case, can evolve to complete conversations about the case between users involved with it, directly within the case. Comments can also be assigned to a user, making them a replacement for tasks.
In the example below, a user will get an extra nudge in the form of a comment, to talk to the client about the background check that will be performed.
This is how the comment will appear in the Case Manager:
The user of the case manager can click 'Resolve' to dismiss the comment, 'Reply' if the comment comes from another user, or 'Assign' to make it the task of a specific user to handle what is said in the comment.

Ensure Instances

With this action, atfinity checks whether the instances you specify are present in the case. If they are not, the platform will create them - again: only when the rule's condition is true.
In the following example, the action will be triggered when we're dealing with a contract that involves a joint account. The action causes atfinity to check if there are already two instances 'Person' with the role 'AccountHolder' present in the case.
If there is only one, atfinity will create another one. If there are none, atfinity will create two.

Assign Values

Use this action to provide a value for an information field. This is convenient if an information field logically speaking has a fixed value under fixed circumstances - for example, making the US Dollar the reference currency for every case where the account holder lives in the US.
In the example below, this action is used to set the number of beneficial owners of an account to zero by default, if the case is dealing with either a joint or an individual account.

Writing Actions: API Send Email, World Check, and IDnow

The API Actions listed below enable you to send data from atfinity to external servers, and receive the reply within atfinity.
Currently, you can define actions that will automatically send out emails, perform background checks, verify identifications, and enable digital signatures, as always only as long as the condition you attach to the action(s) evaluates as true.

[API] Send Email

This action sends out an email, using the configured SMTP service. The content of the message is determined either by providing the subject line and text body in the action, or by a template. When using a template, also indicate the language in which it should be sent. Read here how to create such an email template.
The field 'About' at the top of this action indicates which values are required as input assignments for the action to work, and in what format you should provide them.
The output assignment is an API_RESULT object, which will contain a boolean (true/false), indicating if the mail has been sent successfully.
All values have to refer specifically to the instance featured in the rule's condition.
Below is an example of a rule condition, which evaluates to true when we're dealing with a client with UK nationality, who lives in the EU.
Let's say we decide to always inform UK clients living in the EU about changes we need to make to their contracts, due to some external developments. One way to do that, is through this API action:
Alternatively, when using an email template, the action would look as follows:

[API] World-Check

Triggering the World-Check action will send data on a person from atfinity to the World-Check database. The response helps to identify people with a heightened risk, by telling you whether the person has hits in the World-Check database, how many hits were found, and when the check was performed.
As input assignments for this action, provide up to six data points on an individual. All input assignments are listed in the 'About' field of this action.
All values have to refer specifically to the instance featured in the rule's condition.
The response from the World-Check is an API_RESULT object.
Here's what a World-Check action could look like:
This action creates a new IDnow link, and sends it via email to the specified address. To make this work, define which values should be sent to the IDnow server under 'Input Assignments'. The 'About' field of this action shows you which values you can use, and which of those are required.
For the input assignments dealing with the email part of this action, provide either the subject line and body as text, or point to an email template. When using a template, also indicate which language it should be sent in.
Read here how to create email templates.
All values have to refer specifically to the instance featured in the rule's condition.
As output assignments, the API_RESULT object will contain crucial data on the ID of the instance in the case.
Below is an example of how this action could be configured, when the rule's condition features p is Person.
Last modified 7mo ago