Integration Knowledge Kit
Developer Journal
IBM Process Server 7.5
A developer's journal of lessons learned and metrics to compare developer productivity and performance costs. The journal explores why platform choices count –
covering the planning, expertise, and knowledge required to quickly and flexibly build and deploy highly scalable applications.
Appvance, Inc. 1735 Technology Drive, Suite 820 San Jose, CA 95110 USA Phone: 855.254.1164 Web: http://www.appvance.com
email: [email protected]
August 5, 2013
© 2013 Appvance. All rights reserved.
Index
...
Document Purpose and Brief Introduction to Project Scope!
3
...
Download and Install WebSphere tools!
4
...
WebSphere Process installation!
5
...
WebSphere Integration Designer installation!
7
...
Allocate Purchase Order!
10
...
Reserve Parts!
12
...
Human task!
15
...
Reserve Parts Client App!
16
...
Price Purchase Order!
19
...
Complete Process Order Process!
21
...
Test scripts!
25
...
Allocate Purchase Order!
25
...
Process Purchase Order!
26
...
Reserve Parts!
27
...
Installing on designated environment!
29
...
Change Management!
30
...
Reserve Parts!
31
...
Versioning of PO!
32
1. Document Purpose and Brief Introduction to Project Scope
The present document means to be a developer’s journal where developers are going to write their experience installing and using IBM Tools. For this purpose the following steps will be followed:
1. Installation of Tools and Environment Setup
Using virtual machines for each stack (IBM) servers will be installed and properly configured to enable the development of services.
Notes will be taken during this process regarding download time, and installation and setup troubleshooting.
2. Creation of Web Services
In order to test the tools, a set of services was defined to be developed with each set of tools. These Web Services are to be developed:
o Allocate Purchase Order: The Allocate Purchase Order contains one
operation it receives an XML with the items and quantities requested including ID and other info already set.
o Reserve Parts: This is an internal inventory system that checks if the
requested parts are available, and if so, reserves them for that PO. This particular service is a two part thing. The first one is a service that gets the order and post it to the approval system the other part is a user
interface where a human will look through the list and approve if there are enough items.
o Price the Purchase Order: The Price Purchase order is an external web
service that will receive the PO XML coming from the Reserve Parts and will assign prices to it. At the end, this will be passed to a delivery system that will close the PO calling the allocation service.
In this step, notes will be taken regarding the difficulty and characteristics of web service creation and deployment using the mentioned tools.
For each change to be made, it will be analyzed the support offered by each tool along with any workaround needed to do the change. If a change cannot be applied to a service, a justification will be given.
Further details about the scope can be found in the
2. Download and Install WebSphere tools
Tuesday, June 18th Time: 8 hours
Following tools were downloaded from IBM web page:
• IBM Process Server Manager Advanced 7.5 (it included WebSphere Application Server 7.0)
• WebSphere Integration Designer 7.5
Web page that was used:
https://www-304.ibm.com/partnerworld/wps/servlet/ContentHandler/isv/sac
This page is for IBM partners, and allows to download all IBM products.
Developer’s Comment: These tools are huge (about 7,5 GB). It
took me almost 2 hours to download them.
Following files were downloaded and extracted from the IBM web page BPM_Adv_V7.5_Windows_1_of_3.zip BPM_Adv_V7.5_Windows_2_of_3.zip BPM_Adv_V7.5_Windows_3_of_3.zip IID_V7.5_1_of_2.zip IID_V7.5_2_of_2.zip IID_V7.5_QuickStartGuide IID_V7.5_QuickStartGuide.zip
3.
WebSphere Process installationInstallation instruction was taken from:
http://pic.dhe.ibm.com/infocenter/dmndhelp/v7r5mx/index.jsp?topic= %2Fcom.ibm.wbpm.main.doc%2Fic-homepage-bpm.html
First attempt was to choose typical installation.
After about an 1.5 hours it failed, due to the problem with connecting to the DB2 database. It occurred that during installation I misspell connection string of the server. Second attempt was to choose custom installation
This time I double checked all the properties and it went smoothly, but it took another 1.5 h.
After successful installation I was asked to run Profile Management Tool. I did it. As I was not sure which profile to choose I decided to go for IBM BPM Standard standalone Process Server.
4.
WebSphere Integration Designer installationThere was no problem during WID installation. It took about 1,5 to install.
Developer’s Comment: It took me whole day to download, extract
and install all tools necessary to start developing solution. As describe in the next day description it was not enough.
Wednesday, June 19th Time: 8 hours
I started a day with checking whether everything was working. I started WID and decided to create a new server. It was created and started without and problems. Then I open examples installed along with the WID.
I chose Hello World application part 1, but it failed with an exception:
NoClassDefFoundError: com.ibm.ws.bo.BOCore
After some searching on the Google, it occurred to me that my standard profile created a day before was missing Enterprise Service Bus features. I once again opened Profile Management Tool, but this time I decided to augmented created profile. I added to it ESB features. With this I was able to deploy and start sample application.
After this I decided to go with part 2, but it failed during publishing with a new error:
com.ibm.websphere.management.exception.AdminException: CWWBF0064E: server1 is not configured to run business process applications.
The main difference between part 1 and part 2 is that part 2 contain BPEL process and Human Tasks, which gave me a clue what to look for.
This one was harder to find. It occurred that standard profile installation do not have Business Space and Business Process Choreographer components that are necessary for BPEL process to be able to deployed.
As I wasn’t able to add it to my profile with PMT, I was forced to create a new profile. This time I chose Custom Advanced IBM BPM. During setting up all properties I could to choose to install both tools I needed in my profile.
After it I was able to successfully run all examples and start developing my application.
Developer’s Comment: It took me whole day to fix all issues with
my installation of WebSphere. Each augmentation of the profile took almost an hour, and I needed to do it few times to find a right configuration. I think IBM can make their installers a little bit easier to run and choose what user wants to install.
5. Allocate Purchase Order
Thursday, June 20th Time: 8 hours
First task after installation was to create simple web service that takes Purchase Order and responds with some approval code.
WID has built in support to generate web services from WSDL. So all code can be generate in matters of second. Very good example how to generate it can be found here :
http://www.webagesolutions.com/knowledgebase/waskb/waskb022/
Before creating it, I needed to create a WSDL and XSD first.
Developer’s Comment: Creating WSDL and XSD can be done in any
tool, even notepad. Because I had JDeveloper installation on my machine and I like it support for creating such artifacts I decided to use it. JDeveloper is free to use.
Once I had WSDL I went through steps from the tutorial and WS was ready to test. WID has a feature to test all component.
First test ended with an error: Unable to connect to host.
It occurred that default configuration used in WID to call web service was using wrong address of the WS. I had to change it.
After changing the address it worked. Second test showed that web service was up and running.
6. Reserve Parts
Because one the requirements was to use OAGIS architecture for incoming requests to Reserve Parts application, I analyzed their web page:
http://www.oagi.org/oagis/9.0/Documentation/Architecture.html
I also downloaded a package of ready to use XSDs from their web page. I choose one called ProcessPurchaseOrder.xsd as it looks as the most appropriate one.
Friday, June 21st Time: 4 hours
I started with preparing BPEL process. It went as follow: 1. Incoming message
2. Call allocate purchase order
3. If the result of allocate purchase order is not ok, terminate
4. If the result is ok, go to human task, to approve purchase order
5. If PO is not approved terminate
6. If PO is approved map internal PO into OAGIS PO
It looks like this:
Because internal PO and OAGIS PO were different I had map one into another. WID has a feature called DataMap for such situation. It allows to create mapping between
Monday, June 24th Time: 7 hours
7.
Human taskNext step was to create a human task. WebSphere allows to create tasks that require human attention. In this case we want a simple approval.
Very good tutorial on how to create a human task in WID can be found here:
http://pic.dhe.ibm.com/infocenter/dmndhelp/v7r5mx/index.jsp?topic= %2Fcom.ibm.wbpm.wid.bpel.doc%2Ftopics%2Fhumtask.html
WebSphere also generates user interface for human tasks. It’s simple web page, but it’s enough.
8.
Reserve Parts Client AppNext step was to create a simple JMS application that would mock real application.
Developer’s Comment: Because the aim of this project is to show
capabilities of each tool, I decided to create simple JMS client using WebSphere Integration Designer, instead of going for standalone Spring implementation.
Sample tutorials on creating JMS clients using WID can be found here:
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/ com.ibm.wbit.help.messaging.doc/topics/tjmsexpxml.html
http://www.packtpub.com/article/messaging-with-websphere-application-server-7.0-part1
I did following steps to create a JMS client:
1. Created an interface of my service. It uses OAGIS PO as an entry and simple result as a response
2. Based on the interface simple implementation based on BPEL process was created.
3. The BPEL process just generates some result
4.
5. Once the implementation was ready I added transport layer for the implementation and exported it as JMS binding
6.
7. After deployed to server it was ready to be tested
8.
9. Reserve Part app was ready
Developer’s Comment: Together with reading tutorials it took me
about 2,5 hours to create a sample JMS client, and I think it’s a very good result.
Once I created JMS client that mocked Reserve Parts application I modified my BPEL process for processing PO to call it. After this, it looked in the following way:
I was able to test whole process. It ended successfully.
With this second part of the process was ready and I was able to concentrate on the last part – SAP mock using REST.
9. Price Purchase Order
Tuesday, June 25th Time: 8 hours
I started with reading tutorials on RESTful services in WebSphere.
http://www.ibm.com/developerworks/webservices/library/ws-RESTesb/
http://www.ibm.com/developerworks/websphere/library/techarticles/1004_yu/ 1004_yu.html
http://www.ibm.com/developerworks/websphere/tutorials/0907_voet/
And also one on processing Business Objects
http://pic.dhe.ibm.com/infocenter/dmndhelp/v7r0mx/index.jsp?topic= %2Fcom.ibm.websphere.wps.doc%2Ftaghubs%2Fbusiness_object.html
Developer’s Comment: WebSphere provides SAP adapter to easily
integrate with SAP services (please find below tutorials how to do it). Because we just need sample REST service I decided to create one using WebSphere capabilities.
Tutorials on accessing SAP services directly from WebSphere
http://www.ibm.com/developerworks/websphere/library/techarticles/0807_kumar/ 0807_kumar.html
http://www.ibm.com/developerworks/websphere/tutorials/0906_kumar/index.html
To generate random prices another capability of WebSpehre was used. This time I decided to use Java snippet, which allow to add small amount of code to the process. Following code was added to the process.
DataObject purchaseLines = po.getDataObject("PurchaseOrderLines"); List list = purchaseLines.getList("PurchaseOrderLine");
for(int i=0; i < list.size(); i++) {
DataObject purchaseOrderLine = (DataObject)list.get(i);
double price = Math.random() * 10;
int ammount = purchaseOrderLine.getInt("PurchaseOrderLineAmmount"); purchaseOrderLine.setDouble("PurchaseOrderLinePrice", price);
purchaseOrderLine.setDouble("PurchaseOrderLinePriceTotal", price * ammount);
}
I exported BPEL process as RESTful services. Tests showed it worked perfectly. I was ready to integrate this newly created module into my process.
Developer’s Comment: It took me 4 hours, to read tutorials and
10. Complete Process Order Process
Because all components were ready, I was able to integrate them all. I added invokes to price purchase order service using REST service. To finish the process a call to close purchase order operation was also added. Final look on the process:
Developer’s Comment: It took me 1,5 hours to integrate newly
created modules with the process and made some tests of all.
Once the process was ready I wanted to export it as web service. I added export capabilities to it and added web service binding. When I tried to run it I received following exception:
exception: com.ibm.ws.exception.RuntimeError: java.lang.RuntimeException: java.lang.StackOverflowError [25.06.13 13:49:03:927 CEST] 0000018d SystemErr R com.ibm.ws.exception.RuntimeError: java.lang.RuntimeException: java.lang.StackOverflowError [25.06.13 13:49:03:928 CEST] 0000018d SystemErr R ! at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.ja va:749) ...
[25.06.13 13:49:03:931 CEST] 0000018d SystemErr R Caused by: java.lang.StackOverflowError [25.06.13 13:49:03:946 CEST] 0000018d SystemErr R ! at java.util.HashMap.areEqualKeys(HashMap.java:880) [25.06.13 13:49:03:946 CEST] 0000018d SystemErr R ! at java.util.HashMap.findNonNullKeyEntry(HashMap.java:527) [25.06.13 13:49:03:946 CEST] 0000018d SystemErr R ! at java.util.HashMap.getEntry(HashMap.java:512) [25.06.13 13:49:03:946 CEST] 0000018d SystemErr R ! at java.util.HashMap.get(HashMap.java:498) [25.06.13 13:49:03:946 CEST] 0000018d SystemErr R ! at com.ibm.wsdl.DefinitionImpl.getImports(DefinitionImpl.java:275) [25.06.13 13:49:03:946 CEST] 0000018d SystemErr R ! at com.ibm.wsdl.DefinitionImpl.getFromImports(DefinitionImpl.java:664)
Wednesday, June 26th Time: 7 hours
I started the next day from the exception I had before. On first sight problem looked like problem with linking resources in the WSDL file for the exported service, but the root cause of the problem was connected with caching resources. It looks like WID IDE from time to time can cache some parts of the projects, especially when you use
publish action quite often. Cached parts and modified ones leaded to a conflict state. It occurred that WID cached some older version of my code and had a problem with deploying latest one. After many attempts I finally found a working solution:
0. I removed all application from the server 1. Stopped the server
2. Removed WS Export from my project 3. Added it once again
4. Made a clean build of my code
5. Removed wstemp folder from the server location 6. Started the server
7. Deployed all the application once again
Developer’s Comment: It took me 3 hours to solve it. It was not
the first time I had a problem with caching resource made by WebSphere Integration Designer. In one of previous projects I was working in, where WID was also used as main IDE, same problem occurred for no reason several times. The best and fastest solution was to remove all cached files from the WID instance and make a clean build. It helped in all cases.
11. Test scripts
Next step was to prepare test scripts for modules. I started with preparing tests for SOAP services. I used soapUI to do it. Tutorials how to prepare test scripts using soapUI can be found here:
http://www.soapui.org/Functional-Testing/functional-testing.html http://www.soapui.org/Load-Testing/concept.html
12.
Allocate Purchase Order13.
Process Purchase OrderTest showed that WS was working perfectly normal:
Developer’s Comment: It took me 3 hours to read tutorials and
14.
Reserve PartsI spent rest of the day looking for information how to make Selenium Junit tests.
Thursday, June 27th Time: 6 hours
I found a good tutorial and documentation under following links:
http://docs.seleniumhq.org/docs/index.jsp
http://blog.wedoqa.com/2010/07/selenium-test-in-java-with-eclipse-and-junit/
It occurred that creating Selenium test is very easy. You just needed to install a plugin to Firefox and you were able to record test. After it you were able to export them as Selenium Junit test.
I started testing Reserve Parts GUI. I recorded a test and then I wanted to replay it, but got an error:
3. message on selenuium ide
[error] Unexpected Exception: fileName -> chrome://selenium-ide/content/selenium-core/ scripts/htmlutils.js, lineNumber -> 309,
After some research I found that Selenium plugin is not compatible with latest Firefox version (22.0)
https://code.google.com/p/selenium/issues/detail?id=5681
Developer’s Comment: It took me 3 hours to read tutorials and
prepare test scripts for GUI. As I didn’t received Appvance Enterprise I spent the rest of the day on installing WebSphere tools on remote machine as we were finally given enough disk space to do so. In a meantime I started to gather information on the next ‘Change Management’.
Selenium Test – 3h
15. Installing on designated environment
Friday, June 28th Time: 4 hours
I spent whole Friday (I could spent only 4 hours) on finishing installing all WebSphere tools on remote desktop.
Three was no problem during this process. Once all tools were installed I moved all my code to the new environment and made tests of each components. All but Price
Purchase Order component went OK. Price PO gave me an error:
com.ibm.websphere.sca.ServiceUnavailableException: Could not obtain a connection to the destination. Failed to process the request.
! at com.ibm.ws.http.imprt.handler.HTTPImportService.sendHTTPRequest(HTTPImportSer vice.java:242) ! at com.ibm.ws.http.imprt.handler.HTTPImportHandler.processMessage(HTTPImportHand ler.java:261)
After quick analysis it occurred that newly installed environment was using different ports than my original one. So I had to regenerate export and import bindings for it. Once done all tests were completed.
16. Change Management
Monday, July 01st Time: 5 hours
Last part of the project required following changes to be done 1. Add security and change Allocate Purchase Order to use SOAP
over HTTPS
2. Change transport of Reserve Parts from JMS to REST over HTTPS
3. Support for versioning of PO
Allocate Purchase Order
Tutorials how to configure https support for WebSphere Process Server can be found here:
http://www.ibm.com/developerworks/websphere/tutorials/ 1112_sharath/
http://stackoverflow.com/questions/5657801/implementing-ssl-jax-ws-webservice-on-ibm-websphere-application-server
http://www-01.ibm.com/support/docview.wss?uid=swg21215507
I followed all steps from the first tutorial. It all was based on ikeyman tool which is provided with WPS installation. The tool can generate client and server keys and trust stores which then need to be imported in the admin console of the Websphere Application Server.
After all configuration steps allocate PO web services was working on https.
Developer’s Comment: It took me 3,5 hours to configure https
support.
17.
Reserve PartsChanging transport layer in WPS is very easy. In this case it was only a matter of generating new export and import binding. I added new export rest binding (http binding) for reserve parts process, and then added new import binding in the process PO process. After it I was able to switch from JMS to REST.
Developer’s Comment: It took me 1,5 hours to switch from JMS to
18.
Versioning of POTuesday, July 02nd Time: 5 hours
To add support for two versions of PO I had to do following steps:
8. Modify XSD for PO: new element was added to the XSD. It was similar to the original PO but contained extra parameters. I had to provide new name for it as I wanted to keep everything in one XSD.
9. Modify WSDL for allocate PO Web Service: new operation was added to the WSDL, to accept newly created second version of the PO. WSDL contained both types of operations, the old ones, and also the new ones (new operation were prefixed with ‘new’ to distinguish them).
10.Regenerate PO WS – I recreated steps from Allocate Purchase Order chapter. Because modified WSDL contained extra operations, my newly generate Web Service also contained extra methods, that accepted modified PO. Old methods were also kept to provide backward compatibility.
11.Change main BPEL process to accept two types of incoming messages (WPS has “Receive choice” component that allows multiple entry points into the process). When old type PO was provided process, it went via ‘old path’ and when new type PO was provided, it went via ‘new path’.
12.Regenerate export binding of the BPEL process to accept both PO versions
13.Because only allocate PO WS accepts both PO versions I had to add business object data map component from WPS components palette which allows mapping between different objects.
After all these steps I had new process purchase order process. Tests showed it was working perfectly.