Create and updating Service Data Objects (SDO)
The steps on this page describe how to create or update a service data object genmodel file. A genmodel is an EMF model asset used to generate code. It is initialized from a set of XSD schemas.
Before beginning
- Create a WebSphere Commerceservice module
- Ensure that the EMF genmodel can generate compatible objects
If we are extending an existing WebSphere Commerce noun, you do not need to perform these prerequisite steps - the service module has already been created.
Task info
The examples in this task are based on the service generated in Creating a WebSphere Commerce service module.
Procedure
- Start WebSphere Commerce Developer.
- Update the pattern generated noun with our changes.
- The pattern generated noun definition is located in the following file:
MyServiceModuleName-DataObjects > xsd > OAGIS > 9.0 > Overlays > MyCompany > Commerce > Resources > Nouns > MyBusinessObject.xsd
- Update this schema with the required definition for your logical object model. This file is used to describe your logical object model (noun).
- Save and close the file.
- Generate SDOs from the noun definition.
SDOs are generated using an EMF genmodel. The pattern generates a sample genmodel that must first be updated with the noun definition.
- Expand MyServiceModuleName-DataObjects > ecore.
- Right-click MyServiceModuleName.genmodel.
- Click Reload....
- Select XML Schema and click Next.
- Click Next.
- Click Finish
By default, the genmodel references the WebSphere Commerce foundation data objects. This schema is used by the EMF utility to generate Java classes that represent your noun.
Note: If the custom noun references additional data objects, click Add to add other genmodels.
- The genmodel reloads and opens in Rational Application Developer.
- To generate the SDOs, right click MyServiceModuleName and select Generate Model Code.
- The SDOs representing the noun are generated in MyServiceModuleName-DataObjects > src.
Related concepts
Service Data Objects (SDO)
Related tasks
Generating code from an SDO genmodel file
Updating Service Data Objects