• No results found

Configuring the EnrollmentProcess Process Overview

In document 12c SOA Design Acctivity (Page 145-160)

Practices for Lesson 8: Overview Practices Overview

Practice 8-3: Configuring the EnrollmentProcess Process Overview

In this practice, you create and configure the activities that comprise the BPEL Process.

Assumptions

This practice assumes that you have completed Practice 8-2 successfully.

Tasks

1. Right-click the BPEL process EnrollmentProcess and select Edit.

The model editor opens.

2. Create and configure a Scope activity.

a. Add a Scope activity between the receiveInput and replyOutput activities.

b. Name the Scope Scope_Outer.

Defining Enrollment Invocation

In this section, you define the activities that are directly related to the invocation of the enrollment request.

3. Create and configure an inner Scope.

a. Expand Scope_Outer.

b. Add a Scope within Scope_Outer.

c. Name the new Scope Scope_Inner.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

4. Create and configure an Invoke activity.

a. Expand Scope_Inner.

b. Add an Invoke activity to Scope_Inner.

c. Right-click the Invoke activity and select Edit.

d. Name the Invoke Invoke_Booking.

e. To specify the partner link, use the Browse icon to navigate to BookingService.

f. Create a new Input variable.

g. Create a new Output variable.

Note: Within a scope, you have the option of creating either global or local variables.

You opt to use global variables in this practice.

h. Verify and save your work.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

5. Create and configure an Assign activity.

a. Add an Assign activity just above Invoke_Booking (inside Scope_Inner).

b. Name the activity setBooking.

c. Right-click the new activity and select Edit.

d. Map the inputVariable elements Id, student, and course to their corresponding elements in the Invoke_Booking_process_InputVariable.

e. Use Expression Builder to map the text 'ENROLLMENT' to the type node of Invoke_Booking_process_InputVariable.

f. Verify and save your work.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Defining Payment Invocation

In this section, you create and configure the activities that are directly related to the invocation of the payment processing.

6. Create and configure an Invoke activity.

a. Collapse Scope_Inner.

b. Add an Invoke activity to Scope_Outer immediately following Scope_Inner.

c. Right-click the new Invoke activity and select Edit.

d. Name the activity Invoke_Payment.

e. To specify the partner link, use the Browse icon to navigate to BookingService.

f. Create a new Input variable.

g. Create a new Output variable.

h. Verify and save your work.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

7. Create and configure an Assign activity.

a. Add an Assign activity just above Invoke_Payment.

b. Name the activity setPayment.

c. Right-click the new activity and select Edit.

d. Map the inputVariable elements Id, cardNumber, and amount to their corresponding elements in Invoke_Payment_process_InputVariable.

e. Use Expression Builder to map the text 'PAYMENT' to the Invoke_Payment_process_InputVariable type field.

f. Verify, and then save your work.

8. Create and configure an Assign activity.

a. Add an Assign activity just below Invoke_Payment.

b. Name the activity setSuccess.

c. Right-click the new activity and select Edit.

d. Use Expression Builder to map the text 'Enrollment process completed successfully' to the enrollmentResponse node of outputVariable.

e. Verify, and then save your work.

Adding Compensation Handling to Scope_Inner

At this point, you have created and configured the “happy path,” where the enrollment and payment information are processed successfully. Recall, however, that the practice scenario describes the possibility of a fault being raised in the payment processing, and the need for handling that fault. Specifically, by the time payment processing fails, space will already have been reserved in the class for the enrollment. In this section, you configure the compensation handler to send an offsetting enrollment cancellation that will free up the reserved seat.

9. Create and configure a compensation handler on Scope_Inner.

a. Expand Scope_Inner.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. On the left edge of the Scope, click the Add Compensation Handler icon as shown in the following diagram:

10. Create and configure an Invoke activity.

a. Add an Invoke activity to the compensation handler.

b. Right-click the new Invoke and select Edit.

c. Name the activity Invoke_Cancel.

d. To specify the partner link, use the Browse icon to navigate to BookingService.

e. Use the Browse icon to reuse Invoke_Booking_process_InputVariable.

f. Use the Browse icon to reuse the Invoke_Booking_process_OutputVariable.

g. Verify and save your work.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

11. Create and configure an Assign activity.

a. Add an Assign activity just above Invoke_Cancel.

b. Name the activity setCancel.

c. Right-click the new activity and select Edit.

d. Map the inputVariable element ID to the corresponding element in Invoke_Booking_process_InputVariable.

e. Use Expression Builder to map the text 'CANCELLATION' to the Invoke_Booking_process_InputVariable type field.

f. Verify and save your work.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Adding Error Handling to Scope_Outer 12. Create and configure a Catch branch.

a. Collapse Scope_Inner.

b. On the left edge of Scope_Outer, right-click the Add Catch icon and select Edit.

The Edit Catch window is displayed.

c. Use the Browse icon to navigate to Partner Links > BookingService >

booking_client_ep.wsdl > paymentFault.

This specifies which fault to catch. The fault is thrown by the BookingService application, and is described in its .wsdl document.

d. Specify faultVariable in the Fault Variable field.

This is the variable that holds the fault message.

e. Select the Message Type radio button.

f. Use the Browse icon to navigate to the partner link BookingService file booking_client_ep.wsdl and specify the Message Type

BookingFaultMessage.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

g. Verify and save your work.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

13. Create and configure a CompensateScope activity.

a. Add a CompensateScope activity within Catch.

b. Right-click the activity and select Edit.

c. From the Target drop-down list, select Scope_Inner.

d. Verify and save your work.

14. Create and configure an Assign activity.

a. Add an Assign activity just below CompensateScope.

b. Name the activity setFault.

c. Right-click the new activity and select Edit.

d. Use Expression Builder to map the text 'Payment invalid or over limit.' to the outputVariable enrollmentResponse field.

e. Verify and save your work.

15. Compare your BPEL process to the following partial image. (The fault-handling components are shown here. The “successful” path is not shown in its entirety.)

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Completing the Configuration of Mediator

Configuration of the BPEL process is complete. The only step that remains is to configure the routing rules in the Mediator.

16. Create and configure the transformation for the enrollment request.

a. In the composite overview window, right-click the Mediator RouteRequest and select Edit.

b. To the right of the first Transform Using field, click the Mapper file icon.

c. Create a new XSLT mapper file.

d. In the mapper, map enrollmentRequest to enrollmentRequest.

Note: This mapping passes the data unchanged from the Mediator to the BPEL Process. This is possible because both the components specify the same input message in their wsdl files.

The AutoMapper dialog box opens.

e. Click OK to accept all defaults.

Each of the leaf nodes is mapped from source to target.

f. Verify and save your work.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

g. Close the editor.

17. Create and configure the transformation for the enrollment reply.

a. In the Synchronous Reply section, to the right of the Transform Using field, click the Mapper file icon.

b. Create a new mapper file.

c. In the mapper, map enrollmentResponse to enrollmentResponse.

d. Verify and save your work.

18. Close the .mplan and .bpel file editors.

19. In the compsite.xml editor, verify your composite application.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Practice 8-4: Deploying and Testing the Application

Overview

In this practice, you deploy the Enroll application and test the fault-handling configuration.

Assumptions

This practice assumes that you have completed practices 8-1 through 8-3 successfully.

Tasks

Deploying the Enroll Composite Application

1. Prepare for the test by deploying the Enroll application to IntegratedWebLogicServer.

Note: Remember to select the “Overwrite any existing composites with the same revision ID” check box.

Testing the Composite Application

2. Open Oracle Enterprise Manager (http://localhost:7101/em).

a. In the Target Navigation pane, expand the SOA > soa-infra > default nodes in the tree.

Click the Enroll [1.0] link.

b. On the Enroll [1.0] home page, click Test.

c. On the Test Web Service page, navigate to the Request tab. Use the Browse button to replace the default message with the contents of the file

/home/oracle/labs/files/xml_in/enrollment_input.xml.

d. Click Test Web Service.

The Response tab is displayed.

e. Click Launch Flow Trace.

f. Click Enrollment Process.

g. Under the replyOutput node, click View Payload.

h. Verify that the status value returned is “Enrollment process completed successfully.”

i. Close the Flow Trace windows.

3. To perform a second test (and generate a fault), click the Request tab.

a. On the Request tab page, modify the amount to be any number greater than 5000.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

c. On the Response tab page, click Launch Flow Trace.

d. Click EnrollmentProcess.

The Flow Trace shows that the Invoke faulted and that execution passed to CompensateScope, and within CompensateScope, to setFault.

e. View the payload for Invoke_Payment. The response message matches what is configured in setFault.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

f. Close the Flow Trace windows and minimize your browser.

KONARK JAIN (konarkjain@inฺibmฺcom) has a non-transferable license to use this Student Guideฺ

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Practice 8-5: Using the Fault Policy Wizard

In document 12c SOA Design Acctivity (Page 145-160)