How to process the O/P of the DMN business rule task - resultList with multiple array of object

441 views Asked by At

I am New to Camunda and i am exploring the business rule task from camunda for one of my requirements, i have created a DMN file, I need to pass the O/P of this DMN response to an HTTP Post method in a Json Format. But the O/P of the DMN is not in Json and i don’t know how to process it. Please help me on completing this task.

I am getting the O/P as

[{watchers=Kaif , Mohamad, assignee=Koli , Virat, testBlockName=TCP}, {watchers=Kaif , Mohamad, assignee=Rohit, testBlockName=RRM Pre-association Band Steering - on/off}]

which is not a json format, My O/P needs to be

[{“watchers”:“Kaif , Mohamad”, “assignee”:“Koli , Virat”, “testBlockName”:“TCP”}, {“watchers”:“Kaif , Mohamad”, “assignee”:“Rohit”, “testBlockName”:“RRM Pre-association Band Steering - on/off”}]

All fields seperated with “” and insted of equal it needs to be :. Please Advice me how to proceed further. Thanks in Advance.

1

There are 1 answers

0
pme On

The output of a DMN is a List of Maps (JAVA). What you need is JSON.

So you need to add an Output Mapping to your Business Rule Task.

Something like this: enter image description here

JSON(JsonOutput.toJson(dmnResult)) > the JAVA result dmnResult is translated to a Groovy JSON and then in a Camunda-JSON (Spin-JSON).