Invoking synchronous service using service task

You have being using service task for invoking synchronous operations in services. You have invoked the synchronous service StockValidator_EBS, to validate stock in Chapter 8, Exception Management. However, in this section, you will learn how synchronous service invocation works.

How to do it...

Here, you will learn to invoke a synchronous service using a service task:

  1. Add a service task to the point where you want to invoke a synchronous operation on a service.
  2. In the Implementation tab of the properties of the service task, browse for the service.
  3. Select the StockValidator_EBS service from the list.
  4. Select the synchronous operation from the list.
  5. Check data association and assign the quote object as Input and the StockAvailability object as Output, to the ValidateStock service task, which invokes the StockValidator_EBS service.
    How to do it...
  6. When you have finished this, click on Save.

How it works...

BPMN Service Engine runs a service task and waits for the service to respond before continuing with the process flow. When the service finishes running, it sends a response to the service task. If the service operation returns output data, then this data is mapped to the data objects in the project using the service task data association.

There's more...

In the way you have implemented the invocation of a synchronous operation on a service, you can also invoke a BPM synchronous operation using service task.

Invoking a synchronous BPM process operation

A synchronous BPM process operation can be invoked using a service task, as follows:

  1. Select a point in the BPM process where you need to invoke another BPM process.
  2. Drag-and-drop the service task from Component Palette to that point.
  3. In the properties of the service task, set Implementation to Process Call.
  4. Click on the "browse" button to browse for the process and select a snchronous BPM process.
  5. Select the Node from the Node list.
  6. Use data association to assign parameters to the invoked BPM process.
  7. When you have finished this, click on Save.

In case of a synchronous BPMN process invocation, BPMN Service Engine waits for the response. When the synchronous BPMN process completes, it sends a response, and if the response has returned the data, it gets mapped to the data objects assigned to output of the service task.

..................Content has been hidden....................

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