IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing business processes > Building BPEL processes > Defining BPEL process logic > Adding an activity to a BPEL process > Work with basic activities > Use assign

Troubleshooting errors related to assign activities

Occasionally, data manipulated in a BPEL process with the use of an assign activity can result in errors when that process is deployed to a runtime environment. Here are some of the most common problems as well as solutions.


Assigning fixed values to arrays

If you plan to assign a fixed value to an element inside an array then you will receive an error when you run the process in a runtime environment. This occurs because the XPath that gets generated is unable to address all of the elements in the array. You can work around this by modifying the assign activity's Assign To field to identify the elements in the array.

For example, you would change an existing entry from /attribute2 to /attribute2[1] to identify it as the first element of the array.


Assigning values to a BO attribute

If you attempt to assign a value to an attribute within a BO, you will get the following error:

org.apache.commons.jxpath.JXPathException: Exception trying to create xpath Result/@resultStatusFlag; Cannot create an attribute for path /root/Result/@resultStatusFlag, operation is not allowed for this type of node
There are two work-arounds for this problem:

  1. Assign the value to a non-attribute value within the BO, and then to the attribute.

  2. Use a Java™ Snippet activity to create the BO.

Use assign