-
Notifications
You must be signed in to change notification settings - Fork 0
RexConnect Conditional Execution
Written for version 0.5.0.
There are various scenarios where it is beneficial to conditionally execute a RexConnect command. RexConnect provides this functionality via the RequestCmd.e
property. This property represents a list of command IDs, whose responses must be "successful" in order for the current command to execute.
- If a command does not specify any target command IDs, then it will execute.
- A conditional command may specify one or more target command IDs.
- The target commands must be positioned before the conditional command.
- The conditional command is not executed if any of these are true (for any target command):
- The response is "false" or "0".
- The response has an error.
- The response is empty.
- The target command did not occur.
The key benefit of conditional command execution: a single RexConnect can dynamically decide which individual commands to execute based on actual command results. Without this feature, a RexConnect user may need to make several round-trips to the server and/or wrap several of their command queries in if-then clauses (which still isn't as good -- such "wrapped" queries still must be executed).
The origin of this feature comes from a Fabric "batch" scenario, where several vertices/edges are added in the same RexConnect request, but can fail individually. Notes and ideas leading up to conditional execution are available in this Fabric issue.