ActiveVOS Designer User’s Guide

Copy Operation with Ignore Missing From Data Attribute

Use Ignore Missing From Data to avoid a selection failure when copying data that may not exist in the source variable. If enabled for a copy operation, then any from-spec that selects zero elements, attributes, or text items causes the copy operation to have no effect. The to-spec for the copy operation is not evaluated and nothing changes in the target variable. If this attribute is not enabled, then the regular bpel:selectionFailure fault is raised if the from-spec selects zero items.

Consider the sample below where a customer record could contain special instructions for package delivery. If these instructions exist in the record then they should be copied over to the data sent to the shipping service. If they do not exist, then the default instruction of "NONE" remains in place.

Case 1: Optional Data is Present

Sample data before the copy operation:

<CustomerRecord>
    <Id>100256</Id>
    <ShippingAddress>... </ShippingAddress>
    <DeliveryInstructions>
       Please leave at the back door
     </DeliveryInstructions>
</CustomerRecord>
<ShippingRecord>
    ...
    <SpecialHandling>NONE</SpecialHandling>
</ShippingRecord>

Copy Operation:

<copy ignoreMissingFromData="yes">
   <from>$customerRecord/DeliveryInstructions/text()</from>
   <to>$shippingRecord/SpecialHandling</to>
</copy>

Result after copy operation:

<ShippingRecord>
    ...
    <SpecialHandling>Please leave at the back door
    </SpecialHandling>
</ShippingRecord>

Case 2: Optional Data is Missing

Sample data before the copy operation:

<CustomerRecord>
    <Id>100256</Id>
    <ShippingAddress...>... </ShippingAddress>
</CustomerRecord>
<ShippingRecord>
    ...
    <SpecialHandling>NONE</SpecialHandling>
</ShippingRecord>

Copy Operation:

<copy ignoreMissingFromData="yes">
   <from>$customerRecord/DeliveryInstructions/text()</from>
   <to>$shippingRecord/SpecialHandling</to>
</copy>

Result after copy operation:

<ShippingRecord>
    ...
    <SpecialHandling>NONE
    </SpecialHandling>
</ShippingRecord>

For further details on selection failure settings, see: Using the ActiveVOS Disable Selection Failure Fault Extension.