Creating target elements in Assign

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.

Getting ready

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.

How to do it...

  1. Right-click to the left-hand side of the assignment that causes the selectionFailure fault and click on the insertMissingToData menu item. This will cause the target element to be created if it does not already exist:
    How to do it...

How it works...

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.

There's more...

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.

See also

  • The Ignoring missing elements with Assign recipe in this chapter
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.37.191