Null Action

The Null Action does nothing. It is a no-op. The Null Action is useful for providing transaction breaks. By default, Null Actions are not transactional, while all the other core actions and triggers are transactional. By inserting a Null Action in your flow chart, you can create a "transaction break". At transaction breaks, Flux commits the current database transaction. See Transactions for more information about how Flux handles these transactions.

Because it is an implementation of the Action class, the NullAction also inherits all latent properties an action contains. These include the use of postscripts and prescripts and join points. It is considered good practice to use the pre or post script on a null action to do light processing that doesn’t warrant a full Java Action.

The following code demonstrates using a Null Action’s prescript.

NullAction nullAction = flowChart.makeNullAction();
String prescript = "boolean lastResult = (boolean) flowContext.get(\"RESULT.result\");\n" +
                     "lastResult = lastResult==true?false:true;\n" +
                     "flowContext.put(new Boolean(lastResult), \"RESULT.result\")";
Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.