Nothing Special   »   [go: up one dir, main page]

1 11L BPM857 BuildingSimpleIntegrations PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

IBM Software

Lab 1 Adding integration services to the process

1.1 Overview
In this exercise, we experience adding integrations to our Mortgage Application process. Thanks to the simplicity
of the development approach of IBM Business Process Manager, in the first lab we were able to develop the
process without worrying about integrating it with back-end systems or external services. One could imagine,
though, that our integration team has been working on a new version of the process – by creating a new toolkit
that allows us to connect to back-end services. This new Mortgage Integration Toolkit will provide us two services
– one that connects to a credit score web service, the second that stores approved mortgage applications to our
Mortgage database.

Let’s see how we can take advantage of these integration services in our Mortgage Application process. You will
see that we do not need to know the implementation details of these services – we just need to map our business
data and process steps into them and integration is easy.

Let’s get started!

1.2 Environment setup

NOTE: We will need to use the desktop Process Designer to build our integrations, as
Implementation services are not available in the BPM web editors

Your environment should be up and running before you continue with this lab. Your instructor probably did this
setup ahead of time.

__1. If the Process Center server is not started, please start it using the instruction in the Appendix. If you are
unsure, please ask your instructor.

NOTE: The Proof of technology environment is also already set up with a database and a simple
web service application that were created and configured ahead of time.

__2. If you aren’t already logged in to the desktop Process Designer, launch it by double-clicking the TOOLS
icon on the desktop and then double-click IBM Process Designer 8.5.:

Login with the following credentials and then click Log In.

Lab 11 - Adding integration services to the process Page 1


IBM Software

• Username: admin

• Password: admin

__3. Click the Process Center icon at upper right. Import the application by following these simple
instructions:

__a. Click the Process App tab.

__b. Click Import Process App.

__c. Click Browse… to select C:\BPM-V8.5.7-


PoT\LabWorkbook\INTEGRATION\Mortgage_Application_Process_Simple_Integrations - 2016-
11-16-001.twx

__d. Click OK.

Page 2 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__e. Review artifacts being imported and then click Import to complete the operation.

1.3 Create an Integration Toolkit with integration services


Toolkits are used to share libraries of reusable assets across multiple process applications. Integration services
are often contained in these toolkits. We will now create a new toolkit that will contain our SOA-enabled
integrations to back end services.

1.3.1 Create a toolkit


__4. While in the Process Center view, switch to the Toolkits tab

__5. On the right-hand side, click Create New Toolkit.

__6. Provide the toolkit name as “Mortgage Integrations” and acronym as “MINT”. Click Create.

__7. Once created, click on Open in Designer to the right of the Mortgage Integrations toolkit.

Lab 11 - Adding integration services to the process Page 3


IBM Software

__8. We will add a toolkit dependency to the Better Mortgage Toolkit using Spark so that we can reuse the
data objects already created in previous labs. We do this by selecting the + icon to the right of TOOLKITS
on the left side of the desktop Process Designer.

__9. Locate the Better Mortgage Toolkit and select 2016-11-15-001.

__10. You should now see the Better Mortgage Toolkit using SPARK (2016-11-15-001) in the associated
toolkits.

1.3.2 Create the credit score web service


__11. Create the credit score web service integration by clicking the + icon to the right of Implementation on
the left side of the desktop Process Designer. Then select Integration Service.

__12. For Name enter Credit Score Service and then click Finish. The new service will open and the diagram
will already contain the default Start and End nodes.

__13. Drag a Web Service Integration from the palette on the right and drop it into the diagram.

Page 4 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__14. Draw connectors from the Start node to the new web service integration, and again from the integration
to the End node. Update the name of the integration to Call Credit Score Service. Your diagram should appear as
follows:

__15. In the Properties tab below, click on the Implementation parameters. For the Discovery Scheme, select
“Provide inline configuration” from the drop down. For the WSDL URI parameter, copy and paste the following
URL or click View and at the confirmation prompt, again click View:

http://localhost:9080/BetterMortgageServicesWeb/sca/creditScoreService/WEB-
INF/wsdl/creditScoreService_creditCheckInterfaceHttp_Service.wsdl
http://bpm.bluedemos.skytapdns.com:9080/BetterMortgageServicesWeb/sca/creditScoreService/WEB-
INF/wsdl/creditScoreService_creditCheckInterfaceHttp_Service.wsdl

__16. This web service has been installed locally in WebSphere Application Server. To verify the address, click
the View button to the right of the URI. You should see the XML for the WSDL in your browser.

Lab 11 - Adding integration services to the process Page 5


IBM Software

__a. Next click the Discover button, and Discover again on the pop up window to discover the
operations that are available within the service. Now, select the Operations drop down (you
may need to scroll down) and select requestCreditScore(string,string).

__17. The Generate Types button will create the required business objects if the web service has complex
input and output data structures. However, this simple web service accepts string types and clicking
Generate Types is not necessary.

__18. Click on the Security parameters of the Properties tab. Ensure Security and Policy is set to “Use Basic
Security” and WS Security Authentication is set to “HTTP Authentication”. Provide a Username of
“admin” and Password of “admin”.

__19. Click on the Data Mapping parameters of the Properties tab. We can see that the input and output
mappings for the web service have been updated after the discovery and selection of the web service operation.
We will create the appropriate local service variables next.

Page 6 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__20. Click on the Variables tab (above the diagram). Create two input variables of type String and name them
lname and ssn. Also, create an output variable of type Integer creditscore as shown below.

__21. Provide default values for each of the Input variable lname and ssn. For each variable, select it and then
check the box for Has Default. An initial default value of “” is assigned. Keep this default value.

__22. Return to the Data Mapping parameters of the Properties tab. Map the variables you just created
appropriately by clicking the icon to the right of each parameter and selecting the variable.

__23. Save your work by clicking the Save button or by Ctrl+S or using the Save button.

Lab 11 - Adding integration services to the process Page 7


IBM Software

1.3.3 Create the mortgage application database service


__24. Create another integration service for the mortgage application database service integration by clicking
the + icon to the right of Implementation and then click Integration Service.

__25. For Name enter Write Mortgage Application to Database and click Finish. The new service will open and
the diagram will already contain the default Start and End nodes.

__26. Drag a Server Script from the palette on the right and drop it into the diagram.

__27. Within the System Data (8.5.7.0) toolkit, there are integrations available to use for making calls to
databases using SQL statements. We are going to use one such integration to make the calls to the
Mortgage database.

__28. Expand the System Data (8.5.7.0) toolkit and click on Implementation. When the list of contents is
displayed, type “Execute” to use the desktop Process Designer’s type ahead filtering. We will want to
use the SQL Execute Statement.

Page 8 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__29. Drag and drop two SQL Execute Statement implementations into the diagrams

Lab 11 - Adding integration services to the process Page 9


IBM Software

__30. Rename the Server Script as Create Parameter Lists, the first SQL Execute Statement as Insert into
Applicant Table, and the second SQL Execute Statement as Insert into Application Table. Wire your
diagram as shown below.

__31. We are going to define the required variables for this service. Click on the Variables tab above the
diagram. Click Add Input, and set Name as application. For the Variable Type, click Select and using the
type ahead filter, type “app”. The Application object contained in the Better Mortgage Toolkit using
SPARK will remain in the list. Click Application to select it. Your input should now appear as shown
below.

__32. Add two private variables using the same steps as previous, but select the button Add Private.

• “applicantParamList” of type SQLParameter (make sure to check Is List)

• “applicationParamList” of type SQLParameter (make sure to check Is List).

Page 10 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__33. Your private variables should now appear as shown below.

The Create Parameter Lists server script will contain JavaScript code to initialize and populate our data objects to
be used in our database integrations. The code will initialize our SQLParameter lists and populate them
accordingly. Additionally, some data will be populated from our input application variable, which is accepted as
input to the service.

__34. Return to the diagram and select the Create Parameter Lists server script. Click Properties, then click
Implementation. JavaScript code should be entered here. This code is provided in C:\BPM-V8.5.7-
PoT\LabWorkbook\INTEGRATION\serverscript1.txt. Copy and paste the code to the Script area. If
interested, take a moment to look over the code.

Next, we will define the Insert into Applicant Table integration. As we are using an out-of-the-box service
integration, all we need to provide is the mapping details.

__35. Click on the service Insert into Applicant Table and under the Properties tab, click Data Mapping.
Provide the following values for the Input Mapping.

Lab 11 - Adding integration services to the process Page 11


IBM Software

• Uncheck Use Default, and provide the following (including quotes) SQL for the sql enter:
"INSERT INTO HM_APPLICANT (APPLID, FNAME, LNAME, ADDR, CITY, STATE,
PCODE, MSTAT, DOB, YRLYINCM, EXISTHO, CREDSCOR) VALUES
(?,?,?,?,?,?,?,?,?,?,?,?)"
• Uncheck Use Default for the parameters input. Click the icon just to the right of the
parameter and select applicantParamList from your variables.
• Uncheck Use Default, and enter (including quotes) "ANY" for the return type input.
• Uncheck Use Default, and enter (including quotes) "jdbc/MortgageDS" for the
dataSourceName input.
__36. Your input mapping should now appear as shown below. We will not be providing Output Mapping for
this service.

Repeat similar steps for the Insert into Application Table integration.

__37. Click on this service and under the Properties tab, click Data Mapping. Provide the following values for
the Input Mapping.

• Uncheck Use Default, and provide the following (including quotes) SQL for the sql enter:
"INSERT INTO HM_APPLICATION (APPID, APPLID, MTGTYPE, MTGAMT, MTGRATE,
METRISK, DOCSRECD, STATUS) VALUES (?,?,?,?,?,?,?,?)"
• Uncheck Use Default for the parameters input. Click the icon just to the right of the
parameter and select applicationParamList from your variables.
• Uncheck Use Default, and enter (including quotes) "ANY" for the return type input.
• Uncheck Use Default, and enter (including quotes) "jdbc/MortgageDS" for the
dataSourceName input.
__38. Your input mapping should now appear as shown below. Again, we will not be providing Output
Mapping for this service.

__39. Save your work by clicking the Save button or by Ctrl+S or the Save button.

Page 12 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

1.3.4 Test the Credit Score Service


__40. Before taking a snapshot of the toolkit and using it within Process Applications, it is necessary to test the
services we just built to ensure they work. BPM provides one-click testing capabilities to verify and debut
code at any time.

__41. Open the Credit Score Service implementation if it is not already. Quick way to navigate between
artifacts you are working on is using the drop down.

__42. Click on the Variables tab. We had already checked Has Default when we defined the service, which
allows us to use default data when other data is not available. Currently, the default data is empty. Let’s
update lname to Smith. Save your work.

__43. Return to the Diagram tab. Notice the Debug icon above and to the right of the diagram.

It looks like a bug. This is the button to launch the debugger, which will launch an instance of this
service, stopping execution at the beginning of each activity in the service.

__44. The Playback icon next to the Debug icon will also launch an instance of this service, but will not stop
execution until completion. It will also stop and await user input for Coaches in human services.

Lab 11 - Adding integration services to the process Page 13


IBM Software

__45. Click the Debug icon, as we want to validate this service is working correctly and want to view the data.

Your default browser will be launched, and execution will pause just before Call Credit Score Service is
invoked. We can see that lname is populated with the default data we just defined.

__46. Also, we can see our output (creditscore) has not been initialized yet. Additonal system information is
also displayed. This information is read only and can not be updated. To correct testing information “on-
the-fly”, please refer to the materials on using the Business Process Manager Inspector.

Page 14 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__47. Click the Step button to execute Call Credit Score Service. It should make the web service call and
complete very quickly. Upon completion, we can see that creditscore has indeed been updated with a
value. We have verified that web service is making the call as required.

__48. Click the Run button to complete the service. Close the browser. If the Switch View window is
displayed, check Remember my decision and click No to close it.

__49. Return to the Variables tab and update the lname input variable back to “”.

__50. Save your work.

__51. Run the debugger again using the empty lname data. Notice that it still returns a value. The web service
has been set up to return a value for any last names that it does not have a match for.

->

1.3.5 Test the Write Mortgage Application to Database Service


We will also need to test our SQL Execute calls before taking a snapshot of the toolkit and using it in our process
application. We will do so using the same debug capabilities we used when testing the web service integration.

__52. Open the Write Mortgage Application to Database implementation if it is not already. Click on the
Variables tab. Click on the application input variable, as we will want to identify default data for our
testing. Check Has Default.

Lab 11 - Adding integration services to the process Page 15


IBM Software

__53. Supply values for the variables. The values can be any, however, make sure that integer values for
applicationID and applicantID are supplied and are unique. Also, supply one additional value, such as
firstName. Save your work.

__54. Click the Debug icon to invoke the implementation. The service will be stopped just before the Create
Parameter Lists script is executed. Notice within the application variable is populated with our default
data.

__55. Click Step to continue execute the script and stop before the execution of Insert into Applicant Table
implementation. Scroll through the local variables for applicantParmList and applicationParmList and
observe that the JavaScript in the preceding script have populated them. Each of parameter will be
mapped to the appropriate SQL parameter.

Page 16 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__56. Click Step Over to skip over the debugging of the services nested within the implementation. We will
only focus on the assets in our current Service. If you receive an error, make sure that your SQL and
dataSource value are correct. Also, if you run the test again, make sure to use other values for
Applicant ID and Application ID.

We have now completed the services to update the Applicant table in the Mortgage database.

__57. Click Step Over again to execute the next service to insert a record into the Application table in the
Mortgage database. Click Run to complete the service. Close the browser. If the Switch View window is
displayed in the desktop Process Designer, click No to close it.

__58. Verify the information has been updated in the database. Open C:\BPM-V8.5.7-
PoT\LabWorkbook\INTEGRATION\scripts\db\ReturnAllMortgageApplications.bat. A command
window will open, displaying the contents of the tables. If prompted for a password, the db2admin
user’s password is p4db2admin.

Your data may be different, depending on your test data.

__59. If you wish to test more, make sure you change your default data in the application variable to avoid
database conflicts. Error handling has not been built into our demonstration implementations.

__60. Clear out the default data for the application variable by unchecking Has Default. Save your work.

Lab 11 - Adding integration services to the process Page 17


IBM Software

__61. Create a new snapshot of the toolkit by clicking the camera icon in the upper right of the desktop Process
Designer. Provide a unique name and optional documentation and click OK.

__62. Click on the Process Center icon in the upper right of the desktop Process Designer to go to the Process
Center view. Close the desktop Process Designer.

1.4 Integrate the Mortgage Integrations toolkit with the Mortgage


Application Process
We have built the integrations that will be used in the Mortgage Application process. It is now time to reference
the toolkit in your process application and integrate the implementation services into your process.

We will return to the web editor to makes these updates.

__63. Using Firefox, open Process Center with the URL: https://ibmbpm:9443/ProcessCenter/login.jsp, using
the following credentials.

• Username: admin

• Password: admin

__64. Next to Mortgage Application Process Simple Integrations (MAPINT), click Open in Designer for the. (If
you imported the Mortgage Application Process Simple Integrations process at the beginning of this lab
as your starting point, open that process instead.)

Page 18 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__65. Click on the + Icon to the right of Toolkits (on the left of the editor). Select the Mortgage Integrations
snapshot you created previously in this lab.

__66. Expand the toolkits to verify the reference was added to the process application.

1.4.1 Integrate the Credit Score Web Service into the Process Application
If you performed the first lab, you may recall that you added a “mock” script service to simulate a credit score
service. Now we will rewire this activity to use the web service from our Toolkit, showing that it is easy to use
SOA-enabled services in IBM Business Process Manager without needing to know the implementation details of
the services.

Lab 11 - Adding integration services to the process Page 19


IBM Software

__67. From the process library, click Processes and then click Mortgage Approval Process to open the editor.

__68. On the diagram, double-click the Enter Application Data activity on the person icon to open the service
editor for the human service.

You will see the diagram for the human service, consisting of the Enter Application Data coach and the
Call Credit Check stub service.

__69. Right-click Call Credit Check Service and select Delete to remove it from the canvas.

Page 20 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__70. From the palette, drag and drop a Service onto the canvas.

__71. Under Properties, click Implementation and then click the Select button next to Call a Service to specify
the service you developed earlier.

__72. In the Select Library Item search field, type “credit” to filter down to the Credit Score Service in the
Mortgage Integrations Toolkit we have created. Click Credit Score Service to select it.

Lab 11 - Adding integration services to the process Page 21


IBM Software

__73. Create connections from the coach to the service and from the Service to the End node. Rename the
Service to Credit Score Service. The diagram should look like below.

__74. With the Credit Score Service selected, switch to the Data Mapping in the Properties tab. Specify input
mapping for lname by clicking the mapping icon just to the right of the parameter field and select
application > customer > lastname as the input value. We will not be using social security number for
this exercise.

__75. In the same way, under Output Mapping, click the mapping icon to locate and select application >
customer > creditScore. The final mapping should be as follows.

Page 22 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

You have just added an integration that is implemented as a web service. We will test the web service shortly.
Save your work. Click the X icon to close Enter Application Data.

1.4.2 Integrate the Mortgage Application Database Service into the Process Application
Our next integration step will take mortgage applications that have been approved and store them into our
official system of record, the Better Mortgage database called MORTGAGE.

In the main process diagram, scroll down to the bottom of the Mortgage Application Process diagram and locate
the activity called Update Systems of Record. Click Update Systems of Record activity and under Properties, go to
the Implementation tab.

__76. Click the Select button for the Implementation parameter. In the Select Library Item search field, type
mortgage to filter down to the Write Mortgage Application to Database in the Mortgage Integrations
Toolkit we have created. Click Write Mortgage Application to Database to select it.

After selecting, the Implementation will look as follows:

Lab 11 - Adding integration services to the process Page 23


IBM Software

__77. Under Properties, click Data Mapping. Map the application variable as the input to the Write Mortgage
Application to Database service. Your mappings should look like the following.

__78. Click Save at the top to save your progress. You have just added an integration interfaces with the
Mortgage database! We will now test our integrations in the context of the full process application.

Toolkits and Integration Services


You might have noticed that it was very simple to
connect the process to Toolkit services from the
process we have created. It was a matter only of
dragging-and-dropping pre-built services onto our
canvas, rewiring, and mapping the appropriate
business data. This is a powerful capability of IBM
Business Process Manager to provide business-
consumable integration services in a well-governed
way. This helps many businesses use their investment
in SOA and other integration technologies in a
managed, easy way, while exposing the power of the
business process management design paradigm.

1.5 Playback the Process


__79. From the process diagram, click the Run icon (Run process) at upper right. The Inspector view will be
displayed. We will only cover the basics of the Inspector view for the remainder of this lab to step
through the process. A more detailed lab is also available in this Proof of Technology.

Page 24 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__80. On the right of the Inspector, under Tasks, there should be an Enter Application Data task available. You
may need to scroll down to view it. Click the Play button to the right of the task to launch the task and
display the Coach.

__81. Complete the information in the Enter Application Data task. Make sure to use a last name of Baker,
Harris, Johnson, Smith, or Garrison. Click Submit. Close the browser.

Lab 11 - Adding integration services to the process Page 25


IBM Software

__82. Back in the Inspector, notice that the process has advanced to the next task (Assess Risk). This is also
visible in the process diagram as the Assess Risk task has a halo highlighting it. The previous task of Enter
Application Data is shown as complete. You can hide completed tasks by selecting the ACTIVE filter
above the tasks. Launch the Assess Risk task.

__83. On the Qualifying Information tab of the coach, you should now see the Customer Credit Score – this is
the result of the web service invocation:

__84. Click Submit and close the browser. The process continues to the next step. In Inspector, execute the
third task (Review for Approval). When the coach is displayed, click on the Final Decision tab and enter
ACCEPT.

Page 26 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

__85. Switch to the Final Decision tab, and then select ACCEPT. Click Submit and close the browser.

__86. In Inspector, you should see that the Inspector shows you that the process completed and has executed
the database integration service. If the Inspector does not automatically refresh, click Return to process
instance: Mortgage Approval Process:98 (your instance number may be different). The Inspector should
show the instance as Completed.

__87. As we did when we were debugging the service, verify the information has been updated in the
database. Open C:\BPM-V8.5.7-
PoT\LabWorkbook\INTEGRATION\scripts\db\ReturnAllMortgageApplications.bat. (If prompted for a
password, the db2admin user’s password is p4db2admin.)

Your data may be different, depending on your test data.

__88. Close all the command prompt window.

Lab 11 - Adding integration services to the process Page 27


IBM Software

1.6 Summary
Congratulations! You have completed the steps to create commonly-used simple integration services that retrieve
information via web services and SQL calls to a database.

You created a toolkit to contain these reusable library items and built these integrations from scratch. You then
implemented these new integration services into the existing Mortgage Application Process. As you can see,
simple integrations can be built and implemented very quickly. Later in this Proof of Technology, you may have
the opportunity to explore more complex Advanced Integrations.

Page 28 Discovering the value of IBM Business Process Manager version 8.5.7
IBM Software

1.7 Appendix

1.7.1 Start Process Center

Process Center
Process Center is a component of IBM Business Process
Manager that provides a shared repository for IBM
Business Process Manager development, testing,
deployment, and overall business process management
governance. We will be connecting to Process Center as
we design the process to iteratively develop and test our
process design.

1) Locate the Servers shortcut folder on your desktop.

2) Double-click the Servers shortcut folder to open it.

3) Double-click PC SERVER – START as shown.

The server will take several minutes to start. Please wait for the server to start completely. (The command
window will disappear once the server has started.)

Lab 11 - Adding integration services to the process Page 29

You might also like