AnsweredAssumed Answered

support for JSON encoding dataset values?

Question asked by pdapel on Dec 12, 2013
Latest reply on Mar 28, 2016 by alex.zwinge

I mostly execute Processes within ITPAM v4.1 via SOAP or REST calls.  When those Processes contain complex datasets of output values, such as ValueMaps, it becomes a real chore to ensure they are handled properly.  I would really prefer to store the data inside the Process as a simple JSON-encoded String value, and then do the JSON decoding within my webapp.

I have tried code such as:

  var new_record = { };

  new_record.k = { } ;

  new_record.k.fieldA = 'valueA';

  new_record.k.fieldB = 'valueB';

  new_record.k.fieldC = 'valueC';

  new_record.k.fieldD = 'valueD';

  var json_string = JSON.stringify(new_record);

  Process.json_string = json_string;
 
But this fails to execute when it encounters the JSON.stringify() method. 
 
Is JSON string encoding supported?
Do I need to provide a path (classpath etc) to the JSON.stringify method?
Does anybody else write complex data to JSON instead of complex data structures?

Outcomes