Question
Stefan Cronje · Oct 25, 2018

How can I access array elements in a Business Rule

Hi,

The context of the rule set contains an ArrayOfDT(I've also tried Collection.ArrayOfDataTypes).

I need to access an element using its key in the rule set using the assign function. I've tried everything I can think of and searched the documentation, but can't find anything. It is probably very obvious.

Can you please help?

00
0 0 1 175
Log in or sign up to continue

Replies

Resolved this by adding a Rule Function and using it in the Rule Set.

Rule Class:

Class Test.TestRuleFunction Extends Ens.Rule.FunctionSet
{

/// GetAt implementation for rulesets
ClassMethod CollectionGetAt(ByRef pCollection, pKey As %String) As %Integer [ CodeMode = expression, Final ]
{
pCollection.GetAt(pKey)
}

}

Rule set expression

CollectionGetAt(ReturnValues,"CalculatedValue")