WebSphere Enterprise Service Bus, Version 6.2.0 Operating Systems: AIX, HP-UX, i5/OS, Linux, Solaris, Windows


Using business objects in model groups

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

About this task

Model groups use the tag xsd:choice that you can use to create business objects from a parent business object. The Eclipse Modeling Framework (EMF), however, can cause naming conflicts that may generate an exception. The following example code illustrates how this 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>
Note that there can be multiple instances of the elements named "child1" and "child2",

You should 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 that is used to handle model groups, as shown in the example code below:
set("child1/grandchild/name", "Bob"); 

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

task Task topic

Terms of use | Feedback


Timestamp icon Last updated: 21 June 2010


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wesb620.doc/doc/cpro_modelgroups.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).