My service flow has a map
variable. Using a script task, I populate that variable.
Here is the sample code:
variable defined in service flow - myMap of type tw.Object.Map
My JavaScript:
tw.local.myMap = new tw.object.Map();
var contentTypeKey = "Content-Type";
var contentTypeValue = "application/json";
tw.local.myMap.put(contentTypeKey, contentTypeValue);
log.info(tw.local.myMap.get(contentTypeKey));
When debugging I get this exception:
CWTBG0019E: Unexpected exception during execution. Exception information: 'An exception occurred in activity "Script Task" of "Service Flow" with name "Service Flow test". Task instance id "Task.1083173". Details: "Runtime error in script ("Process: 'Service Flow test' ProcessItem: 'Script Task' Type: 'ITEM'" 2:-1). ReferenceError: "myMap" is not defined. (#2) Script (line 2): 1 : // Assignment script 2 : myMap.get("Content-Type");
Any help appreciated.