Decision table final logic
Decision Table Final Logic
Once a decision table is designed, it will build up all the expressions for actions and conditions based on how it is modeled.
All Decision Tables will be translated (compiled to) Validation logic on execution. To check the executable validation tree logic, click on the Compile to Validation Tree highlighted on the above toolbar.
But you can see the actual expressions that will be evaluated. Let's say you have modelled the following Decision Table:
Once you press the button, you can see the XML representing the tree logic of your decision table will all built expressions. For example, the bellow picture shows you the R7 rule:
Please note this is not the whole tree logic of the above decision table. It is just the logic for R7.
It is also possible to retrieve the Validation Tree programatically. To doing that so you need to:
- Get ITable of your decision table
- Use TableParser parse and transform your decision table to its validation tree
// Load the decision table model from its content i.e. binary/string var decisionTableModel = LoadAdapterUtility.LoadModel(Encoding.UTF8.GetBytes(decisionTable)); // Create a table reader to build ITable of the decision table model var reader = new XmlTableReader(decisionTableModel); IIterable<ITable> tables = reader.GetTables(); // Use TableParser to create the validation tree of the decision table IElementModel validationModel = TableParser.CreateParser().Parse(tables).First(); // If you need the XML equivalent of any IElementModel, you can use ToXml method. string validationXml = validationModel.ToXml();