Repeat-Untill Activity of BPEL Process in SOA Suite 12C

In this article we will discuss about another activity repeat-until in BPEL process. This example will display the series of number in reverse based on loopcounter.

  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 typeREPEAT_UNTIL_ACTIVITY_BPEL_1
  3. Create two variables in BPEL process. Click on variable icon in the main scope. Create two variables with name a�� loopCounter and resultVar and variable type will be integerREPEAT_UNTIL_ACTIVITY_BPEL_2 REPEAT_UNTIL_ACTIVITY_BPEL_3
  4. Drag and drop ASSIGN activity after receiveInput.REPEAT_UNTIL_ACTIVITY_BPEL_4
  5. Double click on Assign activity and assign loopcounter value to input payloadREPEAT_UNTIL_ACTIVITY_BPEL_5
  6. Select RepeatUntil activity from Structured Activities component and drag and drop it after Assign activity.REPEAT_UNTIL_ACTIVITY_BPEL_6
  7. Double click on RepeatUntil activity and enter condition by clicking on expression iconREPEAT_UNTIL_ACTIVITY_BPEL_7. Condition will be like below screenshot.REPEAT_UNTIL_ACTIVITY_BPEL_8
  8. Drag and drop another ASSIGN activity within RepeatUntil activityREPEAT_UNTIL_ACTIVITY_BPEL_9
  9. Double click on assign activity and add expressions to resultVar and loopCounter.resultVar: concat($resultVar , $loopCounter)loopCounter: $loopCounter – 1
  10. Editor wizard of assign activity will look like this.REPEAT_UNTIL_ACTIVITY_BPEL_10
  11. Add one more ASSIGN activity after RepeatUntil activity and assign resultvar to output payloadREPEAT_UNTIL_ACTIVITY_BPEL_11
  12. Now BPEL process will look like the below screenshotREPEAT_UNTIL_ACTIVITY_BPEL_12
  13. Deploy the project and test it in EM console.REPEAT_UNTIL_ACTIVITY_BPEL_13 REPEAT_UNTIL_ACTIVITY_BPEL_14

Have you observed the difference between WHILE activity and RepeatUntil activity?

In While activity, loop condition will be tested before the body is executed. The loop will be exit when the condition will be false.

In Repeat-Until, loop condition will be tested after the body is executed. Thata��s why one extra zero has come in the output payload.

Leave a Reply

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

Show my latest post here