JSON Helper Toolkit

Posted: April 29, 2015 Modified: August 31, 2017


Overview

Using BPM script you can manipulate 2 types of Java Script objects:

  • The BPM defined Objects (TWObject).
  • The Java Script Objects (JSObject).

Normally if you want to convert a TWObjects to a JS Object or JSON notation, you will have to construct the JSON string and copy the attribute from the TW Object to create the matching JS Object / JSON string. You may need similar functionality for example to transform the parameters required to call an AJAX Service which accepts a JSON string. You can also use it to serialize/deserialize an object in Database instead of using BPM XML serialization (error when de-serialize in a modified TW object).

This toolkit provides a Helper JavaScript methods to convert between JSON and TW Object in both directions.

  • The TW Object to JSON conversion is also exposed as a service to convert Complex TW Objects and its children attributes to JS Object types.
  • JSON to TW Object is supported through a JS function. Note: in IBM BPM you can convert and assign a JS Object to a TW object if it has the same structure. if it has additional attribute BPM will through exception in assigning the variable. In such case you need to remove unrequired attributes from the JS Object before converting.

What’s Included?

Project includes the following components:

  • twx files for several BPM versions containing the sample javascript, sample process, and sample service
  • Documentation is included in the project archive file

Additional information

To collaborate with other users of this community asset, post your question to dwAnswers.

Cost: No Charge
Support: As-Is
Provider: IBM

Resources

Project Files on Bluemix Toolchain
Forum

Requirements

IBM BPM 8.0.1 and 8.5.0 (examples provided of both)

Support

This is a community contributed content pack and no explicit support, guarantee or warranties are provided by IBM nor the contributor.