Implement WHILE Loop in BPEL Process in SOA suite 12C

In this article we will discuss about another activity while loop in BPEL process. This example will display the series of number in reverse based on loopcounter. Follow the below steps.

  1. Create a project under same application. Go to File -> New -> Project -> SOA Project. Enter project name and then select Composite With BPEL Process in the next wizard
  2. Click on FINISH button and BPEL Process creation wizard will open. Enter BPEL process name and select Synchronous BPEL Process option as template type. Expose this BPEL process as a SOAP service.WHILE_ACTIVITY_BPEL_1
  3. Create two variables in the BPEL process. Click on Variable icon in the main scope. Create two variables a�� loopCounter and resultVar and variable type will be integerWHILE_ACTIVITY_BPEL_2 WHILE_ACTIVITY_BPEL_3
  4. Drag and drop ASSIGN activity after receiveInputWHILE_ACTIVITY_BPEL_4
  5. Double click on Assign activity and assign loopcounter value to input payloadWHILE_ACTIVITY_BPEL_5
  6. Select WHILE activity from Structured Activities component and drag and drop it after Assign activityWHILE_ACTIVITY_BPEL_6
  7. Double click on while activity and give condition by clicking on expression iconWHILE_ACTIVITY_BPEL_7. Condition will be like below screenshot ($loopCounter>0)WHILE_ACTIVITY_BPEL_8
  8. Drag and drop another ASSIGN activity within WHILE activityWHILE_ACTIVITY_BPEL_9
  9. Double click on assign activity and add expressions to resultVar and loopCounter
  10. resultVar: concat($resultVar , $loopCounter) A� A� A� A�loopCounter: $loopCounter – 1
  11. Editor wizard of assign activity will look like thisWHILE_ACTIVITY_BPEL_10
  12. Add one more ASSIGN activity after WHILE activity and assign resultvar to output payloadWHILE_ACTIVITY_BPEL_11
  13. Now BPEL process will be like the below screenshotWHILE_ACTIVITY_BPEL_12
  14. Deploy the project and test it in EM consoleWHILE_ACTIVITY_BPEL_13 WHILE_ACTIVITY_BPEL_14

Leave a Reply

Your email address will not be published. Required fields are marked *

Show my latest post here