Exposing BPMN process as a service

A common integration requirement is to expose the BPMN process as a service. There are cases when you need to expose Oracle BPM services to be consumed by BPEL, Mediator, and more specifically, by Oracle Service Bus. Exposing process as a webservice is a built-in capability of Oracle BPM. Process instance creation or process notification can be exposed as a service.

In a real world scenario, it would not be practical to have tasks initiated from within the BPM Workspace using the User Task Initiator component as you were doing till now. So you would use the SalesToContract BPM process as a web service.

All the BPMN processes that define a process interface appear in the SOA Composite. To connect to a BPMN process using a custom web service client you need the following information:

How to do it...

In this section, you will learn to expose the BPMN process as a service :

  1. Go to JDeveloper | Project | Composite.xml.
  2. Delete the ReadQuoteRequest service you have created to listen to the JMS queue:
    How to do it...
  3. Right-click on the Start activity and select properties.
  4. Select Define Interface from the drop down,as Implementation, in the Properties area.
  5. Click the green plus (+) icon to add arguments.
  6. In the Create Argument dialog, enter name as'QuoteInput' for the input argument and select type as Component.
  7. Click on the "browse" button to browse for the components and select Quote from the list.
  8. Click on Ok twice to reach back to Properties of the Message Activity.
    How to do it...
  9. Expand the Advance section, check the Asynchronous operation, and enter requestoperation as operation name.
    How to do it...
  10. Check data association, click on edit pencil button to edit the data association.
  11. Drag-and-drop quote from objects into the Output QuoteRequest message.
  12. Click on ok twice.
  13. When you have finished this, click on Save.
  14. Go to End activity and right-click on it.
  15. Select properties and go to Implementation tab.
  16. Select Implementation Type as Message, you will observe that conversation will be continuous.
  17. Select Initiator Node which is QuoteRequest in this case.
  18. Expand the Advance section and give operationQuoteCallback as name of the call-back operation.
  19. You BPMN process is now a service, asynchronous service. Hence, would have a call-back operation too:
    How to do it...
  20. Create a data association if you want this BPMN Asynchronous process to return data.
  21. Let's assign quote objects as output.
  22. When finished, click on Save.

How it works...

When you create a BPMN process with a message Start event and a message End event, it becomes a service provider. This service can be invoked from a web service, web service client, BPEL Service, OSB Service, or from the service task of another BPMN process

The BPMN process that you have converted into a service is an asynchronous service, because the operation type of its message Start event is asynchronous. However, if the operation type of its message Start event is synchronous, then the BPMN process is a synchronous service.

There's more...

You can test the process at this stage to check if the BPMN process can be invoked by BPEL, OSB, or other services.

You can either use a web service client to test it or you can create a BPEL process and invoke this service. You can even go to Oracle EM console to fetch the endpoint URL of the service and can use the default to test the service.

To connect to a BPMN process using a custom web service client, you need the following information:

Invoking BPMN process asynchronous Service

  1. Log in to Oracle EM Console as WebLogic user
  2. Click on the Service Endpoint and WSDL button and copy the Endpoint URI of the service:
    Invoking BPMN process asynchronous Service
  3. Visit the Endpoint URL in a browser.
  4. You will find an HTML Test page, which you can even use as XML source to enter Quote data.
  5. You can verify requestoperation, which you provided when implementing the Start message event:
    Invoking BPMN process asynchronous Service
  6. Enter Quote data and click on Invoke, at the end of this HTML page.
  7. You can find an instance being created in a running state.
  8. Click on the instance and go to the Audit Trail page.
  9. Click on the Audit Trail tab and verify instance creation and input payload.
    Invoking BPMN process asynchronous Service
  10. Now you have WSDL, which can be used to invoke this BPMN asynchronous service.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.255.86