CX_TRANSACTION::SuccessorsByCondition
Description:
This function recursively examines the successor chain (Collection predecessors) when the condition (STRING) is fulfilled (=TRUE); returns all matching successors. For INTEGER = 1, sub-transactions are also involved in the search process.
If the calling transaction object already meets the condition, it is included in the collection, unless bit 3 of the mode parameter is set. The Parameter mode also controls the - extended - search of the transaction objects of the specialized types CX_COMPOUND_TXN and CX_ALLOCATION_TXN.
Note: To understand which objects are searched and how, the logger cx.model.txn can be switched to TRACE mode. The individual steps are then specified in the log file.
Code example:
Item(T("Preisvergleich", "Compare prices")) [ SELECT: GetObject(, ListBox) Dup if { Get(SuccessorsByCondition("type(TopTransaction())=CX_PURCHASE_INQUIRY")) Dup if SendMsg(LIST_PURCHASE_INQUIRY_ITEM) else Drop } else Drop ]
Stack | Position | Object type | Brief description |
---|---|---|---|
Stack(In) | Top | CX_TRANSACTION | A transaction |
Top 1 | INTEGER | Mode (bit pattern) 0 (Integer 1) = for documents of type CX_COMPOUND_TXN, the system also displays 1 (integer 2) = for documents of type CX_ALLOCATION_TXN, the 2 (Integer 4) = search only your own successors collection, not the successors of the following documents (no recursive call!) 3 (Integer 8) = the calling transaction object is ignored, even if it should meet the condition | |
top 2 | STRING | Formula | |
Stack(Out) | Top | COLLECTION | Successor |