Sort Output from a Decision Service

Posted by Joanne Penaflor on 30-Apr-2017 02:59

Hi Guys,

Is there a way to sort the output that comes from Corticon (ie, input / output is json).

It really is just for ease of use while developing the program, good to have but not really required.

Thanks.

Posted by bblais on 15-Jan-2020 15:23

Corticon does not sort the input or output JSON Objects.

It is possible to accomplish using 3rd party tools.

Per the JSON RFC (found here tools.ietf.org/.../rfc7159

"JSON parsing libraries have been observed to differ as to whether or

  not they make the ordering of object members visible to calling

  software.  Implementations whose behavior does not depend on member

  ordering will be interoperable in the sense that they will not be

  affected by these differences."

All Replies

Posted by James Arsenault on 01-May-2017 21:46

Joanne, are you looking to sort the order of entities (and sub entities) or the attributes on an entity? If entities, what criteria would you use for sorting?

Posted by Joanne Penaflor on 01-May-2017 22:03

Hi James, more the attributes in the entities, in alphabetical order, if I can. I know using ruletests in Corticon it does it now, but when I try using SOAPUI to pass in json input, the json output's order is not in any order at all.

Posted by James Arsenault on 01-May-2017 22:12

Joanne, I don’t know of a way to do this. Perhaps SoapUI has means to do the sort.
 
Jim
 

Posted by Satya Kolachana on 06-Jan-2020 21:56

I know its been 3 years since this question answered. Does the final reply still stand true?

Satya

Posted by bblais on 15-Jan-2020 15:23

Corticon does not sort the input or output JSON Objects.

It is possible to accomplish using 3rd party tools.

Per the JSON RFC (found here tools.ietf.org/.../rfc7159

"JSON parsing libraries have been observed to differ as to whether or

  not they make the ordering of object members visible to calling

  software.  Implementations whose behavior does not depend on member

  ordering will be interoperable in the sense that they will not be

  affected by these differences."

This thread is closed