Loading...
 

CX_TRANSACTION::PostStateByUniqueID

CX_TRANSACTION::PostStateByUniqueID

Description:

Returns the achievable target state for the connected workflow with the transferred ID (from ConnectStateMonitor). Like WorkflowRoute, this method does not change the status monitor to which the transaction is currently linked. In contrast to WorkflowRoute the successor state is not determined by the fact that the transaction is switched from the start state through the network, instead it is only checked whether the transaction can be switched from the current state and if another state can be reached, then this is returned. In this respect, this method is only partially suitable for checking whether the state of a transaction has changed. This would only be a reliable check if it makes no difference whether the transaction is passed on from the initial state or from the current state.

If no new state is reachable, the current state is returned and if there is no connected state monitor wrapper for the specified workflow ID, NULL is returned.

Code example:
// Check whether the state has changed
txn Get(PostStateByUniqueID("TASK"))   // -> next state
txn Get(StateMonitor("TASK"))          // -> current state
@ ifnot { "State has changed" Attention(,INFO) }
else { "State unchanged" Attention(,INFO) }
Stack
Stack Position Object type Brief description
Stack(In) Top CX_TRANSACTION A transaction
Top 1 STRING Workflow-ID (unqiueID of the wrapper from monitor)
Stack(Out) Top CX_STATE_MONITOR The achieved target status
Function call: Call(PostStateByUniqueID)