User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:adminmanual:businessmappings:decisiontable [2020/07/02 03:15]
joebordes [Full Map Structure]
en:adminmanual:businessmappings:decisiontable [2020/07/05 22:48] (current)
a.sinani [Select Dish with Module]
Line 290: Line 290:
  
 Finally, comment on a very important option where you can set the value of any variable in the context to **%%__IGNORE__%%** to have that variable eliminated from the decision. This permits us to create complex rules with many variables where we search on only a few of them at a time. Finally, comment on a very important option where you can set the value of any variable in the context to **%%__IGNORE__%%** to have that variable eliminated from the decision. This permits us to create complex rules with many variables where we search on only a few of them at a time.
 +
 +
 +==== Preprocess Directive ====
 +
 +Following the new enhancements,​ we don't have to valorize context variables on the Decision Table map using the Execute Expression Workflow before evaluating the Decision table map. The map will be evaluated on the context of the values that are present on the screen.
 +
 +But there may be cases where we don’t want the context variable to hold the entire value of the field. ​
 +Here comes in play the preprocess directive. The preprocess directive is optional. That being said, if it is present it will send its value to the workflow expression system, get back the result and use that result to search the Decision Table Module.
 +If you think about it the preprocess directive carries the work of the Execute Expression workflow task. You don’t need to explicitly use the workflow system because the preprocess directive will “call” it for you.
 +
 +**Example:​**
 +
 +Let's change the logic we had in the last example above.
 +
 +Remove all the records with the season of Spring and add this new rule on the decision table module: //If the season is Spring then regardless of how many guests there are I want the desired dish to be Beef//.
 +
 +That would be a record like this in the decision table module.
 + 
 +^ sequence ^ season ^ guestcount ^ desireddish ^
 +| 1 | Fall | 8 | Spareribs |
 +| 2 | Fall | 10000 | Stew |
 +| 3 | Spring | * | Beef |
 +| 5 | Winter | 8 | Roastbeef |
 +| 6 | Winter | 10000 | Stew |
 +| 7 | Summer | 10000 | Light Salad and a nice Steak |
 +
 + Lets see how that will look on our Decision Table map:
 +
 +<code XML>
 +<​condition>​
 + <​input>​guestcount</​input>​ <!-- context variable name -->
 + <​preprocess>​if season == '​Spring'​ then '​*'​ else guestcount end</​preprocess> ​ <!-- if present sends the expression to the workflow expression system-->​
 + <​operation>​e</​operation>​ <!-- QueryGenerator operators -->
 + <​field>​guestcount</​field>​ <!-- fieldname of module -->
 +</​condition>​
 + </​code>​
 +
 +As you can see we are using the preprocess directive. What is inside the preprocess directive will be sent to the workflow system. ​
 +So if the season is Spring that valorizes the context variable with the value * and then searches the decision table module for a match. Now, whenever the decision map gets evaluated on a record whose value of the Season field is Spring it will consider the value of Guest Number as * and for our Decision Table module that means that the desired dish is Beef.
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
 ===== Select Global Variable Escalation ===== ===== Select Global Variable Escalation =====