Part 3: Build and test the application
Before you can test the application in Integration Designer, make sure there are no build errors in the STP module and STPLibrary artifacts.
Tip: By default, "Build Automatically" is turned on in Integration Designer. This does not make a difference in our tutorial. While building real world applications, it is a good idea to turn "auto build" off and manually build or clean modules when required. The option is found in the main menu under Project.
Go to the Problems view and make sure there are no errors reported.
Applications built in Integration Designer are typically tested using the Unit Test environment. An IBM Process Server profile is created as part of Integration Designer installation and it is used to test this STP Process.
- Start the Unit Test Server.
- Switch to the Servers view and select the server
named IBM Process Server v7.5 at localhost, as
shown in Figure 20. It is possible your server might have a
Figure 20. Servers View
- In the view toolbar, click the Start the server icon (arrow in a green circle) to start the server. Wait for a few minutes for the server to start. Once the server is started, the status changes from "[Stopped]" to "[Started]".
- Look for the following string in the Console view, which indicates
the server is ready for service:
WsServerImpl A WSVR0002I: Server server1 open for e-business
- Deploy the STP application to Process Server.
- Select Process Server, right-mouse click, and choose Add and Remove to add projects to the server.
- Select STPApp in the Available
list and click the Add button to move it to the
Configured list, as shown in Figure 21. Click
Figure 21. Configuring resources on the server
- STPApp is deployed to the server. The console displays the
information that the application is deployed and started.
Wait until you see the following message in the Console view:
ApplicationMg A WSVR0221I: Application started: STPApp
There are a number of ways to test the application. Some common approaches are:
- Using the Integration Test Client: This client is an application that is part of Integration Designer and the preferred tool of choice for unit testing applications and components built using Integration Designer.
- Using the Business Process Choreographer
Explorer: The BPC Explorer is a Web application that is
shipped along with IBM Process Server. It is used by both
developers and administrators to work with the process instances
in the environment.
Tip: The BPC Explorer should not be used by end users, such as business users. The audience for the BPC Explorer is the IT team. End users should interact with BPM applications via Business Space or custom-built user interfaces.
- Using Web Services Explorer or external applications like
SOAPUI by having the BPEL process exposed via a Web Service
- The CancelRequisition BPEL process needs to be exposed so that other applications can invoke this process. The client for this BPEL process is a process application created using IBM Process Designer or a JEE application. Depending on the caller, the BPEL process is exposed via one or more of the supported exports. The traditional approaches are having an SCA Export and a Web Service Export.
- Once a Web Service Export is available, you can test the process using the inbuilt Web Service explorer, or using third party tools such as SOAPUI.
For this tutorial, we will use the BPC Explorer approach.
- Bring up the BPC Explorer Web application.
- Select IBM Process Server, right-mouse click, and choose Launch > Business Process Choreographer Explorer.
- Under Process Templates, click Currently Valid to
see the list of currently valid process templates, as shown in
Figure 22. Process Templates
- Start an instance of the CancelRequisition process. Select the check box to the left of CancelRequisition. Click on Start Instance.
- Enter the inputs for the process (see Figure 23). Specify the
first name as
John, the last name as
Doe, and requisition number as
123. Click on Submit.
Figure 23. Entering the process input message
- The BPEL process completes its activities and returns the result,
as shown in Figure 24.
Figure 24. View the result
Notice that the result is empty. It is left as an activity for the reader to return an appropriate result.
- Ensure that the Console view shows the output created by
SystemOut O *** Sending email notification for requisitionNumber:'123' and cancellationReason:'Changed my mind' to: 'email@example.com'
Note: As a quick way of testing the process, you would add an Assign activity in the BPEL flow before the call to Notify Admin and hardcode the values as shown in Figure 25.
Figure 25. The Assign activity
- Ensure that the process instance has completed all its activities by checking its status in the BPC Explorer. You can view the status of the process by clicking on Started By Me under Process Instances.
You have now completed the tutorial by creating a BPEL microflow in Integration Designer, assembling the application components, and then testing the process flow.