+ All Categories
Home > Documents > Agc Impugnacion Cessi

Agc Impugnacion Cessi

Date post: 18-Apr-2015
Category:
Upload: rua-sharon
View: 50 times
Download: 1 times
Share this document with a friend
174
Oracle SOA Suite 11g: Essential Concepts Activity Guide D58786GC21 Edition 2.1 April 2012 D76949 Oracle Internal & Oracle Academy Use Only
Transcript
Page 1: Agc Impugnacion Cessi

Oracle SOA Suite 11g: Essential Concepts Activity Guide

D58786GC21 Edition 2.1 April 2012 D76949

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 2: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Disclaimer This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. Restricted Rights Notice If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract. Trademark Notice Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Author Iris Li

Technical Contributors and Reviewers Gary Barg, Pete Daly, Joe Greenwald, David Mills, David Shaffer, Madhavi Siddireddy, Heidi Buelow, Jeff Davies, Ted Witiuk, Soleiman Pello

This book was published using: Oracle Tutor

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 3: Agc Impugnacion Cessi

Table of Contents

Practices for Lesson 1: Introduction ..............................................................................................................1-1 Practices for Lesson 1 ....................................................................................................................................1-2

Practices for Lesson 2: Introducing Service-Oriented Architecture Concepts ..........................................2-1 Practices for Lesson 2: Overview ...................................................................................................................2-2 Practice 2-1: Specifying Tasks in Workflow for a Purchase Order Processing Business Scenario ................2-3

Practices for Lesson 3: Getting Started with Oracle SOA Suite 11g ...........................................................3-1 Practices for Lesson 3 ....................................................................................................................................3-2 Practice 3-1: Test a Predeployed SOA Composite by Using Oracle Enterprise Manager Fusion Middleware Control ........................................................................................................................................3-3 Practice 3-2: Viewing the SOA Composite Instance Details ..........................................................................3-5

Practices for Lesson 4: Building SOA Composite Applications ..................................................................4-1 Practices for Lesson 4: Overview ...................................................................................................................4-2 Practice 4-1: Creating a JDeveloper Connection to the Application Server ...................................................4-3 Practice 4-2: Examining the Prebuilt Composite Application in JDeveloper ...................................................4-5 Practice 4-3: Inspecting the Service Interface (Contract)—WSDL File ..........................................................4-9

Practices for Lesson 5: Orchestrating Services with BPEL Process Components ...................................5-1 Practices for Lesson 5: Overview ...................................................................................................................5-2 Practice 5-1: Examining the Existing Components in the Composite Application ..........................................5-3 Practice 5-2: Adding the Web Services as an External Reference.................................................................5-9 Practice 5-3: Implementing the BPEL Process...............................................................................................5-11 Practice 5-4: Deploying and Testing the Composite Application ....................................................................5-23 Appendix 5-1: Creating a Composite Application Workspace ........................................................................5-27 Appendix 5-2: Create a File Adapter for Writing Records to a File .................................................................5-28 Appendix 5-3: Create an Order Approval BPEL Process ...............................................................................5-30

Practices for Lesson 6: Mediating Messages with Mediator Components .................................................6-1 Practices for Lesson 6: Overview ...................................................................................................................6-2 Practice 6-1: Inspecting the File Adapter That Reads Purchase Order from Files .........................................6-3 Practice 6-2: Creating a Mediator to Route Order Requests ..........................................................................6-6 Practice 6-3: Modifying Composite to Use Mediator to Route Order Result ...................................................6-11 Practice 6-4: Adding Filters to Mediator Routing Rules ..................................................................................6-19 Practice 6-5: Deploying and Testing ..............................................................................................................6-21

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components ....................7-1 Practices for Lesson 7: Overview ...................................................................................................................7-2 Practice 7-1: Examining the Business Rules ..................................................................................................7-3 Practice 7-2: Integrating the Business Rule Component in the BPEL Process ..............................................7-6 Practice 7-3: Modifying BPEL Process ...........................................................................................................7-15 Practice 7-4: Deploying and Testing ..............................................................................................................7-20 Practice 7-5: Modifying Business Rules in SOA Composer ...........................................................................7-23

Practices for Lesson 8: Implementing Human Activities with Human Task Components ........................8-1 Practices for Lesson 8: Overview ...................................................................................................................8-2 Practice 8-1: Creating and Defining a Human Task for Manual Order Approval ............................................8-3 Practice 8-2: Integrating the Human Task Component in the BPEL Process .................................................8-10 Practice 8-3: Deploying and Testing ..............................................................................................................8-18

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 4: Agc Impugnacion Cessi

Practices for Lesson 9: Creating Business-Driven Processes with BPMN.................................................9-1 Practices for Lesson 9: Overview ...................................................................................................................9-2 Practice 9-1: Creating a Process in Business Process Composer .................................................................9-3 Practice 9-2: Editing the Process in BPM Studio ...........................................................................................9-12

Practices for Lesson 10: Managing and Monitoring Composite Applications ...........................................10-1 Practices for Lesson 10: Overview .................................................................................................................10-2 Practice 10-1: Deploying the Composite Through EM Console .....................................................................10-3 Practice 10-2: Testing the Application with a Fault Scenario .........................................................................10-5

Practices for Lesson 11: Enterprise Integration Using Oracle Service Bus ...............................................11-1 Practices for Lesson 11 ..................................................................................................................................11-2

Practices for Lesson 12: Exploring SOA Governance ..................................................................................12-1 Practices for Lesson 12 ..................................................................................................................................12-2

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 5: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction Chapter 1 - Page 1

Practices for Lesson 1: Introduction Chapter 1

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 6: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Introduction Chapter 1 - Page 2

Practices for Lesson 1

Practices Overview There are no practices for this lesson titled “Introduction.”

General Notes There are no notes.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 7: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introducing Service-Oriented Architecture Concepts Chapter 2 - Page 1

Practices for Lesson 2: Introducing Service-Oriented Architecture Concepts Chapter 2

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 8: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introducing Service-Oriented Architecture Concepts Chapter 2 - Page 2

Practices for Lesson 2: Overview

Practices Overview The goal of the practices in this lesson is to investigate and identify the various business processes that you can define and associate with the purchase order processing application. Deduce a workflow diagram by segregating different tasks and business processes in a sequential flow for the purchase order processing business process scenario. In this practice, you specify the missing links in the given processes’ workflow diagram for the purchase order processing business process scenario.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 9: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introducing Service-Oriented Architecture Concepts Chapter 2 - Page 3

Practice 2-1: Specifying Tasks in Workflow for a Purchase Order Processing Business Scenario

Overview In this practice, you specify the missing links in the purchase order processing business process workflow diagram.

Tasks The POProcessingComposite SOA composite is described in the following sequence of steps. 1. Details of the purchase order are received. 2. If the status of the order is payment, the order will pass through a validation and approval

process (where the customer’s credit card status is validated). 3. If the credit card status is invalid, the order is rejected and the validation result is written to

a log file. 4. If the credit card status is valid, the total order amount is evaluated. 5. If the total order amount is less than $3000, the order is auto-approved and updated status

is written to the log file. 6. If the order amount is greater than or equal to $3000, the order passes through a manual

approval process. 7. If the order is “approved” by the assignee, the status of the order will be updated and

written to the log file. 8. If the order is “rejected,” the status of the order will be updated and written to the log file. Based on the application description, fill in the missing business process links (annotated with question marks) in the following business process flow diagram.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 10: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introducing Service-Oriented Architecture Concepts Chapter 2 - Page 4

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 11: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introducing Service-Oriented Architecture Concepts Chapter 2 - Page 5

Solution:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 12: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Introducing Service-Oriented Architecture Concepts Chapter 2 - Page 6

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 13: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 11g Chapter 3 - Page 1

Practices for Lesson 3: Getting Started with Oracle SOA Suite 11g Chapter 3

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 14: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 11g Chapter 3 - Page 2

Practices for Lesson 3

Practices Overview The goal of the practices in this lesson is to make you familiar with the Oracle Enterprise Manager 11g Fusion Middleware Control console with respect to initiating the SOA composite application deployed to the Oracle SOA Suite 11g, and inspecting the composite’s instance.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 15: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 11g Chapter 3 - Page 3

Practice 3-1: Test a Predeployed SOA Composite by Using Oracle Enterprise Manager Fusion Middleware Control

Overview In this practice, you test the CreditCardValidation composite application, predeployed to the SOA server instance, by using the Fusion Middleware Control console.

Assumptions Both WebLogic administration server and SOA server instances are up and running.

Tasks Your tasks here are to:

• Start the WebLogic administration server and managed SOA server instance • Log in to the Fusion Middleware Control console • Initiate the CreditCardValidation composite application and view the response

message

1. To start the WebLogic administration server, perform the following steps: a. Locate the “Start Admin Server” icon on the windows Desktop, double-click it. b. In the “Start Admin Server” command window, wait until you see a message similar to:

<April 8, 2011 5:19:10 PM GMT> <Notice> <WebLogicServer> <BEA- 000360> <Server started in RUNNING mode>

c. Minimize the “Start Admin Server” command window. 2. In a similar fashion, start the SOA Server (managed server):

a. Double-click the “Start SOA Server” icon on the windows Desktop. b. In the “Start SOA Server” command window, wait until you see a message similar to:

INFO: FabricProviderServlet.stateChanged SOA Platform is running and accepting requests

c. Minimize the “Start SOA Server” command window. 3. Log in to the Fusion Middleware Control console by performing the following steps:

a. Open a Firefox browser and enter the following URL in the address field: http://localhost:7001/em

b. In the Oracle Fusion Middleware Control console login page, enter the following credentials and click Login: User Name: weblogic Password: welcome1 Note: The Farm home page (called Farm_base_domain) is displayed after you log in.

4. On the Farm home page, in the left navigation frame, expand the SOA > soa-infra > default folder. You should see ValidationForCC [1.0]. Note: You will note another composite application, called SimpleApproval in the default partition. This application is deployed with the SOA Suite installation.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 16: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 11g Chapter 3 - Page 4

5. Click the ValidationForCC [1.0] link, view the composite information in the ValidationForCC [1.0] > Dashboard tab page, and try to answer the following questions: a. Do you see any instances in the Recent Instances section? If not, why?

Answer: No, because the composite application hasn’t been initiated. b. What are the names and types of the components in the ValidationForCC application?

Answer: The composite contains only one component (as determined from the Component Metrics section), CreditCardValidationProcess, which is a BPEL component type.

What is creditcardstatus_ep in the Services and Referencesd. section? Answer: BPEL component is exposed as a web service, creditcardstatus_ep, which is the entry point to the composite application.

6. On the ValidationForCC [1.0] home page, click Test. 7. On the Test Web Service page, accept all default settings, then provide an input string for

the test. Make sure the Request tab is selected, and scroll down to locate the Input Arguments section. With the default Tree View mode, in the payload > input field, enter the value: 1234-1234-1234-1234, and click Test Web Service. Use the following image as a guide:

8. On the Test Web Service page, the page is refreshed with the Response tab becoming

active and showing the test result as VALID (credit card status). 9. In a similar fashion, execute the test case with a different credit card number, for example

1234-1234-1234-0000, and verify that the result field shows the INVALID credit card status.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 17: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 11g Chapter 3 - Page 5

Practice 3-2: Viewing the SOA Composite Instance Details

Overview When you initialize a SOA composite application, a new composite instance is created. In this practice, you view the generated CreditCardValidation composite instance details and see the path a message has followed from the moment it entered the SOA Suite, until all activity in the composite instance has completed.

Assumptions You initiated the composite application as described in the previous practice.

Tasks 1. View the CreditCardValidation SOA composite’s instances.

a. Click the ValidationForCC [1.0] link in the left navigation frame of EM. The ValidationForCC [1.0] page is displayed in the right pane.

b. In the ValidationForCC [1.0] > Dashboard tab page, you should see two SOA composite’s instances listed in the Recent Instances section.

2. Inspect the flow trace of the SOA composite instance. a. Click the Instance ID to launch the flow trace of the composite instance. b. On the Flow Trace page, under the Trace section, all components that were visited

appear in the flow trace. The flow trace shows the status of each component invocation and also the complete time. Note: In the flow trace, you can also see other composites (if any) that are invoked and all other bindings such as external Web Services and adapter references.

3. To drill down into each component in the flow, you can click the

CreditCardValidationProcess link in the Instance column of the Flow Trace tree to examine the Audit Trail of the BPEL process component.

4. On the “Instance of CreditCardValidationProcess” Audit Trail tab page, you can see the BPEL process activities and what functions they provide. In addition, you can examine the details of the messages processed by the BPEL component by expanding the <payload>

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 18: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 11g Chapter 3 - Page 6

node.

5. Click the Flow tab to view the BPEL flow. You can click an activity to view the details.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 19: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 11g Chapter 3 - Page 7

Note: In the next practice, Lab 4, you will examine the assembly model of this composite application at design time in JDeveloper.

6. When you are finished, close the Flow Trace page window.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 20: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 11g Chapter 3 - Page 8

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 21: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 1

Practices for Lesson 4: Building SOA Composite Applications Chapter 4

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 22: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 2

Practices for Lesson 4: Overview

Practices Overview In the previous practice, you have seen the composite application—CreditCardValidation—deployed on the SOA server. In these practices, you will examine the assembly model of this composite application in JDeveloper, and get familiar with its service interface described in the WSDL file.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 23: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 3

Practice 4-1: Creating a JDeveloper Connection to the Application Server

Overview In this practice, you create an application server connection for your SOA Server to enable you to deploy SOA composite application projects and other services.

Assumptions SOA Server instance must be up and running.

Tasks 1. On the Desktop, double-click the JDeveloper Studio 11.1.1.4.0 desktop icon to start

JDeveloper. 2. On the Select Role window, keep the Default Role selected, deselect the “Always prompt

for role selection on startup” option, and click OK. Note: If you see a Confirm Import Preferences window displayed with a question “Would you like to import preferences from a previous JDeveloper installation?” click No, and deselect the “Allow automated usage reporting to Oracle” option in the Oracle Usage Tracking dialog box.

3. On the JDeveloper window, click the View > Resource Palette menu. 4. On the JDeveloper Resource Palette window, click the New (icon) > New Connection >

Application Server. Use the following image as a guide:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 24: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 4

5. On the Create Application Server Connection wizard pages, enter the information specified in the following table:

Step Screen/Page Description Choices or Values

a. Name and Type Connection Name: MyApplicationServerConnection Accept the default “Connection Type” selection option, and click Next.

b. Authentication Username: weblogic Password: welcome1 Click Next.

c. Configuration Weblogic Domain: base_domain Accept defaults for remaining fields, and click Next.

d. Test Click Test Connection and ensure you have a success for all nine tests, click Finish.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 25: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 5

Practice 4-2: Examining the Prebuilt Composite Application in JDeveloper

Overview In this practice, you examine the assembly of the prebuilt CreditCardValidation composite in JDeveloper. You get familiar with details of a service and how services and service components interact.

Assumptions N/A

Tasks 1. In the Application Navigator pane, click Open Application… (or you can select File >

Open).

2. In the Open Application(s) dialog box, navigate to the

D:\labs\Lesson_04\CreditCardValidation directory, and open the CreditCardValidation.jws file. The ValidationForCC project folder displays in the Application Navigator pane.

3. Expand the ValidationForCC > SOA Content folder; you should see a collection of application files and artifacts.

4. The composite.xml file, known as the SCA Descriptor, contains the XML source showing the assembly model for the composite application. Double-click the composite.xml file; the Composite Editor opens and presents the Design view of the composite. Note: At the bottom of the editor pane are three tabs: Design, Source, and History. The Design and Source tabs provide different views on the same source.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 26: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 6

a. In the Design view, you can see from what components the composite application is

assembled and how these components are related. Try to answer the following questions: 1) This composite is assembled from what service components?

Answer: The composite contains only one service component named CreditCardValidationProcess. It is implemented in BPEL. You can tell the component type by moving the cursor over the component. Note: Optionally, double-click the CreditCardValidationProcess BPEL process (This opens up the CreditCardValidationProcess.bpel file) to open the BPEL designer and view the BPEL activities.

2) Which service provided by the composite is accessible from outside the composite’s domain? Answer: It is the service entry point, creditcardstatus_ep.

b. Double-click the creditcardstatus_ep icon in the Exposed Services lane. In the Update Service dialog box, you can see that the service contract is defined in a WSDL document named CreditCardValidationProcess.wsdl. At the heart of the WSDL contract for a Web Service is the portType element, CreditCardValidationProcess, which contains operation definitions.

c. Close the Update Service dialog box. d. Double-click the CreditCardValidationProcess BPEL process component. The

BPEL process editor opens and presents the design view of the BPEL process. Use the following image as a guide:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 27: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 7

The Design view offers a graphical overview of the BPEL process activities, functions they provide, and the logic flow.

e. Close the BPEL process editor. 5. There are additional folders and files in the composite project folder (in the Application

Navigator pane), depending on the Composite Template chosen when the application is created. In this case, you should see: a. CreditCardValidationProcess.bpel: The component implementation file that

contains the functionality of the BPEL process. It is referenced in the composite.xml file.

b. CreditCardValidationProcess.componentType: Each component has a component type file that references the component-specific implementation file.

c. CreditCardValidationProcess.wsdl: The WSDL file that describes the interfaces (contracts) of the composite as a whole (the services it exposes)

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 28: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 8

d. The xsd folder, which contains XSD files imported into the project and used by WSDL files to define the data design of XML elements

Note: The testsuites, xsl, and Business Rules folders are also presented in the project folder, but they don’t contain any content.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 29: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 9

Practice 4-3: Inspecting the Service Interface (Contract)—WSDL File

Overview In this practice, you analyze the technical aspects of the service interface (contract) according to WSDL, and the XSD document that is used by the WSDL document to define the message structure.

Assumptions N/A

Tasks 1. In the ValidationForCC > SOA Content folder, double-click the

CreditCardValidationProcess.wsdl file. The WSDL editor opens and presents the design view of the WSDL document.

2. In this graphical overview of the WSDL file, you can explore the structure and relationship of the elements.

3. You should see the contents of Port Types, Bindings / Partner Link Types and Services. The WSDL document contains the portType element, a set of abstract operations, in this case, an operation named process, and the abstract messages (input, output, and fault) involved with those operations. Click the Show Contents icon on the Message tag.

4. A message can consist of multiple parts. Each part can be seen to represent a parameter in

the operation request or response. Click CreditCardValidationProcess > process > input element in the Port Types pane; a link appears showing the relationship.

Note: In general, it is recommended to stick with single-part messages because it is less complex and less likely to have you experience tool limitations.

5. Click the Source tab at the bottom of the WSDL editor. The source view of the WSDL document is presented.

Click to see the content of the Messages element.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 30: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 10

6. Locate the <types> section. The type definitions can contain XSD-style elements or import one or more external XSD documents. In this case, the WSDL document imports message definitions using an external XSD document, CreditCardValidationProcess.xsd.

<wsdl:types>

<schema xmlns="http://www.w3.org/2001/XMLSchema">

<import namespace="http://xmlns.oracle.com/CreditCardValidation/ ValidationForCC/CreditCardValidationProcess" schemaLocation="xsd/CreditCardValidationProcess.xsd" />

</schema>

</wsdl:types>

Examine the XML Schema Next, you open the supplied XML schema file using the XML schema (XSD) editor. This enables you to view the structure payload of information. 7. You can view the XSD file in one of the following two ways:

a. In the design view of the WSDL editor, click the Import drop-down menu, and select the CreditCardValidationProcess.xsd file.

b. Double-click the file in the project folder:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 31: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 11

8. The XSD editor opens and presents the design view of the XSD document. You can view the UML class model and entity relationship.

9. Click the Source tab at the bottom of the XSD editor to view the source code of the XSD

document. 10. When you are finished, close the CreditCardValidation application, but leave JDeveloper

open.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 32: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: Building SOA Composite Applications Chapter 4 - Page 12

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 33: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 1

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 34: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 2

Practices for Lesson 5: Overview

Practices Overview The goal of the practices in this lesson is to create the POProcessing composite, which contains a BPEL process. The BPEL process validates the client’s credit card number by invoking an external Web service (CreditCardValidation). Based on the credit card validation result (valid or invalid), the BPEL process sends the status to the File Adapter, which then writes a summary log file in the file system. By implementing this composite application, you get a feel for working with an implementation of the SCA specification for building a composite and the BPEL process modeler. The image shows the components that make up the composite application, along with their dependencies.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 35: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 3

Practice 5-1: Examining the Existing Components in the Composite Application

Overview To save time, you can work on the core activities. The POProcessing composite application, containing some basic components, has already been created for you. In this practice, you will examine these components. If you are interested in creating the composite application from the beginning, the instructions are provided in the Appendix section (Appendix 5-1, Appendix 5-2, and Appendix 5-3) of this document.

Tasks 1. In the Application Navigator pane, click Open Application… (or you can select File >

Open). 2. In the Open Application(s) dialog box, navigate to the

D:\labs\Lesson_05\POApplication directory, and open the POApplication.jws file. The POProcessing project folder is displayed in the Application Navigator pane.

3. In the SOA Content folder, open the composite.xml file in the Design view of the Composite editor.

The composite consists of a BPEL process component, an exposed service, and an outgoing File Adapter.

Inspecting the Service Interface 4. Double-click the approveccorder_client_ep exposed service. In the Update Service

window, you should see that the service interface—published for the BPEL process component—is defined in the ApproveCCOrder.wsdl file.

5. Close the Update Service window. 6. In the POApplication > SOA Content folder, double-click the ApproveCCOrder.wsdl file.

The WSDL editor opens and displays the Design view of the WSDL document. Review the content of the Messages and Port Types elements.

7. Click the Import drop-down menu, and select the order.xsd file to open the XSD editor. The message structure of the ApproveCCOrder.wsdl file is defined in this XML schema.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 36: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 4

8. Expand the elements in the XSD editor. You should see that the structure resembles the following image:

The XSD declares the Order element based on the complex type, OrderType, and it contains multiple child elements. All the child elements are based on simpleType, except the creditCardInfo element, which is based on the complex type, ccInfo.

Inspecting the BPEL Process Service Component 9. The ApproveCCOrder component is created based on the Asynchronous BPEL Process

template. Double-click the ApproveCCOrder BPEL component to open it in the BPEL Editor. You should see that the process contains two types of external partners: • approveccorder: Represents the external party that calls the BPEL process

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 37: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 5

• WriteApprovalResults: Represents the File Adapter service that the BPEL process invokes itself

and three activities at this point: receiveInput, callbackClient, and InvokeWriteApprovalRecords.

10. The receiveInput (the Receive activity) and callbackClient (the Invoke activity) are created

by the template, as will be the case for all asynchronous BPEL processes. The Receive activity receives the service request from an external partner, and starts a new instance of the BPEL process. The Invoke (callback) activity—usually after some meaningful processing in intermediate BPEL activities that have yet to be added—returns a response to the external partner.

11. The Receive activity is present in most BPEL processes, usually at the very beginning. Double-click the Receive activity icon to open the editor. The information in the General tab page shows that a Receive activity: • Receives a request from a partnerLink, and causes a new instance of the BPEL

process to be created • Corresponds with operations in the portType in the WSDL of the BPEL component. In

this lab, the Receive maps to the process operation of the ApproveCCOrder.wsdl file.

• Specifies a BPEL process variable that will be populated with the incoming request message. In this lab, the request message is assigned to the inputVariable. This

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 38: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 6

variable created by default (when the BPEL process is created) is based on the message types specified in the WSDL for the ApproveCCOrder’s process operation.

12. You don’t need to make any changes here; just click Cancel to close the Receive activity

editor. 13. Double-click the callbackClient activity icon to open the Invoke Activity editor.

Note: In an asynchronous process, because the partner is not online, you cannot reply directly. Instead, you make a call to the callback service that the partner has made available. Making a call to a partnerLink is done through the Invoke activity, The information under the General tab shows that Invoke activity: • Returns the output via the callback to the processResponse operation of the

ApproveCCOrder.wsdl file • Uses outputVariable to specify the output to be returned as the service response

by the callbackClient activity. This variable created by default (when the BPEL process is created) is based on the message types specified in the WSDL for the ApproveCCOrder’s processResponse operation.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 39: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 7

14. Again, you don’t need to make any changes here; just click Cancel to close the Invoke

activity editor. Note: Though the BEPL process was created using the Asynchronous BPEL Process template, in this lab, you use it as One-Way BPEL Process, which means no output will be sent to the partnerLink (Client). The callback activity will be implemented in the labs of the lesson titled “Mediating Messages with Mediator Components.”

15. The InvokeWriteApprovalRecords activity (in between the Receive and callback activities) is an Invoke activity added to call the external file adapter service, WriteApprovalResults, to write the order data to the log file. You can double-click it to view the details.

Inspecting the File Adapter Service 16. In the Design view of the Composite editor, double-click the WriteApprovalResults file

adapter (External Reference). 17. In the File Adapter Configuration Wizard, review the information presented in each step and

answer the following questions: Q: What is the operation name of this file adapter service interface? A: Write Q: How does the message structure of the file adapter service interface get defined? A: The message structure is defined by the XSD file—order.xsd in the xsd directory of the SOA project folder.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 40: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 8

Q: Where is the outgoing file located? A: The outgoing file is placed in the d:\Labs\po_data directory.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 41: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 9

Practice 5-2: Adding the Web Services as an External Reference

Overview For the BPEL process component to be able to invoke the CreditCardValidation service, the Web service needs to be added as an external reference in the assembly model of the composite. Then in the following practice, you will modify the BPEL process to call this service to verify credit card status.

Assumptions The CreditCardValidation service is deployed and running on the SOA server.

Tasks 1. Make sure the Composite editor of your POApplication composite application is open and

the Design view displayed. 2. Drag a Web Service component from the Component Palette to the External References

lane in the Composite editor.

3. To configure the interface for the Web Service, perform the steps as below:

a. In the Create Web Service window, enter the following information: Name: getCCStatus Type: Reference Next to the WSDL URL field, click the “Find existing WSDLs” icon.

b. In the SOA Source Browser window, click the drop-down menu (in the top of the window) to select Resource Palette, navigate down the IDE Connections tree to locate ValidationForCC[Default 1.0] service, and click OK. Use the following screenshot as a guide:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 42: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 10

c. When the SOA Resource Browser window closes, the Create Web Service window is

updated with the CreditCardValidation service interface information. Click OK to close the window.

4. Wire the approveCCOrder BPEL process and the getCCStatus service in the Composite editor, as shown in the following screenshot:

O

racl

e In

tern

al &

Ora

cle

Aca

dem

y U

se O

nly

Page 43: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 11

Practice 5-3: Implementing the BPEL Process

Overview In this practice, you edit the BPEL Process component to:

• Perform calling the external CreditCardValidation service • Add internal logic to call the file adapter to write the validation results to a log file

Assumptions N/A

Tasks 1. In the Composite editor of POApplication composite (Design view), double-click the

ApproveCCOrder BPEL process component to open the BPEL Editor. Your BPEL Editor should resemble the following screenshot:

Note: If you don’t see the getCCStatus partner link, use the following instructions to create it: a. Right-click in the Partner Links lane, select “Create Partner Link…” from the context

menu. b. In the Create Partner Link window, create a Partner Link to the getCCStatus service by

using instructions in the following table and associated screenshots:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 44: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 12

Step Screen/Page Description Choices or Values

a. Create Partner Link Name: getCCStatus

Click the SOA Resource Browser ( ) icon.

b. SOA Resource Browser Click the drop-down menu (in the top of the window) to select Resource Palette. Navigate down the IDE Connections tree to locate ValidationForCC[Default 1.0] service. Click OK.

c. Create Partner Link Partner Role: CreditCardValidationProcessProvider Click OK.

When the window closes, the approveCCOrder.bpel file is updated with the getCCStatus in Partner Links lane in the BPEL Editor.

2. Add an Invoke activity to invoke the getCCStatus partner link. a. Drag an Invoke activity from the Component Palette, and drop it to an insertion point

between receiveInput activity and InvokeWriteApproavalRecords activity within the workflow lane. Use the following screenshot as a guide:

b. Drag a wire from the newly added Invoke activity to the getCCStatus in the Partner

Links lane. Note: This tells your BPEL process to invoke the service.

c. In the Edit Invoke window, under the General tab, specify the following values: • Name: InvokeCCStatusService

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 45: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 13

• Input Variable: Click the green [+] icon, accept the default name and type, and click OK. This will create a new global variable. Note: This variable contains the data that will be sent to the CreditCardValidation service, or the input to the service.

• Output Variable: Click the green [+] icon, accept the default name and type, and click OK. This will create a new global variable. Note: This variable contains the data that will be returned by the service, or the output of the service.

d. Click OK to close the Edit Invoke window.

3. Add an Assign activity to assign values to variables. Note: You created the variables that are used when interacting with the getCCStatus service, but they have not been populated. The output variable will automatically be populated when the service returns a result, but you need to populate the input variable that is going to be passed to the service. In this case, you assign the credit card number that is passed into the POProcessing service to the getCCStatus service. a. Drag an Assign activity (from the Component Palette) to an insertion point between

receiveInput activity and invokeCCStatusService activity in the BPEL Editor.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 46: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 14

b. Double-click the Assign activity to edit it. The Assign activity uses an XPath expression

to extract values from the input variable of the approveCCOrder service—in this case it is the credit card number—and assigns it to the input variable of the InvokeCCStatus service. 1) In the Edit Assign window, click the General tab and change the name to

assignCCNumber. 2) Click the Copy Rules tab, to copy the data:

a) In the source column (left), expand Variables > Process > Variables > inputVariable > payload > Order > creditCardInfo > cardNumber.

b) In the target column (right), expand Variables > Process > Variables > invokeCCStatusService_process_InputVariable > payload > process > input.

c) Drag a connector from the cardNumber node (in the source column) to the input node (in the target column), as shown in the screenshot below:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 47: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 15

Note: The inputVariable is based on the ApproveCCOrderRequestMessage, which has one part (called payload) that is based on the Order element in the order.xsd file.

c. When the two nodes are connected, the screen is updated with the XPath expression. Use the following screenshot as a guide. Click OK.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 48: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 16

4. Add a Switch activity to check the result of credit card validation.

a. Drag a Switch activity and drop it between the invokeCCStatusService activity and InvokeWriteApprovalRecords activity. After dropping the Switch activity, your BPEL editor will be updated as shown in the following screenshot:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 49: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 17

b. Double-click the Switch activity icon ( ). c. In the Switch dialog box, enter EvaluateCCStatus in the Name field, and click OK. d. Add a condition in the Switch activity to compare the result returned from the

getCCStatus service with a string value. If the condition is true, then BPEL executes any activities in the <case> branch of the Switch activity. If not, any activities in the <otherwise> branch are executed. 1) Click the <condition> button. 2) In the pop-up window, enter True in the Label field, and click the XPath Expression

Builder icon ( ). 3) In the Expression Builder window, in the BPEL Variables field, expand Variables >

Process > Variables > invokeCCStatusService_process_OutputVariable > payload > processResponse, and select the result element.

4) Click the Insert Into Expression button (the wide button under the Expression field).

5) In the Expression field, place the cursor at the end and add: ='VALID'. Use the following screenshot as a guide:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 50: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 18

6) Click OK to close the Expression Builder window. 7) Click OK to close the Condition pop-up window.

e. Add an Assign activity in the True branch of the Switch activity. The Assign activity assigns the value ‘approved’ to the “status” child element of the InvokeWriteApprovalRecords_Write_InputVariable that populates the outgoing message. 1) Drag an Assign activity (from the Component Palette) onto the text Drop Activity

Here in the True branch of the Switch activity.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 51: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 19

2) Double-click the Assign activity to edit it. 3) In the Edit Assign window, click the General tab and change the name to

assignApproval. 4) Click the Copy Rules tab. 5) In the target column (right), expand Variables > Process > Variables >

InvokeWriteApprovalRecords_Write_InputVariable > body > Order, and locate the status node.

6) Drag the Expression icon ( ), and drop it to the status node, as shown in the screenshot below: O

racl

e In

tern

al &

Ora

cle

Aca

dem

y U

se O

nly

Page 52: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 20

7) In the Expression Builder window, in the Expression field, enter ‘approved’ and

click OK.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 53: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 21

8) In the Edit Assign window, note that the From and To fields are updated with the

XPath expression. Click OK to return to the BPEL flow.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 54: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 22

f. Similarly, add an Assign activity in the <otherwise> branch of the Switch activity to

assign the invalidCreditCard value to the InputVariable of the outgoing message. 1) Drag an Assign activity (from the Component Palette) into the <otherwise> branch

of the Switch activity. 2) Double-click the Assign activity to edit it. 3) In the Edit Assign window, click the General tab and change the name to

assignInvalidCC. 4) Click the Copy Rules tab. 5) In the target column (right), select Variables > Process > Variables >

InvokeWriteApprovalRecords_Write_InputVariable > body > Order, and locate the status node.

6) Drag the Expression icon ( ) to the status node. 7) In the Expression Builder window, in the Expression field, enter

‘invalidCreditCard’ and click OK. 8) In the Edit Assign window, note that the From and To fields are updated with the

XPath expression. Click OK to return to the BPEL flow. 5. At the top of BPEL designer, click the green check mark to validate the BPEL process. Any

yellow flags should disappear and you should not see any warning messages. 6. Save the changes to the project.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 55: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 23

Practice 5-4: Deploying and Testing the Composite Application

Overview In this practice, you deploy the POProcessing composite application to the SOA server and use the Enterprise Manager 11g Fusion Middleware Control console to test the service with a sample input.

Assumptions N/A

Tasks

Deploy the POProcessing composite to application server. 1. In the Application Navigator pane, right-click the POProcessing project, and select Deploy >

POProcessing. The Deploy POProcessing window is displayed. 2. In the Deploy POProcessing window, use the instructions in the following table to configure

the deployment settings and deploy the composite:

Step Screen/Page Description Choices or Values

a. Deployment Action Make sure Deploy to Application Server is selected. Click Next.

b. Deployment Configuration Accept the default settings, and click Next. Note: Because this is the first time you are deploying the application, you can use the default settings. If you are redeploying your application with the same revision number, you must select the option to overwrite the previous version or enter a new version (revision ID). Otherwise, the deployment will fail.

c. Select Server Select MyApplicationServerConnection. Click Next.

d. SOA Servers Accept the default settings. Click Finish.

3. The deployment processing starts. Monitor deployment progress and check for successful compilation in the SOA – Log window, and verify that deployment is successful in the Deployment – Log window, similar to what is shown in the following screenshots:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 56: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 24

4. When you are finished, close the POProcessing application in JDeveloper.

Test POProcessing Composite Using Enterprise Manager Web Interface. In this section, using Oracle Enterprise Manager 11g Fusion Middleware Control console, you test the POProcessing composite with a set of predefined input parameters. 5. Log in to the Fusion Middleware Control console by performing the following steps:

a. Open a web browser and enter the following URL in the address field: http://localhost:7001/em

b. On the Oracle Fusion Middleware Control console login page, enter the following credentials and click Login: User Name: weblogic Password: welcome1

6. On the Farm home page, in the (left-hand) navigation frame, expand the SOA > soa-infra > default folder. You should see POProcessing [1.0] is in the list of deployed applications.

7. The POProcessing application accepts a purchase order via a SOAP invocation. To initiate a test of the POProcessing composite, perform the following steps: a. Click the POProcessing [1.0] link. b. On the POProcessing [1.0] home page, click Test. c. On the Test Web Service page, accept all default settings, scroll down to the Input

Arguments section in the Request tab, select XML View and replace the initial XML contents with the XML data in the file: D:\labs\Application_Files\PO_Files\po-SOAP.xml

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 57: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 25

d. Click the Test Web Service button.

On the Test Web Service page, the page is refreshed with the Response tab becoming active and showing the test result.

8. Verify the test result of the POProcessing SOA composite. a. On the Test Web Service page, under the Response tab, verify that the Test Status is

“Request successfully received.” Question: Why does the Test Web Service page not show any response?

b. Click the Launch Flow Trace link to view the details of the results. c. On the Flow Trace page, under the Trace section, all components that were visited

appear in the flow trace. Verify that all components have a Completed state, indicating that the application executed successfully.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 58: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 26

d. You can also verify the result by opening the new log file (order_n.txt) that has

been created by the File Adapter service in the D:\labs\PO_data\ directory with a text editor. The output file should resemble the following: <?xml version="1.0" encoding="UTF-8" ?><ns1:Order xmlns:ns1="http://xmlns.oracle.com/ns/order" xmlns="http://xmlns.oracle.com/ns/order">

<ns1:customerId/>

<ns1:orderId/>

<ns1:status>approved</ns1:status>

</ns1:Order>

9. Execute the test case again, but this time, change the credit card number to something like, 1234-1234-1234-0000, which represents an invalid credit card.

10. Observe the order status in the new log file that has been created by the File Adapter service in the D:\labs\PO_data\ directory. The output file should resemble the following:

<?xml version="1.0" encoding="UTF-8" ?><ns1:Order xmlns:ns1="http://xmlns.oracle.com/ns/order" xmlns="http://xmlns.oracle.com/ns/order">

<ns1:customerId/>

<ns1:orderId/>

<ns1:status>invalidCreditCard</ns1:status>

</ns1:Order>

The invalidCreditCard status is the result of the <switch> statement in the approveCCOrder BPEL process.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 59: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 27

Appendix 5-1: Creating a Composite Application Workspace

Overview

In this practice, you create a simple SOA composite application with a service and a reference, which is the starting point for your course application.

Assumptions N/A

Tasks The main tasks in this practice are:

• Creating an application workspace • Creating a File Adapter as an External Reference

To create the application workspace with a SOA Project containing an empty composite application, perform the following steps: 1. In the JDeveloper Application Navigator, click New Application… (or you can select File >

New). 2. In the Create Generic Application dialog box, use instructions in the following table and

accept default values for all fields that are not specified in the “Choices or Values” column:

Step Screen/Page Description Choices or Values

a. Name your application Application Name: POApplication Directory: D:\labs\Lesson_05\POApplication Application Template: SOA Application Click Next. Note that the title of the dialog box changes to Create SOA Application.

b. Name your project Project Name: POProcessing Click Next.

c. Configure SOA settings Composite Template: Empty Composite Click Finish.

3. At this point, JDeveloper will create the SCA composite definition—composite.xml. Select File > Save All to save the changes to your application and project.

O

racl

e In

tern

al &

Ora

cle

Aca

dem

y U

se O

nly

Page 60: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 28

Appendix 5-2: Create a File Adapter for Writing Records to a File

Overview In this practice, you create a File Adapter service as an external reference in the composite. The BPEL process component uses it to write new purchase order data in a text file.

Assumptions You have successfully completed the previous practice.

Tasks 1. Make sure the Composite editor of your composite application, POApplication, is open and

the Design view displayed. 2. Drag a File Adapter component from the Component Palette to the External References

lane in the Composite editor. Use the following image as guide:

3. In the File Adapter Configuration Wizard, use the instructions in the following table to

configure the File Adapter:

Step Screen/Page Description Choices or Values

a. Welcome Click Next.

b. Service Name Service Name: WriteApprovalResults Click Next.

c. Adapter Interface Accept the default option. Click Next.

d. Operation Operation Type: Write File Operation Name: Write Click Next.

e. File Configuration Directory for Outgoing Files: D:\labs\po_data Note: You can click Browse to locate and select the specified folder. File Naming Convention: order_%SEQ%.txt Click Next.

In the next few steps, you will define the message for the write operation. In this case, message structure is defined by a predefined schema, order.xsd, so you need to import it

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 61: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 29

Step Screen/Page Description Choices or Values from the file system into your SOA project folder.

f. Messages Click the “Browse for Schema File” icon ( ) next to the URL field.

g. Type Chooser Click the Import Schema icon ( ) in the upper-right corner.

h. Import Schema File Click the Browse Resources icon.

i. SOA Resource Browser Navigate to D:\labs\Application_Files\schemas, and select Order.xsd. Click OK.

j. Localize Files Keep the default settings and click OK.

k. Type Chooser Expand the Project Schema Files > order.xsd entry (if needed) and select the Order node. Click OK.

l. Messages Click Next.

m. Finish Click Finish.

When the wizard closes, the composite.xml file is updated with a new reference for the outbound File Adapter service in the Composite editor. The WSDL and XSD files are generated as well as the WriteApprovalResults_File.jca file that contains the configuration details for the file adapter.

4. Save the changes to your application and project. 5. In the project folder, navigate to SOA Content > xsd folder, double-click the Order.xsd

file. The XSD Editor opens and displays the Design view of the XSD document. 6. Review the schema content. 7. Close the XSD Editor when you are done.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 62: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 30

Appendix 5-3: Create an Order Approval BPEL Process

Overview

In this practice, you create the approveCCOrder BPEL process that initially verifies the credit card of the client and then, based on the credit card status, approves or disapproves the order.

Tasks 1. Make sure the Composite editor of your composite application, POApplication, is open and

the Design view displayed. 2. Drag a BPEL Process component from the Component Palette to the Components lane in

the Composite editor. The Create BPEL Process Wizard is launched. 3. In the wizard, perform the following steps to configure the BPEL Process:

• Name: ApproveCCOrder • Template: Asynchronous BPEL Process • Service Name: approveccorder • Leave the check box “Expose as a SOAP Service” selected.

Note: This will result in the BPEL component being exposed as a Web Service in the composite application.

• Next to the Input field, click the “Browse Input Elements” icon ( ). In the Type Chooser dialog box, expand the Project Schema Files > Order.xsd, select the order element, and click OK.

• Back in the BPEL Process screen, choose the same XSD document and element for

the Output field. Note: These two BPEL process variables: inputVariable and outputVariable are used to capture the input received in the service request and specify the output to be returned as the service response by the callback activity. After the configuration, your screen should resemble the screenshot below:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 63: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 31

• Click OK. When the wizard closes, the composite.xml file is updated with an

exposed service and a BPEL process component in the Composite editor, and the two components are wired together.

4. To wire the ApproveCCOrder BPEL process component and the File Adapter service, in the Composite editor, drag a line from the ApproveCCOrder BPEL component to the WriteApprovalResults service. The composite.xml file is updated with the ApproveCCOrder wired to the WriteApprovalResults File Adapter as shown in the screenshot:

5. Double-click the ApproveCCOrder BPEL process to open the BPEL Process Editor. The

process resembles the following screenshot:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 64: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 32

6. Add an Invoke activity to invoke the WriteApprovalResults service.

a. Drag an Invoke activity from the Component Palette to an insertion point between the receiveInput activity icon and callbackClient activity icon. Use the following screenshot as a guide:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 65: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 33

b. Drag the wire from the Invoke1 activity to the WriteApprovalResults in the Partner Links

lane. Note: This tells your BPEL Process to invoke the service.

c. In the Edit Invoke dialog box, specify the following values, and click OK. • Name: InvokeWriteApprovalRecords • Input Variable: Click the green [+] icon, and click OK to create a new global

variable, accepting the default name and type. Note: This variable contains the data that will be sent to the WriteApprovalResults service, or the input to the service.

Your configuration should resemble the screenshot below:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 66: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Orchestrating Services with BPEL Process Components Chapter 5 - Page 34

Click OK. When the Invoke window closes, in the BPEL Editor, the approveCCOrder.bpel file is updated with the InvokeWriteApprovalRecords activity link to the WriteApprovalResults partner link.

7. Save the changes to your application and project.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 67: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 1

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 68: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 2

Practices for Lesson 6: Overview

Practices Overview In the previous lab, you created the POProcessing composite that accepts purchase orders via a SOAP invocation, validates credit card number with ApproveCCOrder BPEL process, then writes the validation results to a log file using the outgoing File Adapter service. In this lab, you restructure the POProcessing composite application assembly model by adding:

• A new file adapter to accept purchase order from a file • A Mediator component to provide mapping between the message structure delivered

by the file adapter service and the data model of the service interface published for the BPEL service component

By doing so, you get to understand: • How file adapter can be used together with Mediator to read incoming files as well as

initiate new instances of composite applications to process the contents from these files

• How Mediator takes the messages from the client, transforms them into the appropriate structure, and then routes them to the target service

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 69: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 3

Practice 6-1: Inspecting the File Adapter That Reads Purchase Order from Files

Overview

For this practice, a File Adapter service that reads purchase order from files has already been added for you (to save your time). So you just need to examine the configuration of the File Adapter and the XML Schema that defines the message structure of the incoming files.

Assumptions N/A

Tasks 1. In the Application Navigator pane, click Open Application… (or you can select File >

Open). 2. In the Open Application(s) dialog box, navigate to the

D:\labs\Lesson_06\POApplication directory, and open the POApplication.jws file. The POProcessing project folder is displayed in the Application Navigator pane.

3. In SOA Content folder, open the composite.xml file in the Design view of the Composite editor.

This assembly model is based on the composite created in Lab 5 with two changes made: • Adding a file adapter, receivePO. This file adapter service will be used to read

incoming purchase order from a file and initiate new instances of composite applications to process the contents from these files.

• Removing the wire between the ApproveCCOrder BPEL component and WriteApprovalResults file adapter service

Note: The assembly model (composite) provides two service entry points. You can still initiate the POProcessing application from the approveccorder_client service entry point through the Oracle Fusion Middleware Control Console Composite Test Web Service page tool. The newly added file adapter will provide the receivePO service entry point to read the purchase order as an input file. The file adapter service interface avoids too much typing to initiate the application, and simulates data input similar to the way an external client application would provide input.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 70: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 4

Inspecting the File Adapter Let’s take a look at the configuration of this File Adapter service: 4. In the Design view of the Composite editor, double-click the receivePO file adapter

(Exposed Service). 5. In the File Adapter Configuration Wizard, review the information presented in each step and

answer the following questions: Q: What is the operation name of this file adapter service interface? A: Read Q: From where should the File Adapter service read the files? A: The directory from where the service reads the files is d:\Labs\Application_Files\test. Q: What is the name pattern for the files to process? A: po*.xml. This name pattern is used as a filter that determines which of the files in the directory should be processed by the File Adapter. Q: How does the message structure of the file adapter service interface get defined? A: The message structure is defined by the XSD file, Order_File.xsd in the xsd directory of the SOA project folder. Note: With the above configuration, File Adapter service is kicked off whenever polling reveals a new file present to be processed. Files that have been processed by the File Adapter service are removed from the directory where they were placed; this behavior is configured through the check box labeled “Delete files after successful retrieval.”

Examining the File Order XML Schema The input message is produced by the File Adapter service according to the XML schema, Order_File.xsd. Let’s take a look at the structure of this XSD file. Note: This XSD file was imported into the project folder from the file system by the File Adapter Configuration Wizard when creating the File Adapter service. 6. In the POApplication > SOA Content > xsd folder, double-click the Order_File.xsd file. 7. The file opens in the XSD Editor and is displayed in the Design view. Examine the purchase

order XML schema and answer the following questions: Q: What elements does the schema declare? A: The XSD declares the PurchaseOrder element. Q: What type is the element based on? A: The element is based on a complex type named PurchaseOrder.

8. Expand the PurchaseOrder element to view the definition of this complex type. It contains a number of child elements.

9. To compare this customer order schema with the order.xsd file, open the order.xsd file from your project’s xsd folder.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 71: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 5

Compare the two schemas, can you describe the differences?

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 72: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 6

Practice 6-2: Creating a Mediator to Route Order Requests

Overview In this practice, you create a Mediator component to route the purchase order retrieved from the files to the ApproveCCOrder BPEL service component. You need to configure the routing rules to:

• Instruct the Mediator where to send XML messages • Perform some message transformation because the structure and some of the data

elements in the files are not matched with the BPEL component service interface

Assumptions N/A

Tasks

Creating a Mediator component 1. Make sure the Composite editor of your POApplication composite application is open and

displayed in the Design view. 2. Drag a Mediator component from the Component Palette to the Components lane in the

Composite editor. 3. In the Create Mediator window, specify the following options and click OK.

• Name: routePO • Template: Define Interface Later

4. Wire the components: • From receivePO File Adapter to routePO Mediator • From routePO Mediator to ApproveCCOrder BPEL component Use the following screenshot as a guide:

Configuring Routing Rules By wiring the routePO Mediator component to the ApproveCCOrder BPEL component, you create a routing rule with ApproveCCOrder BPEL process as the target service. In this section, you configure this new routing rule to transform the purchase order, an XML input based on the

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 73: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 7

Order_File.xsd file, into an XML format understood by the ApproveCCOrder BPEL process component. 5. To further configure the routing rule, in the Composite editor, double-click the routePO

Mediator to open the Mediator Editor.

6. In the Mediator Editor (routePO.mplan window), click the mapping icon to specify the mapping as shown in the following screenshot:

7. In the Request Transformation Map dialog box, select the Create New Mapper File option.

Enter receiveOrder_To_approveOrder.xsl in the respective text field, and click OK. Note: Make sure to provide a meaningful name for the Mapper file, one that clearly indicates what is being mapped to what.

8. The mapping editor opens. When creating a Mapper file, you basically specify the XML conversion path from the input XSD to the target service’s XSD. Drag PurchaseOrder node from the source side to Order node on the target side. Use the following image as a guide:

Target service

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 74: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 8

9. You will be prompted for auto-mapping preferences. In the Auto Map Preferences window,

perform the following steps: a. Deselect the “Match Elements Considering their Ancestor Names” check box and click

Show Dictionaries. b. Under the Dictionaries field, click the Add button. c. Select

D:\labs\Application_Files\dictionary\po_to_order_dictionary.xml and click Open.

d. The Auto Map Preferences window is updated with the dictionary information as shown in the following screenshot:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 75: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 9

Note: The dictionary is usually created by business analysts and lists common synonyms in use across data objects (such as “qty” being used instead of “quantity,” and “custID” instead of “customerID”). The dictionary is not mandatory, and even without it, the auto-mapping feature identifies and enables mapping of these fields. However, a dictionary, customized to a specific company helps improve its accuracy.

10. Click OK to close the Auto Map Preferences window.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 76: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 10

11. In the mapping editor, verify that the resultant mapping resembles the following screenshot:

12. Save and close both the mapping editor and the Mediator editor to return to the Composite

editor.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 77: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 11

Practice 6-3: Modifying Composite to Use Mediator to Route Order Result

Overview It is a best practice to link Mediators to File Adapter services to receive incoming requests and write message out to files. In the previous lab, the approveCCOrder BPEL service component directly calls the file adapter to write the validation results to a log file. In this practice, you will modify the composite application to use the Mediator component to route the results to the outgoing File Adapter Service, which in turn writes to the log file.

Assumptions N/A

Tasks

Examining the modified BPEL service component Apart from the removal of wire between the ApproveCCOrder BPEL component and WriteApprovalResults file adapter service (created in Lab 5), the BPEL asynchronous service was also modified so that it can send the response to the routePO Mediator, which routes the message to the outgoing File Adapter service. The modifications are:

• Deleting the activity in the BPEL process that invokes the WriteApprovalResults partnerLink

• Assigning validation results to the outputVariable of the callback activity

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 78: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 12

In this section, you will review the changes. 1. In the Composite editor, double-click the ApproveCCOrder component to open the BPEL

editor. You should notice the InvokeWriteApprovalRecords activity removed from the process flow. Note: You can compare the modified BPEL process with what you created in Lab 5 to see the differences.

2. In this lab, the BPEL asynchronous service will send the response by invoking the callback

activity (instead of calling InvokeWriteApprovalResults partnerLink), so the validation results need to be assigned to the “status” child element of the outputVariable of the callback activity. a. Double-click the assignApproval activity in the True branch of the Switch activity. b. In the Edit Assign window, you should see the value ‘approved’ assigned to the

outputVariable’s status element.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 79: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 13

c. Click Cancel to close the Edit Assign window of the assignApproval activity. d. Similarly, double-click the assignInvalidCC activity in the otherwise branch of the

Switch activity. e. In the Edit Assign window, you should see the value ‘invalidCreditCard’ assigned

to the outputVariable’s status element.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 80: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 14

f. Click Cancel to close the Edit Assign window of the assignInvalidCC activity.

3. Wire routePO Mediator to WriteApprovalResults File Adapter. Use the following screenshot as a guide:

Configuring routing rules Again, by wiring the routePO Mediator component to the WriteApprovalResults File Adapter service, you create a routing rule with WriteApprovalResults File Adapter as the target service.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 81: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 15

In this section, you configure the routing rule to transform the input XML message into an XML format understood by the WriteApprovalResults service. 4. To further configure the routing rule, in the Composite editor, double-click the routePO

Mediator to open the Mediator Editor. 5. In the Mediator Editor, the newly added routing rule is at the bottom of the Static Routing

section. Click the mapping icon to specify the mapping as shown in the following screenshot:

6. In the Request Transformation Map dialog box, select the Create New Mapper File option.

Enter receiveOrder_To_writeOrder.xsl in the respective text field, and click OK. 7. In the mapping editor, drag the PurchaseOrder node from the source side to Order node on

the target side. 8. In the Auto Map Preferences window, click Show Dictionaries. You should see the

dictionary you added earlier presented in the Dictionaries field. 9. You will use the same dictionary for this mapping, so keep all the settings as is, and click

OK to close the Auto Map Preferences window. 10. In the mapping editor, verify that the resultant mapping resembles the following screenshot:

11. Save and close the mapping editor.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 82: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 16

12. In the Mediator editor, verify that the routing rule for the WriteApprovalResults Write operation is updated with the transformation mapper file. Use the following screenshot as a guide:

Adding routing rules In this section, you add a routing rule to route the validation results from the BPEL process to the outgoing File Adapter service. 13. In the Composite editor, double-click the routePO Mediator to open the Mediator Editor. 14. Set the callback of the asynchronous BPEL process to call the file adapter service by

performing the following steps: a. Specifying the target service and operation:

1) Click the “Browse for target service” icon next to the <<Target Operation>> field in the Callback section.

2) In the pop-up Target Type window, click Service. 3) In the Target Services window, select POProcessing > References >

WriteApprovalResults > Write.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 83: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 17

b. Creating the transformation from the source message format to the target message format:

1) Click the mapping icon below the WriteApprovalResults::Write target service field in the Callback section.

2) In the Callback Transformation Map dialog box, select the Create New Mapper File option. Enter approveOrder_To_writeOrder.xsl in the respective text field, and click OK.

3) In the mapping editor, drag Order node from the source side to Order node on the target side. Note: Note that the message structure used by the BPEL process service interface is the same as the outgoing file adapter service. But with Mediator, you can change the output file format without having to modify the BPEL process.

4) In the Auto Map Preferences window, click Show Dictionaries. You should see the dictionary you added earlier presented in the Dictionaries field.

5) You will use the same dictionary for this mapping, so keep all the settings as is, and click OK to close the Auto Map Preferences window.

6) In the mapping editor, verify that the resultant mapping resembles the following screenshot:

7) Save and close the mapping editor.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 84: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 18

c. In the Mediator editor, verify that the callback routing rule is updated with the target service and transformation mapper file information. Use the following screenshot as a guide:

15. Close the Mediator editor, and save the all changes to the project.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 85: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 19

Practice 6-4: Adding Filters to Mediator Routing Rules

Overview In the previous practices, you defined two routing rules for the routePO Mediator component. The links between input message and target services have been established. In this practice, you can add filer conditions (optional) for each target service so that the Mediator can perform content-based routing. The input messages (purchase order) are sent to the target service if and only if their contents satisfy the following conditions specified for the routing rules:

• If the purchase order’s status is payment, orders are sent to the ApproveCCOrder_client::process service operation.

• If the purchase order’s status is not payment, orders are sent to the WriteApprovalResults::Write service operation.

Assumptions N/A

Tasks To add the filter conditions for the two routing rules, perform the following steps: 1. In the POProcessing Composite editor window, double-click the routePO Mediator

component icon.

Add a status filter to the routing rule to the ApproveCCOrder BPEL process. 2. In the routePO Mediator Editor (routePO.mplan window), in the first routing rule with

ApproveCCOrder_client::process as the target service, click the “Invoke Expression Builder” icon .

3. In the Expression Builder window, in the Variables section, expand the in > body > PurchaseOrder tree, select status and click Insert Into Expression.

4. In the Expression field, append: = 'payment' to the XPath expression to form an expression similar to:

$in.body/imp1:PurchaseOrder/imp1:status = 'payment'

5. Click OK to close the Expression Builder window.

Add a status filter to the routing rule to the WriteApprovalResults File Adapter. 6. In the routePO Mediator Editor (routePO.mplan window), in the second routing rule with

WriteApprovalResults::Write as the target service, click the Invoke Expression Builder icon.

7. In the Expression Builder window, in the Variables section, expand the in > body > PurchaseOrder tree, select status and click Insert Into Expression.

8. In the Expression field append: != 'payment' to the XPath expression to form an expression similar to:

$in.body/imp1:PurchaseOrder/imp1:status != 'payment'

9. Click OK to close the Expression Builder window. The Mediator Editor is updated with the filter conditions added to the routing rules, as shown in the following image:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 86: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 20

10. Save your project files.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 87: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 21

Practice 6-5: Deploying and Testing

Overview In this practice, you deploy the modified POProcessing composite application to the SOA server and test the service by feeding the sample purchase order files to it.

Assumptions N/A

Tasks

Deploy the POProcessing composite to application server. 1. In the Application Navigator pane, right-click the POProcessing project, and select Deploy >

POProcessing. The Deploy POProcessing window is displayed. 2. In the Deploy POProcessing window, use the instructions in the following table to configure

the deployment settings and deploy the composite:

Step Screen/Page Description Choices or Values

a. Deployment Action Make sure “Deploy to Application Server” is selected. Click Next.

b. Deployment Configuration Use a new version for this deployment by changing the revision ID to 2.0, and click Next. Note: Alternatively, you can redeploy your application with the same revision number by selecting the option “Overwrite any existing composites with the same revision ID.”

c. Select Server Make sure MyApplicationServerConnection is selected. Click Next.

d. SOA Servers Accept the default settings. Click Finish.

3. Deployment processing starts. Monitor deployment progress and check for successful compilation in the SOA – Log window, and verify that deployment is successful in the Deployment – Log window.

4. When you are finished, close the POProcessing application in JDeveloper.

Test POProcessing Composite by using the sample purchase order files In this section, you copy an XML file into the folder specified as the input folder for the purchase orders to be processed by the POProcessing composite application, monitor the execution of the process, and observe the results in the form of a file created by the application in a folder specified as its output folder. 5. Log in to the Fusion Middleware Control console by performing the following steps:

a. Open a Web browser, and enter the following URL in the address field: http://localhost:7001/em

b. On the Oracle Fusion Middleware Control console login page, enter the following credentials and click Login: User Name: weblogic

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 88: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 22

Password: welcome1 6. On the Farm home page, in the left navigation frame, expand the SOA > soa-infra > default

folder. You should see POProcessing [2.0] is in the list of deployed applications. 7. Click the POProcessing [2.0] link. On the POProcessing [2.0] home page, you shouldn’t see

any composite instances initiated. 8. To initiate the POProcessing [2.0] application, in Windows Explorer, you copy the file

D:\Labs\Application_Files\PO_Files\po-payment.xml to the D:\Labs\Application_Files\test folder. This order has a payment status. Note: You must copy (do not move) the file because the input file adapter removes the file from the input folder after it has been read (consumed) by the file adapter service.

9. To monitor the application, watch the test folder, wait for the input file to be removed as an indication that the application has started to process the file, and then perform the following steps: a. In the EM, refresh the POProcessing [2.0] home page; a new composite application

instance is displayed.

b. Click the instance ID link, you should see the Flow Trace page resembling the

following image:

c. You can click the component link to view the details of each component (routePO,

ApproveCCOrder, CreditCardValidationProcess) in the audit trail page.

Click to refresh.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 89: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 23

10. You can also verify the result by opening the log file (order_n.txt) that has just been created by the File adapter service in the D:\labs\PO_data\ directory with a text editor. The output file should resemble the following:

<?xml version="1.0" encoding="UTF-8" ?><ns1:Order xmlns:ns1="http://xmlns.oracle.com/ns/order" xmlns="http://xmlns.oracle.com/ns/order">

<ns1:customerId/>

<ns1:orderId/>

<ns1:status>approved</ns1:status>

</ns1:Order>

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 90: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: Mediating Messages with Mediator Components Chapter 6 - Page 24

11. Execute the test case again, but this time, feed the purchase order with shipment status by copying D:\Labs\Application_Files\PO_Files\po-shipment.xml to the D:\Labs\Application_Files\test folder, and viewing the result in the new log file, which should resemble the following:

<?xml version="1.0" encoding="UTF-8" ?><imp1:Order xmlns:imp1="http://xmlns.oracle.com/ns/order" xmlns="http://xmlns.oracle.com/ns/order">

<imp1:customerId>1111</imp1:customerId>

<imp1:orderId>2222</imp1:orderId>

<imp1:prodName>iPod shuffle</imp1:prodName>

<imp1:itemType>electronics</imp1:itemType>

<imp1:price>145</imp1:price>

<imp1:qty>30</imp1:qty>

<imp1:status>shipment</imp1:status>

<imp1:creditCardInfo>

<imp1:cardNumber>1234-1234-1234-1234</imp1:cardNumber>

<imp1:cardType>Mastercard</imp1:cardType>

</imp1:creditCardInfo>

</imp1:Order>

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 91: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 1

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 92: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 2

Practices for Lesson 7: Overview

Practices Overview In these practices, you will integrate a Business Rule service component (with predefined Business Rules) in the POProcessing SOA composite. The ManualApproval Business Rule is accessed by the approveLargeOrder BPEL process to decide whether the order requires manual approval. The rule stipulates that when the order’s total amount is over or equal to $3000, it needs to go through a manual approval process. Later, you use the SOA Composer to modify the rule to decrease the autoapproval amount from $3000 to $1000.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 93: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 3

Practice 7-1: Examining the Business Rules

Overview In this practice, you examine the precreated Business Rule component that decides on whether the order needs manual approval.

Assumptions N/A

Tasks 1. In the Application Navigator pane, click Open Application… (or you can select File >

Open). 2. In the Open Application(s) dialog box, navigate to the

D:\labs\Lesson_07\POApplication directory, and open the POApplication.jws file. The POProcessing project folder is displayed in the Application Navigator pane.

3. In SOA Content folder, open the composite.xml file in the Design view of the Composite editor. The assembly model resembles the following screenshot:

Note that the composite adds a Business Rule component—ManualApproval—to the assembly model that you created in Lab 6.

Viewing the facts involved in the rules 4. Double-click the ManualApproval Business Rule component to open the Rule Editor. 5. Click the Facts tab to view the defined facts involved in the rules. As shown in the

screenshot below, the rules use XML Facts, which are based on an XML schema, OrderApproval.xsd.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 94: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 4

Viewing the XML schema 6. In the Application Navigator pane, expand the POApplication > SOA Content > xsd folder

and double-click the OrderApproval.xsd file. 7. The schema opens in the XSD Editor and is displayed in the Design view, which resembles

the following image:

As you see, the schema declares two elements: • Approval, which contains a child element—approvalRequired with a Boolean type • orderValue, which contains a child element—price with a double type

8. Close the XSD Editor when you are done. O

racl

e In

tern

al &

Ora

cle

Aca

dem

y U

se O

nly

Page 95: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 5

Inspecting the Ruleset and modifying the rules 9. Go back to the ManualApproval Rule Editor, click Rulesets > Ruleset1 tab, you should see

the Ruleset containing two rules of type “IF-THEN rule” displayed in the window, which resembles the following screenshot:

The test (IF) for the first business rule tries to match the input data, order price, against the defined condition. When the test evaluates to true—in this case, the price is equal to or greater than 5000—a match has been made. When the test results in a match for a business rule, its action (THEN) is triggered or executed. In this case, the action creates the output from the decision service by asserting a new fact of the output type, approvalRequired.

10. To change the price limit condition, perform the following steps: a. In the IF statement of Rule1, click 5000, and change it to 3000 in the pop-up field. b. Similarly, in the IF statement of Rule2, click 5000, and change it to 3000.

11. Save the rule definition, and close the Rule Editor.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 96: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 6

Practice 7-2: Integrating the Business Rule Component in the BPEL Process

Overview In this practice, you integrate the ManualApproval decision service in the ApproveCCOrder BPEL process by adding and configuring a Business Rule activity in the BPEL process.

Assumptions N/A

Tasks 1. In the design view of the Composite editor, double-click the ApproveCCOrder BPEL

component to open it in the BPEL editor. 2. To create a variable to store the output from the decision service in BPEL process, perform

the following steps: a. In the Structure Palette of JDeveloper, expand Variables > Process and select the

Variables node.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 97: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 7

Note: If you don’t see the Structure Palette, you can open it by selecting Structure in the View menu. b. Click the green [+] icon to add a variable. In the Create Variable window, configure as

follows: • Name: decisionVariable • Type: Choose the Element option, and browse and select the approval element

from the OrderApproval.xsd schema. After the configuration, the Create Variable window resembles the screenshot below:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 98: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 8

c. Click OK to close the window, and you should see approvalRequired added in the

decisionVariable folder in the Structure Palette.

Adding a Business Rule activity into the BPEL workflow 3. In the BPEL editor, expand the SOA Components node in the Component Palette. 4. Drag a Business Rule activity from the Component Palette to right after the True condition

in the EvaluateCCStatus Switch activity. Use the following screenshot as a guide:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 99: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 9

5. Double-click the rule activity (Rule1). 6. In the Rule configuration pane, in the Dictionary tab page, select ManualApproval (from the

drop-down menu) for Dictionary. 7. To assign BPEL variables to business rule input facts:

a. With the Assign Input Facts tab selected, click the green [+] icon.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 100: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 10

b. In the Decision Fact Map window, specify the fact mapping for the Input fact by copying

values from BPEL variables to the Input Business Rule facts. The BPEL variable is the total amount for an order, which is calculated by using the Expression Builder to multiply the item price by the quantity. Perform the following steps:

c. In the From column, select Expression option for Type.

d. Click the XPath Expression Builder icon ( ).

e. In the Expression Builder window, in the BPEL Variables field, expand Variables >

Process > Variables > inputVariable > payload > Order. Select the price element and click the Insert Into Expression button.

f. In the Expression field, append the multiply operator * to the XPath expression. g. In the BPEL Variables field, expand Variables > Process > Variables > inputVariable >

payload > Order. Select the qty element and click the Insert Into Expression button to form an expression similar to: bpws:getVariableData('inputVariable','payload','/ns3:Order/ns3:price') * bpws:getVariableData('inputVariable','payload','/ns3:Order/ns3:qty')

h. Click OK to close the Expression Builder window.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 101: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 11

i. In the Decision Fact Map window, you should see the Expression field in the From column updated with the above expression.

j. In the To column, expand Variables > Process > Scope-Rule1 > Variables > dsIn > payload > callFunctionStateless > parameterList >orderValue, and select the price element. Use the following image as a guide:

k. Click OK to close the Decision Fact Map. The Rule configuration pane is updated with

the new rule added to the Assign Input Facts field, which resembles the following screenshot:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 102: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 12

8. Similarly, assign business rule output facts to BPEL variables:

a. Select the Assign Output Facts tab, and click the green [+] icon. b. In the Decision Fact Map window, in the From column, expand Variables > Process>

Scope-Rule1 > Variables > dsOut > payload > callFunctionStatelessDecision > resultList > approval, and select the approvalRequired element.

c. In the To column, expand Variables > Process> Variables > decisionVariable > approval, and select the appovalRequired element. Use the following image as a guide:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 103: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 13

d. Click OK to close the Decision Fact Map window. The Rule configuration pane is

updated with the new rule added to the Assign Output Facts field, which resembles the following screenshot:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 104: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 14

9. Click the General tab and change the rule name to ApprovalRule. 10. Click OK to close the Rule configuration pane. In the BPEL editor, the BPEL workflow is

updated with the new rule activity. 11. Save the BPEL process and project files.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 105: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 15

Practice 7-3: Modifying BPEL Process

Overview In this practice, you add a Switch activity into the BPEL workflow to route the workflow data, based on the rule action.

Assumptions N/A

Tasks 1. In the BPEL editor, expand the BPEL Constructs node in the Component Palette. 2. Drag the Switch activity from the Component Palette to right after the ApprovalRule

business rule activity. Use the following screenshot as a guide:

3. After dropping the Switch activity, double-click the Switch activity icon ( ). 4. In the Switch dialog box, enter EvaluateApprovalType in the Name field, and click OK.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 106: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 16

5. Add a condition that uses XPath expression to evaluate the output from the decision service: a. Click the <condition> button. b. In the pop-up window, enter ManualApprovalRequired in the Label field, and click

the XPath Expression Builder icon ( ). c. In the Expression Builder window, in the BPEL Variables field, expand Variables >

Process > Variables > decisionVariable > approval, and select the approvalRequired element.

d. Click the Insert Into Expression button. e. In the Expression field, append: = 'true' to the XPath expression to form an

expression similar to: bpws:getVariableData('decisionVariable','/ns4:approval/ns4:approvalRequired') = 'true'

f. Click OK to close the Expression Builder window. The <condition> pop-up window is updated with the XPath expression. Use the following screenshot as a guide:

g. Click OK.

6. Add an Assign activity in the ManualApprovalRequired branch of the Switch activity to assign the decision result “Manual Approval Required” to the status child element of the outputVariable to populate the outgoing message. a. Drag an Assign activity (from the Component Palette) onto the text box Drop Activity

Here, right after the ManualApprovalRequired in the Switch activity.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 107: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 17

b. Double-click the Assign activity to edit it. c. In the Edit Assign window, click the General tab and change the name to

AssignDecisionResult. d. Click the Copy Rules tab. e. In the target column (right), expand Variables > Process > Variables > OutputVariable

> payload > Order, and locate the status node.

f. Drag the Expression icon ( ) to the status node. g. In the Expression Builder window, in the Expression field, enter ‘Manual Approval

Required’, and click OK. h. The Edit Assign window is updated with the XPath expression, which resembles the

image below:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 108: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 18

i. Click OK to close the Edit Assign window. Note: This Assign activity is used to show the decision result in the outgoing message for now. In the next Human Workflow lab, you will replace this Assign activity with the real Human Task service component.

7. Similarly, add an Assign activity in the <otherwise> branch of the Switch activity to assign the ‘auto-approved’ value to the status element of the outputVariable to populate the outgoing message. a. Drag an Assign activity onto the text box Drop Activity Here, right after the <otherwise>

block. b. Double-click the Assign activity to edit it. c. In the Edit Assign window, click the General tab and change the name to

AutoApproved. d. Click the Copy Rules tab. e. Assign the value ‘auto-approved’ to the status child element of the

outputVariable. (Refer to steps 6e–6g). f. Click OK to close the Edit Assign window.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 109: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 19

8. The BPEL editor is updated with the new Assign activities. It resembles the following screenshot:

9. Remove the assignApproval activity from the flow because the BPEL process doesn’t need

it to assign any values. 10. Save the BPEL process and close the BPEL editor. To this point, you complete the

integration of the ManualApproval decision service in the ApproveCCOrder BPEL process. The composite application in the Composite editor should resemble the following screenshot:

11. Save all your project files.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 110: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 20

Practice 7-4: Deploying and Testing

Overview In this practice, you deploy the modified POProcessing composite application to the SOA Server and test the service by feeding the sample purchase order files to it.

Assumptions N/A

Tasks

Deploy the POProcessing composite to application server. 1. In the Application Navigator pane, right-click the POProcessing project, and select Deploy >

POProcessing. The Deploy POProcessing window is displayed. 2. In the Deploy POProcessing window, use instructions in the following table to configure the

deployment settings and deploy the composite:

Step Screen/Page Description Choices or Values

a. Deployment Action Make sure Deploy to Application Server is selected. Click Next.

b. Deployment Configuration Use a new version for this deployment by changing the revision ID to 3.0, and click Next. Note: Alternatively, you can redeploy your application with the same revision number by selecting the option “Overwrite any existing composites with the same revision ID.”

c. Select Server Select MyApplicationServerConnection. Click Next.

d. SOA Servers Accept the default settings. Click Finish.

3. Deployment processing starts. Monitor deployment progress and check for successful compilation in the SOA – Log window, and verify that deployment is successful in the Deployment – Log window.

4. When you are finished, close the POProcessing application in JDeveloper.

Test POProcessing Composite by using the sample purchase order files In this section, you copy an XML file into the folder specified as the input folder for the purchase orders to be processed by the POProcessing composite application, monitor the execution of the process, and observe the results in the form of a log file created by the application in a folder specified as its output folder. 5. Log in to the Fusion Middleware Control console by performing the following steps:

a. Open a Web browser, and enter the following URL in the address field: http://localhost:7001/em

b. On the Oracle Fusion Middleware Control console login page, enter the following credentials and click Login: User Name: weblogic

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 111: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 21

Password: welcome1 6. On the Farm home page, in the left navigation frame, expand the SOA > soa-infra > default

folder. You should see POProcessing [3.0] is in the list of deployed applications. 7. Click the POProcessing [3.0] link. On the POProcessing [3.0] home page, you shouldn’t see

any composite instances initiated. 8. To initiate the POProcessing [3.0] application, in Windows Explorer, you copy the file

D:\Labs\Application_Files\PO_Files\ po-large-iPod.xml to the D:\Labs\Application_Files\test folder. This order has a payment status. Note: You must copy (do not move) the file because the input file adapter removes the file from the input folder after it has been read (consumed) by the file adapter service.

9. To monitor the application, watch the input folder, wait for the input file to be removed as an indication that the application has started to process the file, and then perform the following steps: a. In the EM, refresh the POProcessing [3.0] home page; a new composite application

instance is displayed. b. Click the instance ID link; you should see the Flow Trace page resembling the following

image:

c. You can click the component link to view the details of each component (routePO,

ApproveCCOrder, CreditCardValidationProcess, ManualApproval) in the audit trail page.

10. You can also verify the result by opening the log file (order_n.txt) that has just been created by the File adapter service in the D:\labs\PO_data\ directory with a text editor. The output file should resemble the following:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 112: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 22

<?xml version="1.0" encoding="UTF-8" ?> <ns1:Order xmlns:ns1="http://xmlns.oracle.com/ns/order" xmlns="http://xmlns.oracle.com/ns/order">

<ns1:customerId/>

<ns1:orderId/>

<ns1:status>Manual Approval Required</ns1:status>

</ns1:Order>

11. Execute the test case again, but this time, feed the composite service with an order price less than $3000. To do so, copy D:\Labs\Application_Files\PO_Files\ po-medium-headset.xml to the D:\Labs\Application_Files\test folder, and view the result in the new log file, which should resemble the following:

<?xml version="1.0" encoding="UTF-8" ?> <ns1:Order xmlns:ns1="http://xmlns.oracle.com/ns/order" xmlns="http://xmlns.oracle.com/ns/order">

<ns1:customerId/>

<ns1:orderId/>

<ns1:status>auto-approved</ns1:status>

</ns1:Order>

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 113: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 23

Practice 7-5: Modifying Business Rules in SOA Composer

Overview In this practice, you lower the order’s automatic approval threshold from $3000 to $1000 by editing the Business Rules in SOA Composer.

Assumptions N/A

Tasks 1. Log in to the SOA Composer by performing the following steps:

a. Open a Web browser, and enter the following URL in the address field: http://localhost:8001/soa/composer

b. On the SOA Composer application login page, enter the following credentials and click Login: User Name: weblogic Password: welcome1

2. In the SOA Composer home page, click Open drop-down menu in the top menu bar, and select Open Rules. The list of rule dictionaries stored in MDS is displayed.

3. Select the ManualApproval rule dictionary, and click Open.

Note: Alternatively, you can click the Ruleset1 link of the ManualApproval rule dictionary.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 114: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 24

4. The ruleset contained in the rule dictionary is displayed.

Note that the rules are shown in an even (business user) friendlier terminology than in JDeveloper, with the string “same or more than” instead of the operator “>=”.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 115: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 25

5. To edit the rules changing the automatic approval amount from $3000 to $1000, perform the following steps: a. Click the Edit button in the top menu bar to enter the edit mode as shown in the

following screenshot:

b. In the IF statement of Rule1, replace 3000 with 1000 in the field. c. In a similar fashion, in the IF statement of Rule2, replace 3000 with 1000 in the field. d. Click the Commit button in the top menu bar to commit the changes to the run time. e. When prompted for confirmation, click Yes. This ends the edit session, and you are

back to the preview mode.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 116: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Encapsulating Business Logic with Business Rules Components Chapter 7 - Page 26

Verify that the modified rule is activated at run time To verify that the new business logic is applied to your POProcessing composite at run time, you repeat the steps (from Step 4 to Step 10) described in the previous practice (Practice 7-4), but this time with different input files. 6. To initiate the POProcessing [3.0] application, in Windows Explorer, you copy the file

D:\Labs\Application_Files\PO_Files\ po-medium-headset.xml to the D:\Labs\Application_Files\test folder.

7. Monitor the test folder, wait for the input file to be removed as an indication that the application has started to process the file, and then go to the D:\labs\PO_data\ directory.

8. Open the latest log (order_n.txt) file in a text editor. The output file should resemble the following:

<?xml version="1.0" encoding="UTF-8" ?><ns1:Order xmlns:ns1="http://xmlns.oracle.com/ns/order" xmlns="http://xmlns.oracle.com/ns/order">

<ns1:customerId/>

<ns1:orderId/>

<ns1:status>Manual Approval Required</ns1:status>

</ns1:Order>

The total price of this headset order is $1499.7. In the previous practice, the purchase was automatically approved based on the old rule. With the new rule activated, now the order needs to go through the manual approval process.

9. Optionally, you can feed the POProcessing [3.0] composite application with the po-small-notepad.xml input file (located in the same D:\Labs\Application_Files\PO_Files directory) as a purchase order, and observe the result in the output file.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 117: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 1

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 118: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 2

Practices for Lesson 8: Overview

Practices Overview In these practices, you will create and define a Human Task service to make the final decision on a large purchase order (over $3000).

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 119: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 3

Practice 8-1: Creating and Defining a Human Task for Manual Order Approval

Overview In this practice, you define a simple and straightforward human task with a single user, an expiration date, and a default (out-of-the-box) task form. There is no routing, escalation, or delegation; no notifications; and no fancy task form.

Assumptions N/A

Tasks 1. In the Application Navigator pane, click Open Application (or you can select File > Open). 2. In the Open Application(s) dialog box, navigate to the

D:\labs\Lesson_08\POApplication directory and open the POApplication.jws file. The POProcessing project folder appears in the Application Navigator pane.

3. In the SOA Content folder, open the composite.xml file in the Design view of the Composite editor. The assembly model resembles the following screenshot:

4. Perform the following steps to create the Human Task service component:

a. Drag a Human Task component from the Component Palette and drop it in the Components lane in the Composite editor.

b. In the Create Human Task dialog box, specify the following options and click OK. • Name: ManualPOApproval • Namespace: Leave as default.

5. To edit the ManualPOApproval task, double-click the ManualPOApproval component. The Human Task editor opens the newly created task definition file ManualPOApproval.task. Do the following: a. Within the General subtab page, specify the following options:

• Task Title: Approve Large Order • Description: Manual approval task for large orders Accept defaults for the remaining fields.

b. To define the task parameter, click the Data tab. On the Data subtab page, click the green [+] sign and select “Add other parameter” from the drop-down list to open the Add Task Parameter dialog box.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 120: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 4

1) In the Add Task Parameter dialog box, with the Element option selected, click the

browse (magnifying glass) icon next to the Element field. 2) In the Type Chooser dialog box, expand Project Schema Files > Order.xsd, select

the Order element, and then click OK.

3) In the Add Task Parameter dialog box, select the “Editable via worklist” check box.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 121: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 5

4) Click OK to close the Add Task Parameter dialog box.

c. To specify an assignee for the task, click the Assignment tab. On the Assignment subtab page, double-click the <Edit Participant> box in the diagram.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 122: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 6

1) In the Add Participant Type dialog box, specify the following: • Type: Single • Label: Large Order Approver

2) Click the green [+] sign next to Participant Names and select Add User. 3) Accept the default values for the Identification Type and Data Type fields. Enter

weblogic in the Value field.

4) Click OK to close the Add Participant Type dialog box.

d. To set an expiration time for the task, click the Deadlines tab. On the Deadlines subtab page, perform the following: • Select “Expire after” from the Task Duration Settings drop-down list. • Set the duration to 5 minutes.

6. Save the ManualPOApproval.task file before proceeding. If you attempt to close the file without saving it first, a window (resembling the following screenshot) appears prompting you to save the changes. Click Yes.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 123: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 7

7. Create the task form for the task details that include the task payload and the actions that

you defined in the task. a. In the Human Task editor, click the Create Form drop-down menu and select Auto-

Generate Task Form.

Note: The Auto-Generate Task Form option generates a default task form for your composite. This generated task form lives in its own project. The form is created using ADF Faces Rich Client components. The Launch Task Form Wizard option is a semi-automated way of creating a task form. It guides you through a multistep wizard that allows configuration of many aspects of the generated task form. Alternatively, you can create a JSF project to manage the task form and point it to the task file that you create in your composite.

b. In the Create Project dialog box, enter TaskDetails in the Project Name field for the task form and click OK.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 124: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 8

c. JDeveloper generates the necessary artifacts for the TaskDetails project. You can see that the TaskDetails project folder is added in the Application Navigator pane. It resembles the following screenshot:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 125: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 9

d. In addition, the task details form (taskDetails1.jspx) opens in JDeveloper. It resembles the following screenshot:

8. Save all and close the task form, task flow, and Human Task editor, and return to the

Composite editor.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 126: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 10

Practice 8-2: Integrating the Human Task Component in the BPEL Process

Overview In this practice, you integrate the ManualPOApproval service component into the ApproveCCOrder BPEL process by adding and configuring a Human Task activity in the BPEL process.

Assumptions N/A

Tasks 1. In the Design view of the Composite editor, double-click the ApproveCCOrder BPEL

component to open it in the BPEL editor. 2. In the BPEL editor, expand the SOA Components node in the Component Palette. 3. Drag a Human Task activity from the Component Palette and drop it in the

ManualApprovalRequired branch. Use the following screenshot as a guide:

4. Double-click the Human Task activity – HumanTask1. 5. In the Human Task dialog box, perform the following:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 127: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 11

a. Select ManualPOApproval from the Task Definition drop-down list. b. Enter Approve Large Order in the Task Title field. c. Click the ellipsis […] button to the right of the Order field (under Task Parameter) to

select the BPEL variable that needs to be passed as the input parameter. d. To configure the mapping between the task parameters and the BPEL variables, in the

Task Parameters dialog box, ensure that the Type list contains the Variable option, and then select Variables > Process > Variables > inputVariable > payload > Order, and click OK.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 128: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 12

e. The Human Task dialog box is updated with the options that you specified as shown in the following screenshot:

Click OK to close the dialog box.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 129: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 13

6. In the BPEL editor, note that: • HumanTask1 was updated with ManualPOApproval1 • A Switch activity was added—with branches for each of the outcomes configured for

the selected task definition, as well as a branch for the otherwise case. For this task, the outcomes are REJECT and APPROVE, and therefore, the switch has three branches.

Note: If the task definition specifies task parameters that can be modified by the task service, the CopyPayloadFromTask Assign activities are generated with a single copy operation to copy the modified task payload data to the BPEL variable that was defined as a task parameter in the task definition.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 130: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 14

a. Expand the ManualPOApproval1 activity. It contains a combination of an Assign, an Invoke, and a Receive activity. This is similar to an asynchronous Invoke from the BPEL component to a partner link.

These three activities prepare the data to be passed to the task, invoke the Task Service to create an instance of the ManualPOApproval task, and receive its asynchronous result.

b. Collapse the activity.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 131: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 15

7. Add an Assign activity in the “Task outcome is REJECT” branch of the Switch activity to assign the decision result “Rejected” to the status element of the outputVariable to populate the outgoing message. a. In the Component Palette, expand the BPEL Constructs node. b. Drag the Assign activity from the Component Palette and drop it in the “Task outcome

is REJECT” branch, immediately after the CopyPayloadFromTask icon.

c. To edit the activity, double-click the Assign1 icon.

1) In the Edit Assign window, click the General tab and change the name to AssignRejected.

2) Click the Copy Rules tab. 3) In the target column (right), expand Variables > Process > Variables >

outputVariable > payload > Order, and locate the status node.

4) Drag the Expression icon ( ) and drop it to the status node. 5) In the Expression Builder window, in the Expression field, enter rejected and

click OK.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 132: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 16

6) The Edit Assign window is updated with the XPath expression, which resembles the following screenshot:

7) Click OK to close the Edit Assign window.

8. Repeat the substeps in the previous step to add the Assign activity (AssignApproved) in the “outcome is APPROVE branch” of the Switch activity to assign the decision result “Manually approved” to the status element of the outputVariable.

9. Repeat the substeps in Step 7 to add the Assign activity (AssignExpired) in the branch for the otherwise case to assign the value “expired” to the status element of the outputVariable.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 133: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 17

10. After you complete the preceding steps, the Switch activity (after ManualPOApproval1) in the BPEL process flow should resemble the following screenshot:

11. Save and close the BPEL editor and return to the Composite editor. The composite.xml

file is updated and resembles the following screenshot:

12. Save the project.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 134: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 18

Practice 8-3: Deploying and Testing

Overview In this practice, you deploy the POProcessing composite application to the SOA server and test the service by feeding the sample purchase order files to it. In a real-world situation, when the BPEL process is initiated and executes the Human Task service, the users involved in the Human Workflow interaction should ideally be notified that a task has been assigned to them. In which case, they can log in to the Worklist application to view their task assignments and the associated data, and perform a task-based action to enable the workflow pattern to come to completion. Due to the complexity of configuring a mail server and an email account, the lab setup is simplified without notification configuration, so you will directly log in to the Worklist application as the authorized user and perform an action on the assigned task.

Assumptions N/A

Tasks

Deploy the POProcessing composite to the application server. 1. In the Application Navigator pane, right-click the POProcessing project and select Deploy >

POProcessing. The Deploy POProcessing window appears. 2. In the Deploy POProcessing window, use the instructions in the following table to configure

the deployment settings and deploy the composite:

Step Screen/Page Description

Choices or Values

a. Deployment Action

Make sure Deploy to Application Server is selected. Click Next.

b. Deployment Configuration

Use a new version for this deployment by changing the revision ID to 4.0, and click Next. Note: Alternatively, you can redeploy your application with the same revision number by selecting the option “Overwrite any existing composites with the same revision ID.”

c. Task flow deployment

Use the default POApplication for Application Name. Select the “Overwrite Existing Application” check box, and select the Projects check box in the Deployable Taskflow Projects table. Use the following screenshot as a guide: O

racl

e In

tern

al &

Ora

cle

Aca

dem

y U

se O

nly

Page 135: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 19

Step Screen/Page Description

Choices or Values

Note: The TaskDetails project with the generated task form is deployed as a stand-alone web application that will be linked in FMW Control with the human task that it supports.

d. Select Server Select MyApplicationServerConnection. Click Next.

e. SOA Servers Accept the default settings. Click Finish.

3. The deployment processing starts. Monitor deployment progress and check for successful compilation in the SOA – Log window. Verify that the deployment is successful in the Deployment – Log window.

4. When you are finished, close the POProcessing application in JDeveloper.

Test the POProcessing composite by using the sample purchase order files. In this section, you copy an XML file into the folder that is specified as the input folder for the purchase orders to be processed by the POProcessing composite application, monitor the execution of the process, and observe the results in the form of a log file created by the application in a folder that is specified as its output folder. 5. Log in to the Fusion Middleware Control console by performing the following steps:

a. Open a web browser and enter the following URL in the address field: http://localhost:7001/em

b. On the Oracle Fusion Middleware Control console login page, enter the following credentials and click Login: User Name: weblogic Password: welcome1

6. On the Farm home page, in the (left) navigation frame, expand the SOA > soa-infra > default folder. You should see POProcessing [4.0] in the list of deployed applications.

7. Click the POProcessing [4.0] link. On the POProcessing [4.0] home page, you should not see any composite instances initiated.

8. To initiate the POProcessing [4.0] application, in Windows Explorer, copy the D:\Labs\Application_Files\PO_Files\ po-large-iPod.xml file to the D:\Labs\Application_Files\test folder. This order has a payment status.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 136: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 20

Note: You must copy (do not move) the file because the input file adapter removes the file from the input folder after it has been read (consumed) by the file adapter service.

9. To monitor the application, watch the input folder, wait for the input file to be removed as an indication that the application has started to process the file, and then perform the following steps: a. In the EM, refresh the POProcessing [4.0] home page. A new composite application

instance is presented. b. Click the instance ID link. You should see the Flow Trace page that resembles the

following screenshot:

c. You can click the component link to view the details of each component (routePO,

ApproveCCOrder, CreditCardValidationProcess, ManualApproval, and ManualPOApproval) on the audit trail page. Note that the state of ManualPOApproval, ApproveCCOrder, and routePO is Running. This is because the order is waiting for an assignee to take action.

Approve or reject the order by using the Oracle BPM Worklist application. 10. To log in to the Oracle BPM Worklist application, perform the following:

a. Open a web browser and specify the following URL: http://localhost:8001/integration/worklistapp

b. On the console login page, enter the following credentials and click Login: User Name: weblogic

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 137: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 21

Password: welcome1 11. On the Oracle BPM Worklist page, the Approve Large Order task entry appears within the

My Tasks subtab page.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 138: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Implementing Human Activities with Human Task Components Chapter 8 - Page 22

12. Click the Approve Large Order task. The task Details page opens the task in the lower frame of the Worklist application, which resembles the following screenshot:

Note: The first time the task form appears, there will be a delay of a minute while the pieces of the form are compiled and loaded.

13. After the form opens, you can see the task details and the different options. Click Approve. This submits the task and notifies the BPEL to continue processing. Note: If you do not act on the task within five minutes, the task will expire, and then the Approve and Reject options will not be available.

14. Revisit the Oracle Enterprise Manager 11g Fusion Middleware Control console and refresh the Flow Trace page. You see that the State column shows a Completed status for all the service components.

15. You can also verify the result by opening the log file (order_n.txt) that has just been created by the file adapter service in the D:\labs\PO_data\ directory with a text editor. The output file should resemble the following:

<?xml version="1.0" encoding="UTF-8" ?><ns1:Order xmlns:ns1="http://xmlns.oracle.com/ns/order" xmlns="http://xmlns.oracle.com/ns/order">

<ns1:customerId/>

<ns1:orderId/>

<ns1:status>Manually approved</ns1:status>

</ns1:Order>

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 139: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 1

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 140: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 2

Practices for Lesson 9: Overview

Practices Overview In these practices, you perform the following:

• Create a simple BPMN process in Business Process Composer and publish this process to the BPM Metadata Service (MDS) repository.

• Retrieve the published project from MDS in BPM Studio, make a minor edit, and republish the project to MDS.

With these practices, you will get an idea of how process analysts and developers create, share, and implement BPM processes by using Business Process Composer and BPM Studio.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 141: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 3

Practice 9-1: Creating a Process in Business Process Composer

Overview In this practice, you log in to Business Process Composer, create a BPM project, and create a simple manual process.

Assumptions N/A

Tasks

Access the Business Process Composer. 1. Log in to Business Process Composer by performing the following steps:

a. Open a web browser and enter the following URL in the address field: http://localhost:8001/bpm/composer

b. On the Business Process Composer application login page, enter the following credentials and click Login: User Name: weblogic Password: welcome1

Create a Simple BPM Process. 2. Create a blank BPM project called POShipment in the default folder. Perform the following

steps: a. In the Business Process Composer welcome page, click Create New Project.

b. In the “Choose a source” section, select “Create a blank Project.”

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 142: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 4

c. In the “Name the project” section, enter POShipment in the Name field and select the “Begin editing now” check box.

d. In the “Create the project” section, click Next. e. Examine the settings available in the “Choose a Folder” and “Deployment Options”

sections of this window, but do not change them.

f. When you have finished, click the Create button in the Create section. g. The window refreshes, and your new (blank) project is displayed in edit mode.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 143: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 5

3. Create a simple manual process called POShipment, with a Start activity, an End activity, and one User Task activity. a. In the POShipment pane on the left, right-click Processes, select New > Process. The

New Process window appears. b. Name the process POShipment and select Manual Process from the Pattern drop-

down list:

c. Click OK.

The POShipment process appears in the canvas. It was created with a Start event, an End event, and a User Task called UserTask.

O

racl

e In

tern

al &

Ora

cle

Aca

dem

y U

se O

nly

Page 144: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 6

Add Activities. 4. Change the label of the default UserTask to Get Order. Double-click the label and type

the new name. 5. Add one more User Task and a Manual Task to the POShipment process model after the

Get Order task, in order: − Check Inventory − Pack and Ship

When you have finished, your process model should resemble the following screenshot:

Note: The “Pack and Ship” task is usually performed offline. Oracle BPM cannot manage this task, but as a process analyst, you want to include it in the model. Use a Manual Task for this activity. Perform the following steps to create the preceding flow: a. To make space for the User Tasks that you will add to the process model, move the

End event to the extreme right:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 145: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 7

b. Drag User Task from the BPM Component Palette, position the cursor to the right of Get Order, directly on the transition line, (you want this new task to be in the process flow, so ensure that the transition line is highlighted), and then click to add this task to the flow.

The new User Task is added, with the default name UserTask.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 146: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 8

c. Add a Manual Task to the flow in a similar fashion. You can find Manual Task on the next page of Basic Flow Objects, in the Activities folder.

Your process model should now look like the following:

d. Relabel the tasks to Check Inventory and Pack and Ship. Your process model

should now look similar to the following:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 147: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 9

Add Swimlanes and Roles. Add swimlanes and roles as shown in the following screenshot, and move each task into position according to the role that will perform the task:

6. To create a new role called OrderProcessing and to assign that role to the first

swimlane, perform the following: a. Either double-click Process Owner (the current label on the swimlane), or right-click

Process Owner and select Properties:

The Edit Lane window appears. Currently the only roles that exist are the Process Owner role and the Automatic Handler role. These are the default roles.

b. To add a new role, click the green plus sign. c. In the Create Role window, enter OrderProcessing and click OK.

d. Back on the Edit Lane window, the new role OrderProcessing appears in the Role

field. Click OK.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 148: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 10

The swimlane should now be labeled OrderProcessing.

7. Now add one swimlane and role for the Pack and Ship task, which is usually performed by

the shipping and handling staff, and position the task on this swimlane. a. Drag the Pack and Ship task into the space below the OrderProcessing

swimlane. A new swimlane is added and it is labeled Unassigned Role:

b. Double-click Unassigned Role and follow the instructions earlier in this section to

create a new role called ShippingClerk. Assign that new role to the swimlane containing the Pack and Ship task.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 149: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 11

c. Drag the End icon to the ShippingClerk swimlane. Your process model should resemble the following screenshot:

Note: To optimize the layout of the swimlanes, click the Autolayout button on the toolbar to the upper-left of the editor.

Save and Publish the Project to the BPM MDS Repository. 8. To save the project, click Save on the toolbar at the top of the Business Process Composer

page.

9. To publish the project to the BPM Metadata Service repository, click Editing and select

Publish from the drop-down menu.

After the project is published, the Business Process Composer changes to Read-Only mode.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 150: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 12

Practice 9-2: Editing the Process in BPM Studio

Overview In this practice, you access BPM Studio, open the POProcessing application, retrieve the published POShipment project from MDS, make a minor edit, and republish the project. Finally, you retrieve and view the revised project in Business Process Composer.

Assumptions N/A

Tasks

Open the POProcessing Application. You need to have an application open in JDeveloper to retrieve the BPM project that was created in Business Process Composer. The application can be a SOA application or a generic application. In this practice, you will use the POProcessing application that you created in the previous labs. 1. To open the POProcessing application, perform the following steps:

a. Open JDeveloper. In the Application Navigator pane, click Open Application. b. In the Open Application(s) dialog box, navigate to the

D:\labs\Lesson_09\POApplication directory and open the POApplication.jws file. The POProcessing project folder appears in the Application Navigator pane.

Connect to the BPM MDS Repository. Before retrieving the published POShipment project (created in Business Process Composer) from MDS, you need to connect JDeveloper to the obpm partition of the MDS repository. 2. To configure a connection in BPM MDS Navigator, perform the following steps:

a. From the View menu, select BPM MDS Navigator. The BPM MDS Navigator pane appears (without any content).

b. Click the Configure Connection down arrow and select Configure Connection:

The Configure Connection window appears:

c. Click the green plus sign. d. In the Create SOA_MDS Connection window:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 151: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 13

1) Name the connection: BPM_MDSConnection 2) Ensure that Connection Type is DB Based MDS

3) Click the green plus sign next to the Connection field 4) In the Create Database Connection window, provide the connection details to the

database in which the MDS repository is stored. Enter the values for the following fields and accept the default values or choices for all remaining fields: • Connection Name: MDSConnection • Username: DEV_MDS • Password: welcome1

Note: The MDS database schema was created by the Repository Creation Utility during the installation process of SOA Suite 11g.

5) Click Test Connection. 6) Make sure that you see the Success message, and then click OK to close the

Create Database Connection window. The Create SOA_MDS Connection window is updated with the database connection details that you just provided.

7) For this connection, you also need to select the appropriate MDS partition: obpm

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 152: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 14

8) Click Test Connection. You should see the message “Success!” displayed in the

Status field. 9) Click OK to close the Create SOA_MDS Connection window.

e. The Configure Connection window is updated with the new MDS connection name. Click OK.

O

racl

e In

tern

al &

Ora

cle

Aca

dem

y U

se O

nly

Page 153: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 15

The BPM MDS Navigator now displays two folders: Public and Templates:

f. Expand the Public folder. You should see the POShipment project:

Check Out the BPM Project. 3. Click Refresh to ensure that you have the latest data from MDS.

4. In the BPM MDS Navigator, right-click the POShipment project and select Check out.

The Check out window appears.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 154: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 16

5. If you want to change the name of the project, you could change it here. For now, leave the name as is. Click OK.

6. The Project Locking window appears. Click Yes to lock the project so that no one else can make changes to the project while you are editing it.

The BPM MDS Navigator reappears.

Notice the project now has a lock icon to indicate that it is locked.

7. Switch back to Application Navigator; notice that the POShipment project appears in the Projects folder.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 155: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 17

8. Expand the POShipment project folder. Because a BPM application is also a SOA application (with BPMN as an additional component), you will note two subfolders: BPM Content and SOA Content.

Inspect and Edit the BPM Process. 9. To open the POShipment process in the BPMN Process Editor window, you can perform

either of the following: • Navigate to BPM Content > processes folder and double-click the POShipment

process. • Open composite.xml file in the SOA Content folder and double-click the

POShipment BPMN process component.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 156: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 18

10. The same process diagram appears in the BPMN Process Editor as you have been working on in Business Process Composer:

Notice that many of the tasks and transitions show a yellow Warning symbol, which indicates that these flow objects have not been implemented yet.

11. Make the following minor change to the process model: change the role of OrderProcessing to InventoryManagement. a. Right-click the OrderProcessing label on the swimlane and select Properties. b. In the Role properties window, click New. c. In the Role window, enter InventoryManagement in the Name field and click OK. d. In the Role properties window, the new role InventoryManagement appears in the

Name field. Click OK. e. Back in the BPM Process Editor window, the first swimlane should now be labeled

InventoryManagement.

Save and Publish the Revised Project to BPM MDS. 12. To save the changes, click the Save All button:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 157: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 19

13. To publish the project to BPM MDS, perform the following:

a. Click the BPM Project Navigator. b. In the BPM Project Navigator, right-click the POShipment project and select “Publish

to BPM MDS.” The Publish to BPM MDS window appears:

c. Select the Override check box to overwrite the project version currently stored in MDS,

and click OK. Note: If you are prompted for unlocking the project, click Yes. Your revised project is now published to MDS.

View the Revised Project in Process Composer. 14. You can view the modified BPM project in Business Process Composer.

a. If your Business Process Composer session has timed out, log in again. (If it is still active, start with step d as follows.)

b. On the main screen of the Welcome page, look for the POShipment project and click its header to open it. (Alternatively, click Project > “Open a Project” and select it from the list.)

c. You should see the revised BPM process open in the window as shown in the following screenshot:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 158: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 20

What Next? After you have the BPM process defined, you can start simulating the execution of the process in BPM Studio. Through the simulations, analysts can examine what-if scenarios for a business process and achieve process optimization based on the results. 15. The simulation is accessed through BPM Project Navigator in BPM Studio.

a. Click BPM Project Navigator to display that window. Now that you have checked out the POShipment project, it is listed in the BPM Project Navigator:

b. Expand the POShipment project. The various components of the project are listed.

You should see the Simulations node in the list. c. Expand the Simulation node; you can use the tools to create the simulation models and

definition.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 159: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 21

Note: How to create simulation is not within the scope of this course. It is mentioned here only to show you that BPM Studio provides the simulation capacity. Simulations are coved in the Oracle BPM 11g Modeling course.

When the BPM process definition has completed, developers can start the actual implementation, which includes:

• Implementing each process activity. For example, to implement a User Task, you need to create a Human Task component for it.

• Defining data that is associated with the process • Defining the conditions that steer the execution

Details of implementation are covered in the Oracle SOA Suite 11g: Build Composite Applications course.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 160: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Creating Business-Driven Processes with BPMN Chapter 9 - Page 22

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 161: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10 - Page 1

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 162: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10 - Page 2

Practices for Lesson 10: Overview

Practices Overview In the practices for this lesson, the key tasks are to:

• Deploy the POProcessing composite application through EM console • Stop the CCValidation service that the POProcessing application calls for credit card

validation • Initiate a POProcessing composite instance, monitor the process execution and

activity, and recover the fault using the EM Control console

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 163: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10 - Page 3

Practice 10-1: Deploying the Composite Through EM Console

Overview In this practice, you deploy the archive of the POProcessing composite application by using the Oracle Enterprise Manager Fusion Middleware Control console.

Assumptions The composite application SAR file (sca_POProcessing_rev5.0.jar) exists in the D:\labs\lesson10\ POApplication\deploy folder.

Tasks To deploy the POProcessing application through the Oracle Enterprise Manager Fusion Middleware Control console, perform the following steps: 1. Log in to the Oracle Enterprise Manager Fusion Middleware Control console.

a. If it is not already visible, open a web browser window and enter the URL http://localhost:7001/em.

b. On the Oracle Enterprise Manager Fusion Middleware Control console login page, enter the username weblogic and password welcome1, and click Login. Note: The Farm home page (called Farm_soa_domain) is displayed after you log in.

2. Deploy the POProcessing application to the default partition in the SOA infrastructure. a. On the Farm home page, in the navigation frame, expand the SOA folder, right-click

soa-infra and select SOA Deployment > Deploy. b. On the Deploy SOA Composite > Select Archive page and perform the following steps:

1) In the “Archive or Exploded Directory” section, accept the default “Archive is on the machine where this web browser is running” option and click Browse.

2) In the “Choose file” dialog box, navigate to the D:\labs\lesson10\POApplication\deploy folder, select sca_POProcessing_rev5.0.jar, and click Open.

3) Verify that the selected JAR file is shown in the “Archive is on the machine where this web browser is running” option field, and click Next.

c. On the Deploy SOA Composite > Select Target page, in the SOA Partition section, select default from the drop-down menu, and click Next.

d. On the Deploy SOA Composite > Confirmation page, accept the default settings and click Deploy. Note: A deployment progress dialog box appears, showing the progress of the deployment operation until deployment succeeds (as in this case) or fails. When deployment succeeds, the Deployment Success dialog box closes.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 164: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10 - Page 4

e. In the (left) Navigator frame, the deployed POProcessing[5.0] is selected, and the POProcessing [5.0] application page appears in the frame at the right. It contains a confirmation message that indicates that the composite application was deployed successfully. Use the following screenshot as a guide for the expected result:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 165: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10 - Page 5

Practice 10-2: Testing the Application with a Fault Scenario

Overview In this practice, you create a fault scenario by stopping the ValidationForCC composite that the POProcessing application depends on for credit card validation. Then you initiate an instance of the POProcessing application, examine the application Flow Trace pages to track the message flow through the composite application, check the error message, and take corrective action to recover the faulted instance.

Assumptions You have successfully deployed the POProcessing[5.0] application as described in the previous practice.

Tasks Your tasks here are to:

• Stop the ValidationForCC composite that the POProcessing application calls, for validating the credit card number

• Initiate the POProcessing application and examine specific details about the composite instance by using its Flow Trace pages

• Recover the faulted instance

Stop the ValidationForCC Composite. 1. On the Farm navigation tree, click the ValidationForCC [1.0] entry. The composite

application home page (on the Dashboard tab) opens in the right pane. 2. Click Shut Down on the toolbar at the top of the home page.

3. When you are prompted for confirmation, click Yes. You should see a confirmation

message indicating that the composite was shut down successfully.

Initiate the POProcessing Composite. 4. In the (left) navigation frame, expand the SOA > soa-infra > default folder. Click the

POProcessing [5.0] link. On the POProcessing [5.0] home page, you should not see any composite instances initiated.

5. To initiate the composite application, in Windows Explorer, copy the file D:\Labs\Application_Files\PO_Files\po-medium-headset.xml to the D:\Labs\Application_Files\test folder.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 166: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10 - Page 6

Note: You must copy (do not move) the file because the input file adapter removes the file from the input folder after it has been read (consumed) by the file adapter service.

6. To monitor the application, watch the test folder, wait for the input file to be removed as an indication that the application has started to process the file, and then perform the following steps: a. In the EM, refresh the POProcessing [5.0] home page. A new composite application

instance appears in the Recent Instances section. b. In the Recent Faults and Rejected Messages section, you should see recoverable

faults, as shown in the following screenshot:

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 167: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10 - Page 7

c. Click the instance ID link. You should see the instance’s Flow Trace page that resembles the following screenshot:

d. You can click the component link to view the details of each component in the audit

trail page. e. When you finish, close the flow trace page or audit trail page.

Recover the Faulted Instance. 7. On the POProcessing composite home page, click the Recover… link.

8. The Flow Trace page of the BPEL process instance (where the fault occurs) appears on the

Faults tab.

9. Click the error message link. You should see a message box (in the top section of the

window) that displays more detailed information about the fault. It provides information such as possible causes of exception and whether or not it is recoverable. Because the fault is

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 168: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10 - Page 8

recoverable, the recovery options appear in the bottom section when you click the error message link. Leave this window open because you need it in the following step.

10. To recover the fault, perform the following steps: a. Go to the main EM console window. On the Farm navigation tree, click the

ValidationForCC [1.0] entry. The composite application home page opens in the right pane.

b. Click “Start Up…” on the toolbar at the top of the home page. c. When you are prompted for confirmation, click Yes. You should see a confirmation

message indicating that the composite was started successfully. d. Go to the Flow Trace window. In the bottom section, keep the default settings and click

Recover.

e. When you are prompted for confirmation, click Yes. You should see a message

indicating that the action completed successfully. f. Close the Information dialog box and the Flow Trace window.

11. Go to the main EM console window. On the Farm navigation tree, click the POProcessing[5.0] entry. The composite application home page opens in the right pane.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 169: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10 - Page 9

12. Click the instance ID link. You should see that the instance has now completed successfully. The Flow Trace page should resemble the following screenshot:

13. You can also verify the result by opening the log file (order_n.txt) that has just been created

by the file adapter service in the D:\labs\PO_data\ directory with a text editor. The output file should resemble the following:

<?xml version="1.0" encoding="UTF-8" ?><ns1:Order xmlns:ns1="http://xmlns.oracle.com/ns/order" xmlns="http://xmlns.oracle.com/ns/order">

<ns1:customerId/>

<ns1:orderId/>

<ns1:status>auto-approved</ns1:status>

</ns1:Order>

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 170: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: Managing and Monitoring Composite Applications Chapter 10 - Page 10

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 171: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Enterprise Integration Using Oracle Service Bus Chapter 11 - Page 1

Practices for Lesson 11: Enterprise Integration Using Oracle Service Bus Chapter 11

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 172: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: Enterprise Integration Using Oracle Service Bus Chapter 11 - Page 2

Practices for Lesson 11

Practices Overview There are no practices for this lesson titled “Enterprise Integration Using Oracle Service Bus.”

General Notes There are no notes.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 173: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Exploring SOA Governance Chapter 12 - Page 1

Practices for Lesson 12: Exploring SOA Governance Chapter 12

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y

Page 174: Agc Impugnacion Cessi

Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Exploring SOA Governance Chapter 12 - Page 2

Practices for Lesson 12

Practices Overview There are no practices for this lesson titled “Exploring SOA Governance.”

General Notes There are no notes.

Ora

cle

Inte

rnal

& O

racl

e A

cade

my

Use

Onl

y


Recommended