IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Business objects programming > Programming techniques > Create nested business objects

Use business objects in model groups

You create the model group path patterns when working with nested business objects that are part of a model group.

Model groups use the tag xsd:choice that you can use to create business objects from a parent business object. The business object framework, however, can cause naming conflicts that can generate an exception. The following example code illustrates how naming conflicts can occur:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 targetNamespace="http://MultipleGroup">
  <xsd:complexType name="MultipleGroup">
    <xsd:sequence>
      <xsd:choice>
        <xsd:element name="child1" type="Child"/>
        <xsd:element name="child2" type="Child"/>
      </xsd:choice>
      <xsd:element name="separator" type="xsd:string"/>
      <xsd:choice>
        <xsd:element name="child1" type="Child"/>
        <xsd:element name="child2" type="Child"/>
      </xsd:choice>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

there can be multiple instances of the elements named "child1" and "child2",

Use the Service Data Object (SDO) path patterns for model groups to resolve these conflicts.


Results

You would get arrays that use the SDO path pattern used to handle model groups code:

set("child1/grandchild/name", "Bob"); 

set("child11/grandchild/name", "Joe"); 

Create nested business objects