Adding Insert Actions

Use the insert action to insert the result of an XQuery expression at an identified place relative to nodes selected by an XPath expression. The insert action is one of a set of update actions.

Before you begin

These instructions assume you are already editing a message flow in the Edit Message Flow page, as explained in Creating, Editing, and Viewing Message Flows.

To add an Insert action

  1. Navigate to where you want to add the action, as described in Adding and Editing Actions in Message Flows.
  2. Click the appropriate icon, then select Add an Action > Message Processing > Insert.
  3. Click <Expression> to edit an XQuery expression. The XQuery expression is used to create the data that will be inserted at a specified location in a named variable. The XQuery Expression Editor page is displayed. See Creating and Editing Inline XQuery and XPath Expressions.
  4. When you finish editing the expression, select the relative location from the drop-down list. The relative location is used to control where the insert is performed relative to the result of the XPath expression:
    • Before-as sibling before each element or attribute selected by the XPath expression
    • After-as sibling after each element or attribute selected by the XPath expression
    • As first child of-as first child of each element identified by the XPath expression. An error occurs if the result of the XPath returns attributes.
    • As last child of-as last child of each element identified by the XPath expression. An error occurs if the XPath returns attributes.
  5. Click XPath. The XPath Expression Editor page is displayed. See Creating and Editing Inline XQuery and XPath Expressions.
  6. Valid configurations include those in which:

    • XQuery and XPath expressions both return elements.
    • The XQuery and XPath expressions both return attributes-in which case, the XQuery expression must return attributes.
  7. When you finish editing the XPath expression, enter a context variable in the in variable field. The XPath evaluates the contents of this variable. To learn more about context variables, see Appendix A, Message Context.

After you finish

When you complete the configuration of this action, continue by configuring other actions or by saving your configuration, as described in Adding and Editing Actions in Message Flows.