IBM® WebSphere® Process Server relationship service provides capabilities that enable integration developers to correlate properties that may have different values but have the same semantic meaning across a group of related business objects. There are two primary relationship types: dynamic and static. Dynamic relationships are typically used to correlate primary keys from a set of related business objects, whereas static relationships are typically used to correlate non-primary key properties. This article discusses dynamic relationships, Part 1, Static relationships shows you how to build static relationships using IBM WebSphere Integration Developer, and Part 3 (coming soon) focuses on dynamic composite relationships.
The business scenario used in this article assumes that the IBM Corporation has three different enterprise systems that have a representation of customer. The IBM IT organization has determined the need to integrate these three systems and provide a single composite canonical representation of the customer inside a Customer Relationship Management (CRM) Hub enabling customer relationship business processes to be developed independent of the existing Enterprise Information Systems (EIS).
Each enterprise system, SSA Global, SAP, and an IBM DB2® relational database, all have a representation of customer that contains a property named
id, which represents the primary key. Each of these three systems generate the value of id. For example, the SSAGlobal system generates an id of 1 for
customer, John Doe; the SAP system generates an id of 10 for the same customer, John Doe; and the DB2 system generates an id of 10A for John Doe.
The id for the GBO customer in the canonical space is generated by the hub, which is 1.
The dynamic relationship in this scenario correlates these four representations of customers that are basically the same customer but have different primary keys.
During the execution of this business integration application, the dynamic relationship is invoked when an incoming (or outgoing) event containing the customer business object is exchanged between the external systems and the CRM Hub. Those events are intermediated using the interface map component, which results in the invocation of a business object map. The business object map transforms the system-specific representation of the customer to/from the canonical representation. During that process, the business object map transforms the source id property to the target id property. This transformation is performed using the relationship service to lookup the correlated data for the pertinent source and target roles. The following diagram depicts the scenario:
Figure 1. Business scenario
To demonstrate how dynamic relationships can be used to solve this business scenario, let's' develop the following artifacts:
- Four business objects (SSA Global, SAP, DB2, and Canonical) and two business graphs (SSA Global BG and Canonical BG).
- A dynamic relationship containing four roles (a role for each business object).
- Two business object maps, one that invokes the dynamic relationship to perform a transformation on the id property and another business graph map that calls the business object map.
- An interface map with a source interface and a target interface that invokes the business object map.
This article assumes that you are familiar with creating Business Objects, Interfaces, Interface Maps, and Business Object Maps.
In this step, create the four business objects and two business graphs required by the subsequent steps.
- Start IBM WebSphere Integration Developer.
- Create a new module named
CRM, (choose File => New => Project). - Create a customer business object for the three enterprise systems and a fourth for the canonical representation. For simplicity sake, the example
uses the same property names for each of the business objects. Use the following to create each business object:
Figure 2. Business Objects
-
Create the following properties and property types for each of the four business objects:
Figure 3. SAPCustomer and SSACustomer
Figure 4. JDBCCustomer and GBOCustomer
- Dynamic relationships need the verb or the change summary information in the business graph. Hence you need to create business graphs for the business objects. In this scenario, you create only for the SSAGlobal and the canonical business objects. You can create the rest of the business graphs to create a complete end-to-end scenario.
- Right-click on the business objects and select Create a Business Graph.
Figure 5. SSACustomerBG and GBOCustomerBG
Now that you've created the business objects, you can create the relationship. The relationship defines a dynamic relationship for the primary key id property for each of the four business objects.
- Create a relationship, (choose File => New => Relationship).
- In the first panel, specify the target namespace:
http://www.ibm.com/rels/CustomerIdand nameCustomerId. - Click Next.
Figure 6. Create the relationship
- On the next panel, keep the defaults. This indicates that the relationship will be created for a primary key property named: id.
Figure 7. Create the relationship
A role must be associated with each business object that participates in the relationship. The role represents metadata that describes which
property in the business object will be correlated to the properties described in the others roles that are part of the relationship. Thus for
this scenario, create four roles, one for each of the customer business objects.
To create each of the four roles, select the Add Role icon from the
relationship editor pictured below:
Figure 8. Add Role
A dialog then pops up where the business object associated with the role can be selected. Select the business object and click Ok. Repeat this until you have created a role for each of the business objects (JDBCCustomer, SSACustomer, SAPCustomer, and GBOCustomer).
Each role has its target namespace and name automatically generated. It is a good idea at this point to update the target namespace, name, and display name for each role. To do this:
- Select the role.
- Select Properties from the horizontal list of items below the roles.
- Select Description from the vertical list of items below the Properties tab.
- Update the Name, Display Name, Targetnamespace attributes using values from the following table:
Figure 9. Role names
- Repeat this for all four roles.
The canonical role (GBO) is a managed role for this identity relationship. This means that the GBO's ids are generated by WebSphere Process Server Relationship Service.
- Select the GBO role.
- Select Properties from the horizontal list of items below the roles.
- Select Details from the vertical list of items below the Properties tab.
- Check the Managed checkbox.
Figure 10. Mark Managed Role
Each of the four roles must now have its key set to the property that correlates across the relationship (for example, id). To set the key property (alias, key attribute):
- Select the role.
- Select the icon labeled Add KeyAttribute. See Figure 11 for an example:
Figure 11. Add the Role Key Attributes
- This pops up a dialog of all the properties in the business object associated with the role. For this scenario, select id.
- Repeat this for all four roles.
Identity relationship definition summary
At this point, you have defined the dynamic relationship. This relationship defines enough information to enable the id property to be canonicalized and decanonicalized during the transformation of the EIS customer business objects to/from the canonicalized customer business object. To demonstrate each of the integration relationships between the CRM Hub and the external systems, three interface maps and six corresponding sets of business object maps would need to be developed to handle these integration scenarios:
- SSA Global to/from the CRM Hub
- SAP to/from the CRM Hub
- DB2 to/from the CRM Hub
To keep this example simple, create the interface map for SSA Global to/from the CRM Hub using a simple set of source/target interfaces. Then create two business object maps to handle the inbound scenario where an SSA Global customer business object is transformed to a canonical customer business object and a SSA Global customer business graph is transformed to a canonical customer business graph. You can create the remaining two interface maps and five business object maps is extra credit!
Create the business object map
Create a business object map to transform a SSA Global business object to a canonical business object. Use the relationship transformation to transform the source business object's id property to the target business object's id property.
- Create a business object map, (choose File => New => Business Object Map).
- On the first panel, name the business object map
SSACustomerToGBOCustomerand specify the target namespacehttp://www.ibm.com/maps. - Click Next.
- On the second, panel select SSACustomer as the input and GBOCustomer as the output.
- Click Finish.
- Create a Relationship transformation between the SSACustomer to the GBOCustomer business objects.
- Create a Move transformation between every property of SSACustomer to the same property in GBOCustomer with the exception of id.
Figure 12. SSACustomerToGBOCustomer Map
Dynamic relationships depend on the verb property or change summary information contained in the business graph to do automatic maintenance of role instances. Since the verb property is set to a business graph, you need to create a business graph map that further calls the above submap that contains the relationship transform. This map transforms an SSA Global business graph to a canonical business graph.
- Create a business object map, (choose File => New => Business Object Map).
- On the first panel, name the business object map
SSACustomerBGToGBOCustomerBGand specify the target namespacehttp://www.ibm.com/maps. - Click Next.
- On the second panel, select SSACustomerBG as the input and GBOCustomerBG as the output.
- Click Finish.
- Create a Submap transformation between the SSACustomer to the GBOCustomer business objects.
- Create a Move transformation between the verb property of SSACustomerBG to the verb property in GBOCustomerBG.
Figure 13. SSACustomerBGToGBOCustomerBG Map
Prior to creating an interface map that invokes the SSACustomerBGToGBOCustomerBG map, create a source and target interface for the interface map.
- Create a source interface, (choose File => New => Interface).
- Name the interface
SSAEventand give it the target namespacehttp://www.ibm.com/interfaces/ssa. - Add a request/response operation named
processEvent. - Add an input message named
ssaCustomerBGof typeSSACustomerBG.
Figure 14. Interface SSAEvent
- Create a target interface, (choose File => New => Interface).
- Name the interface
GBOEventand give it the target namespacehttp://www.ibm.com/interfaces/hub. - Add a request/response operation named
processEvent. - Add an input message named
gboCustomerBGof typeGBOCustomerBG.
Figure 15. Interface GBOEvent
Create the interface map for the SSA Global to/from the CRM Hub.
- Create a source interface, (choose File => New => Interface Map).
- Name it
SSACustomerBGToFromGBOCustomerBGand give it the target namespacehttp://www.ibm.com/interfaceMaps. - Click Next.
- Select the Source interface as the SSAEventBG interface.
- Select the Target interface as the GBOEventBG interface.
- Click Finish.
- Connect the processEvent operations.
- Select the line that connects the processEvent operations to view the Parameter mappings.
- Connect ssaCustomerBG to gboCustomerBG.
- Select move and then select Properties from the horizontal tab below the Parameter mappings.
- Select Description.
- Change move to map.
Figure 16. Create the Interface Map
- Select Details.
- Select SSACustomerBGToGBOCustomerBG for the Business Object Map.
Now set up the assembly diagram to test the relationship via the interface map component.
- Open up the assembly diagram.
- Drag the Interface Map SSACustomerToFromGBOCustomer onto the assembly diagram surface.
- Drag a Java™ component onto the assembly diagram surface.
- Wire the Interface Map to the Java component. The Java component is needed so that the unit test environment can run without throwing an exception when it tries to resolve the interface map reference.
- At this point, you can test the component with your test server.
- Right-click on the Assembly Editor and select Test ModuleThis starts the test server and deploy the DynamicRelationship module to the test server.
- This brings up the Test Run Window with the business object.
- Change the verb to
Create. - Enter
1as the id value. - Enter
Johnas the firstName. - Enter
Doeas the lastName.
Figure 17. Test the run result
- Click Continue.
- Click on the Request in the Events side of the window.
Figure 18. Test the run result
When the interface map is invoked with the business object SSACustomerBG, it calls the map which in turn calls the submap. The submap SSACustomerToGBOCustomer will invoke the relationship with the SSACustomer role. The verb is set to create. This invocation will cause the relationship service to generate a unique id for the GBOCustomer role. In this case, the id is 7. Relationship service will now save this correlation information of SSACustomer with id 1 corresponds to GBOCustomer with id 7. From here on, when an update or delete is sent through the system for the SSACustomer with id 1 and relationship is invoked, it will be able to map it to the correct GBOCustomer id which is 7.
This article shows how you can create an identity relationship, call the relationship from a map, create an interface map that calls the map, and test the relationship on the server.
-
WebSphere Process Server relationship service, Part 1: Static relationships
-
IBM WebSphere Business Process Management Version 6.0 information center
-
WebSphere Business Integration zone
-
WebSphere Process Server and WebSphere Integration Developer resources
-
WebSphere Education
-
WebSphere technical podcast series
-
Redbook: Technical Overview of WebSphere Process Server and WebSphere Integration Developer
-
IBM WebSphere Developer Technical Journal
Comments (Undergoing maintenance)





