4.2 Managing Operation Data

The driver shim applies special handling to Subscriber commands based on the <operation-data> element. On the Subscriber channel, the <operation-data> element can be added to a command to specify XML data that you want included with the command result. In this way you can match commands with the responses they generate, which is useful for creating associations.

As discussed in Section 1.0, Understanding the Salesforce.com Driver, the <operation-data> element is added to the command from one of the Subscriber channel policies. The driver shim removes the operation data from the command before it is sent to the application, and restores the <operation-data> element (and all child elements) to the resulting response. If needed, rules and style sheets can then access the operation-data element on the result.

4.2.1 Using Operation Data to Specify XML to Be Returned on the Result

The sample configurations for the Salesforce.com driver use the <operation-data> element to keep track of identifying information for a command, so the result can be recognized and associations can be properly assigned. Check these samples for details of how the <operation-data> element is used.

When the <operation-data> element is restored on the response, it appended as a child element of the root node. You can override this by providing one or more parent-node-n attributes to the <operation-data> element, where n is a number beginning with 1 that is incremented for each parent specifier provided. The driver shim looks for parent-node-n attributes. When they are found, the attribute is checked to see if the named node exists. If the node is found, it uses as the parent for the <operation-data> element on the response.