Communicating with external processes and services
Till this point, you have finalized the contract. Let's save the contract information in the database. We can achieve it by communicating with either an external service, which performs the service of interacting with the desired database and performs an insert operation into it. This external service could be a BPEL Service, Mediator service, Adapter Service, or another BPM Process itself. Let's take the case of invoking an Adapter Service (Database Adapter) to perform the insert operation. As a Process Analyst, you will model the service call in the process. However you will implement it in Implementation phase.
How to do it...
1. Go to Component Palette | BPM | Default Activities and select the Service Task activity.
2. Click on the Contract swimlane between the Finalize Contracts User task and End event.
3. This will open the Properties dialog for the Service Task activity.
4. In the Basic tab, enter Name as
Save Quote
.5. Leave other tabs as default. We will implement it at the implementation phase.
6. Create an unconditional sequence flow from the Contracts Finalize User task to the Save Quote service and from the Save Quote service to the End event.
7. When you have finished the preceding steps, click Save.
How it works...
Process Analysts can add the service task when they know that a process must invoke an external service or process to communicate with other processes and services, such as BPMN process, BPEL process, SOA service, Adapter Services and mediator services.
Service task invokes processes and service, synchronously. When the service task invokes a process or service, the token waits at the service task until a response is returned. After the response is received, the token continues to the next sequence flow in the process.
There's more...
Service Adapter (Database Adapter) will be configured in Composite.xml
.
In the Service Activity Save Quote properties, on the Implementation tab, you can browse the service that you will carry out in the Implementation phase to implement it.