Problem with multiple extension assign operations
I noticed this problem using JDeveloper 11.1.1.5 and WebLogic Server Version: 10.3.5.0 and 10.3.4.0 .
When we try to do multiple extension assign operations, only the first one will work and all the others will be ignored.
I made this simple example with 4 insert after operations.
<assign name="Assign"> <copy> <from>$inputVariable.payload/ns1:Vat_Code</from> <to>$outputVariable.payload/ns1:Vat_Code</to> </copy> <copy> <from>$inputVariable.payload/ns1:Vat_Code_Desc</from> <to>$outputVariable.payload/ns1:Vat_Code_Desc</to> </copy> <copy> <from>$inputVariable.payload/ns1:TargetList</from> <to>$outputVariable.payload/ns1:TargetList</to> </copy> <extensionAssignOperation> <bpelx:insertAfter> <bpelx:from>$inputVariable.payload/ns1:TargetList/ns1:Target[1]</bpelx:from> <bpelx:to>$outputVariable.payload/ns1:TargetList/ns1:Target</bpelx:to> </bpelx:insertAfter> <bpelx:insertAfter> <bpelx:from>$inputVariable.payload/ns1:TargetList/ns1:Target[1]</bpelx:from> <bpelx:to>$outputVariable.payload/ns1:TargetList/ns1:Target</bpelx:to> </bpelx:insertAfter> <bpelx:insertAfter> <bpelx:from>$inputVariable.payload/ns1:TargetList/ns1:Target[1]</bpelx:from> <bpelx:to>$outputVariable.payload/ns1:TargetList/ns1:Target</bpelx:to> </bpelx:insertAfter> <bpelx:insertAfter> <bpelx:from>$inputVariable.payload/ns1:TargetList/ns1:Target[1]</bpelx:from> <bpelx:to>$outputVariable.payload/ns1:TargetList/ns1:Target</bpelx:to> </bpelx:insertAfter> </extensionAssignOperation> </assign>
I tested this assign with the following input:
The expected result would be:
<outputVariable> <part name="payload"> <VatCodeDesc> <Vat_Code>123</Vat_Code> <Vat_Code_Desc>123 Description</Vat_Code_Desc> <TargetList> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> </TargetList> </VatCodeDesc> </part> </outputVariable>
But the result was :
<outputVariable> <part name="payload"> <VatCodeDesc> <Vat_Code>123</Vat_Code> <Vat_Code_Desc>123 Description</Vat_Code_Desc> <TargetList> <<ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> </TargetList> </VatCodeDesc> </part> </outputVariable>
As we can see in the audit trail, the assign only made the first insert after operation and ignored the following ones.
The workaround to solve this problem is to isolate each insert after operation in different extensionAssignOperation tags.
<assign name="Assign"> <copy> <from>$inputVariable.payload/ns1:Vat_Code</from> <to>$outputVariable.payload/ns1:Vat_Code</to> </copy> <copy> <from>$inputVariable.payload/ns1:Vat_Code_Desc</from> <to>$outputVariable.payload/ns1:Vat_Code_Desc</to> </copy> <copy> <from>$inputVariable.payload/ns1:TargetList</from> <to>$outputVariable.payload/ns1:TargetList</to> </copy> <extensionAssignOperation> <bpelx:insertAfter> <bpelx:from>$inputVariable.payload/ns1:TargetList/ns1:Target[1]</bpelx:from> <bpelx:to>$outputVariable.payload/ns1:TargetList/ns1:Target</bpelx:to> </bpelx:insertAfter> </extensionAssignOperation> <extensionAssignOperation> <bpelx:insertAfter> <bpelx:from>$inputVariable.payload/ns1:TargetList/ns1:Target[1]</bpelx:from> <bpelx:to>$outputVariable.payload/ns1:TargetList/ns1:Target</bpelx:to> </bpelx:insertAfter> </extensionAssignOperation> <extensionAssignOperation> <bpelx:insertAfter> <bpelx:from>$inputVariable.payload/ns1:TargetList/ns1:Target[1]</bpelx:from> <bpelx:to>$outputVariable.payload/ns1:TargetList/ns1:Target</bpelx:to> </bpelx:insertAfter> </extensionAssignOperation> <extensionAssignOperation> <bpelx:insertAfter> <bpelx:from>$inputVariable.payload/ns1:TargetList/ns1:Target[1]</bpelx:from> <bpelx:to>$outputVariable.payload/ns1:TargetList/ns1:Target</bpelx:to> </bpelx:insertAfter> </extensionAssignOperation> </assign>
With this workaround we get the expected result.
<outputVariable> <part name="payload"> <VatCodeDesc> <Vat_Code>123</Vat_Code> <Vat_Code_Desc>123 Description</Vat_Code_Desc> <TargetList> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> <ns1:Target> <ns1:Name>Item 123</ns1:Name> <ns1:DestinationName>Destination 123</ns1:DestinationName> </ns1:Target> </TargetList> </VatCodeDesc> </part> </outputVariable>
The same problem happens with all the extensionAssignOperation, such as, copyList, append, insertBefore and insertAfter. This workaround works with all of them.
Leave a comment