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).
- 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.
Project includes the following components:
- Documentation is included in the project archive file
To collaborate with other users of this community asset, post your question to dwAnswers.