The use of Json2.js and Bpm-json-utils.js in IBM BPM

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.