The target of a copy must exist in Assign. In this recipe, we will show how to create that target if it does not already exist. If the target does not exist, a selectionFault
is thrown.
Open an assignment that causes selectionFailure
faults when an element is not present in the output. It is possible that the target element is not present because an earlier XSLT transform did not create it.
selectionFailure
fault and click on the insertMissingToData menu item. This will cause the target element to be created if it does not already exist:When the insertMissingToData
attribute is set on a copy
statement in Assign, it causes the intended target element to be created if it does not already exist.
The insertMissingToData
attribute only works with the copy assign
subelements; it cannot be used when appending or inserting elements.
The MiscMappings
project in the code samples has a sample BPEL process called MappingBPELProcess.bpel
demonstrating this.