We have already discussed about the synchronous and asynchronous BPEL process in my previous articles. Now we will discuss about the operations of different activities in BPEL process.
In this example we will see the use of IF activity in BPEL process. Here the output will come on the basis of IF condition.
- Create a SOA project. Click on File -> New -> Project -> SOA Project and Enter project name as IFActivity
- Click on NEXT button and select the option Composite With BPEL Process
- Click on FIINISH button. BPEL process creation wizard will open. Select the option Synchronous BPEL Process in the template field and also select the checkbox Expose as a SOAP Service
- Create a variable in BPEL process
- Click on green plus sign to create a variable. Enter variable name as inputVar and select string as variable type
- Select Assign activity from component palate and drag and drop it in between receiveInput and replyOutput.
- Double click on Assign activity and map the inputVariable to inputVar
- Select IF activity from Structured Activities component and drag and drop it after Assign activity.
- Now click on plus sign in IF activity and add else if condition like below screenshot. Change the label of IF condition
- Drag and drop three Assign activities under each IF and else-if condition
- Add conditions in IF and ELSE IF and leave the ELSE part
- Assign some value to the output payload in each assign activity under IF condition
- Save the project and the BPEL process will look like below
- Deploy the project and test it in the Enterprise Manager console.
- Test the project by giving different input values.