Tuesday, January 15, 2008

Oracle BPEL reports error "Cannot set non-message value to a message based variable"

Issue: BPEL Process error while executing Transformation activity. This error happens more frequently when transformation activity involves on huge schema.

Reported error is:
{{http://schemas.xmlsoap.org/ws/2003/03/business-process/}mismatchedAssignmentFailure} messageType: {} parts: {{summary=Mismatch Assign. Cannot set non-message value to a message based variable. Please check the BPEL source. }}

Solution :
After research, it appears to be caused due to some issue in Jdeveloper. What happens is, sometimes Jdeveloper ‘strips’ some content from the <BpelProcess.bpel> file. Jdeveloper version I am using is Studio Edition Version 10.1.3.3.0.4157. In my case this happened when my transformation source was an Element and the target was the message type.

When you create a transformation activity, your xxxx.bpel file would have like :

<assign name="MyTransformActivity">
<bpelx:annotation>
<bpelx:pattern>transformation</bpelx:pattern>
</bpelx:annotation>
<copy>
<from expression="ora:processXSLT('mytranslation.xsl',bpws:getVariableData('sourceVariable'))"/>
<to variable="OurputVariable" part="OutputVariblepart"/>
</copy>
</assign>


but jdeveloper for some reason strips the part=”OutputVariablepart”.

So solution is to add the above missing part manually in the xxxx.bpel file.

No comments: