Adding JSON objects into arrays

Skip to first unread message

Azman Salleh

Jun 22, 2021, 2:55:01 PMJun 22
to OpenRules
Currently, I'm aware that OpenRules is able to load in predefined data to add into an array or using Java snippets/macros.

What currently I'm trying to achieve is to create a JSON object with fields from variables and add it to an array namely Data as Object[] within a DT. I am able to append integers as shown below. But how do I append stuff like the following into Data
  number: 1,
  value: ${Lab Test Type Value},
  description: "This is a string"

Screenshot 2021-06-22 at 12.01.58 PM.png


Jun 22, 2021, 2:59:18 PMJun 22
to OpenRules


Let’s assume your decision variable Data is defined in the Glossary with the type MyData[], where MyData is your Java bean with 3 attributes:

  • int number;
  • String value;
  • String description;

Then if your conclusion for the row “Data” you may put the following snippet in the cell under “Add”:

:= myCurrentData(decision, 1, ${Lab Test Type Value}, “this is a description”)

where myCurrentData can be defined in Excel as follow:


Let us know if it helps – at least try it and send us a sample project that contains these constructs with possible errors (if any).


OpenRules Support

Reply all
Reply to author
0 new messages