I’ve deployed the Dinner decision table from the get-started pages, onto an EC2 server and I want to call it from a BPMN process I’m running locally.
I looked at the example for Rest calls for calculating whether it’s a holiday on github. Where I’m stuck, is that this example didn’t have a payload. With the dinner decision table I need to pass through the number of guest and the season:-
I’m confused as to what you’re asking here. Are you asking what a payload would look like to invoke the “dinner” example (I’ve worked with that also) or are you asking how to code variable inputs in the BPMN code itself?
The Dinner example outputs some things to the system/server log (essentially a deployment check to ensure that the deployed DMN is viable), but also returns a response to a REST request to the DMN when you ask to evaluate a set of inputs.
I was asking for both, The dinner decision service works when I call it using chrome’s Advanced Rest Client. It’s now a case of working how how to call that decision service from a locally executed process.
I thought that I would be coding everything inside of the BPMN but Ive obviously been working with a very old version of Camuda Modeler (now rectified) and I wasn’t aware until I read Steve’s post that you can set this inside the modeler.
I was able to call the decision service using hard coded values the following way (confirmed by checking the cockpit on the amazon server)
That is correct as the type for guestCount is specified as an integer, however the payload i used (pasted from above) in Chrome Advanced Rest Client worked fine. The call from the local process to the cloud decision works as well (with the hard-coded payload version) as checking on the cloud cockpit I can see that it was called and that the correct output was returned.
@theHornet you need to read the JSON Spin documents, and read up on the difference between a JSON Object and JSON array. you are using var customers = customerProperty.elements(); which is trying to get the array elements, but customerProperty is a object and so .elements() is not correct.
Should be something like:
var grub = S(response).elements().get(0).prop("desiredDish").prop("value").value();
I am using the parameter “var json = S(response, ‘application/json’);”, as the output of my connector, but I would like to filter the result, instead of show all the Json. Do you know you to filter the result?
This is the Json returned.
“nomeCliente”: “Andre Sousa”,
“nomeCliente”: “Lucas Rodrigues”,