Expression functions

Extend your transaction monitoring rules with expression functions.

Expression functions help you extend your rule conditions to make transaction monitoring even more precise. For example, if you want to compare the applicant name with the name specified on the card that was used to make a payment, you can invoke the personNamesFuzzyIncompatible method and pass the arguments based on the expression attributes.

personNamesIncompatible

bool personNamesIncompatible(String applicantName, String fullName)

Checks the similarity of applicantName and fullName. Returns true if there is no similarity or the similarity is low.

ArgumentTypeDescription
applicantNameStringApplicant name.
fullNameStringFull name to compare with.

personNamesFuzzyIncompatible

bool personNamesFuzzyIncompatible(String applicantName, String fullName)

Checks the fuzzy similarity of applicantName and fullName. Returns true if there is no similarity or the similarity is low. E.g. Stüber Schäfler and Schaefler Stueber returns false.

ArgumentTypeDescription
applicantNameStringApplicant name.
fullNameStringFull name to compare with.

intersectsWithDict

bool intersectsWithDict(String str, Set dict)

Returns true if dict contains any token from str.

ArgumentTypeDescription
strStringString to tokenize and check intersection with.
dictSetSet of strings.

inList

bool inList(String listName, String value)

Returns true if value is in the client list with the name listName.

ArgumentTypeDescription
listNameStringClient list name.
valueStringValue to check.

notInList

bool notInList(String listName, String value)

Returns true if value is not in the client list with the name listName.

ArgumentTypeDescription
listNameStringClient list name.
valueStringValue to check.

anyTokenInList

bool anyTokenInList(String listName, String value)

Returns true if any token from value is in the client list with the name listName.

ArgumentTypeDescription
listNameStringClient list name.
valueStringString to tokenize and check intersection with.

diffPctGte

bool diffPctGte(Double value1, Double value2, double pct)

Returns true if val1 greater than val2 increased by pct percentage. val1 > val2 + val2 * pct / 100.0.

ArgumentTypeDescription
value1DoubleFirst value.
value2DoubleSecond value.
pctDoublePercentage.

uniqTxnsByCounterpartyGroupCntGte

bool uniqTxnsByCounterpartyGroupCntGte(Object obj, Number minElementsInTheGroup, Number minGroupCnt)

Returns true if the count of groups that contain the number of elements is equal to or greater than minElementsInTheGroup is equal to or greater than minGroupCnt. For example, a player played X (minGroupCnt) games more than Y (minElementsInTheGroup) times.

ArgumentTypeDescription
objObjectList of transactions.
minElementsInTheGroupNumberMinimum number of elements in the group.
minGroupCntNumberMinimum number of groups.

amountByTxnFieldInListGte

bool amountByTxnFieldInListGte(Object obj, String listName, String fieldPath, Number maxAmount)

Returns true if the sum amount in the default currency of transactions matched by fieldPath with the client list listName is not less than maxAmount.

ArgumentTypeDescription
objObjectList of transactions.
listNameStringClient list name.
fieldPathStringField path in the calculation context. The value from this field is checked in the client list, For example, counterparty.paymentMethod.issuingCountry.
maxAmountNumberMaximum amount.

diffInDaysFromNowGte

bool diffInDaysFromNowGte(Object dateStr, int days)

Returns true if the date in dateStr differs from now in not less than days days.

ArgumentTypeDescription
dateStrObjectString with date to extract and check the difference in days.
daysintNumber of days.

diffInDaysFromNowLte

bool diffInDaysFromNowLte(Object dateStr, int days)

Returns true if the date in dateStr differs from now in not more than days days.

ArgumentTypeDescription
dateStrObjectString with date to extract and check the difference in days.
daysintNumber of days.

cntTxnsByMatchingTxnsWithPctAmountGte

bool cntTxnsByMatchingTxnsWithPctAmountGte(Object leftTxnsObj, Object rightTxnsObj, double diffPct, int thresholdCnt)

Returns true if the count of transactions in the left that are similar to the right (according to diffPct) is greater than or equal to thresholdCnt. E.g. for the last 7 days, the number of outgoing transactions that match the approximate amount of incoming transactions is greater than or equal to 3, then alert.

ArgumentTypeDescription
leftTxnsObjObjectList of transactions.
rightTxnsObjObjectList of transactions.
diffPctDoubleDiff percentage.
thresholdCntintCount of similar transactions to trigger alert.

timeInRange

bool timeInRange(LocalDateTime localDateTime, String from, String to)

Checks whether the time of local date is in the specified time range: [from; to].

ArgumentTypeDescription
localDateTimeLocalDateTimeDate and time object.
fromStringTime in HH:mm:ss format.
toStringTime in HH:mm:ss format.