06 permit app bpel lab

Upload: hassan-khwileh

Post on 02-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 06 Permit App BPEL Lab

    1/47

    CREATE THE PERMIT APPLICATION BPEL PROCESS................................ 2

    Create JDeveloper BPEL Project............................................................................... 2

    Import XSD Files ........................................................................................................ 4

    Assign the BPEL Instance/Reference ID..................................................................... 9

    Add Background Check............................................................................................. 19Add ESB Data Service .............................................................................................. 29

    OracleSOA Suite 10.1.3

    Hands-On WorkshopBPEL and ESB

  • 7/27/2019 06 Permit App BPEL Lab

    2/47

    Create the Permit Application BPEL Process

    This lab will build out the BPEL process to handle permit application requests. Thisprocess will utilize the ESB BackgroundCheckSOAP and ESB PermitDBOut services.

    Create a BPEL Project

    1. First a JDeveloper BPEL project needs to be created. Right-click on the

    SOAWorkshop application workspace and select New project

    Figure 1

    2. In the New Gallery window, select BPEL Process Project and click the OK button.

    Figure 2

  • 7/27/2019 06 Permit App BPEL Lab

    3/47

    3. Name the new BPEL process PermitProcess (no spaces in the name). Make sure

    the Template Synchronous BPEL Process is selected. ClickFinish.

    Figure 3

    4. JDeveloper should now show an empty BPEL process as shown in the following

    diagram.

    Figure 4

  • 7/27/2019 06 Permit App BPEL Lab

    4/47

    Import XSD Files

    5. Next, we will import XML Schemas (XSD) that include object definitions for our

    Permit Application. The XSD includes definitions for the Permit Application which

    will be defined as the input to the BPEL process. The XSD also includes a response

    object that will be configured. Select the Schemas folder in the Structane panelocated at the lower-left corner of JDeveloper. Then right-click.to select the ImportSchema option.

    Figure 5

    6. In the Import Schema window, click the flashlight icon.

    Figure 6

  • 7/27/2019 06 Permit App BPEL Lab

    5/47

    7. Select the PermitApplicationCanonical.xsd file in the

    /home/oracle/MyFiles/support directory. ClickOpen and then OK.

    Figure 7

    8. Now the definitions of the PermitApplicationCanonical.xsd file can be referenced inthe BPEL process. You should see the PermitApplicationCanonical.xsd in the

    Structure pane.

    Figure 8

  • 7/27/2019 06 Permit App BPEL Lab

    6/47

    9. Next, the inbound request object and the response object for the BPEL process needs

    to be assigned to structures defined in the PermitApplicationCanonical.xsd schema.By default when a BPEL process is created, these structures are defined as simple

    string types. In the Structure pane expand the tree for Message Types > Process

    WSDL as show below. Select the payload element for

    PermitProcessRequestMessage and select the edit pencil icon.

    Figure 9

    10. In the Edit Message Part window, select the flashlight icon.

    Figure 10

  • 7/27/2019 06 Permit App BPEL Lab

    7/47

    11. In the Type Chooser dialog select the PermitApplication element under the Project

    Schema Files PermitApplicationCanonical.xsd path. ClickOK twice.

    Figure 11

    12. Next, the XSD structure for the BPEL response will be defined. In the Structure paneof JDeveloper, select the payload element under the

    PermitProcessResponseMessage and select the pencil icon.

    Figure 12

  • 7/27/2019 06 Permit App BPEL Lab

    8/47

    13. In the Edit Message Part window, select the flashlight icon.

    Figure 13

    14. In the Type Chooser dialog select the PermitApplicationResponse element under

    the Project Schema Files PermitApplicationCanonical.xsd path. ClickOK

    twice.

    Figure 14

    15. Save your work by selecting the Save All icon on the Toolbar.

  • 7/27/2019 06 Permit App BPEL Lab

    9/47

  • 7/27/2019 06 Permit App BPEL Lab

    10/47

    18. Click on the General tab and specify the name as AssignPermitIDAndReply.

    Figure 17

    19. Click on the Copy Operation tab and click the Create option. Select the CopyOperation from the pop-up list.

    Figure 18

  • 7/27/2019 06 Permit App BPEL Lab

    11/47

  • 7/27/2019 06 Permit App BPEL Lab

    12/47

  • 7/27/2019 06 Permit App BPEL Lab

    13/47

  • 7/27/2019 06 Permit App BPEL Lab

    14/47

    26. Your Assign activity should now have the following 3 copy operations. ClickOK.

    Figure 25

    27. Compile the BPEL process to make sure there are no errors. Click the Rebuild icon

    in the top center of the JDeveloper screen. This will compile the BPEL processand you can look at the log window for any errors. If the BPEL process was builtcorrectly, you should see a message like the following Successful compilation: 0

    errors, 0 warnings.

    Figure 26

  • 7/27/2019 06 Permit App BPEL Lab

    15/47

  • 7/27/2019 06 Permit App BPEL Lab

    16/47

  • 7/27/2019 06 Permit App BPEL Lab

    17/47

  • 7/27/2019 06 Permit App BPEL Lab

    18/47

    32. After submitting the sample data you should see output similar to the following. This

    shows the reply from the BPEL process.(Notice that the StatusCode has a value of0(which we specified in the assign activity) and the ReferenceID has value of 270001(which should be the BPEL instance ID)). Your ReferenceID will vary. 270001 is

    only an example.

    Figure 32

    We can see by selecting the Instances tab of the BPEL Console that 270001 is thevalue of the BPEL instance id. This value will vary based on the current Instance ID

    in the BPEL system.

    Figure 33

  • 7/27/2019 06 Permit App BPEL Lab

    19/47

  • 7/27/2019 06 Permit App BPEL Lab

    20/47

    In the Service Explorer dialog navigate down through Registered ESB Services

    Local_IntegrationServer PermitData and select BackgroundCheckSOAP.ClickOK.

    Figure 36

    Configure your Partner Role as indicated in the following diagram. ClickOK.

    Figure 37

  • 7/27/2019 06 Permit App BPEL Lab

    21/47

    35. Next, an Invoke activity will be added to the BPEL process to invoke the

    BackgroundCheckService. Drag an Invoke activity from the Components

    Process Activities to the BPEL canvas and place it below the replyOutputactivity.

    Figure 38

    36. Click on the arrow icon to the right of the Invoke_1 activity and drag it on top of

    the BackgroundCheckService. The Edit Invoke dialog pop-up appears.

    Figure 39

  • 7/27/2019 06 Permit App BPEL Lab

    22/47

  • 7/27/2019 06 Permit App BPEL Lab

    23/47

  • 7/27/2019 06 Permit App BPEL Lab

    24/47

    41. The BPEL process should now look like the following. Notice the yellow flag next to

    the InvokeBackgroundCheckService activity. This flag exists because we have notyet assigned values to the BPEL variables used in invoking the background service.

    Figure 43

    42. Drag an Assign activity aboveInvokeBackgroundCheckService.

    Figure 44

  • 7/27/2019 06 Permit App BPEL Lab

    25/47

  • 7/27/2019 06 Permit App BPEL Lab

    26/47

    45. The Create Copy Operation window appears. For the From Variable select the

    Variables Process VariablesinputVariable payloadns1:PermitApplication ns1:Applicant node. For the To Variable select the

    Variables Process Variables

    InvokeBackgroundCheckService_checkApplicant_InputVariable payload

    ns1:Applicant node. ClickOK twice.

    Figure 47

  • 7/27/2019 06 Permit App BPEL Lab

    27/47

  • 7/27/2019 06 Permit App BPEL Lab

    28/47

  • 7/27/2019 06 Permit App BPEL Lab

    29/47

  • 7/27/2019 06 Permit App BPEL Lab

    30/47

    Add an ESB Data Service

    50. Now well add logic to the BPEL process to invoke the ESB data service. Right-click

    on ether of the two Services swimlanes and select Create Partner Link.

    Figure 51

    51. Name the partner linkPermitDataService. Click on the flashlight icon to select aservice.

    Figure 52

  • 7/27/2019 06 Permit App BPEL Lab

    31/47

    52. In the Service Explorer dialog select the Registered ESB Services

    Local_IntegrationServer PermitData PermitData_RS node. ClickOK.

    Figure 53

    53. In the Create Partner Link window make sure the entry for Partner Role is as

    indicated in the diagram below. ClickOK.

    Figure 54

  • 7/27/2019 06 Permit App BPEL Lab

    32/47

    54. Drag an Invoke activity to the BPEL canvas below the

    AssignBackgroundCheckReply activity.

    Figure 55

    55. Drag the arrow icon on the right side of the Invoke activity and drop it onto the

    PermitDataService.

    Figure 56

  • 7/27/2019 06 Permit App BPEL Lab

    33/47

  • 7/27/2019 06 Permit App BPEL Lab

    34/47

  • 7/27/2019 06 Permit App BPEL Lab

    35/47

    60. Select the Copy Operation tab. Create a copy operation as defined in the following

    diagram.

    The From variable is Variables Process VariablesinputVariable

    payload ns1:PermitApplication.

    The To variable is Variables Process Variables

    InvokePermitDataServiceInput > PermitApplication > ns1:PermitApplication.

    Figure 60

    ClickOK twice.

    61. Drag and drop a Switch activity from the Components Process Activities palette

    below theAssignPermitDataService Assign activity.

    Figure 61

  • 7/27/2019 06 Permit App BPEL Lab

    36/47

  • 7/27/2019 06 Permit App BPEL Lab

    37/47

  • 7/27/2019 06 Permit App BPEL Lab

    38/47

    66. Double click on the Assign and name the activity APPROVE_REJECT via the

    General tab. The select the Copy tab and click on CreateCopy Operation.

    On the From side select an Expression for the Type: and type APPROVE as the

    expression source.

    On the To side select Variables Process Variables

    InvokePermitDataServiceInput PermitApplication

    ns1:PermitApplication ns1:Approval ns1:Outcome as the target.

    Figure 66

    ClickOK twice.

  • 7/27/2019 06 Permit App BPEL Lab

    39/47

  • 7/27/2019 06 Permit App BPEL Lab

    40/47

    When the Deployment Properties window pops-up just select the OK button. (For first

    time deployment this will not display). We will ALWAYS deploy Version 1.0 for thislab.

    Figure 68

  • 7/27/2019 06 Permit App BPEL Lab

    41/47

  • 7/27/2019 06 Permit App BPEL Lab

    42/47

  • 7/27/2019 06 Permit App BPEL Lab

    43/47

  • 7/27/2019 06 Permit App BPEL Lab

    44/47

  • 7/27/2019 06 Permit App BPEL Lab

    45/47

  • 7/27/2019 06 Permit App BPEL Lab

    46/47

  • 7/27/2019 06 Permit App BPEL Lab

    47/47