I am trying to run some existing BPLE 1.1 process on ODE (see previous emails)
I am having trouble with an assign to an attribute on a variable.
The variable is declared like so:
<variable name="aeAppAuth" element="ns8:aeAppAuth" />
The variable is given a literal initialization like this
<copy>
<from>
<ns8:aeAppAuth xmlns:ns8="mynamespace"
xmlns:defaultNS="mynamespace">
<ns8:userId xmlns:ns8="mynamespace"
xmlns:defaultNS="mynamespace">admin</ns8:userId>
<ns8:password xmlns:ns8="mynamespace"
xmlns:defaultNS="mynamespace">welcome</ns8:password>
</ns8:aeAppAuth>
</from>
<to variable="aeAppAuth" />
</copy>
Then later an attempt is made to set an attribute named xsi:type to the value,
ns8:Auth, like this
<copy>
<from expression="'ns8:Auth'" />
<to variable="aeAppAuth" query="/ns8:aeAppAuth/@xsi:type" />
</copy>
This compiles assuming my fix for literal assignments (see JIRA issues ODE-922
and ODE-924) but fails at runtime with the error:
INFO - ODEServer-1 - ASSIGN.run(111) | Assignment Fault:
{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure,lineNo=96,faultExplanation=No
results for expression: {OXPath10Expression @xsi:type}
DEBUG - ODEServer-1 - BpelRuntimeContextImpl.completedFault(230) | ProcessImpl
completed with fault
'{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure'
The problem can be worked around but setting the attribute,
xsi:type="placeholder" in the literal initialization like this
<copy>
<from>
<ns8:aeAppAuth xsi:type="placeholder" xmlns:ns8="mynamespace"
xmlns:defaultNS="mynamespace">
<ns8:userId xmlns:ns8="mynamespace"
xmlns:defaultNS="mynamespace">admin</ns8:userId>
<ns8:password xmlns:ns8="mynamespace"
xmlns:defaultNS="mynamespace">welcome</ns8:password>
</ns8:aeAppAuth>
</from>
<to variable="aeAppAuth" />
</copy>
Basically this is the classic BPEL "selectionFailure" due to an uninitialized
variable. I'm not sure if my BPEL is technically valid since the spec does
seem to indicate that Selection Failure should occur for elements AND
attributes although there seems less reason to demand an attribute be present
before you can set it and the spec did not seem that clear.....
Anyway it is not really convenient for me to modify the existing BPEL to add
this kind of attribute initialization to the relevant literal initializations
so I was hoping to use the usual get out clause that most BPEL engines seem to
provide that allow element and I assume attributes to be created on selection.
In the case of ODE this appears to be setting an attribute,
insertMissingToData, to the value "yes" on the <copy> activity element like
this:
<copy insertMissingToData ="yes" >
<from expression="'ns8:Auth'" />
<to variable="aeAppAuth" query="/ns8:aeAppAuth/@xsi:type" />
</copy>
Unfortunately this fails with the same error. I suspect this is partly due
to the runtime only applying this attribute if the <to> is an expression and
not if it is a variable with an expression selector. That seems to be the case
at runtime. I don't understand the reason for that distinction so perhaps
that is due to a BPLE 2.0 bias. The other reason seems to be that the
insertMissingToData attribute actually does nothing at runtime except exist and
get passed around a bit. I am still investigating this but it would be helpful
to know if this is a known issue in ODE 1.3.5
As a further comment, it would probably be useful if the insertMissingToData
attribute could be defaulted to "yes" for an entire process. The individual
control for each <copy> is nice but it requires you to modify the BPEL to use
it. A global setting for the process, say in the deploy.xml would be handy.
Tim