Loading...
 

CX_EXPANDABLE::ConditionedFilter

CX_EXPANDABLE::ConditionedFilter

Description:

This object is placed in a new plugspace for the duration of the formula evaluation. The transferred formula expression is evaluated against this plugspace and if the result evaluates to TRUE, then this object is returned, otherwise NULL is returned.

The functionality of ConditionedFilter is equivalent to the following InstantView code:

Var(expandable formula, result) -> expandable CreateTransObject(CX_FORMULA) -> formula formula Put PlugSpacePush [ expandable ] PlugSpace formula Call(Evaluate) -> result PlugSpacePop result if expandable else NULL

Note:
If a formula is executed, all objects in the plugspace are searched sequentially for the required data field. However, if there are not only documents in the plugspace that have a "transaction" data member, for example, but also simple values as objects, the evaluation of the formula would result in an error because the system also attempts to read the "transaction" data field from the simple value, which it does not have. The solution here is to place the ConditionedFilter in front of the desired data field.

(For less complex access paths, see also ClassFilter).

Code example (often used in transition descriptions of business processes or conditions in transaction descriptions):
// 1. Beispiel
ConditionedFilter("inherited(this, CX_LINK_TXN)").FirstSuccessorByCondition("type(TopTransaction())=CX_ITEM_DEMAND")

// 2. Beispiel
"type(this)=CX_OFFER | type(this)=CX_STOCK_ORDER | type(this)=CX_BUDGET_OFFER" object Call(ConditionedFilter)
Stack
Stack Position Object type Brief description
Stack(In) Top CX_EXPANDABLEThis object
Top-1STRINGFormula expression to be evaluated
Stack(Out) Top CX_EXPANDABLE | NULLThis object if the formula was evaluated to TRUE, otherwise NULL

Function call: Call(ConditionedFilter