Question

SPIN/DOM-XML errors in BPA Workflows

  • 27 March 2024
  • 2 replies
  • 45 views

Userlevel 3
Badge +7

ISSUE/QUESTION: 

When working with Workflows you might encounter errors indicating SPIN/DOM-XML. These errors can be random but when occurred once can occur repeatedly.

The error is 'Cannot serialize object in variable 'var' : SPIN/DOM-XML-01030 Cannot create context'. It is  visible in troubleshoot mode as below.

ENVIRONMENT:  IFS Cloud

AUDIENCE: ALL

RESOLUTION/ANSWER:

When this error is encountered at the point of using an array in a script task, following workaround can be used.

Instead of an array use the java ArrayLIst implementation in the script task. 

For example, the error seen in the image can be overcome by replacing the script with the following. 

var c = new java.util.ArrayList(); 

c.add(‘x’);  

execution.setVariable("abc",c); 

CAUSE: N/A

ADDITIONAL INFORMATION: N/A

SCRIPTS/LOGS: N/A

SOURCE: CS0206101

VERIFIED: NO


2 replies

Userlevel 4
Badge +9

@Lahirumala de Mel 

Is this the same for using javascript array functions like map? 

We had an issue where we tried the following:

 

var orderNos = CustomerOrderSet_Set.map(function(order) {
return order.OrderNos;
}).join(', ');
execution.setVariable("OrderNos",orderNos);

The workflow engine complains with a message “map is not a function” 

This code works perfectly if you try it outside of IFS but when trying to use it on a collection which is a result of an API READ action it gives this error?

 

Can you confirm that we need to do the same type of fix when we want to apply some array functions on a collection coming from a READ action?

We get this error

 

Userlevel 3
Badge +5

.map() is a ES6 syntax in javascript and that is currently not supported form of syntax in workflow

but you should be able to do the same thing using it in the following way 

 

var orderNos = Array.prototype.map.call(CustomerOrderSet_Set, function(order) {  
return order.OrderNos;
}).join(", ");

execution.setVariable("OrderNos",orderNos );

 

Can you give it a try and see 

Reply