Writing a background JS code in IBM's processdesign today requires the conversion of object objects to JSON format.
First thought of the josn.stringify () method,
Input.afterlineleadercode = Lineleaderno;
Input.afterlineleadername = Lineleadername;
TW. Local.input[i] = json.stringify (input); Input is a data object
Among them,TW is the shorthand for teamwork in IBM BPM , which refers to the largest object in PD, including the native tw. Local Object , the Tw.system object of the system .
But every time the code executes this, the background is consistent with the error:
Cwllg2041e:teamworksjavascriptexception created non-nested. Error: [teamworksexception name= ' json2.js ', message= ' Can ' t Find Method Java.lang.String.valueOf (). ', line=187, pos=0 Nested=<none>]
Preliminary analysis is due to the inability of json.stringify () to convert a simple object to a TW object. So use the method in Bpm-json-utils.js.
If you want to use json.stringify (), you need to set the property to the TW object
Input.afterlineleadercode = Tw.local.afterLineleaderCode;
Input.afterlineleadername = Tw.local.afterLineleaderName;
Tw.local.input[i] = json.stringify (input);
That's all you can do.
The use of Json2.js and Bpm-json-utils.js in IBM BPM