Everywhere you use Cascade get expression it redirects evaluation to given parameter and returns value from that parameter from specified output column.

Cascade get syntax

cascade statement

meaning

$p param.name

returns parameter's value from first output cell, this is equivalent with: engine.get("param.name", ctx). getHolder()

$p param.name [ idx ]

returns parameter's value from output cell with given index, this is equivalent with: engine.get("param.name", ctx). getHolder(idx)

$p param.name [ code ]

returns parameter's value from output cell with given code, this is equivalent with: engine.get("param.name", ctx).getHolder(code)

Implicit type conversion

If, within P1 parameter in level of type T1 occurs cascade get to level type T2 in P2 parameter, then: step 1: internally cascade get will return Holder type T2" step 2: Holder is converted into Holder

conversion will meet Hyperon's conversion standards, see dec(), num(), str(), date(), bool() conversion methods,

conversions may be lossy, which simply means losing the value or precision of a variable. (eg. T1 is integer while T2 is number)

Example

Suppose we have 2 parameters defined as follows:

Parameter par.p1:

IN risk.code

OUT limit (integer)

OUT factor (number)

A

500

5.0

B

600

6.1

*

700

7.2

Parameter par.p2:

IN risk.code

OUT value (integer)

OUT factor (number, array)

A

100

1, 2

B

$p par.p1

1, $p par.p1 [factor]

C

$p par.p1 [limit]

$p par.p1[0], $p par.p1[1]

As you can see, par.p2 has output level value of type integer and output level factors defined as array of type number.

See what happens when you will get value from par.p2 with risk.code equal to A, B and C:

Result of getting value from par.p2 with risk.code=A in context:

value (integer)

factors (number, array)

100

[1, 2]

Result of getting value from par.p2 with risk.code=B in context:

value (integer)

factors (number, array)

600

[1, 6.1]

Result of getting value from par.p2 with risk.code=C in context:

value (integer)

factors (number, array)

700

[700, 7.2]

TIP: When parameter P1 uses cascade get to parameter P2, then P2 is evaluated with the very same context P1 was.

Avoid cycles When using cascade gets it is forbidden to create evaluation cycle. In other words:

Evaluation cycle: P1 -> P2 -> … -> P1 is not allowed.