IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Developing using the JavaScript API > Create business objects

Business object advanced properties

The advanced properties for business objects lets you customize the serialized XML representation of the business object. This XML representation is used by external systems when a business object is part of an exposed web service.

The advanced properties used for serialization purposes are automatically created with appropriate values when you create a business object or import a WSDL file with business objects. It is recommended that you leave these serialization values as they are. Only change a value if you are an advanced user who has a need to override a value. You should be very knowledgeable of all the standard XML elements as defined by the W3C's XML Schema.

You should also have read the web services compatibility topic and the XSD generation pattern for business objects topic which are linked to at the end of this topic. These topics specify restrictions that apply to XML schemas interacting with this product and within this product.

A change will only affect this particular business object. If you had a process application with 100 business objects and you wanted to override an element such as the target namespace in the XML representation for all business objects then you would need to make 100 changes.

The customization is done by selecting and changing a property, saving that configuration of the business object and then clicking View XML Schema to see the XML Schema Definition (XSD) describing the XML representation of the business object. In this section, we will show several examples of values you might change using customization so that you understand the behavior of the using the customization tool.

Any change to serialization values should be tested. If you are using the business object in inbound or outbound web services, for example, this would mean testing those web services after your change. If you are using Integration Designer and your business object is used in an Advanced Integration service, you should test the Advanced Integration service.

The following properties are discussed:


Anonymous Type

Schemas can be built with sets of named types, for example, an InvoiceType. Then elements can be declared such as invoiceCanadian that reference those types. However, if you only need to reference a type once then there is considerable coding overhead. An anonymous type is used for these cases of a single reference.

To specify the value for an anonymous type, select Anonymous Type and select true or false.

You may want to select the false setting as it explicitly states that the type is not anonymous. Anonymous types can cause difficulties as discussed in Web services hints and tips: avoid anonymous types.

If you have read the XSD generation pattern for business objects topic you will also know that the true value is not honoured by the generator. Save your work. Click View XML Schema. Your output should be similar to the following sample.

<xs:schema targetNamespace="http://EH" elementFormDefault="qualified"
	attributeFormDefault="unqualified">
	<xs:complexType name="employee">
		<xs:sequence>
			<xs:element name="employeeNumber" type="xs:int" minOccurs="0"
				maxOccurs="1" nillable="false" />
			<xs:element name="firstName" type="xs:string" minOccurs="0"
				maxOccurs="1" nillable="false" />
			<xs:element name="lastName" type="xs:string" minOccurs="0"
				maxOccurs="1" nillable="false" />
		</xs:sequence>
	</xs:complexType>
	<xs:element name="employee" type="tns:employee" />
</xs:schema>


Exclude from XML

In most cases you would leave this setting as is, which will include your business object in the XML representation; that is, it is set to false. However a type could define some instance fields that you might not want to serialize to an XML representation.

For example, an instance field that has no equivalent in XML as it refers to an internal running process. You may also not want to serialize a lot of data when you know the web service could take some of the data and calculate values itself thus improving performance by reducing the data transferred.

To exclude a business object from the XML representation, select Exclude from XML and select true. Save your work. Click View XML Schema. Your output should be similar to the following sample.

<xs:schema targetNamespace="http://EH" elementFormDefault="qualified"
	attributeFormDefault="unqualified" />


Namespace

Namespace can be used to change the target namespace. The target namespace defines explicitly the elements that belong to this instance of the namespace.

You might want to change the target namespace if you imported a WSDL file and the target namespace for your business object was changed on importation.

To rename the target namespace, select Namespace and enter the target namespace you prefer.

For example: http://www.mycorporation.com/employees. Save your work. Click View XML Schema. Your output should be similar to the following sample.

<xs:schema targetNamespace="http://www.mycorporation.com/employees"
	elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:complexType name="employee">
		<xs:sequence>
			<xs:element name="employeeNumber" type="xs:int" minOccurs="0"
				maxOccurs="1" nillable="false" />
			<xs:element name="firstName" type="xs:string" minOccurs="0"
				maxOccurs="1" nillable="false" />
			<xs:element name="lastName" type="xs:string" minOccurs="0"
				maxOccurs="1" nillable="false" />
		</xs:sequence>
	</xs:complexType>
	<xs:element name="employee" type="tns:employee" />
</xs:schema>


Node Type

Nodes in an XML document can be defined as elements or attributes. A discussion of these types can be read in Principles of XML design: When to use elements versus attributes. In most cases, an element type is used which is the default, so you do not need to set it explicitly. However, you can set it to use an attribute.

To change the type to an attribute, select Node Type and select Attribute. Save your work. Click View XML Schema. Your output should be similar to the following sample.

<xs:schema targetNamespace="http://EH" elementFormDefault="qualified"
	attributeFormDefault="unqualified">
	<xs:complexType name="employee">
		<xs:sequence>
			<xs:element name="firstName" type="xs:string" minOccurs="0"
				maxOccurs="1" nillable="false" />
			<xs:element name="lastName" type="xs:string" minOccurs="0"
				maxOccurs="1" nillable="false" />
		</xs:sequence>
		<xs:attribute name="employeeNumber" type="xs:int" />
	</xs:complexType>
	<xs:element name="employee" type="tns:employee" />
</xs:schema>


Order

Order explicitly sets the order of the complex type's elements. Usually you would leave the order in the XML representation of the business object exactly as it is in the business object editor. However, you might want to change the order if the external web service changed and required the elements to be presented in a specific way.

To change the order of a complex type's elements, select each element and add a number to the Order field to specify the order you want in the XML representation.

For example, suppose the order of an employee complex type is employeeNumber, firstName and lastName and you needed to change it to accommodate a web service order of lastName, firstName and then employeeNumber. You would set employeeNumber to 2, firstName to 1 and lastName to 0. Save your work. Click View XML Schema. Your output should be similar to the following sample.

<xs:schema targetNamespace="http://EH" elementFormDefault="qualified"
	attributeFormDefault="unqualified">
	<xs:complexType name="employee">
		<xs:sequence>
			<xs:element name="lastName" type="xs:string" minOccurs="0"
				maxOccurs="1" nillable="false" />
			<xs:element name="firstName" type="xs:string" minOccurs="0"
				maxOccurs="1" nillable="false" />
			<xs:element name="employeeNumber" type="xs:int" minOccurs="0"
				maxOccurs="1" nillable="false" />
		</xs:sequence>
	</xs:complexType>
	<xs:element name="employee" type="tns:employee" />
</xs:schema>

Create business objects


Related tasks:
Create business objects


Related reference:
Web services compatibility
XSD generation pattern for business objects