Decisions

Previous Next

A decision is a programmatic construct that allows you to:

Mix logic expressed in SQL with logic expressed in action scripts.

Add branching and looping to SQL statements and action scripts.

This is a technical concept. Do not confuse it with the business concept of 'decision' as used in Decision Engines and Decision Modeling and Notation (DMN, the OMG standard first published in 2014). The USoft Rules Engine can act as a Decision Engine, but it is not defined in terms of decision trees or decision calls. Instead, it automatically implements business rules in response to data manipulation events. As such, it is constructed by solely implementing Business Rules and does not need Decision as a modeling concept.

A Decision is declared in the Decisions info window, which clearly shows the 4 attributes that make up a decision:

Decision Name.

Decision SQL.

Yes Action.

No Action.

Example

The decision shown in the picture below uses SQL to retrieve the name of the system directory and concatenate it with a command-line instruction. The result is passed to the operating system (and represented by the :1 placeholder in the Yes Action) for execution. If, for some reason which in this particular situation is not expected, the SQL statement does not yield a result, nothing happens (No Action).

The decision is executed when it is called from an Action Task in a job, from another (or indeed from the same) Decision, from a GUI element in Windows Designer or Web Designer, or from an action script in a SQL Command window. The call from an Action Task looks like this:

ActionDecision( TEST_SYSTEM_CREATE_APPDATA )

 

The call from an action script in a SQL Command window must used the action keyword to switch from the SQL context to an action context:

action ActionDecision( TEST_SYSTEM_CREATE_APPDATA )

 

MR_clip0013

 

 

collapseDefining and checking a decision
collapseCalling a decision

 

 

See Also

Decision attributes

Decision variables and placeholders

Decision branching and looping