IBM MQSeries Workflow SupportPac WA07

Web Services Process Management Toolkit
Version 1 Release 2

IBM

Credit Request Sample Scenario

The sample scenario uses a simple workflow model, which encompasses the processing of a credit request through a bank. The credit request process comprises running a credit check, evaluating the credit check, deciding if the credit can be granted, and informing the customer accordingly.

A bank employee starts a client application and is prompted to enter the customer information applying for credit as well as the credit amount. Then, the client application sends a Web Service invocation request to MQSeries Workflow containing the customer information. MQSeries Workflow starts the process and passes the information to the first activity where the risk of granting credit must be assessed. This activity is called 'GetCreditReport' and is carried out by a Web Service. This can be an in-house application or even from a third-party partner, that is, a financial subcontractor. The Web Service is invoked and as a result a credit report of the customer is created, which includes the risk factor: high, medium, or low. Then, control is given back to the main workflow process, where the next activity is started depending on the content of the credit report and the credit amount. If the risk is medium or high or if the credit amount is higher than 100000, control is passed to activity 'Request Approval'. If the application for credit is rejected, control passes to an activity that posts a notice for rejection of credit. If it is accepted, control passes for posting acceptance.
The Web Service GetCreditReport is a simple Web Service implementation to illustrate its potential use. You could also implement it as an MQWF process. You can use the DPXML sample, which is delivered with MQWF to do that.

Everything gets done in good order by the right person in the right sequence. MQSeries Workflow ensures that the bank's defined and modeled process is followed. Every application gets processed properly and efficiently.
 

Setting up the sample

You find the CreditRequest sample directory in the samples sub-directory. You can run the sample scenario by either using the MQWF Client or the MQWF Web Client.
  1. Using the MQWF Client

  2. Change to the CreditRequest directory and perform the following steps:
    1. Adapt the sample FDL file CreditRequest.fdl to your environment.
      1. running
      2. Change USER to your user ID, that is the user ID with which you are logged on to the machine.

      3. Note that the user ID must be a valid MQSeries Workflow user ID and conform to the MQSeries naming rules of the MQMD UserIdentifier field, for example, it cannot be longer than 12 bytes. For more information, refer to the MQSeries  Programming Guide.
      4. Change FMCGRP to your MQWF installation system group name
      5. Change FMCSYS to your MQWF installation system name
      6. Change FMCQM to your MQWF installation queue manager name
    2. Next, import the FDL into your Workflow system. Execute the following command:

    3. wfimport CreditRequest.fdl
      Note: You can also import the .fdl file into Buildtime and study the process model with the sample definitions.
    4. Edit testit.cmd and change the userid and the password of the PEA start up fmcsxpea command according to your Workflow user.

    5.  
  3. Using the MQWF Web Client

  4. Change to the CreditRequest\WebClient directory and perform the following steps:
    1. Adapt the sample FDL file CreditRequest.fdl to your environment.
      1. Change USER to your user ID, that is the user ID with which you are logged on to the machine.

      2. Note that the user ID must be a valid MQSeries Workflow user ID and conform to the MQSeries naming rules of the MQMD UserIdentifier field, for example, it cannot be longer than 12 bytes. For more information, refer to the MQSeries  Programming Guide.
      3. Change FMCGRP to your MQWF installation system group name
      4. Change FMCSYS to your MQWF installation system name
      5. Change FMCQM to your MQWF installation queue manager name
    2. Next, import the FDL into your Workflow system. Execute the following command:

    3. wfimport CreditRequest.fdl
      Note: You can also import the .fdl file into Buildtime and study the process model with the sample definitions.
    4. Edit in the CreditRequest directory testit.cmd and comment out the fmcsxpea command on line 25:

    5. REM fmcxspea -u=user -p=password -f
    6. Copy the html files in the WebClient\programs sub-directory into the programs directory of your MQWF web client.

Running the sample

  1. Make sure that you set up the generic service provider as well as the Web Service UPES  correctly.

  2.  
  3. If you want to use the MQWF Client make sure that it is installed on your machine. The client is needed because all the activities except for the UPES activities are implemented using the CreditRequest scenario executables.

  4.  
  5. The sample uses port 2020. If your SOAP server uses a different port, you can redirect the port by using the Axis Tcp monitor. For example, to redirect port 2020 to port 8080 enter the following command:

  6. start java org.apache.axis.utils.tcpmon 2020 localhost 8080
     
  7. Execute the testit.cmd:

  8. testit
     
  9. Then, a window 'CreditRequestView' is displayed. Click 'New Request...' to display a dialog asking for the customer information as shown below.

  10.  

     


     

  11. The following scenario navigates through the process where activity 'RequestApproval' is not processed. It describes the steps by using the MQWF Client. If you want to use the MQWF Web Client, navigate through the process instance by using your Web browser.

  12. Enter less than 100000 into the credit amount field, for example, 9999. Click 'OK' to check the parameters log window.
     
  13. A message indicates that the request has been approved.


  14.  
  15. Click 'OK' to view the response message on the log entry of the CreditRequestView window.

  16.  
  17. You can start a second process where the 'RequestApproval' activity is processed. This is the case if the credit amount is greater than or equal to 100000. Click 'New Request...' in the CreditRequestView window to display a dialog that requests additional information.

  18.  
  19. Enter 100000 or a larger amount in the credit amount field. The process then runs the 'AcceptCredit' activity. Click 'OK' to view the message parameter in the log panel.

  20.  
  21. Next, the next application displays a window requesting manual approval. Click 'Approve' or 'Reject'.

  22.  
  23. If you click 'OK' in this window, you see the response message on the log entry of the CreditRequestView window.