I have a workflow that sums labor hours by activity sequence from a Schedule of Work and writes those summed values to the Activity Estimate. The workflow works as expected in our TEST environment. I added the workflow to an Application Configuration Package and imported into our PROD environment, and the workflow does not function (generates the error “Cannot serialize object in variable ‘result’: SPIN/DOM-XML-01030 Cannot create context). The same data generates a different result.
Could this be a permissions issue? It fails for all users (I don’t have access to the app owner though)
Here’s the code for the ‘result’ variable:
var workset = execution.getVariable("Reference_SchOfWorkEstimateResourceSummary_Set");
var myMap = {};
var ArrayList = Java.type('java.util.ArrayList');
var activitySeqlist = new ArrayList();
for (var i = 0; i < workset.length; i++) {
actSeq = workseti].ActivitySeq;
qty = worksetti].Quantity;
if (actSeq in myMap ) {
myMapiactSeq] = myMap/actSeq] + qty;
} else {
myMapbactSeq] = qty;
activitySeqlist.add(actSeq);
}
}
execution.setVariable("result", myMap) ;
execution.setVariable("actiseqens", activitySeqlist);
From PROD:
From TEST (successful execution with same data):