Skip to content
February 20, 2014 / Daniel Dias

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>

Assign

I tested this assign with the following input:

TestWS

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>

OutputWS

As we can see in the audit trail, the assign only made the first insert after operation and ignored the following ones.

Audit
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>

OutputWS2

Audit2
The same problem happens with all the extensionAssignOperation, such as, copyList, append, insertBefore and insertAfter. This workaround works with all of them.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: