The Insert action loads an XML node into the FactBase to supplement the initial incoming XML message. This node can be described as a fragment of XML within the business rule or it can be loaded from an external XML file.
The insert action takes two parameters. The first specifies the XML to insert. This can be defined in three different ways, either as the filename of the document to parse in, as an XPath pointing to the location in the FactBase where this filename is contained (XPath to document), or finally as an XML fragment embedded directly in the rule. The second (to location) parameter is an XPath to the location in the FactBase where the information will be added.
For the first option, the file can be chosen by clicking the Choose File link and selecting the required file from the Repository Viewer window. If an XML fragment is being entered, then this should be typed directly into the text area. The entered content must be a valid XML fragment.
The insert action also supports the Merge Option setting to determine how the new content will be inserted.
This second example shows how an XML fragment can be used to define the content to be inserted. In this example, a SOAP Fault structure is being inserted to indicate an error.