MDM Application Toolkit for Product Domain
I recently had to build a product bundling process for a demo using BPM and the MDM Application Toolkit(MDMAT). Having built many business processes over the past 2 years using data from InfoSphere MDM I realized this was going to be the first one I that I was to build against the product domain of the physical engine. Using the MDMAT against the Party domain is pretty darn easy and very quickly a rich process can be built that interacts with MDM's library of web services for many different types of processes. How useful would it be for me when operating against the Product Domain, especially when a good chunk of my data was stored in Product domain XML soft specs? Well I'm pleased to say it was also very straight forward. I've written some notes below that will hopefully allow others to also find it just as easy to use the MDMAT against the product domain.
The process was to execute a search against the MDM product domain using some pre defined criteria that would allow me to pull back all products that met a certain criteria. in this case it was to retrieve a list of products that were within the 'Mobile Phone' category of the 'Channels' hierarchy, were aimed at a 'Market Segment' that was 'Affluent' had an 'Effective Date' before today's date and an 'Expiry Date' that was after todays date. This would allow me to show currently active offers on the mobile channel for Affluent customers. The 'Market Segment', 'Effective Date' and 'Expiry Date' attributes were all stored as attributes within an XML spec called 'Offer Attributes'. In the search results that come back from MDM I also needed to pull out some additional attributes that were stored within another XML spec called 'Channel Mobile Phone', these attributes were named 'MobilePhoneHeadline' and 'MobilePhoneSalesText' All of this had to be built in a small amount of time AND display on a mobile device. Fortunatly I knew that with the MDMAT and BPM I at least had a chance of pulling this off pretty easily.
Whenever I build a business process I first start by defining the variables that I will need. Since BPM applications are data driven, I find it helpful to define the data upfront and then worry about wiring them into a process at a later stage. Using the MDM Workbench I exported my MDM WSDL and imported it into Process Designer. This gives me access to my MDM Product business objects within BPM, allowing me to easily construct a ProductSearchBobj object with the criteria I need to execute my search and also create a ProductSearchResultBObj object to hold the results that are returned from the search. In total I decided I needed 4 business objects:
|Object Name||Object Type||Type imported from:||Purpose|
|ProductSearch||ProductSearchBObj||MDM Workbench||Hold Product search criteria|
|ProductSearchResults||ProductSearchResultsBObj||MDM Workbench||Hold Product search result data|
|MDMConnection||MDM_Connection (From MDMAT)||MDM Application Toolkit||Hold MDM server connection credentials|
|diplayObject||DisplayObject||Manually created||To be used by the UI controls to display data|
With the objects defined I could move on to define my process flow. I created a very simple flow to suit the requirements as seen below:
I would first use the 'Configure Spec Search Criteria' node to execute a script to populate the ProductSearch object with the crieteria I needed. I would then configure the 'Retrieve all Offers' node to use the MDM Application Toolkits' Physical MDM Txn service to execute a search an return a list of ProductSearchResults objects. I figured that there would be some simple scripting required to extract the information I would need from the search results XML specs so I created a 'Populate Display Object' node to define a script that would allow me to extract the spec values from the XML and pass into the displayObject. the 'Display All Offers' coach then displays the list of displayObjects in a table and once a user has made a selection the 'View Offer Details' coach displays details for that offer.
With my objects defined and my process defined all I had to do was a little bit of scripting to firstly populate my search and then extract my search results to populate my displayObject. (I had already populated my MDMConnection object with my MDM server's credentials and configured the 'Retrieve all Offers' node to use the MDM Application Toolkit's Physical MDM TXn service to call an MDM 'searchProductInstance' service and pass in my ProductSearch object.)
Populating the Search
I wrote a simple script in my 'Configure Spec Search Criteria' object to pass in the search criteria. I wont include the full script here, but all I had to do was create an instance of a ProductSearch object and set the following attributes:
|Spec Value instance 1|
|Spec Value instance 2|
|Spec Value instance 3|
When passed into the 'Retrieve all Offers' node my search criteria successfully results in a list of products that I am interested in being returned as a list of ProductSearchResultBObj's within my ProductSearchResult object. The final stage is to extract the attributes I need from the results to populate my display Object.
Extracting the spec values and populating the display object
Up until now everything I had done was pretty similar to other processes I had built, this final piece was the most challenging, in that I had never extracted values from an XML spec before within a business process. Looking at my ProductSearchResults object I drilled down into the XMLSpec attribute and noticed that there were no attributes defined within it to store the spec values that were returned from my search. That is because the import of the WSDL into Process Designer can not recognize the type as XML. To solve this problem I manually created objects that represent the XML spec contents. I added a 'ChannelMobilePhone' object that contained two String attributes and also I added an 'OfferAttributes' object that contained three String attributes as per my MDM XML spec. I knew that the MDM Application Toolkit uses the name of the attribute to work out how to populate the object inside the process so by creating the attributes to match the XML spec they will be populated with the values from the XML spec. When I was done my XML spec object looked like this:
With my spec values now populated inside my ProductSearchResults object all that was left was to use a script to iterate through the results and populate my displayObject. This was pretty standard stuff, I just had to ensure I included plenty of null checks in the script but that was as complex as it got. On running my process the results were successfully returned from MDM and the spec values were added to the extra attributes I defined within my XMLSpec attribute. Finally the values from the XML spec were extracted and displayed in my coach screens.
This ended up being a bit of a longer blog post then I intended (sorry JT), but hopefully it will provide you a good starter in using the MDMAT for the product domain. I really enjoyed building this process (and writing this article) as it showed me how cool the MDMAT is for helping me to build MDM centric business processes. The ability to build processes against MDM and not worry about the connection and any complexity in calling MDM Web Services saves a huge amount of time and with a little bit of script I was able to leverage the value of MDM's XML specs. if you want more information drop me an email. I'd love to hear what you are doing.