Customizing Names of Cases and Instances

When a new case is started in Atfinity it will be automatically given a generic name, e.g. 'Contractual Relationship 729'. The same happens when a new instance is created. To customize the name that is given so it contains more specific information from the case or instance a formula can be used. The formula is an expression in Atfinity's Rule Language (RuLa) that uses known values of information from a case or instance and builds a name from it. So an instance of a person would be called 'Simon Fisher' instead of 'Person 289'.

Writing Name Formulas for Cases

Defining a name formula in a process means that all cases which are started with this process will be named according to that formula. The formula can both access information of the outcome instance of a case directly with the reference OUTCOME_INSTANCE as well as information of other instances linked to the outcome instance, latter which is described in the second example below.

In the first example the name of a case should just be the contract number. This is information of the outcome instance, which is why OUTCOME_INSTANCE needs to be used as well as the information key contract_number:

JOIN(
    [
    "Contract Nr: ",
    OUTCOME_INSTANCE.contract_number,
    ]," - "
)

This will return a String like 'Contract Nr: 11896'.

Naturally, combinations of RuLa functions can and sometimes need to be used in the name formula to create more complex names.

To access case information from instances other than the outcome instance the get_properties_from_instances function needs to be used. For example, if the case name should include all the names of all the account holders on a contract the following expression is used.

JOIN(
    get_properties_from_instances(
        instances(
            AccountHolder
        ), 
        full_name
    ),
    " ; "
)

This expression does three things:

  • instances(AccountHolder) returns a list of all the instances in a case that take the role of an account holder,

  • get_properties_from_instances then gets all the full names of all these instances

  • and JOIN returns one string combining all the names separated with a semicolon.

Writing Name Formulas for Instances

Instances of ontologies can also be given a customized name by defining a name formula. Here, only information of the respective instance can be used. Therefore the reference self is used, which makes the instance point to itself.

It makes sense that an instance of a person has the name of the person. Therefore, an information like full_name can be used in an expression as follows:

self.full_name

Of course, it is possible to use other RuLa functions in the name formula to connect multiple pieces of information into one string and format it as required:

JOIN(
    [self.account_name, self.client_number], 
    ", "
)

This function returns a string of the account name and the client number separated by a comma.

Last updated