понедельник, 16 июля 2012 г.

Simple value assignment in BPEL

I've spent a lot of time on a problem when we need to assign just simple value to the tag body which has some attributes already assigned before. E.g. we have some variable varOut which contains the following structure:

<complexStructure>
  <complexValue someAttr="someAttrValue"></complexValue>
</complexStructure>

To assign some value from the variable varWithSimpleValue to the complexValue tag body now we might want to make a following copy procedure:

<assign name="someName">
  <copy>
    <from variable="varWithSimpleValue"/>
    <to variable="varOut" query="/complexStructure/complexValue"/>
  </copy>
</assign>

But BPEL treats source anyway as a complex structure regardles which type is used to define it, let it be even xsd:string and as a result of this operation the whole complex destination (complexValue with its children which are its attributes for the given example) is replaced thus someAttr will be lost. To solve the problem we can use string function which converts object to simple value and have a copy made like this:

<assign name="someName">
  <copy>
    <from expression="string(bpws:getVariableData(varWithSimpleValue))"/>
    <to variable="varOut" query="/complexStructure/complexValue"/>
  </copy>
</assign>

And better and more logical solution is to use text function for the destination to specify that we are selecting complexValue's simple text content not the whole structure:

<assign name="someName">
  <copy>
    <from variable="varWithSimpleValue"/>
    <to variable="varOut" query="/complexStructure/complexValue/text()"/>
  </copy>
</assign>

Originally the problem appeared with JBPM 3.2 but I believe other BPEL implementation should behave similarly.

вторник, 21 февраля 2012 г.

Our company Serena is IT Innovator of the year!

Yahoo!!!

The company I'm currently working in, Serena Software, is the Pink Elephant 2011 Innovator of the Year!!!
Here is our baby :)

Another news about that on PR-Web

пятница, 13 января 2012 г.

Deadline

Dedicated to IT... What does deadline mean for us :)