Don't have an Vision instance to practice these tutorials? Visit http://cholagls.com/products-/11i-virtual-machine for details.Our smart solution to smart people like you !!
Here in this simple example lets see how to implement this switch case. Here we will see how to use a File Read Adapter,Assign Activity and Switch Case.
Initial Steps
1.Right Click on Applications.Select New.Go to General->Workspaces->Workspace.

2.Name the workspace as SwitchDemo.Un check the Add new project.

3.Right click on SwitchDemo and select New. Selet New BPEL Project.
4.Name the project as SwitchDemo and select Synchronous process.Depending on your project needs you need to choose this.
File Adapter
5.Save your work.Since we are going to use the File Adapter we need to have a schema for it. So Copy OrderBookingPo.xsd file from C:\OraBPELPM_3\integration\orabpel\samples\tutorials\127.OrderBookingTutorial\PracticeFiles and paste it in your working folder(C:\OraBPELPM_3\integration\jdev\jdev\mywork\SwitchDemo)
6.Right click on Project Schemas in the Structure Navigator and select Import Schemas.Click on the torch icon and select
the OrderBooking xsd file from you r project folder


7.For creating the File adapter drag and drop a PartnerLink to the right side.
8.Name it as FromFile.
.

9.Click on the icon showed in the above screenshot. Select the file adapter.
10.

10.Select the Read File option.
.

11.Select the directory from where the files need to be picked from.

12.Select the file types you want the adapter to pick up.

13.Select the time interval in which the file needs to be picked.

14.A schema needs to be selected.Click Browse and from the Project schemas choose the OrderBookingPo and then Purchase Order.

15.Click Next and Finish.Check the My Role and Partner Role and click Ok.

16.Double click on ReceiveInput and set the following:
Partner Link - FromFile
Operation - Read

Switch Case
17.Drag and drop a Switch activity below receive.There will be 2 cases by default. Drag and drop a assign activity on both the cases.

18.Name the case1 as OrderAbove100 and the otherwise case as Otherwise.
19.Double click on the OrderAbove100 case and create an expression by clicking on Expression icon.Double click on OrderPrice or click the arrow to shuttle it to right.Then click the > symbol and enter ' 100'.this will check if orderprice is greater than 100. and then execute the activities in that particular case.


Map to results.

20.Now for the otherwise case.Double click on that case and select create copy rules.Select the type as expression.Here I am concating the order price item with a string Otherwise Case. So whenever the order price is not greater than 100 this case will get executed and this outputstring will be displayed as output.


Deploy the project and put a xml file into C:/temp folder. It will be picked up.Login to the BPEL Console and Click on SwitchDemo process. Goto AuditFlow and check the output.

Related Posts:
Set as favorite
Bookmark
Report Article
Hits: 374
Trackback(0)
Comments (0)

Write comment

















