Hi,
I have a decision table that returns two outputs based on the input values.
I'm calling this Decision table rule from a process, how can i store the result in a activity class variable?
The output of the decision table is a MAP, i could not find a compatible datatype for this in a process model.
Can someone please help?
TIA
Regards,
Sunil Zacharia
Discussion posts and replies are publicly visible
Hi Sunil, When a decision has multiple outputs, it is called as compound output (or MAP) which is nothing but a dictionary with fields that correspond to each output field name of the Decision. You could write an expression rule which calls the decision and then cast the output of the decision to a CDT corresponds to the dictionary the decision returns. Lastly call that expression inside your process model and capture the output with that CDT type. Thanks
Hi Sunil,
I'm not sure what exactly mean MAP, The output of the Decision table can be any of the type as displayed in the below Image and all these data types are available in PM.
Please let us know if you still have doubts and it will be helpful, if you attach your Decision table screen shot.
Hi Chandu, When you have more than one output fields defined in a decision, it returns a type called MAP which is basically a dictionary so in order to extract each of the individual output fields you need to cast the dictionary, it is upto you if you want a CDT to cast to or map individual output to separate variables. Thanks
Okay Thank you. Could you please let me know how to get MAP output type. Currently I'm in 18.2
Hi i too had a similar requirement to achieve couple of months/an year ago, where we need to return array of output. Scenario to consider: (I). When we have more than one output configured, means each output can be either of same or different types, hence this returns MAP, as this deals with Key-Value pair format to differentiate the responses of their respective output. e.g (Sample response) { Output1: {1,2,3} -> Here this output is of Number Integer (List/Array), Output2: myGroup1 -> Here Output2 is of type Group } This is equivalent to the Dictionary structure. Consider, Output1 and Output2 is the name of your Output of decision Object, and this might vary based on what name you configure under your decision object. Now when you call this decision Object into Process model, you can hold this as following: 1. Under Script Task Input tab, use todatasubset(rule!yourDecision) -> Store this into a AC Variable of type datasubset (as i don't want to hold this complete datasubset into PV, instead i need to hold the individual responses(Output1, Output2), depending on your requirement). Now under Output tab of this Script task, write the following: (a). index(ac!datasubset.data, "Output1", {}) -> Store this into PV of type List of Number(Integer) (b). index(ac!datasubset.data, "Output2", {}) -> Store this into PV of type Group Consider, datasubset is the activity class variable of type Datasubset defined under Input Tab of Script Task. Hope this will help you deal with Multiple output of decision Object.