Using the MDM Application Toolkit to build MDM-centric business processes, Part 2: Performing CRUD operations against MDM using the Application Toolkit

This is the second in a series of articles that describe how to create process applications for master data by using IBM Business Process Manager (BPM). Specifically, this series refers to the InfoSphere Master Data Management (MDM) Application Toolkit and IBM BPM 8.0.1, both of which are provided with InfoSphere MDM 11.0. This article focuses on extending the Hello World scenario to perform a full set of create, retrieve, update, and delete (CRUD) operations against an MDM operational server. The article shows you how to create human services quickly and simply within BPM to drive operations on the MDM server. I start by constructing a create process, and then proceed with update, delete, and retrieve. This article focuses on the speed and simplicity with which you can create CRUD business processes using the MDM Application Toolkit. While more advanced interactions are possible, they are deferred for later articles in the series

Doug Cowie (doug.cowie@uk.ibm.com), Software Engineer, IBM

Doug CowieDoug Cowie is a software engineer on the MDM Application Toolkit team at IBM's Hursley labs. He joined IBM after finishing his Master's degree at the University of Bristol, and has previously worked on the User Interface Generator and other projects.



24 October 2013

Overview

This article demonstrates how to use the MDM Application Toolkit to create a simple CRUD Human Service. The building blocks for performing these kinds of operations in BPM are integration service nodes. The MDM Application Toolkit provides a range of these integration services. In this article, you use the MDM Create, MDM Update, MDM Get, and MDM Delete integration services. These are easy to use, simplified integration services that facilitate the rapid development of MDM enabled business processes. The MDM Application Toolkit also provides integration services for interacting with the hierarchical tree Coach View and for performing advanced physical operations against an MDM server. These integration services will be described in subsequent articles in this series.


Preparing to build the services

The MDM Application Toolkit provides the integration services. To use those integration services, data types are required for the input and output parameters. Some of these data types are part of the Application Toolkit, such as the MDM_Connection business object. An instance of this business object is required by each of the four integration services that are covered in this article because the MDM_Connection data type specifies which MDM server to perform operations against.

Additionally, business objects that represent the data model of the MDM server are required. The simplest way of creating these business objects is using the BPM feature that creates business objects from a WSDL file. To make this process easier, the MDM Workbench has a wizard to create and export an appropriate WSDL file from a virtual or physical MDM environment.

Building a Create Coach

Continuing from the previous article in the series, this article assumes that you have already imported the virtual data types and have created a simple search operation in the IBM Process Designer.

  1. To build the CRUD Coach, first create a new Human Service, and call it CRUD Process.
  2. Drag a Coach on to the human service and call it create.
  3. Switch to the Variables tab and create two private variables.
    • Call the first variable connection, and set its type to be MDM_Connection. Select the Has Default check box. Copy in the connection details that you used for the Search and Results Process in the article in Part 1 of this series.
    • Call the second variable newPerson and set the type to PERSON.
    Figure 1. Screen capture of variables needed for the Create Coach
    A screen capture of Process Designer showing the creation of variables needed for a Create service
  4. Switch to the Coaches tab and create a coach for two sets of attributes. The first set of attributes is for the LGLNAME business object and the other set is for the HOMEADDR business object.

I used a combination of BPMs Vertical Section and Horizontal Section layout controls to build the coach shown in Figure 2. To create all the attribute fields (textboxes, and so forth), expand newPerson under the Variables part of the Palette and drag the LGLNAME and HOMEADDR business objects onto the Coach.

Figure 2. Screen capture of the Create Coach
A screen capture of Process Designer showing the creation of a coach for the Create service

Now, you can initialize the newPerson object. You need to fill the srcCode attribute of the MEMHEAD so that the MDM operational server knows which data source to add the record to. You also need to initialize the parts of the PERSON object you will be using in the Coach.

  1. Switch to the Diagram view and select the Create Coach.
  2. In the Properties view, select the Pre & Post tab. In the Pre-execution Assignments area, initialize the newPerson variable with the following values:
    tw.local.newPerson = new tw.object.PERSON();
    tw.local.newPerson.MEMHEAD = new tw.object.MEMHEAD();
    tw.local.newPerson.MEMHEAD.srccode = "MOD";
                            
    tw.local.newPerson.LGLNAME = new tw.object.MEMNAME();
    tw.local.newPerson.HOMEADDR = new tw.object.MEMADDR();
  3. Drag a Nested Service from the Palette and call it do create and set the Attached Nested Service to MDM Create. Under the Data Mapping tab, set Connection to the connection object and set inputObject to newPerson.
Figure 3. Screen capture of the diagram for the Create Coach.
A screen capture of Process Designer showing the diagram of the Create service

At this point, you are almost ready to run the Create Coach. You just need to wire up the nodes. Connect the Start node to the create Coach. Connect the create Coach to the do create node. Then connect that to the End node.

If your server is set up correctly, running the process and entering data into the fields on the Coach should result in a person being created. The Create integration service does not return anything, it simply creates the person. If it fails, an error is thrown.

As you can see, this is very similar to the search process that you created in Part 1 of this series of articles. In fact, all the processes are very similar. The update and delete Coaches are almost identical to the Create Coach. The only differences are with the inputObject parameter. Both the Update and Delete Coaches require that certain fields are populated in the MEMHEAD part of the object. As long as the object has been loaded from the MDM operational server, all of the necessary fields will be populated.

Building a Get Coach

To load an object from the MDM operational server, you must perform a Get operation. Use the same human service as before, and create a new Coach:

  1. Name the Coach Menu and insert it between the Start node and the create Coach.
  2. On the Menu Coach, place two buttons. Label one button Create and the other button Get.
  3. Connect the Create button to our create Coach, and change the line coming from Start so that it now points to the Menu Coach.
  4. Because the Get operation returns data that you want to view, you need to create two Coaches with a Nested Service in-between the Coaches. Call the first Coach get, the nested service do get, and the final Coach person. Your diagram should now look like Figure 4:
    Figure 4. Screen capture of the updated diagram for Get
    A screen capture of Process Designer showing the updated diagram used for the Get service.
  5. After you create these nodes, switch to the Variables tab.
  6. Create two PERSON variables and one NameValuePair variable. One of the PERSON objects is used to tell the server which record to return. The other variable is the result of the Get operation. Call the first variable personToGet, the other variable result, and the NameValuePair object params. The NameValuePair object holds parameters for the operation. Set the NameValuePair Is List to true.
    Figure 5. Screen capture of variables needed for Get
    A screen capture of Process Designer showing the addition of variables needed for a Get service
  7. Switch to the Coaches view. The get Coach is used to populate the criteria for the Get operation. The person Coach is used to display the retrieved object.
  8. Select the get Coach and expand the Variables section of the Palette. Find the personToGet object, expand it, and then expand the MEMHEAD attribute. Drag the ENTRECNO attribute onto the Coach.
    Figure 6. Screen capture of the coach used to provide input to the Get operation
    A screen capture of Process Designer showing the coach used to provide input to the Get
  9. Switch to the person coach. From the result object, drag a couple of attributes onto this Coach. In Figure 7, you can see the MEMHEAD, LGLNAME, and HOMEADDR attributes:
    Figure 7. Screen capture of the Coach used to display results of the Get operation
    A screen capture of Process Designer showing the coach used to display results of the Get
  10. Return to the Diagram view. Click the do get service and in the Properties tab, set the Attached Nested Service to the MDM Get integration service.
  11. On the Data Mapping tab, set the following mappings:
    • The Connection to the connection object
    • The inputObject to the personToGet object
    • The Parameters to the params object
    • Under Output Mapping set the result to the result object.
  12. On the Pre & Post tab under Pre-execution assignments, specify the following values to configure the parameters object:
    tw.local.params = new tw.object.listOf.NameValuePair();
                            
    tw.local.params[0] = new tw.object.NameValuePair();
    tw.local.params[0].name = "entType";
    tw.local.params[0].value = "id";
                            
    tw.local.params[1] = new tw.object.NameValuePair();
    tw.local.params[1].name = "memType";
    tw.local.params[1].value = "PERSON";

The params object is used to tell the MDM operational server what entity and member types we are trying to interact with. These types are defined in the virtual MDM configuration.

You now need to connect the nodes in the Diagram. Connect the Menu Coach to the get Coach. Connect the get Coach to the do get service. Connect the do get service to the person Coach. Finally connect the person Coach to the End node.

In order to return an object, you will need to know its MEMRECNO value. To find the MEMRECNO, you can either run the Inspector application or use the Search integration service from the previous article.

Building an Update Coach

The Update and Delete operations are quite similar, and you will add them onto your existing service:

  1. On the Coaches view, select the person Coach.
  2. Drag a button onto the bottom of this Coach and change its label to Update.
  3. On the Diagram view, drag a Nested Service near to the person Coach and call the nested service do update.
  4. Configure the do update nested service to run the MDM Update integration service. Under Data Mappings, set the Connection to be the connection object. Set the inputObject to the result object.
Figure 8. Screen capture of the diagram with the Update node
A screen capture of Process Designer showing the diagram modified to run an Update service

By using the result object, if a user makes changes to the data on the person Coach, the changes can then be sent back to the operational server simply by clicking the Update button. It would also be easy to use BPM to send the changes for a review before the changes are submitted back to the MDM operational server.

To complete the Update, connect the person Coach to the do update nested service, and the service node to the End node.

To confirm that the integration service works, you need to run the process twice and check that your changes are being retrieved from the operational server the second time.

Building a Delete Coach

To create the Delete service, the steps are similar to the steps that you used to build the Update Coach:

  1. Create a new button for the Delete service in the person Coach.
  2. Drag a nested service onto the diagram.
  3. Configure the nested service to use the MDM Delete integration service.
  4. Set up the Data Mappings using the same setting that you used for the Update service.
  5. Connect up the diagram the same way that you did for the Update service.
Figure 9. Screen capture of the diagram with Delete
A screen capture of Process Designer showing the diagram modified to run an Delete service

Conclusion

You have now experienced just how easy it is to create CRUD operations for MDM-centric business processes using IBM Process Designer and the Application Toolkit. While this is clearly a simplified demo, with your MDM business objects represented in Process Designer, you can use the great features to create visually stunning coaches and complex workflows. These simple-to-use integration services enable decision making within MDM's rich workflow engine, powered by IBM BPM, to be based on high quality master data. In addition, you can use the integration services to create MDM-centric applications quickly and easily with minimal code.

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Information management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management, Business process management
ArticleID=949734
ArticleTitle=Using the MDM Application Toolkit to build MDM-centric business processes, Part 2: Performing CRUD operations against MDM using the Application Toolkit
publish-date=10242013