ibm.EncloseInstancePipeAdded by IBM on July 25, 2013 | Version 1 (Original)
|Encloses one or more XML instances into a form.
By default, this pipe replaces the identified instance (the id denoted by #.name). If it cannot find the instance named, it will append the instance as the final instance in the first data model.
Table 1. Table containing the list of expressions and descriptions for ibm.EncloseInstancePipe
|form||key||The key used to retrieve the Form object from the data bucket.
|instances||list of instances||The list contains a list of maps. Each map contains two parameters: name and load.
Important: The list of instances has to be 1, 2, 3...
|#.name ||string||Name of the instance to enclose.
|#.load ||key||The instance to be enclosed into the form.
|pidOutputs.main ||pipe||Triggers the next pipe in the pipeline.|
EncloseInstancePipe has 2 parameter keys:
- form (resolved type = Form) – The form in which to enclose the instances.
- instances (resolved type = List) – A List of Map objects which contain two key/value pairs: load and name. The load value should resolve to a string, array of bytes, InputStream, or DOM Document, that is the instance. The name value should resolve to a string that is the instance name. If an item in the list is invalid, an error will be logged and the instance containing the error will not be enclosed but the remaining List items will continue to be processed.
The following example encloses an instance into a form and then calls the PreserveMapPipe:
# Setting instance to Form
- Data instances in your form must have an id attribute (#.name). If the data instance in your form does not contain an id attribute, the EncloseInstancePipe will not be able to manipulate the data. To avoid this problem, ensure that you added an explicit id attribute to your XForms instance.