Question
Centene
US
Last activity: 17 Jul 2017 15:45 EDT
Decision Tables and Web Services.
Is it possible to expose a Decision Table as a Web Service? There are several things I cannot quite figure out, if so. The "Parameters" tab lets you define parameters, but in the Decision Table area, these parameters cannot be used as a condition value - i.e. i'd like a web service to use Input Parameters and evaluate them - not a property on Case - and return a result.
Is this possible? Or is a Decision Table always tied to a Case, and must evaluate properties on a case?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
CA
Hey Jim, this is the video I produced for you: https://mesh.pega.com/meshvideos/4631
Let me know if it helps,
Ben
Pegasystems
US
Hi Jim,
I don’t think decision tables are tied to a case. Also, to refer to the parameters in the matrix, use the syntax “param.name”. To get some basic info, go to class explorer under rule-declare-decisiontable so you can see the instance list of decision tables, bring up any one of them, and then use “?” or “actions - > help” depending on which Pega version you’re on, to see the contextual help for decision tables. /Eric
Centene
US
Eric
Thanks again for the reply. The decision table appears to be tied to a case in that the "conditions" portion appears to only accept case properties. I tried the "param.name" syntax initially - before posting this.
What happens then, is that any time I click in the "if"/"otherwise" area, i get a nullpointer error in Pega.
But, assuming I get past that, if I have a Decision Table with Parameters, how do I invoke that via a web service? Do i need to create an activity to run the Decision Table? If so, how do i pass the web service's incoming parameters to the activity and then on to the Decision Table? I have tried searching PDN and Mesh for an article describing this process, to no avail...
that is correct; Service calls an activity which executes the Decision table rule and returns the result. Please take a look at this article(https://pdn.pega.com/integration/how-the-service-accelerator-works). service accelerator wizard will help with Pega Service creation.
Centene
US
Gopinathan
Many thanks. I've actually constructed an activity that calls the Decision Table successfully and sets the parameter with my value. However, when i run this activity through the Service Wizard, the output it generates for the web service is problematic.lnstead of my simple integer parameter being returned, I get
<ns1:AdderResponse xmlns:ns1="urn:PegaRULES:SOAP:CenteSpecialPWorkProject:Services">
<outResult></outResult>
</ns1:AdderResponse>
So it's wrapped in this namespace thing, for one, and second, the output result does not contain the output that is being returned by the Decision Table.
When I run the activity by itself, the output parameter is being set correctly (i'm doing a Show-Property to confirm the value).
Pegasystems Inc.
CA
Hi Jim,
I'm going to record a short video of how one can accomplish what you are looking for an post it here today. Hopefully that will help you.
Can you let me know what version of Pega you are using? I will record the video on Pega 7.1.7 (our latest release), but will try to point out differences if any exist on the version you are using.
Cheers,
Ben
Centene
US
Ben
Thanks a bunch! We're using 7.1.7 so your video will be spot on for me.
Accepted Solution
Pegasystems Inc.
CA
Hey Jim, this is the video I produced for you: https://mesh.pega.com/meshvideos/4631
Let me know if it helps,
Ben