Using the Object BOM Native Type
xsd:any
The Object Type is used to handle sections of XML with an unknown format or where content is not known, but the data of which can still be passed on by the system. BOM Attributes can be defined as Object type (for example, xsd:any). An Object type BOM class attribute can be assigned either another Object attribute, or a BOM class. For example, given the following BOM:
If a Web Service process has the following fields and parameters
Data Field / Parameter | Type | Name |
---|---|---|
Input Parameter | Class1 | inputField1 |
Data Field | Class2 | bomField2 |
Data Field | Class3 | bomField3 |
Output Parameter | Class2 | outputField1 |
Then a script in the process can be written as
bomField2 can be used as the input parameter to another Web Service, which would pass the xsd:any value from the input parameter of one service to the input parameter of another service.
You can also write
which would pass the Business Object bomField3 in an xsd:any type construct in the response XML message for the web service.
Object BOM Native Type attributes can have a multiplicity greater than one, in which case the add() method will be used as usual for assigning values to the field, for example:
xsd:anyAttribute
The xsd:anyAttribute is a very restrictive form of Object BOM Native Type. This type can only be assigned to itself. No other BOM type can be assigned either to or from it.
xsd:anySimpleType
The xsd:anySimpleType is very similar to xsd:any, it behaves in the same manner but instead of taking a BOM Class as its input it takes a primitive type.
xsd:anyType
The xsd:anyType is again similar to both the xsd:any and xsd:anySimpleType. The difference is that it can be assigned either a BOM Class or primitive type. This makes it the most flexible of storage types. One important difference is that if you wish to set the value of an xsd:anyType to the same value as either another xsd:anyType or a Business Object (that is, a BOM Class instance), then you must use ScriptUtil.copy() in order to take a copy of the source object before assigning it to the xsd:anyType.