Aug 3, 2008

The lost (collaxa) BPEL-tutorials: 105.AsyncCompositeLoanBroker

Here the next BPEL tutorial. If you are starting now, please set up your environment first (take a look on the previous tutorials).
The AsyncCompositeLoanBroker will show you, how to call an asynchronous webservice/BPEL within a BPEL.

  1. Open the LoanBroker.jpr in your JDeveloper. Then open the BPEL:

  2. The LoanService is used with an Invoke and a Receive. This has to be done everytime the wsdl you use has the structure (asynchronous):
    <portType name="LoanService">
    <operation name="initiate">
    <input message="tns:LoanServiceRequestMessage"/>
    </operation>
    </portType>
    <portType name="LoanServiceCallback">
    <operation name="onResult">
    <input message="tns:LoanServiceResultMessage"/>
    </operation>
    </portType>

    and not like this (synchronous)
    <portType name="StockQuoteService">
    <operation name="process">
    <input message="tns:StockQuoteServiceRequest"/>
    <output message="tns:StockQuoteServiceResponse"/>
    </operation>
    </portType>

    For more information read the WSDL-specification...
  3. To get the tutorial running, you have to modify all build.properties in ../../utils/AsyncLoanService and in the LoanBroker project (http.port, admin.password, ...) .
  4. Do a right click on the build.xml and choose "Run Ant Target" -> deploy
    This target will deploy the LoanService and the LoanBroker.
  5. To start the BPEL open the BPELConsole -> Dashboard and click on LoanBroker. Put some parameters in the form and click invoke.

  6. In opposite to an invoke of synchronous BPEL, you will not get the response. The BPELConsole shows the following:

  7. Click on the audit and there you can see the result of the instance.
    This audit screen is very nice for debugging or retracing workflow instances.
The advantage of asynchronous BPELs is, that you do not have to care about timeouts, but this comes with the cost, that the BPEL PM has to dehydrate the instance into the database (which is a little bit slower...)

No comments:

Post a Comment