Skip to content

Rules

Definition

Processes in Atfinity are guided by rules. A rule tells the application what actions it should take, when a specific condition is met.

Each rule can trigger multiple actions, from ensuring defined instances are present in a case to issuing a warning, from sending out an email to performing a background check.

These are the actions a rule can trigger:

Action Description
Create Issue Raise an issue to alert a user to something that requires attention. Issues are marked with a red icon. The process cannot function properly until issues are fixed.
Create Warning Display a warning. Warnings are marked with a grey icon, because they're less severe than issues. Ignoring warnings will not stop the system from working.
Create Comment Add a comment to a case, which has no other implication than informing a user of something.
Ensure Instances Atfinity will check that the instances you specify in this action are actually present in the case. If they are not, Atfinity will create them.
Require Roles Selected roles will be required and available in a case for users to assign them to instances.
Assign Values Have Atfinity assign a designated value to a specified information field.
Require Information Give a reference to an information of an instance that is then required, regardless of anything else, e.g. p.first_name to require the first_name for a match of p is Person
[API] Send Email An email will be sent, according to a template and/or input values you specify in this action.
[API] World-Check This action triggers communication with the external World-Check database, to search for any hits a person might have there.
[API] Send IDnow Signing Link Create an IDnow link, and have it emailed to a specified address.

The same actions can be attached to a Button Layout Element, which runs them when a user clicks it instead of when a condition becomes true.

Run only once

(new in Atfinity 17)

Normally a rule keeps applying for as long as its condition is true, and what it did is taken back again once the condition turns false. Some rules are not meant to work that way. Setting up a case with starting values, or telling another system that a case has begun, should happen once and then stay done.

Turning on Run only once changes a rule to exactly that: for each match, it runs on the first evaluation where its condition is true and never runs again for that match. What it set stays behind as if a user had entered it, so the rule no longer owns it and it can be changed afterwards, by a user or by another rule.

A rule with no condition runs once when the case is created, which is the simplest way to give a new case its starting values.

Each match is counted separately, so a rule for p is Person runs once for every person, including people added to the case later.

The option is not available for rules whose actions only require information or roles. Such a requirement holds only while the rule applies, so running once would drop it again. In a rule that mixes those actions with others, the other actions run once while requiring information or roles continues on every evaluation.

To find out whether a case is currently in its very first evaluation, use CASE.is_first_rule_engine_run.

Examples

Ensure Instances

When a contractual relationship in a case has a joint account, there must be at least two account holders. A rule could recognise this situation with a condition like this:

cr is ContractualRelationship
cr.type_of_account = joint

The rule could then trigger the action Ensure Instances to automatically ensure two account holders for this case.

ensure 2 Person, AccountHolder

Had the case been about a contractual relationship with an individual account, the condition would have been false and no actions would have been triggered.

Assign Values

Sometimes it is faster to have some information take default values. If someone's nationality is Swiss, chances are that this person also lives in Switzerland. Therefore, whenever the condition...

p is Person
p.nationality = che

... is true, the information 'Domicile' can be assigned the value Switzerland (che). The assignment would look like this:

p.domicile := che
p.phone_country_code := che

It is possible to assign multiple values in an assignment action. In the example above, the phone country code was also set to be the country code for Switzerland.