Come for answers. Stay for best practices. All we’re missing is you.
A unified JavaScript library for IBM BAW (Business Automation Workflow) that converts between TW Objects and JSON strings with configurable logging.
Simply include the toolkit to any Process App / import the JS file in any toolkit / Process App.
Converts any IBM BAW TW Object (including Lists, Maps, Dates, TWObjects) to a JSON string.
// Basic usage (no logging)
var jsonString = BAWJSONUtils.TWToJSON(tw.local.myObject);
// With logging enabled for debugging
var jsonString = BAWJSONUtils.TWToJSON(tw.local.myComplexObject, true);
Parses JSON string and optionally assigns it to a TW variable path. Handles Map XML strings automatically.
// Parse and assign
BAWJSONUtils.JSONToTW(
'{"name":"John","age":30}',
'tw.local.employee',
false // logging disabled
);
jsonString,
'tw.local.result',
true, // logging enabled
null // optional reviver function
I am getting an error when trying to import into toolkits. Is there a way to troubleshoot this? Thank you.
@Jheyson Mogollón
Can you please share the details of implementation and the error you are getting via atanuroy@live.in
Thanks!
i get an error when i tried to use JSONToTW(jsonString, mappingVariableName) with an Twobject from an external service to an Twobject from ads with the same estructure.