Cache value – how to filter out record(s)
Often within Novulo processes you need to refer to record(s) several times: in decisions, updating steps, calling subprocesses, etc. From the performance perspective it is better to find record(s) once and refer to it/them as a variable. Here the Cache value step from the Process variables plugin comes in hand.
To start
Add the Process variables plugin via the Plugin manager.
Cache one record
To cache one record – for example, a customer – you need use the cache record step with the “First” method.
Drag the cache value step to your process (1), go to the plugin configuration tab and set the datatype (2). A customer record has the N_Person datatype, so I chose it (don’t confuse with the list of persons):
Click OK and go to the Parameters tab.
Build the expression using the “First” method: in my example I filter the first record from the persons list where the customer’s name equals to the name from the process input parameters (trigger):
Then I can refer to the value from the cached value step. In my example I check if the value is not null:
Cache multiple records
To cache several records you need use the cache record step with the filter expression or with the “In” method.
Go to the plugin configuration tab and set the datatype. This time I choose the list of persons.
In the Parameters tab I filter the persons list by the first name equals to the first name passed as the input parameter:
You can also use the “In“ method to filter out records. For example, in this expression I get the list of books from the copies list linked to the customer:
{Books, this , this.in({CopiesOverview, book , Boolean:and([customer.equals(parent.parent.trigger.record.customer), Boolean:not(book.isnull())])})}
Notice:
- in IN-expression you must check whether the returned field is not null. The Architect shows the error if the check is missing.
- Use IN-method carefully: IN-expressions are slow when one need to scan more than one table.
Read more about frequently used expressions.
Then I can refer to the value from the cached value step. For the list I check if the count of records in the cached list is greater than 0.
Cache basic types
Notice that you can also cache basic types: string(s), integer(s), etc. In the example below, I need to cache name of a customer, so I set the datatype = string. Then filter the first record from the persons list, but as a result I will get not the record (object), but the first name (string).
Similar I can collect a list of names.
Read also: How does Process Variables plugin work?





