I want to evaluate certain conditions in the the decision tree and finally in the Action part i need to call a Function.!
Can i do this in the Decision tree ? if yes Please explain me the Procedure...
This is somewhat hard to describe briefly but I will give it a try. I have to assume that you know how to initially create the decision tree template and specify the input parameters. After the wizard completes for that part, open the template. In the templates section of the editore create a new "Code" template and give it a name like "Action Template" if you want to follow along with what I am doing. Use your own name if not. After renaming it, open the new code template. Just so that you can see what is going on, I entered "Run MyFunction Label" in the "Label Format" box, "Run MyFunction" in the "Display Format" box and "MyFunction();" in the "SRL Content" box. Then close it.
Next, click the "+" next to the little blue and red icon in the "Action Node Group". Select your new "Action Template". Next, open the instance that was created. I had added one input parameter in the wizard called "inputParm" and that is what shows up in the instance editor. Right click on that and select "Add a New Node". Select the "Auto" checkbox (at the top right). Under the "Node" label choose "Action", Then in the middle right click "Add Row". Finally, where it now says "<Do Nothing>", click on the "<Do Nothing>" row, and then the 3 little dots at the far right end. Select the "Action Template" you had just created. The row will now be populated with the name you entered into the "Display Format" box. Also double click on the box that was initially entered for you and specify the selection conditions.
Now under the project expand the instance and double click on the generated ruleset. Expand the content and read through carefully to see that your function is not being executed in the then clause in what is probably the "_node1" rule.
Business Rules Consulting, Inc.
Mahesh H wrote:Hi Guys,I want to evaluate certain conditions in the the decision tree and finally in the Action part i need to call a Function.!Can i do this in the Decision tree ? if yes Please explain me the Procedure... Thank you,Mahesh.
Yes you can dynamically call a function and also a function instance created from a function template.
1. Create a code template with one string value holder"<<fn_call>>". display the value holder and in srl "apply <<fn_call>>".
2. Add the code template to the actions list in decision tree.
3. In the action node select the new code template you have created and enter the function names along with the arguments if any(for eample: assignValue("sample"))
You can create a typed instance list provider and map it to the function template.
Same as above but instead of string value holder directly map it to the typed instance list provider.
hope this helps.
Kishore P Fernando
Retrieving data ...