Extending IBM InfoSphere Master Data Management

Transcription

Extending IBM InfoSphere Master Data Management Serverusing the MDM WorkbenchTony Garrard (garrard@uk.ibm.com) and Matt Lovett (mlovett@uk.ibm.com)All Rights ReservedVersion 2.0 Copyright International Business Machines Corporation 2009, 2010Page 1 of 35

ContentsTrademarks .3Introduction.3Prerequisites.3Additional References.4Setting up the Development Environment.4Preparing to run the Setup Wizard.4Running the Setup Wizard .4WebSphere Configuration .7MDM Configuration and Deployment.8Database Information.9Resolving problems that occur during setup and configuration .10Setup Wizard Task Descriptions.10Importing the MDM Resources .10Modify the Web Service Configuration.11Configuring the WebSphere Application Server .11Creating the database .12Deploying the MDM EAR.13Deploying the MDM Configuration .13Verifying the Install .13Restoring the setup tool .14Creating a new Hub Module .14Creating an Addition.16Code Generation .19Merging CustomerResources.20Configuring the domain .21Adding an Entity Extension .21Sharing the code.25Sharing the workspace .25Sharing the model .27Testing the Extensions .27Testing the addition using Web Services.28Testing the addition using the service controller bean.30Appendix A: Web Services Test sample code.31Appendix B: Service controller sample code.33 Copyright International Business Machines Corporation 2009, 2010Page 2 of 35

TrademarksIBM , DB2 , InfoSphere , Rational and WebSphere are trademarks of InternationalBusiness Machines Corporation in the United States, other countries, or both.EJB, Java, Java Naming and Directory Interface, JDBC, J2EE, and all Java-basedtrademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries,or both.Other company, product, or service names may be trademarks or service marks of others.IntroductionThe IBM InfoSphere Master Data Management (MDM) Server 9 provides a solution formanaging enterprise data.The framework provides a comprehensive data model and associated business servicesthat can be extended to create a customized solution tailored to your business.This article provides guidance on how these extensions are developed using the MDMWorkbench supplied with the MDM Server product. The following topics are discussedwith the use of examples to help you get started: Setting up your development environmentAdding new entities to the data modelCustomizing entities within the data modelThe use of code control systems to manage generated artifactsMethods for testingThe majority of this whitepaper is also applicable to the IBM InfoSphere MasterInformation Hub (MIH). The MIH workbench provides similar capabilities to the MDMWorkbench, allowing the user to add new entities to the application.Prerequisites IBM Rational Application Developer for WebSphere Software (RAD) 7.5.4or IBM Rational Software Architect (RSA) 7.5.4 installed (without the WebService feature pack as it is incompatible with the MDM Workbench)The MDM Workbench 9.0.0.2 installed on RSA/RADThe WebSphere 7.0.0.5 test environment installed on RSA/RADDB2 9.5 fixpack 4 installed onto the same machine as the RSA/RAD toolingAccess to the MDM900 WAS AIX.tar.gz file supplied with the MDM Serverdistribution mediaMDM Server version 9 can be deployed onto either WebSphere Application Server 6.1 or7.0.0.5. Throughout this article version 7.0.0.5 will be used. The versions and fixpack Copyright International Business Machines Corporation 2009, 2010Page 3 of 35

levels of the pre-requisite software are important and are documented in the MDMWorkbench infoCenter.Additional ReferencesTo complement the information provided in this document, additional information can befound from the following sources:The MDM Workbench developerWorks dmworkbenchMDM Workbench developerWorks kbench-developerworks-forumSetting up the Development EnvironmentBefore you can develop extensions to the MDM platform it is necessary to prepare theRSA workspace by running a setup wizard. This section outlines the recommended setupprocedure. More information on the individual tasks within the wizard can be found laterin this article.Preparing to run the Setup WizardPrior to running the setup wizard, the workspace preferences must be configured asfollows.Enable J2EE developer capability in RSA1. Click Window Preferences to open the Preferences dialog.2. Click General Capabilities.3. Confirm the J2EE Developer capability is enabled.Select the WebSphere 7 JRE as the default1. Click Window Preferences to open the Preferences dialog.2. Click Java Installed JREs.3. Confirm the WebSphere Application Server v7.0 JRE is selected.The WebSphere 7 JRE will not be available unless you have installed the WebSphereApplication Server 7 Test Environment. This feature is required before running the setupwizard.Running the Setup WizardTo run the setup wizard: Copyright International Business Machines Corporation 2009, 2010Page 4 of 35

Click File New Other. The New wizard opens.On the Select a wizard page select InfoSphere Master Information Hub Development and Test Environment.Click Next.You will then see a dialog detailing all the tasks that can be run.Figure 1: The Development and Test Environment wizardFigure1.PNGEach setup task is explained in more detail later in this document.If the wizard has been run previously, the “Restore the Development Environment SetupTool” task should be run on its own prior to running any other task. This ensures that no Copyright International Business Machines Corporation 2009, 2010Page 5 of 35

residual information from a previous run has been left within the tool configuration, andclears the saved information from the following pages of the wizard.While it is possible to run all of the setup tasks in one step, it is recommended to run thefirst 5 tasks, up to “Create an Application Database”. Then verify that your workspacesecurity settings match those of the application server (see this section). Once this iscomplete then re-launch the setup wizard and invert the selection to choose the remaining8 tasks.It is important to note that running the wizard turns off the workspace “BuildAutomatically” option. If you wish to re-enable automatic builds then select “BuildAutomatically” from the Project menu.When working through the wizard the following additional dialogs will be displayed toinput the required information. Some of the tasks do not require all of this information sosome dialogs may be omitted. Copyright International Business Machines Corporation 2009, 2010Page 6 of 35

WebSphere ConfigurationFigure 2: WebSphere ConfigurationFigure2.PNGFor the WebSphere Configuration:1. Choose the WebSphere version. For this article we are using version 7.0. Selectingthe WebSphere version will automatically configure the “WebSphere home”.2. Select the required profile from the “Profile Name” drop-down box. If you havenot yet created a WebSphere Application Server profile, use the “Create Profile”button to launch the Profile Management Tool. Selecting a profile will fill in thecorrect values for the bootstrap port, node name, and cell name.3. In “Backup profile at” specify the directory where the profile backup will beplaced.4. In “Application distribution file” specify the location of the MDM Distributionfile.5. In “Unpack distribution to” specify where the distribution will be unpacked. Copyright International Business Machines Corporation 2009, 2010Page 7 of 35

MDM Configuration and DeploymentFigure 3: Application Configuration and DeploymentFigure3.PNGFor the Application Configuration and Deployment:1. Click the “Detect host name” button to add in your machines host name, or type‘localhost’.2. The “Deployment name” is defaulted to MDMServer.3. In the “Temporary output folder” specify the folder or pathname where the MDMEAR from your workspace will be exported to. Copyright International Business Machines Corporation 2009, 2010Page 8 of 35

Database InformationFigure 4: Database InformationFigure4.PNGFor the database information panel:1. Check that the “Database home” is set to the correct location. This should be DB2 INSTALL LOC/java2. Specify the username and password for the user that will create the database3. Specify the name of the database.Before you can continue from the database information panel you must click the “TestConnection” button. This will validate the database settings and once the settings havebeen successfully checked, the Next and Finish buttons will be enabled.Once all the required information has been specified, clicking the Finish button willexecute the selected setup tasks. Copyright International Business Machines Corporation 2009, 2010Page 9 of 35

Resolving problems that occur during setup and configurationIf you are having issues with the development setup, you will need to examine the logs todetermine where the error occurred.Logging of the tasks is done in several areas: c:\test\ DevEnvSetup.log logs the actions of the wizard (the directory must existfor this log to appear). ternal.automation\automationLog.log logs the output of the tasks. Database logs are found within the database scripts in the MDMDatabase project.For each set of scripts you will find a “localrun” folder that contains the output. WORKSPACE\CustomerResources\logs will contain the logs generated by theserver. You may need to refresh the project in the workspace before you can seethe log files. ManagementAgent.log and ManagmentConsole.log will show theactivity of the “Deploy Configuration” task. The location of these log files isconfigured in the CustomerResources/properties/Log4J.properties file.Setup Wizard Task DescriptionsThe following sections give more details and explanations for each of the tasks availablein the Development and Test Environment wizard.Importing the MDM ResourcesTasks Involved: Import Application Projects into WorkspaceCustomize Configuration FilesTask Details:These tasks are responsible for setting up the workspace within RSA/RAD.The task “Import Application Projects into Workspace” performs several actions:1.2.3.4.Extracts the MDM application and resources into the specified unpack location.Imports the MDM EAR and the EAR manifest file into the workspace.Updates the classpath settings for the MDM projects.Imports the database scripts (from the MDM/database folder within the unpackedlocation) into a project called MDMDatabase.5. Creates a CustomerResources project and unzips the properties.jar andDWLSchemas.jar into this project.6. Imports the ManagementAgent and ManagementConsole (from the MDM folderwithin the unpacked location) into the workspace. Copyright International Business Machines Corporation 2009, 2010Page 10 of 35

The task “Customize Configuration files” modifies property files in theCustomerResources, ManagementAgent and ManagementConsole to match theconfiguration details that were specified in the wizard. It also sets the databaseconfiguration found in the dwl-config.xml file within the DWLCommonServicesEJBproject.Modify the Web Service ConfigurationNote that the wizard does not configure the MDM Web services to match the securityattributes of your app server. The default is security enabled. If this does not match thesecurity settings of your app server then you must reconfigure Web services. In each ofthe WSEJB projects, there are 2 files found in the folder ejbModule/META-INF in the same folder there are example files with the suffixSecurityEnabled/SecurityDisabled. You will need to copy the contents of the files thatmatch your WAS security setting into the above two files.Configuring the WebSphere Application ServerTasks Involved: Backup WebSphere profileConfigure WebSphere profileTask Details:There are two tasks associated with configuring the application server:The “Backup WebSphere Profile” task will backup the profile to the directory specified inthe wizard.The “Configure WebSphere Profile” task creates all the required application serverresources, including Message Queues and JDBC Connections. It also sets the serverclasspath to include resources held in the CustomerResources project. This enablesdevelopers to configure the MDM Server directly within the CustomerResources folderwithout having to repackage the configuration into the appropriate jars held in the EAR.The classpath setting can be checked using the WAS admin console.1. Select your server from Servers / Application Servers.2. From Server Infrastructure, expand Java and Process Management.3. Choose Process Definition, and from Additional Properties select Java VirtualMachine.4. From General Properties confirm the classpath settings that point to the resources. Copyright International Business Machines Corporation 2009, 2010Page 11 of 35

Figure 5: Verifying the WAS classpathFigure5.PNGTo validate that the task has completed successfully, use the WAS Admin console andcheck that the jdbc/DWLConfig Data source has been created. This task must completesuccessfully or deploying the MDM EAR to WAS will fail.Creating the databaseTasks Involved: Create an Application DatabaseTask Details:The “Create an Application Database” task will create the required DB2 database. Thedatabase created using the task will have full Compound Triggers with Delete (more aboutthis on creating the new MDM Module). It will also have data set to the insuranceindustry. This may not match the choices you make when installing MDM Server, but isadequate for a development and test environment.To use Oracle as your database, you should refer to the Tech note “Setting up the MDMServer development environment with WebSphere Application Server and an Oracledatabase” from the IBM support website. Copyright International Business Machines Corporation 2009, 2010Page 12 of 35

To check that the application server can connect to the database, use the WAS adminconsole to test the connection (via Resources/JDBC/Data sources).Deploying the MDM EARTasks Involved: Clean workspacePrepare for deploymentBuild workspaceExport Application EARDeploy Application to WebSphere ProfileTask Details:These tasks build an EAR file for the application, and then deploy the EAR ontoWebSphere Application Server. An alternative to running these tasks is to manually runProject Clean from the build menu and then hot-deploy the EAR to the WAS server. Tohot-deploy the EAR ensure that your server is show in the “Servers” view, and then rightclick the server and use “Add and Remove Projects ” to add the MDM EAR project.If you have run the wizard, but would prefer to use the hot-deploy functionality, you mustremember to remove the deployed application from the server (using the WAS adminconsole) before hot-deploying the MDM EAR project.Deploying the MDM ConfigurationTasks Involved: Deploy ConfigurationTask Details:The task “Deploy Configuration” runs the management agent and console to deploy theconfiguration held in the exported EAR. This means that even if you have hot-deployedthe MDM application, you will have to run the “Export Application EAR” for this task tosuccessfully complete.To check that the task completed successfully, view the APPSOFTWARE andCONFIGELEMENT tables within the database.Verifying the InstallTasks Involved: Import Installation Verification projectValidate Installation Copyright International Business Machines Corporation 2009, 2010Page 13 of 35

Task Details:These tasks import and run the Install VerificationTest. To determine whether the testshave successfully completed, you will need to examine the response files found inInstallVerification/xml/response. Each response file should have “SUCCESS” as theResult Code. You will need to refresh the Install Verification project before the responsefiles are visible in the workspace.Restoring the setup toolTasks Involved: Restore the Development Environment Setup ToolTask Details:As previously mentioned, this task cleans up the configuration within the tool, as well asthe saved responses to the pages within the wizard. This task should be run before settingup each new development environment.Creating a new Hub ModuleThe MDM server configuration may be extended in a number of different ways, from thedevelopment of entirely new entities to just adding behavioral modifications to existingentities.The MDM server is composed of Hub Modules. MDM provides the following defaultmodules: BusinessServices, DWLBusinessServices, FinancialServices, Party and Product.For each of these modules, there exists a reference model that can be found in Module/src/reference.mdmxmi which you can open to view the Transactions, BusinessObjects and Codetables available.In order to create any server modifications, a

The IBM InfoSphere Master Data Management (MDM) Server 9 provides a solution for managing enterprise data. The framework provides a comprehensive data model and associated business services that can be extended t