d53946gc20_sg2

364
Oracle SOA Suite 11g: Build Composite Applications Volume II Student Guide D53946GC20 Edition 2.0 September 2010 D65408 Oracle University and Egabi Solutions use only THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED

Upload: arief-rachman

Post on 01-Jan-2016

98 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications

Volume II • Student Guide

D53946GC20

Edition 2.0

September 2010

D65408

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 2: D53946GC20_sg2

Copyright © 2010, 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 whereyour 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 RIGHTSThe 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

Glenn Stokol

Technical Contributors and Reviewers

Akshatha Niranjan

Anand Sidgiddi

Anirudh Pucha

Anjulaponni Azhagulekshmi

Subbiahpillai

Avijit Borthakur

Bijoy Choudhury

Brian Fry

Clemens Utschig

David McCann

David Shaffer

David Twelves

Deirdre Matishak

Demed L’Her

Dhiraj Thakkar

Gangadhar Konduri

Heidi Buelow

Holger Dindler Rasmussen

James Mills

Jay Kasi

Joe Greenwald

John Cobb

Kalpak Kothari

Ken Cooper

Kevin Clugage

Khanderao Kand

Kristopher Rice

Lloyd Williams

Lynn Munsinger

Manoj Das

Mark Kennedy

Melody Yang

Mohan Kamath

Peter Laseau

Prabhu Thukkaram

Prasad Dixit-Hardikar

Prasen Palvankar

Rakesh Saha

Rashmi Menon

Robert LaVallie

Shay Shmeltzer

Sheela Vasudevan

Stephanie McReynolds

Steven Friedberg

Steven Muench

Swarnapriya Shridhar

Ted Witiuk

Timothy Gleason

Tom Hardy

Valli Pataballa

Vasiliy Strelnikov

Vikas Anand

Vikas Jain

Viktor Tchemodanov

William Prewitt

Yan Jing

Yi Lu

Yogesh Kumar

Yosuke Katsuki

Editors

Arijit Ghosh

Nita Pavitran

Graphic Designer

Rajiv Chandrabhanu

Publisher

Syed Imtiaz Ali

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 3: D53946GC20_sg2

iii

Contents Preface I Introduction

Objectives I-2 Course Objectives I-3 Agenda: Day 1 I-4 Agenda: Day 2 I-5 Agenda: Day 3 I-6 Agenda: Day 4 I-7 Agenda: Day 5 I-8 Summary I-9

1 Overview of Service-Oriented Architecture (SOA) and Service Component

Architecture (SCA) Concepts Objectives 1-2 Service-Oriented Architecture (SOA) 1-3 Why Is an SOA Approach Required? 1-4 Ways to Implement Services 1-5 What Are Services? 1-6 Adopting Standards for an SOA Approach 1-7 Standards That Enable SOA 1-8 Designing with an SOA Approach 1-9 Creating Service Portfolios 1-10 Quiz 1-11 History of Implementing SOA Applications 1-12 Service Component Architecture (SCA) Applications 1-13 Service Component Architecture (SCA) 1-14 Elements of a Service Component Architecture (SCA) 1-15 Comparing SOA and SCA 1-16 Service Data Object (SDO) 1-17 Quiz 1-18 Event-Delivery Network (EDN) and Event-Driven Architecture (EDA) 1-19 Managing Composite Application Life Cycle 1-20 Describing the Course Environment 1-21 Oracle JDeveloper 1-22

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 4: D53946GC20_sg2

iv

Creating a Database Connection 1-23 Creating an Application Server Connection 1-24 Creating a Web Services Inspection Language (WSIL) Connection 1-28 Setting JDeveloper Preferences 1-29 Summary 1-30 Practice 1 Overview: Configuring the Development Environment 1-31

2 Designing Composite Applications with Oracle SOA Suite 11g

Objectives 2-2 Getting Started with Oracle SOA Suite 11g 2-3 Oracle SOA Suite 11g Platform 2-4 Oracle WebLogic Server 2-5 WebLogic Server Domain 2-6 Course Software Configuration 2-7 Oracle SOA Suite 11g Architecture 2-8 Oracle Portability Layer 2-9 Event Delivery Network 2-11 Metadata Services (MDS) 2-12 Service Engines 2-13 Oracle SOA Suite 11g Components 2-14 Adapter Services 2-15 Routing and Filtering with Mediator Components 2-16 Orchestrating Services with BPEL Components 2-17 Implementing Business Rules Components 2-18 Implementing Workflow with Human Task Components 2-19 The Role of ADF Applications with SOA 2-20 Business Events 2-21 Securing Services in Oracle SOA Suite 11g 2-22 Monitoring Services with Oracle BAM 2-23 Oracle Service Bus 2-24 Summary of Oracle Service Bus, Mediator, and BPEL 2-25 Oracle Service Bus with Oracle SOA Suite 2-26 Comparing Oracle Service Bus and Mediator Components 2-27 Designing Composite Applications 2-28 Course Use-Case: Purchase Order Processing 2-29 Course Use-Case: Referenced Composite Applications 2-30 Course Use-Case: Event-Driven Composite Applications 2-31 SOA Application Design Approaches 2-32 Composite Application Design Guide 2-33 Basic Interaction Patterns 2-34 Quiz 2-35

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 5: D53946GC20_sg2

v

Additional SOA and Web Service Resources 2-36 Summary 2-37 Practice 2 Overview: Examining Services in the Course Application 2-38

3 Creating a Composite Application

Objectives 3-2 Service Component Architecture (SCA):A Review 3-3 Composite Applications as Business Services 3-4 Composite Applications 3-5 SCA Components in Oracle SOA Suite 11g 3-6 Assembling a Composite Application 3-7 Examining the composite.xml Source 3-8 Designing a Composite Application 3-9 Creating an SOA Application in JDeveloper 3-11 Create SOA Application Wizard: Application Name 3-12 Create SOA Application Wizard: Project Name 3-13 Create SOA Application Wizard: Project SOA Settings 3-14 Describing the SOA Composite Editor 3-15 Initial Composite Project Structure 3-16 Creating Service Entry Points 3-17 Creating External References 3-18 Creating Adapter References 3-19 Creating a File Adapter Example 3-20 Quiz 3-21 Creating a File Adapter Example Importing a Schema 3-22 Creating Components 3-23 Example: Creating a Mediator Component 3-24 Adding Wires to Composite Application 3-25 Adding a Mediator Transformation 3-26 Mapping the Transformation Rules 3-27 Quiz 3-28 Deploying a Composite Application 3-29 Testing a Composite Application 3-30 Summary 3-31 Practice 3 Overview: Creating a Simple Composite Application 3-32

4 Managing and Monitoring a Composite Application

Objectives 4-2 Overview of Managing SOA Applications 4-3 Configuration with WebLogic Server 11g Administration Console 4-4 Overview of WebLogic Server Administration Console 4-5

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 6: D53946GC20_sg2

vi

Managing with Oracle Enterprise Manager 4-6 Describing the Fusion Middleware Control 4-7 Accessing the SOA Infrastructure Home Page 4-8 Accessing a Composite Application Home Page 4-9 Examining a Composite Application Home Page 4-10 Quiz 4-11 Deploying a Composite Application 4-12 Deploying with JDeveloper (Review) 4-13 Specifying Deployment Configuration Details 4-14 Creating a Deployment Profile 4-16 Deploying Multiple SOA Projects 4-17 Exploring the SOA Archive and SOA Bundle 4-18 Deploying with Oracle Enterprise Manager 4-19 Deploying a SOA Archive: Select Archive 4-20 Deploying a SOA Archive: Select Target and Confirmation 4-21 Undeploying with Enterprise Manager 4-22 Redeploying a Composite Application 4-23 SOA Composite Applications Versioning 4-24 Specifying WSDL URL for a Default Revision 4-25 Managing Composite Application State 4-26 Managing SOA Applications with JDeveloper 4-27 Managing SOA Applications with Ant Scripts 4-28 Testing a Composite Application 4-29 Initiating a Test in Enterprise Manager 4-30 Preparing the Request Data for a Test 4-31 Tracking Message Flow 4-32 Working with the Flow Trace 4-33 Working with a Component Audit Trail Page 4-34 Accessing Logs and Other Settings 4-35 Initiating a Test in JDeveloper 4-36 Viewing the Response in JDeveloper 4-37 Quiz 4-38 Managing the Life Cycle of a Composite Application 4-39 Overview of Configuration Plans 4-40 Creating a Configuration Plan 4-41 Modifying a Configuration Plan 4-42 Summary 4-43 Practice 4 Overview: Managing Composite Applications 4-44

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 7: D53946GC20_sg2

vii

5 Creating Adapter Services Objectives 5-2 Overview of Adapter Services 5-3 Describing Technology Adapters 5-4 Packaged Application and Legacy Adapters 5-5 Quiz 5-6 File Adapter 5-7 Working with a File Adapter 5-8 Introducing the Database Adapter 5-9 Configuring a Database Adapter 5-10 Configuring a Master Detail Relationship Example 5-15 Configuring a Database Adapter 5-16 Configuring Database Adapter 5-17 Configuring the Database Adapter Run-Time Connections 5-18 Redeploying the Run-Time DbAdapter 5-19 Employing a JMS Adapter 5-20 Configuring a JMS Destination 5-21 Configuring a JMS Connection Factory 5-22 Creating the JMS Adapter Connection Pool 5-23 Associate the JMS Connection Pool to a Connection Factory 5-24 Creating a JMS Adapter 5-25 Configuring the JMS Adapter Connection and Interface 5-26 Configuring the JMS Adapter Resources and Payload 5-27 Quiz 5-28 Integrating with Oracle e-Business Suite 5-29 Oracle Applications Adapter Architecture Overview 5-30 Summary 5-31 Practice 5 Overview: Validating Credit Cards with a Database Adapter 5-32

6 Working with Mediator Components

Objectives 6-2 Part 1: Core Mediator Functionality 6-3 Introducing Mediator Components 6-4 Describing Features of Mediator Components 6-5 Routing Rules 6-6 Synchronous and Asynchronous Interactions 6-7 Content-Based and Header-Based Routing 6-8 Transformations 6-9 Validations 6-10 Error Management 6-11 Event Handling 6-12

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 8: D53946GC20_sg2

viii

Quiz 6-13 Service Virtualization 6-14 Creating a Mediator Component 6-15 Effects of Creating a Mediator Component 6-16 Deleting a Mediator Component 6-17 Mediating Services and Events 6-18 Modifying a Mediator Component 6-19 Editing a Mediator Component 6-20 Types of Mediator Routing Rules 6-21 Adding a Routing Rule for the Echo Option 6-22 Adding a Routing Rule to Publish an Event 6-23 Creating the Published Event 6-24 Adding a Dynamic Routing Rule 6-25 Configuring a Routing Rule 6-26 Setting the Target Service 6-27 Handling Synchronous and Asynchronous Responses and Faults 6-28 Configuring Message Filters 6-29 Configuring Validation 6-30 Sequential and Parallel Routing Rules 6-31 Part 2: XSL Transformations 6-32 Configuring Transformations 6-33 Editing with the XSLT Mapper 6-34 Mapping Types and Tools 6-35 Adding a Function to a Transformation 6-36 Modifying Function Parameters 6-37 Chaining (Nesting) Functions 6-38 Mapping Nodes Automatically 6-39 Adding a For-Each Mapping Rule 6-40 Adding an If Mapping Rule 6-41 Adding a choose Mapping Rule 6-42 Adding a Dictionary for Auto Mapping 6-43 Creating a Dictionary for Auto Mapping 6-44 Quiz 6-45 Testing Transformation Maps 6-46 Initiating an XSL Transformation Test 6-47 Viewing the Test Results 6-48 Summary 6-49 Practice 6 Overview: Implementing Mediator Components 6-50

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 9: D53946GC20_sg2

ix

7 Developing a Simple BPEL Component Objectives 7-2 Business Process Execution Language (BPEL) 7-3 Parts of a BPEL Process 7-4 XML Structure of a BPEL Process 7-5 Creating a BPEL Component 7-6 Describing BPEL Process Templates 7-7 Synchronous Process Concepts 7-8 Asynchronous Process Concepts 7-9 Describing the BPEL Design Editor 7-10 Designing the BPEL Process 7-11 Constructing a BPEL Process 7-12 Classification of BPEL Activity Types 7-13 Oracle BPEL Extension Activity Types 7-15 Quiz 7-17 Structuring a Process with a Scope Activity 7-18 Adding Activities to a Scope 7-19 Configuring a Scope Activity 7-20 BPEL Variables 7-21 Creating Variables and Importing Types 7-22 Choosing Global or Local Variables 7-23 Creating a Variables and Setting Types 7-24 Communicating Data with a BPEL Process 7-25 Assigning or Copying Data to Variables 7-26 Creating an Assign Activity 7-28 Examining the BPEL Process XML Source 7-29 Configuring an Assign Activity 7-30 Creating Copy Operations 7-31 Creating Expressions with the XPath Expression Builder 7-32 Working with the XPath Expression Resolver 7-33 Adding XPath Functions to an Expression 7-34 Transforming Data in a BPEL Process 7-35 Creating and Configuring a Transform Activity 7-36 Quiz 7-37 Testing a Composite with a BPEL Process 7-38 Accessing the BPEL Process Audit Trail 7-39 Examining the BPEL Process Audit Trail 7-40 Examining the BPEL Process Visual Flow 7-41 Summary 7-42 Practice 7 Overview: Creating a Simple BPEL Process 7-43

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 10: D53946GC20_sg2

x

8 Orchestrating Services with BPEL Objectives 8-2 Describing Process Orchestration 8-3 Orchestrating Services from BPEL 8-4 Partner Links and Service Invocation 8-5 Partner Links, Partner Link Types, and Roles 8-6 Creating a Partner Link 8-7 Configuring a Partner Link 8-8 Creating a WSIL Connection (Review) 8-9 Accessing WSDL URLs with a WSIL Connection 8-10 Exploring Results of Creating Partner Links 8-11 Synchronous Services 8-12 Invoking a Synchronous Service 8-13 Auto-Generated BPEL Variables 8-14 Exchanging Request and Response Data 8-15 Synchronous Interaction Pattern 8-16 Preparing and Obtaining Data 8-17 Asynchronous Services 8-18 Invoking an Asynchronous Service 8-19 Receiving a Callback Response 8-20 Asynchronous Interaction Pattern 8-21 Describing WS-Addressing and Correlation 8-22 Quiz 8-23 Conditionally Branching with a Switch Activity 8-24 Adding a Switch Activity 8-25 Configuring Branches of a Switch Activity 8-26 Summary 8-27 Practice 8 Overview: Part 1: Invoke and Switch Activities in BPEL 8-28 Practice 8 Overview: Part 2: Invoke and Switch Activities in BPEL 8-29 Practice 8 Overview: Changes to the Composite Application 8-30

9 Implementing Coordination and Interaction Patterns

Objectives 9-2 Processing Activities in Parallel 9-3 Adding a Flow Activity 9-4 Blocking Invoke Problem with Flows 9-5 Implementing Non-Blocking Invokes 9-6 Executing a Branch Multiple Times with FlowN 9-7 Creating and Configuring a FlowN Activity 9-8 Indexing XML Arrays Dynamically 9-9 Comparing Flow and FlowN 9-10

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 11: D53946GC20_sg2

xi

Quiz 9-11 Request-Response Patterns 9-12 One-Way Message Interaction 9-13 Synchronous Interaction 9-14 Asynchronous Interaction 9-15 One Request, Multiple Responses 9-16 One Request, a Mandatory Response, and an Optional Response 9-17 Asynchronous Interaction with Timeout Pattern 9-19 Implementing a Pick Activity 9-20 Asynchronous Interaction with a Notification Timer Pattern 9-21 One Request, One of Two Possible Responses 9-22 Multiple Requests, Multiple Responses 9-24 Multiple Requests, First Response 9-25 Looping with a While Activity 9-26 Suspending a Process with a Wait Activity 9-27 BPEL Deployment Descriptor Properties 9-28 Quiz 9-29 Summary 9-30 Practice 9 Overview: Part 1: Implementing Pick, While, and FlowN 9-31 Practice 9 Overview: Part 2: Coordinating with a Flow Activity 9-32

10 Handling Exceptions in Composite Applications

Objectives 10-2 Fault Handling Concepts 10-3 Types of Service Faults 10-4 Defining Business Faults 10-5 Managing Faults in Mediator 10-6 Configuring a Target Service for a Mediator Fault 10-7 Considering Faults with Asynchronous Mediator Components 10-8 Describing Faults in BPEL Processes 10-9 Creating BPEL Fault Handlers 10-10 Catch and CatchAll Handlers 10-11 Handling Faults with a Catch Branch 10-12 Handling Faults with a CatchAll Branch 10-13 Catching BPEL Run-Time Faults 10-14 Throwing Business Faults in BPEL 10-15 Returning Faults from a Synchronous Process 10-16 Returning Faults from an Asynchronous Process 10-17 Faults That Cannot Be Handled 10-18 Quiz 10-19 Overview of the Fault Management Framework 10-20

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 12: D53946GC20_sg2

xii

Introducing Policy-Driven Fault Handling 10-21 Fault Policy File Structure 10-22 Creating Fault Policies 10-23 Creating Fault Conditions and Actions 10-24 Configuring a Retry Action for a Fault Condition 10-25 Configuring a Java Action 10-27 Fault Bindings File Structure 10-28 Defining Fault Bindings 10-29 Quiz 10-30 Recovering Faults with Enterprise Manager Fusion Middleware Control 10-31 Accessing a Recoverable Fault 10-32 Recovering a Fault Condition 10-33 Summary 10-35 Practice 10 Overview: Part 1: Creating and Propagating a Fault 10-36 Practice 10 Overview: Part 2: Handling a Fault 10-37

11 Managing Transactions with Services

Objectives 11-2 Transactional Services 11-3 Transaction Boundaries with Services 11-4 Implementing Transactional Services 11-5 Introducing the Service Data Object (SDO) 11-6 Implementing an SDO with ADF 11-7 Deploying an ADF-BC Application 11-8 Accessing an SDO in a Composite Application 11-9 Creating an SDO Partner Link 11-10 BPEL Entity Variables 11-12 Executing SDO Operations with an Entity Variable 11-13 Querying Data with an Entity Variable 11-14 Configuring the BindEntity Activity 11-15 Updating Data with an Entity Variable 11-16 Inserting Data with an Entity Variable 11-17 Deleting Data with an Entity Variable 11-18 Transaction Concepts in BPEL 11-19 Quiz 11-20 BPEL Process Dehydration 11-21 Default Transactional Behavior in BPEL 11-23 Transaction Boundaries with Entity Variables 11-24 Transactional Adapters in a BPEL 11-25 Forcing a Rollback from a BPEL Flow 11-26 Global Transactions with Two Database Adapters 11-27

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 13: D53946GC20_sg2

xiii

Invoking a Database Adapter (Review) 11-28 Compensation and Transactions 11-29 Compensating Transaction: Example 11-30 Implementing Compensation in BPEL 11-31 Quiz 11-32 Summary 11-33 Practice 11 Overview: Working with Entity Variables and SDOs 11-34

12 Implementing Human Task Services

Objectives 12-2 Human Tasks 12-3 Human Workflow Concepts 12-4 Human Workflow Services 12-5 Common Workflow Exchange Patterns 12-6 Workflow as a Service 12-7 Human Tasks in a Composite Application 12-8 Implementing Human Tasks in a Composite Application 12-9 Working with Human Workflow in BPEL 12-10 Adding a Human Task to a BPEL Process 12-11 Quiz 12-12 Configuring the Human Task 12-13 Configuring the Task Header and Outcomes 12-14 Adding Human Task Parameters 12-15 Setting the Task Parameter Values 12-16 Processing the Task Outcomes 12-17 Configuring Assignment and Routing Policies 12-18 Configuring Stages and Participants 12-19 Selecting a Participant 12-20 Selecting a User Participant 12-21 Configuring Expiration and Escalation Settings 12-22 Configuring Notification Settings 12-23 Configuring Workflow Notification Channels 12-24 Accessing the Worklist Application 12-25 Viewing and Acting on Task Information 12-26 Task Display Forms 12-27 Generating a Task Display Form 12-28 Deploying Task Display Forms 12-29 Working with Notification Services 12-30 Oracle User Messaging Service (UMS) 12-31 Oracle UMS Components and Architecture 12-32 Configuring Workflow Notification Properties 12-33

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 14: D53946GC20_sg2

xiv

Configuring the User Messaging Email Driver 12-34 Viewing and Testing Email Notifications 12-35 Sending Email Notification from BPEL 12-36 Sending Notification to Users Preferred Channel 12-37 Quiz 12-38 Summary 12-39 Practice 12 Overview: Implementing Human Workflow and Notification 12-40 Practice 12 Overview: Changes to the POProcessing Composite 12-41

13 Developing Business Rules

Objectives 13-2 Introducing Business Rules 13-3 Declarative Rule Concepts 13-4 Rule Inference Concepts 13-5 Guidelines for Selecting Rules Use Cases 13-6 Basic Oracle Business Rule Concepts 13-7 Oracle Business Rule Components 13-8 Firing of Rules in a Rule Session 13-9 Overview of the Business Rules Component 13-10 Developing Business Rules for an Application 13-11 Facts, Bucketsets, Globals, RL Functions 13-13 Decision Service Architecture 13-14 Working with Decision Service 13-15 Creating a Business Rule Component in a Composite Application 13-16 Creating a Business Rule in a BPEL Process 13-17 Configuring a Business Rule in BPEL 13-18 Configuring Business Rule Input Facts 13-19 Configuring Business Rule Output Facts 13-20 Examining Business Rule Component Files 13-21 Opening the Business Rules Designer 13-22 Editing the Rule Dictionary 13-23 Creating XML Facts 13-24 Creating RL Functions 13-25 Creating Globals (Variables and Constants) 13-26 Working with Bucketsets 13-27 Creating a List of Ranges Bucketset 13-28 Creating Links to Other Dictionaries 13-29 Creating a Rule Set 13-30 Identifying the Structure of a Rule 13-31 Creating Business Rules 13-32 Creating a Rule Test 13-33

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 15: D53946GC20_sg2

xv

Creating the Rule Action 13-34 Quiz 13-35 Working with Decision Tables 13-36 Creating Decision Tables and Conditions 13-38 Creating Decision Tables Rules 13-39 Creating Decision Table Actions 13-40 Business Rules and Decision Functions 13-41 Creating and Editing Decision Functions 13-42 Invoking Rules in a Decision Function 13-43 Testing Business Rules at Design-Time 13-44 Testing Business Rules at Run-Time 13-45 Describing the Rules SDK 13-46 Quiz 13-47 Summary 13-48 Practice 13 Overview: Implementing Business Rule Components 13-49

14 Testing and Debugging Composite Applications

Objectives 14-2 Testing SOA Composite Applications 14-3 Introducing the Composite Test Framework 14-4 Overview of Test Suites 14-5 Overview of Test Cases 14-6 Creating a Test Suite 14-7 Creating a Test Case 14-8 Examining Test Suite and Test Case Files 14-9 Contents of a Test Case 14-10 Initiating Inbound Messages 14-11 Emulating Outbound Messages 14-12 Emulating Callback Messages 14-13 Emulating Fault Messages 14-14 Creating Variable or XML Assertions 14-15 Configuring Variable-Based Assertions 14-16 Configuring XML-Based Assertions 14-17 XML-Identical Assertion Example 14-18 XML-Similar Assertion Example 14-19 Quiz 14-20 Selecting the Test Cases to Run 14-21 Running the Test Cases 14-22 Examining Results of a Test Run 14-23 Viewing Assertion Information 14-24 Quiz 14-25

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 16: D53946GC20_sg2

xvi

Debugging Composite Applications 14-26 Troubleshooting Guidelines 14-27 Summary 14-28 Practice 14 Overview: Creating and Running a Test Suite and Test Case 14-29

15 Securing Services and Composite Applications Objectives 15-2 Introduction to Web Service Security 15-3 Securing End Point Examples 15-6 Quiz 15-7 Oracle Web Service Manager 15-8 Oracle Web Services Manager Policy Framework 15-9 Components of Oracle Web Services Manager Architecture 15-10 Introduction to Policies 15-11 Policy Interceptor Pipeline 15-12 Policy Assertions 15-13 Types of Security Tokens 15-14 Security Assertion Markup Language (SAML) 15-15 Introduction to Security Policies 15-16 Quiz 15-17 Securing SOA and Identity Propagation 15-18 Attaching a Policy to an Inbound Request 15-19 Attaching a Policy to an Inbound Request by Using Oracle JDeveloper 11g 15-20 Attaching a Policy to an Outbound Request 15-21 Attaching a Policy to an Outbound Request by Using Oracle JDeveloper 11g 15-22 Managing SOA Composite Application Policies 15-23 Summary 15-25 Practice 15 Overview: Attaching Security Policies 15-26

16 Designing and Managing Business Events

Objectives 16-2 Introduction to Business Events 16-3 Event Delivery Network (EDN) Concepts 16-4 Event Delivery Network and Business Events 16-5 Event Definition Language (EDL) 16-6 Aligning SOA and EDA through EDN 16-7 EDN Support in Oracle SOA Suite 11g 16-8 Creating a Business Event 16-9 Subscribing to Events in Mediator Components 16-10 Setting Event Delivery Consistency 16-11 Publishing an Event from a Mediator Component 16-12

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 17: D53946GC20_sg2

xvii

Initiating a Composite with ADF-BC Events 16-13 Publishing an ADF-BC CRUD Event 16-14 Summary of ADF-BC CRUD Events 16-15 Emulating Events in a Test Case 16-16 Quiz 16-17 Managing EDN in Enterprise Manager 16-18 Viewing Events in Enterprise Manager 16-19 Testing Events with Enterprise Manager 16-20 Subscribing to Database Events 16-21 Viewing Event Subscriptions 16-22 Viewing Event Faults 16-23 Quiz 16-24 Summary 16-25 Practice 16 Overview: Publishing and Subscribing to an Event 16-26

17 Monitoring Composite Applications with Sensors and Oracle BAM

Objectives 17-2 What Are Sensors? 17-3 Creating BPEL Sensors 17-4 Configuring BPEL Sensors 17-5 Sensor Files 17-6 Composite Sensors 17-7 Creating a Composite Sensor 17-8 Quiz 17-10 Overview of Business Activity Monitoring 17-11 Introduction to Monitoring with Oracle BAM 17-12 Interfacing with Oracle BAM 17-13 Oracle BAM Tools and Roles 17-14 BAM Architect 17-15 BAM Active Studio 17-16 BAM Active Viewer 17-17 BAM Administrator 17-18 Preparing an Oracle BAM Dashboard 17-19 ICommand Utility 17-20 Importing and Exporting with ICommand 17-21 Integrating Oracle BAM with the BAM Adapter 17-23 Creating a BAM Connection 17-24 Creating and Configuring the BAM Adapter 17-25 Configuring the Run-Time OracleBamAdapter 17-27 Using a Mediator Component with a BAM Adapter 17-29 Creating a BAM Sensor Action in a BPEL Process 17-30

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 18: D53946GC20_sg2

xviii

Configuring a BAM Sensor Action 17-31 Introduction to Complex Event Processing 17-32 Monitoring CEP with SOA Suite and BAM 17-33 Basic Oracle CEP Integration with Oracle BAM 17-34 Quiz 17-35 Summary 17-36 Practice 17 Overview: Creating Sensors and Monitoring in Oracle BAM 17-37

Appendix A: Performing Common Tasks in JDeveloper

Objectives A-2 Creating a Database Connection A-3 Creating an Application Server Connection A-4 Creating an Application A-6 Creating an Empty Project A-8 Creating an SOA Project A-9 Creating a Project from Existing Sources A-10 Creating a Project from Existing Sources: Finish A-12 Deploying an SOA Composite Application A-13 Creating an ADF Business Component Project A-15 Creating Business Components from Tables A-16 Selecting the Table for an ADF-BC Application A-17 Creating the ADF-BC View Objects A-18 Creating the ADF-BC Application Module A-19 Creating the ADF-BC Service Interface A-20 Configuring the ADF-BC Service Interface A-21 Verifying the ADF-BC Service Interface A-22 Setting the ADF-BC Deployment Configuration A-23 Creating the ADF-BC Service Deployment Profile A-24 Summary A-25

Appendix B: Overview of the Oracle Applications Adapter

Objectives B-2 Integrating with Oracle E-Business Suite B-3 Adapter for Oracle Applications B-4 Adapter for Oracle Applications Architecture B-5 Applications Context Concepts B-7 Establishing Applications Context B-8 Setting Applications Context in BPEL B-9 Invoking an Oracle Applications Operation B-10 Adapter Design-time and Run-time Connections B-11 Configuring the Adapter Run-Time Connections B-12

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 19: D53946GC20_sg2

xix

Completing Adapter Configuration B-13 Configuring an Adapter Design-time Connection B-14 Creating an Oracle Applications Adapter Service B-15 Oracle Applications Module Browser B-16 Summary B-17

Appendix C: Working with Domain-Value Maps and Cross References

Objectives C-2 Introducing Domain-Value Maps (DVM) C-3 Creating a Domain-Value Map C-4 Populating a Domain-Value Map C-5 Using a Domain-Value Map in Transformations C-7 Introducing Cross References C-8 Working with Cross References C-9 Creating a Cross Reference Table C-10 Defining the Cross Reference Table Structure C-11 Populating Cross Reference Tables C-12 Looking Up Cross Reference Tables C-13 Deleting Cross Reference Entries C-14 Summary C-15

Appendix D: Coordinating Master-Detail BPEL Processes Objectives D-2 Introducing Master-Detail Processes D-3 Coordinating a Master-Detail Process Example D-4 Creating a Master Process D-5 Creating a Detail Process D-6 Coordinating the Master-Detail with an Invoke Activity D-7 Summary D-9

Appendix E: Integrating Services with Oracle Service Bus Objectives E-2 Introduction to Oracle Service Bus E-3 Role of Oracle Service Bus E-4 Oracle Service Bus Core Features E-5 Oracle Service Bus Functional Layers E-6 Oracle Service Bus Architecture E-7 Projects and Resources E-8 Introduction to Proxy Services E-9 Introduction to Business Service E-11 Message Flow Definitions E-12

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 20: D53946GC20_sg2

xx

Oracle Service Bus Console E-13 Quiz E-14 Comparing Oracle Service Bus and Mediator Components E-15 Quiz E-16 Summary E-17

Glossary

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 21: D53946GC20_sg2

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

Managing Transactions with Services

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 22: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 2

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

Objectives

After completing this lesson, you should be able to:

• Describe Transactions with Services

• Explain Transactional implications of Services

• Describe a Service Data Object (SDO)

• Deploy an Application Developer Framework-Business Component (ADF-BC) application

• Manage Transactions with SDOs

• Explain database transaction management issues

• Execute transactional services from Mediator and BPEL components

• Manage transactions with the Database Adapter

• Explain compensation handling within a BPEL process

Objectives

As you find your application requirements get more complex, you begin to realize that interacting with a database as a service is unavoidable in the real world. Inherent with database interactions is the need to manage transactional semantics.

While SOA-enabled technology, like BPEL, were not designed with database transactional behavior as a primary influence. Therefore, the goal of this lesson is to help you understand how to manage database transaction boundaries in the context of your composite applications.

Your goal is to learn when transactional operations are committed and rolled back in the context of BPEL components so that you can make better design decisions when executing SOA applications that interact with databases either through Database Adapters and other services, such as Service Data Object (SDO) implementations.

In this lesson you explore working with the BPEL Entity Variable as a technique for executing database operations through Service Data Object (SDO) implementations, such Oracle ADF-BC component applications. Working with Entity Variables and their associated SDO implementations provides an alternative approach, to Database Adapter, as a way to interact with a database. Entity Variables and SDO implementation enrich your design choices for applications that interact with a database.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 23: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 3

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

Transactional Services

A transactional service can be defined as:

• Any service that stores data using a database transaction

• Any endpoint implemented by:– A Java Web service that executes database operations

– A Database Adapter service that executes statements or procedures performing Data Manipulation Language (DML)

– A JMS Adapter or AQ Adapter that sends messages to transaction-based services

– A Service Data Object that operates on a database

Note: SOAP endpoints, File Adapter, and FTP Adapter service implementations are non-transactional, that is, they do not join existing transactions and start new transactions (if any).

Transactional Services

From a simplistic perspective, a transactional service can be defined as any Web Service or Adapter service implementation that performs DML operations in a relational database, where the operations are subject to Atomicity, Consistency, Isolated, Durable (ACID) principles.

With the Oracle SOA Suite 11g platform, a transactional service can be implemented as a Java Web service, a Database Adapter, a JMS Adapter, and the AQ Adapter—all of which can be invoked from a Mediator and BPEL components. The Service Data Object is used by BPEL through entity variables (see the pages titled “Service Data Objects” and “BPEL Entity Variables”).

In all cases, transactional boundaries depend on the context, configuration, and environment of the services that are implemented and invoked. Transaction semantics are different for services that are invoked synchronously compared with services invoked asynchronously.

Note: It is possible to implement SQL-based logic in different ways to those already mentioned.

For example, you could create an EJB that implements database logic that is exposed through a Web Service Invocation Framework (WSIF) approach. Oracle ADF applications that perform database logic can also be exposed as synchronous SOAP style services.

Non-transactional services are those that do not modify database data, and include the File Adapter and FTP Adapter, among others.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 24: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 4

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

Transaction Boundaries with Services

Transactions boundaries depend on the type of interaction. Transactions:

• Start when a service is invoked (operation begins)

• End when a service ends (operation completes)

• Propagate across synchronous services, which can:– Join an existing transaction

– End the existing transaction

– Propagate the transaction to another synchronous services

• Terminate when invoking an asynchronous service, which:– Ends or suspends the existing transaction

– Starts a new independent transaction

Note: SOAP inherently has no support for transactions.

Transaction Boundaries with Services

In general, a transaction is started by a service when it is invoked by a client, and ends when the service operation completes. This is the default behavior for services invoked with the SOAP binding (SOAP over HTTP). If the invoked service completes successfully, the transaction started is committed; otherwise errors will roll back the transaction. Errors may or may not be returned to the client.

However, in Oracle SOA Suite 11g implementation, when invoking a synchronous service using Java bindings or APIs, an existing transaction can be propagated to the invoked service. The invoked service can join the transaction, propagate it to another synchronous service, or end the transaction.

Transactions are not propagated to a service invoked asynchronously. Therefore, by default asynchronous service invocations start a new transaction and either terminate or suspend the transaction in the environment invoking the service.

Note: Since SOAP inherently has no support for transactions, using SOAP binding methods causes the invoked service to be performed as an atomic transactional, that is, all operations must be performed by the service in an all-or-none mode.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 25: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 5

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

Implementing Transactional Services

With Oracle SOA Suite 11g you can implement the following types of services with transactional behavior:

• Web services that execute SQL transactions, including Application Developer Framework-Business Component (ADF-BC) components

• Database Adapter

• Service Data Objects

Implementing Transactional Services

Transactional enabled services are those that execute some SQL statements, either:• Explicitly, through a Web Service application or a Database Adapter that executes SQL

statements, or• Implicitly, through a Service Data Object.

Note: For more information read the SDO specifications at http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sdo.

In all cases, the assumption is a transaction is started and completed when a service operation is invoked, and depending on context and how the operations are invoked they may possibly join an existing transaction.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 26: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 6

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

Introducing the Service Data Object (SDO)

The Service Data Object (SDO) is a specification for a data programming architecture and API that:• Unifies data programming across data source types

• Supports common application patterns• Simplifies how to query, view, bind, update,

and introspect dataData sources

Data Mediator Service

ClientData Graph

Metadata

RDBMS

XML

Web Service

XML

Change summary

Data Object

Introducing the Service Data Object (SDO)

The Service Data Object (SDO) specification defines a data programming architecture and an API for programmatically accessing data across different data source types. The main purpose of the SDO specification is to simplify data programming, that is how applications access data irrespective of the source of data. SDO simplifies data programming by:

• Unifying access across different data source types, such as relational databases (RDBMS), XML, Web services, and Enterprise Information Systems through JCA adapters.

• Providing support for common application patterns• Enabling applications, tools and frameworks to more easily query, view, bind, update, and

introspect data.

Key components of the SDO specification are:• The Data Graph, which is a collection of disconnected data objects that may form a tree

(graph) structure.• The Data Object, holds the actual primitive data or references to other Data Objects. Data

Objects reference their Metadata describing their structure to support data introspection.• The Data Mediator Service (also called a Data Access Service), connects client

applications to data sources.

Client applications query a Data Mediator Service and get a data object (and possibly a data graph) in response. Client applications send an updated data graph to a Data Mediator Service to have the changes applied to the underlying data source.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 27: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 7

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

Implementing an SDO with ADF

• Create the ADF-BC Application Module by declaratively generating components based on database tables.– Create a Generic Project that uses the ADF Business

Components technologies.

– In the project, create ADF Business Components with the Business Components From Tables item.

• Configure the ADF Application Service Interface properties and set the data source in the Configurations properties.

• Create a deployment profile with the Business Components Service Interface archive type.

• Deploy the ADF-BC Application Module to the SOA server.

Implementing an SDO with ADF

While you can write your own Java classes that implement the SDO interfaces defined by the SDO specifications, you may find that creating an ADF-BC Application Module containing ADF-BC components easier, because the ADF Java components created already implement the SDO interfaces.

To quickly create an SDO for a composite application, use the JDeveloper ADF-BC wizards to generate an ADF-BC Application Module based on a database table. The ADF-BC components created can be configured with a service interface and deployed as a Web service that can also be used as an SDO.

Before you deploy the ADF-BC application you must create a Business Components Service Interface archive type so that the application can be deployed and referenced as a Web Service or accessed as an SDO.

Note: For more information on the steps required to create the ADF-BC application and prepare it for deployment as a service refer to the appendix titled “Performing Common Tasks in JDeveloper.”

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 28: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 8

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

Deploying an ADF-BC Application

To deploy an ADF-BC Application:

1. On the JDeveloper Application Navigator, click the JDeveloper Application Menu icon, and select Deploy > application_deployment_profile_name > to soaserver.

2. On the Select Deployment Targets, select the target server, for example: soa_server1, and click OK.

1

2Application menu icon Application deployment

profile name

Deploying an ADF-BC Application

The slide lists and illustrates the steps required to deploy an ADF-BC application by using its deployment profile. Service-oriented ADF applications are deployed using the Application Menu, which can be displayed by clicking the Application Menu icon in the JDeveloper Application Navigator window. The ADF-BC deployment profile name appears in the Application deploy menu after it has been created in Deployment section of the ADF-BC application Project Properties.

Note: The ADF-BC application deployment profile must be created in the Deployment section of the ADF-BC Project Properties. If the ADF-BC application is being used as a Web Service and a Service Data Object implementation then the project deployment profile must be created as a Business Components Service Interface type. For more information about creating the ADF-BC project deployment profile refer to the appendix titled “Performing Common Tasks in JDeveloper.”

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 29: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 9

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

Composite Application

Accessing an SDO in a Composite Application

Components required to interact with an SDO are:• An External (service) Reference to an ADF-BC application

deployed as a business service and SDO• A BPEL Entity Variable associated with the ADF-BC

service partner link• An activity that uses the Entity Variable, such as Bind

Entity, Assign, Create Entity, and Remove Entity activities

ADF-BC service

BPEL client

Entity variable

Data Database

JDBC

SDO

Partner Link

Copy of SDO data in memory

Accessing an SDO in a Composite ApplicationTo interact with an SDO in a composite application create the following components:

• An External (service) Reference to an ADF Business Component (BC) application deployed as a business service. The external reference must be wired to the BPEL process component to create a partner link for the service.Note: The ADF-BC component application is deployed to the run-time environment in a Enterprise Archive (EAR) file created as a Business Component Service Interface archive type. Refer to the previous slide titled “Creating the ADF-BC Service Deployment Profile.”

• An Entity Variable in the BPEL process. When an Entity Variable is defined you require the partner link associated to the ADF-BC service to complete the Entity Variable definition.

• An activity that uses the Entity Variable. The activities that use an Entity Variable are the Bind Entity and Assign, Create Entity, and Remove Entity activities.Note: The Assign activity cannot be used with an Entity Variable unless the Entity Variable is associated with an instance of data by using a Bind Entity activity.

Note: A composite application cannot exposed an SDO as a service entry point.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 30: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 10

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

Creating an SDO Partner Link

• Create and configure a BPEL Partner Link with SDO URL.

• Alternatively, create Web Service or ADF-BC Service in the composite application and wire it to the BPEL process.

1

2

Creating an SDO Partner Link

Assuming you have an application deployed as and SDO, such as an ADF-BC application, then you can create a Partner Link to the service in the same way as you normally create Partner Links in a BPEL process component. The slide shows the different ways to create a Partner Link for a service that is also an SDO. An ADF-BC service interface is exposed through a WSDL and therefore it can be treated as a normal Web Service and an SDO. To create the Partner Link:

1. On a BPEL Diagram window, drag a Partner Link from the Component Palette onto the Partner Link column. When the Create Partner Link window is displayed enter the endpoint URL for the ADF-BC application service interface (WSDL). As normal, you are prompted to create the Partner Link Types, which is generated by JDeveloper. After this you can select the Partner Role and click OK to create the Partner Link.

2. On the Composite Editor window, there are two ways to create a Partner Link for an SDO to be used by a BPEL process component. These ways are:

- Drag a Web Service from the Component Palette onto the External References column and configure the External Reference

- Drag an ADF-BC Service from the Component Palette onto the External References column and provide required configuration details.

Note: You must create a wire between the BPEL component and the SDO External Reference to create the Partner Link in the BPEL process.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 31: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 11

Creating an SDO Partner Link (continued)

When you create an External Reference by using the Web Service component from the Component Palette, this generates a reference that uses SOAP Bindings. Services with SOAP Bindings can reside on the same machine or a machine remote from the Composite Application that uses the service.

When you create an External reference based on the ADF-BC Service from the Component Palette it requires some additional configuration details, in particular it requires a Registry name for the ADF-BC service. The Registry name is generated when the ADF-BC component is deployed after creating addition XML elements in a Web application deployment descriptor. The process of performing this task is not covered in this course.

The ADF-BC Service component implements a different binding type from the Web Service External Reference. The ADF-BC Service creates a component that uses an ADF Binding, which requires that the ADF-BC service is collocated with the Composite Application that uses it. The main benefit is that the ADF Binding uses native Java RMI interfaces and offers better run-time performance when invoking the service because you eliminate the overhead of the SOAP network layers.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 32: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 12

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

BPEL Entity Variables

An Entity Variable is:• Defined as a BPEL variable with the Entity Variable option

selected and associated with the Partner Link of an SDO

• Used to query and manipulate data (bound by a key value) in a row of data source underlying the SDO

1

23

4

BPEL Entity Variables

An Entity Variable is used to query and manipulate data in the underlying data source bound by a key value. An Entity Variable is created in a Scope in the same way as you create standard BPEL variables. However, in the Create Variable window you must select the Entity Variable option and associate the variable with a Partner Link for an SDO. Before you create the Entity Variable make sure the Partner Link for the SDO has been defined. The steps, as shown in the slide, to create an Entity Variable are:

1. On a BPEL Scope, click the Variables icon.2. On the Variables window, click the Create (+) icon.3. On the Create Variable window, enter the variable Name field, such as customerEV. In

the Type section:- Select Element and click the Browse (magnifying glass) icon.- On the Type Chooser window, expand the SDO server Partner Link to select the SDO

structure. In the example the element structure is a View Object (or View Link) defined in the inline schema of the partner link for the ADF-BC application that is deployed as an SDO.

4. On the Create Variable window, select the Entity Variable option, and click the Browse icon to choose the Partner Link for the SDO.

Close the Create Variable dialog box. The Entity Variable is ready to be used in BPEL activities.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 33: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 13

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

Executing SDO Operations with an Entity Variable

• Entity Variables are used in the following BPEL activities:– bindEntity, to query data from the SDO– createEntity, to create data through the SDO– removeEntity, to remove data through the SDO– Assign (or Transform), to update data bound to a variable

• Entity Variables in BPEL activities execute SDO operations that map to these ADF-BC application Create, Read, Update, Delete (CRUD) methods:

BPEL Activity SDO Operations ADF-BC Methods

<bpelx:bindEntity> GetByKey getNameVO

<bpelx:createEntity> Create createNameVO

<Assign> copy and transform operations

Update

ProcessChangeSummary

updateNameVOprocessCSNameVO

<bpelx:removeEntity> Delete deleteNameVO

Executing SDO Operations with an Entity Variable

An Entity variable is used with the following BPEL activities, causing associated operations in the ADF-BC SDO service to be executed:

• A bindEntity activity invokes the most generic form of getNameVO method, where NameVO is typically derived from your View Object (or View Link) name of underlying ADF-BC service. The bindEntity activity gets a data row of values that match unique key values supplied in bindEntity activity.

• Assign or Transform activities, modifies elements in the Entity Variable causing the changes to be cached in BPEL process memory. The Entity Variable must first be used in a bindEntity activity. The actual data is stored (updated) in the database through the ADF-BC service at BPEL dehydration points, which causes the processCSNameVOmethod of the ADF-BC service to be invoked (where CS means ChangeSummary).

• A createEntity activity inserts a new row, by calling createNameVO. A bindEntity activity is not required.

• A removeEntity activity deletes the row, by executing deleteNameVO.

The ADF-BC component methods are registered in the extra metadata of the corresponding WSDL portType for the ADF-BC application service.

Note: The ProcessChangeSummary method must be selected to enable BPEL entity variables to execute bind and update operations on the SDO Service.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 34: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 14

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

Querying Data with an Entity Variable

To query data with an Entity Variable in BPEL:

• Add a Bind Entity activity

• Configure the Bind Entity

1

23

Querying Data with an Entity Variable

The slide shows the steps to query a data row by the primary key value by using an Entity Variable in a Bind Entity activity. The steps are:

1. Add a Bind Entity activity into the BPEL process. This creates the <bpelx:bindEntity> element in the process source.

2. Right-click the Bind Entity activity and select Edit.3. On the Bind Entity properties window, set properties such as the Name, Entity Variable,

and Unique Keys, and click OK.

The Bind Entity activity executes the getNameVO method in the ADF-BC service, where NameVO represents the View Object name whose methods are exposed through the ADF-BC service.

Note: You may wish to use the JDeveloper Web Server Test tool to verify that the ADF-BC service is accessible.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 35: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 15

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

Configuring the BindEntity Activity

1

2

3

4

Configuring the BindEntity ActivityThe graphics show the steps to configure the settings in the Bind Entity window. Apart from setting meaning name, the main steps are:

1. Next to the Entity Variable field, click the Browse icon to locate the Entity Variable to be bound to the data. The Browse Variables window displays the Entity Variables in scope and the name selected populates the Entity Variable field.

2. Next to the Unique Keys section, click the Create (green plus) icon to specify a key field to be used when binding the Entity Variable to data. This opens the Specify Key window

3. On the Specify Key window, click the Variable (x) icon to display the Browse Entity Variable window. On the Browse Entity Variable window, expand the Entity Variable tree and locate the element representing the primary key. There is a colored entry that is an annotation that identifies the key element. Do not select the annotation element. Click OK to return to the Specify Key window, which now has the Key Local Part and Key Namespace URI populated by your selection.

4. On the Specify Key window next to the Key Value field, click the Expression Builder icon to open the Expression Builder in which you can create an expression or select a variable to provide the value for the key to look up a target row in the database. Click OK

Note: The bindEntity activity represents a query by unique ID and retrieves a single row. However, if the Entity Variable is based on a master-detail structure the detail rows are retrieved the same time as the master row.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 36: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 16

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

Updating Data with an Entity Variable

To update a data row with an Entity Variable in BPEL:

1. Execute the Bind Entity activity.

2. Execute an Assign or Transform activity that modifies elements in the Entity Variable.

Note: Update operations requirethe ProcessChangeSummaryprocessCSNameVO methodto be exposed in the SDO interface.

1

2

Updating Data with an Entity Variable

To update a row using an Entity Variable, use an Assign activity (with copy operations or transform functions) where the target of the changes are one or more elements in the Entity Variable. Before performing any update operations you must have executed a Bind Entity activity to associate the database row with the process context.

Entity Variable elements that are not set are not updated. Elements that are assigned an empty value are treated as NULL values.

Note: A Transform activity can be used to obtain or modify values in an Entity Variable.

In addition, for update operations to be possible the ADF-BC service must expose the ProcessChangeSummary method of the view objects associated with the Entity Variable.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 37: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 17

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

Inserting Data with an Entity Variable

To create data with an Entity Variable:

• Prepare the new data values in a BPEL variable.

• Add and configure a Create Entity activity with:– The Entity Variable

– An expression that getsdata values from aBPEL variable

<bpelx:createEntity name= variable="ordersEV"><bpelx:fromExpression>bpws:getVariableData('orderData')</bpelx:fromExpression>

</bpelx:createEntity>

In this example, the variable orderData has same structure

as the Entity Variable

Inserting Data with an Entity Variable

The slide shows how to add and configure a Create Entity activity in a BPEL process. The BPEL source code is shown for the element after configuring the From field.

The Create Entity activity copies the data from the located specified in the “From” expression into the Entity Variable, which is used to perform an insert operation through its associated Service Data Object.

XML elements in the Entity Variable map to columns of the table into which their values are inserted. Therefore, exceptions can occur if values required by the database column are not included with the insert operation. However, with an Oracle Database, columns can be populated by the database by using the default value options eliminating the need for the XML elements to provide an initial value. XML elements, which map to columns that allow NULL values, can be excluded or set as an “empty” element to insert a NULL value.

Note: The Create Entity activity does not require the Entity Variable to be bound to a data row.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 38: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 18

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

Deleting Data with an Entity Variable

To delete data with an Entity Variable:

1. Assign the key value data into the Entity Variable.

2. Add a Remove Entity activity to the BPEL process configured with the Entity Variable.

<bpelx:removeEntity name="RemoveEntity_1"variable="customerEV"/>

1

2

Deleting Data with an Entity Variable

The graphic shows how to create and configure a removeEntity activity, which is used to delete a row from the underlying database. In this case, the Entity Variable should be populated with a key value of the row to be deleted, or previously bound to an existing row by using the bindEntity activity.

Note: The DML operations performed by the use of the createEntity, removeEntity, and Assign operations on an Entity Variable that has been used in a bindEntity activity, are performed with an optimistic locking strategy. Therefore, some exceptions can occur due to concurrency issues. The concurrency mechanism is managed by the SDO maintaining the current revision number of a row. The ADF-BC service will throw an exception if the row’s revision number is determined to be out of date.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 39: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 19

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

Transaction Concepts in BPEL

• BPEL processes are:– Transient, when they execute from start to end without

dehydration– Durable, when one or more dehydration points (<receive>,

Pick <onMessage>, <wait>, and others) occur during execution.

• BPEL transactions:– Begin at the start of the process

– End when the process completes, or at the first dehydration point in a durable process

Transaction Concepts in BPEL

To help understand transaction handling and management in a BPEL process, we define the following types of BPEL process:

• A Transient process executes from start to end without dehydration. A transient process executes within a single transaction. Unhandled faults or a machine crash during the execution of a transient process do not leave a trace in the system.

• A Durable process has one or more dehydration points during the course of processexecution. Dehydration occurs when BPEL activities, such as a <receive>, a Pick <onMessage>, and a <wait>, are encountered, to save process state while waiting for the event to be completed. A durable process is executed in multiple transactions because of the database commits to save the process state in the dehydration store.

For a BPEL process, given the above definitions, a transaction:• Begins at the start of the process. The first Receive activity marks the start of a BPEL

process.• Ends at the end of a transient (synchronous) process, when it sends the reply to its client, or

when a dehydration point occurs in a durable (asynchronous) process. If a fault occurs before these end conditions, the transaction is rolled back to the start and unhandled faults are returned to the caller.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 40: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 20

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

Quiz

Which activities can be used to interact with a Service Data Object (SDO) through an Entity Variable?

a. Receive

b. Bind Entity

c. Invoke

d. Assign

e. Transform

Answer: b,d,e

The Bind Entity activity queries a row through an SDO, the Assign and Transform activities update a data row queried with a Bind Activity. The Invoke and Receive activities are not required to interact with an SDO. O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 41: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 21

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

BPEL Process Dehydration

Dehydration Store

Client

Request

BPEL Engine

DehydrationDehydration point

Hydration

SOAINFRAdatabase schema

Callback response

BPEL Process Dehydration

Certain business processes can be long running, because the involved partners might not be able to react instantly to the requests. This happens in asynchronous scenarios where a business process invokes a partner Web service (using the <invoke> activity) and then waits for the response (using the <receive> or <pick> activities). While waiting for the response the BPEL engine can store the process (and its state, such as variables in scope) in the database (dehydration store), thus freeing up server resources. This is called dehydration.

When the BPEL engine receives the response it first restores the process with its state from the database (hydration) and then continues with the execution of the process. In real-world scenarios where many business processes might be running side by side, the dehydration capability is important as it reduces the demands on hardware performance. The process of dehydration causes data being written to the SOA database in the same transaction context as the changes that are made to application database data through Entity Variables and SDOs. Therefore, implicit dehydration points (at the start of a Receive, Wait, or Pick activity) cause a commit to occur ending any application transactions.

Note: You can explicitly request dehydration by calling the built-in checkpoint() method, in a Java Embedding activity. However, the built-in checkpoint() method is being deprecated in the future. The alternative option is to set the Partner Link idempotent property to true for a synchronous operation.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 42: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 22

BPEL Process Dehydration (continued)

Idempotent activities

Idempotent activities are those that can be retried, such as the Assign activity.

Non-idempotent activities happen only once, such as an Invoke activity, after which the BPEL engine saves the instance. All breakpoint activities (Receive, Pick, Wait) are always non-idempotent. The rest of the activities are idempotent.

Durable and Transient Processes

There are two kinds of processes in BPEL:• Durable, has one or more mid-process breakpoint or idempotent activities, causing it to

stop and wait for some event in the middle of the process. Durable processes tend to be long lived.

• Transient, does not have any mid-process breakpoint and idempotent activities, and never stops and waits for any event in the middle of the process. Transient processes tend to be short lived.

To determine the process type, if there are any breakpoint activities then the process is durable. Otherwise, the process is transient.

Dehydration

Dehydration occurs when the BPEL process encounters a breakpoint activity. The three cases when dehydration would occur are:

• When the BPEL instance encounters a mid-process breakpoint activity (excluding the initial Receive). This only occurs to durable and non-transient processes.

• When the BPEL instance encounters a non-idempotent activity (such as Receive). On recovery from a crash, the BPEL engine retries only the idempotent activities. Therefore, dehydration occurs when the engine encounters a non-idempotent activity.

• When the BPEL instance finishes, the BPEL engine saves the process instance to the dehydration store, unless it is configured not to do so. This occurs to durable and transient processes.

By default, all BPEL processes are dehydrated regardless of whether they are synchronous or asynchronous. However, for synchronous processes that do not need to be durable, you can turn off the dehydration mechanism by setting the following properties (in the BPEL process deployment descriptor):

• Set inMemoryOptimization to true.• Set completionPersistPolicy property to faulted or off.

Asynchronous process invocation messages are always saved to the dehydration store. Dehydration for asynchronous processes can be turned off, as long as the process is “transient.”Durable processes are always dehydrated regardless of the settings of the persistence properties (such as inMemoryOptimization and completionPersistPolicy).

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 43: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 23

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

Default Transactional Behavior in BPEL

• A Java Transaction API (JTA) transaction is always used with requests, and when:– It exists, the local transaction joins (enlisted into) the global

JTA transaction when transaction property is set– It does not exist, a new transaction is created

• A transaction is completed when it encounters a breakpoint activity (that is, one causing dehydration) or reaches the end of the flow.

client

Asynchronous Service

invoke

invoke

receive

BPEL process

receive

reply

TxClient

transaction exists. Tx

New local transactionSynchronous

invoke

Asynchronous invoke

Uses its own transaction

Default Transactional Behavior in BPEL

Oracle BPEL Server always executes requests within a JTA transaction, such that if a JTA transaction exists the server’s local transaction is enlisted into the global transaction. If the JTA transaction does not exist, a local transaction is created. Oracle BPEL Engine completes its local transaction either when a breakpoint activity (dehydration) occurs or at the end of the flow.

Note: The JTA transaction is not necessarily committed at this point. If the JTA transaction existed before the Oracle BPEL Engine request, the transaction is committed by the initiator.

The graphic illustrates the following behavior:• The client initiates the JTA transaction and invokes a synchronous BPEL process.• The synchronous BPEL process does not specify the transaction property (by default), and

creates a new local transaction, which is committed when the synchronous BPEL process successfully ends and returns a response to the client.

• When the client invokes the asynchronous BPEL process, the message invocation is executed within the client JTA transaction, and not the asynchronous BPEL process, which executes in its own transaction. When the client JTA transaction commits, the BPEL synchronous instance and asynchronous invocation message are committed to the database.

• If the JTA transaction is rolled back, the synchronous BPEL process transaction remains committed.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 44: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 24

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

Transaction Boundaries with Entity Variables

A transaction with Entity Variables within a BPEL process:

• Starts when an Entity Variable is updated

• Ends with a commit being performed when– A BPEL process dehydration or wait point occurs

– A Scope containing the Entity Variable completes without fault

• Ends with a rollback being performed when a Scope containing the Entity Variable terminates with an unhandled fault condition

Note: Remember from the client perspective, all SDO operations are executed in their own transaction context when using SOAP bindings.

Transaction Boundaries with Entity Variables

When making changes to an Entity Variable through an assign operation the changes are made to a copy of the data local to the BPEL process. Typically, the local copy is fetched from database through ADF-BC service at the <bpelx:bindEntity> activity. The data changes are pushed back to the ADF-BC service, which commits the data, when:

• The BPEL process is dehydrated• The Scope in which the Entity Variable is declared completes without propagating a fault

Note: Dehydration of a BPEL process happens when the BPEL process cannot proceed, that is, the process (including all the parallel branches, if exists) are waiting for some incoming message (a <receive> activity) or some time-based event (a <wait> activity)

All the work performed in the BPEL process will be grouped under one atomic transaction. Essentially, the dehydration point dictates the atomic transaction shape and boundary of the BPEL process.

Note: When the changes are performed by another remote service invoked by a BPEL process through SOAP, the changes are executed in a different transaction context.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 45: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 25

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

Transactional Adapters in a BPEL

• Transactional JCA Adapters (JMS, Database, AQ, Oracle Applications) support global (two-phase commit) transactions.

• Inbound transactions:– Start when the inbound adapter initiates the transaction

– End when control is returned to the inbound adapter

• Outbound transactions:– Start with the first outbound JCA adapter interaction

– End when the process ends or encounters a dehydration point. Errors cause a rollback to the start of the transaction or the last dehydration point

Note: All asynchronous requests are executed in their own transaction contexts.

Transactional Adapters in a BPEL

BPEL Transactional adapters support global (two-phase commit) transactions, through the JCA 1.5 X/Open Architecture (XA) contracts, including Oracle Applications, Database, Advanced Queuing, and JMS adapters. Non-transactional adapters include the File and FTP adapters.

• Inbound Transactions: For a synchronous BPEL process, a global transaction that is initiated by an inbound adapter is maintained till the end of a process flow, at which point the first Reply activity is encountered. For an asynchronous BPEL process, a transactional adapter initiates a global JTA transaction before sending an inbound message, which is stored in the dehydration store. When control returns to the inbound adapter, it commits the JTA transaction. If the process fails, the transaction is rolled back.

• Outbound Transactions: Transactional outbound JCA adapter interactions (initiated by an Invoke activity) are created with a global JTA transaction, such that all BPEL activities, including JCA adapter invocations are part of the global transaction. Therefore, all activities are committed, or rolled back if an error occurs. For example, a BPEL process can insert data into several tables (on different databases) with different invoke activities. When the BPEL instance is about to finish, the JTA transaction ends, at which point the database operations are committed. If an error occurs during the BPEL instance execution, all activities (and database operations) are rolled back to the last dehydration point.

Note: You can learn more in Oracle Application Server Adapter Concepts Guide 11g (11.1.1).

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 46: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 26

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

Forcing a Rollback from a BPEL Flow

Two ways to force a rollback of a BPEL JTA transaction:• Throwing a bpelx:rollback fault within your flow

• Invoking a partner link that marks the JTA transaction for rollback only

<throw name="Throw" faultName="bpelx:rollback"/>

Forcing a Rollback from a BPEL Flow

There are two mechanisms to force a rollback of a BPEL JTA transaction:• Explicitly throwing a bpelx:rollback fault within your flow• Invoking a partner link that marks the JTA transaction for rollback only

For example, if a BPEL process invokes an ESB flow that fails to call a Web service endpoint, the JTA transaction is marked for rollback. Because the Oracle ESB flow enlists its local transaction in the JTA transaction, a rollback on the JTA transaction impacts Oracle BPEL Engine's ability to dehydrate (as the JTA transaction is used by Oracle BPEL Engine for persistence).

When using the Database adapter, the TopLink layer does mark a transaction for rollback if the integrity of the transaction has not been compromised, as expected. However, in a sequence of two insert operations, the second insert fails, the transaction is rolled back and marked for rollback because it breaks the TopLink unit-of-work concept.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 47: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 27

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

Global Transactions with Two Database Adapters

By default, Database Adapters:

• Participate in global transactions

• Support invoke operations on two different services to commit or rollback as a unit

• Complete a transaction subject to normal dehydration points and process termination conditions

Note: Failure from either of the invoked Database Adapters causes the global transaction to roll back.

Global Transactions with Two Database Adapters

By default Database Adapters are configured to participate in global X/Open Architecture (XA) transaction. Global transactions require two services participating in the same transaction so that their operations are committed or rolled back as a unit. The Invoke activities participate in the global transaction subject to the normal BPEL transaction’s boundaries.

Failures that cause a rollback of the same global transaction include:• A Database Adapter operation that inserts or updates multiple tables as part of one invoke

that fails after some successful changes. In this case, the adapter marks the global transaction as rollback only, because the invoke operation was not atomic and a commit can cause data corruption.

• The invoke operation is retried multiple times until the global transaction times out and is rolled back, such as when the target database is down.

• An explicit bpelx:rollback fault is thrown from within the BPEL process.

Note: It is not guaranteed that both invocations use the same SQL connection, but it can be expected to happen. If you notice this is not the case, and you are using an XADataSource, set the TopLink property GetActiveUnitOfWork=true on all participating invokes.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 48: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 28

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

Invoking a Database Adapter (Review)

• Create a partner link using the Adapter Configuration Wizard and choose the desired operations.

• Add an Invoke activity configured with:– The partner link name for the Database Adapter service– The database operation– An input variable for Merge

(insert and update), Insert only,Update only, Delete operations and stored procedures

– An output variable for the Select operation and stored procedures

Note: Database exceptions, caused by integrity constraints and others, are returned as faults to a composite component.

Invoking a Database Adapter (Review)

The key aspects of working with a database adapter are listed in the slide. The Invoke activity is configured to execute the desired operation exposed by the Database Adapter service. Depending on the operation, it may require an input variable to supply data, an output variable to receive information, or both. For example, the DML operations (MERGE, INSERT, UPDATE, and DELETE) are one-way operations that require input data. No output data is returned for these operations. However, faults are thrown in the event of some database error condition caused by the operation, such as integrity constraint violations.

Database faults can be handled by using a Catch or CatchAll branch in the enclosing scope or higher scopes depending on how you want to manage error conditions in your BPEL process.

For more detailed steps on using the Adapter Configuration Wizard to configure the Database Adapter partner, refer to the lesson titled “Creating Adapter Services.”

For more in-depth information about working with the Database Adapter, refer to the documentation titled Oracle Fusion Middleware User's Guide for Technology Adapters 11g Release 1 (11.1.1).

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 49: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 29

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

Compensation and Transactions

• The problem: Transactions do not work with asynchronous services.– ACID principles and XA transactions cannot be applied

across asynchronous invocations.

– Transactions can be managed for synchronous services, provided all invocations are synchronous.

• The solution: Implement compensation handling, which enables an asynchronous invocation to execute:– An operation (do) that performs a transaction

– An operation (undo) that reverses a previously completed transactional operation

For example: A travel agent needs to undo some booking operations for a customer in the event of some services offered being unavailable.

Compensation and Transactions

The problem with transactional-based processes is that a global XA transaction is not possible with an asynchronous service invocation. Asynchronous services perform transactions in their own local context. So, how do you get transactional behavior with long-running processes?

By using compensation techniques, implemented with compensation handlers in BPEL, you can manage transactional-style operations and error recovery across asynchronous operations. However, the service that provides the transactional operation must also provide the undo operation, which reverses the effects of the transactional operation. This allows a BPEL process to manage what has been done and enables it to undo the work done in the event of an error.

Note: X/Open Architecture (XA), ACID (Atomicity, Consistency, Isolation, Durability), and two-phase commit transaction models do not work in a BPEL context because they are not suitable for long-lived transactions. Even for short-lived flows, some services (for example, SOAP Web services or external services) do not allow resource locking or a two-phase commit.

The example mentioned is of a travel agency that orchestrates external services to manage a travel booking for a customer. The complete transaction requires an airline reservation, car hire, and accommodation to be done. If the airline and car reservations have been successfully made, and the accommodation booking cannot be made due to room unavailability, then the process must be managed such that the airline and car reservations are undone.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 50: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 30

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

Compensating Transaction: Example

Travel_Flow BPEL (process scope)

Scope: Travel_Booking

Scope:Do_Airline

Invoke bookAirline

Scope:Do_Car

Invoke bookCar

Scope:Do_Hotel

Invoke bookRoom

Car_RentalService

Airline Service

Hotel Service

Invoke cancelAirline

Compensate Do_Airline

Compensate Do_Car

Compensation Handlers

Invoke cancelCar

cancelAirlinebookAirline

WSDL

cancelCar

bookCar

WSDL

cancelRoombookRoom

WSDL

RoomUnavailableException

1

3 4

2

6

5 Cancelled callBack

Compensation Handlers

Compensating Transaction: Example

The travel flow example is used to explain the key concept of compensating transactions. The Travel flow process scope contains a nested scope called Travel_Booking. The Travel_Booking scope is key to the implementation because it contains:

• The nested scopes, containing activity sequences, to perform their “do” operation. Each scope has a compensation handler with activities to perform their “undo” operation.

• The fault handlers to catch exceptions raised by “do” operations so that the appropriate compensation can be performed

The example illustrates how compensation occurs when the last transactional operation, in the Do_Hotel scope fails. The flow shown includes the following:

1. The Do_Airline successfully invokes the bookAirline operation. 2. The Do_Car successfully invokes the bookCar operation.3. The Do_Hotel fails and throws RoomUnavailableException, indicating an error.4. The Travel_Booking Scope’s Catch branch handles the exception and executes the

Compensate activities.5. The Do_Car Compensation handler is processed to perform the cancelCar operation.6. The Do_Airline Compensation handler is executed to invoke the cancelAirline

operation.Note: Compensation cannot be implemented unless the external services provide corresponding undo operations for any operations they offer.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 51: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 31

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

Implementing Compensation in BPEL

BPEL Process Scope

Outer Scope

Inner Scope

Invoke DO operation Invoke UNDO

operation

Compensate Inner scope

Compensation handler

Fault handler

1

3

4

2

5

Compensate activity

Add Catch branch

Add Compensation Handler.

Implementing Compensation in BPEL

The key steps required to implement compensation in BPEL are:1. Create an outer scope containing all transaction operations.2. Add an inner scope for each operation, containing the “do” operation activities.3. Add a compensation handler containing the “undo” operation activities to the inner scope.

Note: A scope can have one compensation handler.4. Add a fault handler (Catch branch) configured to listen for the specific error condition

requiring compensation to the outer scope.5. In the fault handler, add the Compensate activity configured with the name of the scope

whose compensation handler should be processed. The fault handler can include as many Compensate activities needed to perform all the required undo operations for the error condition.

Note: A different Catch branch may be needed for each different error condition that requires different compensating actions to be processed.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 52: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 32

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

Quiz

Which operations cause a process dehydration to occur, and therefore successfully end a transaction?

a. Pick with an OnMessage branch

b. Invoke

c. Wait

d. Assign

e. Receive

Answer: a,c,e

In general activities that cause a BPEL process to be suspended or wait for a period of time (Pick with onMessage or an onAlarm branch), Receive, and Wait activities) cause dehydration to occur. When a process is dehydrated its state is persisted in the SOA schema of the SOA database. Since the persistent data is committed, the commit operation is executed in the same transactional context as the BPEL process and therefore an existing transaction is ended.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 53: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 33

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

Summary

In this lesson, you should have learned how to:

• Describe Transactions with Services

• Explain Transactional implications of Services

• Describe a Service Data Object (SDO)

• Deploy an Application Developer Framework-Business Component (ADF-BC) application

• Manage Transactions with SDOs

• Explain database transaction management issues

• Execute transactional services from Mediator and BPEL components

• Manage transactions with the Database Adapter

• Explain compensation handling within a BPEL process

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 54: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 11 - 34

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

Practice 11 Overview: Working with Entity Variables and SDOs

OrdersService

Fulfillment

Insert order

Check Stock

Ship order

BindEntity_customer

CustomerService

Scope_insertorder

Assign_orderid

Transform_order

CreateEntity_order

Scope_shiporder

Assign_shiporder

BindEntity_address

Switch_shiporder

Service Data Object

Service Data Object

INSERTand

UPDATE

Query

ordersEV

customerEV

addressEV

Practice 11 Overview: Working with Entity Variables and SDOs

The aim of this practice is to implement the transactional behavior through the use of Entity Variables, as illustrated in the slide. The implementation changes include:

• Deploying the two ADF-BC component applications as services: one for managing the order data, the other for managing the customer data. These ADF-BC service are then used as Service Data Objects (SDOs).

• In the Fulfillment BPEL process you create the following three Entity Variables and their associated activities to store or retrieve database data:

- The order entity variable is used with the orders SDO to insert a new order and its items into the database. The order entity variable is also used to update the order status and the date shipped information.

- The customer entity variable is used with the customer SDO to query the customer name and email information.

- The address entity variable is also used with the customer SDO to query the customer address that is copied to the shipping request sent to the shipping companies through the JMS Adapter services.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 55: D53946GC20_sg2

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

Implementing Human Task Services

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 56: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 2

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

Objectives

After completing this lesson, you should be able to:

• Describe Human Task concepts

• Explain the Human Task component

• Design a Human Task

• Invoke a Human Task from a BPEL Process

• Generate ADF Task Forms for Human Tasks

• Interact with the Worklist application to act on tasks

• Add email notification to a BPEL Process

Objectives

In your design of the order processing application you find out that the business wants to implement human interaction to ensure that credit card orders above a specified limit are manually approved (or rejected) by a purchasing manager.

With this requirement in mind your task is to learn how to:• Implement a Human Task component that specifies a simple approver assignment and

routing policy• Include notifications to the approver that a manual approval task has been assigned to them

to be acted on• Send email notification messages to the customer to inform them about the status of their

order

To assist you with the tasks at hand, this lesson discusses human workflow concepts and the creation and configuration of Human Task components. You learn how to orchestrate a Human Task from a BPEL process component, and generate ADF Task Forms that control visual appearance of order information visible the notification email message and the Worklist application used by the approvers assigned the task of manually approving the selected orders.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 57: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 3

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

Human Tasks

The Human Task enables automated processes to:

• Integrate interactions with people

• Assign and route tasks to the correct users or groups

Automated process

Human Task

Task ServiceAssignee

Assignee

Assign

Route

Create task

Complete task

Human Tasks

End-to-end business processes often require some human interaction as part of a business process. For example, humans are needed for expense and purchasing approvals, exception management, or performing tasks to allow a business process to continue its execution. The human task component provides these human workflow capabilities with the following features:

• Human interactions with processes, including assignment and routing of tasks to the correct users or groups

• Deadlines, escalations, notifications, and other features required for ensuring the timely performance of a task (human activity)

• Presentation of tasks to end users through a variety of mechanisms, including a Worklistapplication, known as the Oracle BPM Worklist application

• Organization, filtering, prioritization, and other features required for end users to productively perform their tasks

• Reports, reassignments, load balancing, and other features required by supervisors and business owners to manage the performance of tasks

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 58: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 4

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

Human Workflow Concepts

Key components of a human workflow process:

• Task: The work to be done by a user, role, or group

• Participant: A user or set of users to which the task is assigned and routed based on some routing policy

• Notification: A message sent to a user assigned to a task

• Worklist: An application used to examine and act on tasks

• Human Task Editor: A tool used to defined the task settings and parameters

Human Workflow Concepts

A task in a human workflow represents the work that needs to be done by a user, role, or group. Tasks are also referred to as work items. Each task is associated with some parameters that describe the nature and data related to the task.

Human workflow supports the declarative assignment and routing of tasks. In the simplest case, a task is assigned to a single participant (user or group). However, many situations exist in which more complex task assignment and routing is required. For example, tasks that follow an approval pattern often require the task to be routed up a chain of management chain, or worked and voted on by a group of people. This requires some form of routing policy definition.

A participant is a user or set of users who are specified in the assignment and routing policy definition. For example, a vacation request (task) is assigned to a manager (participant). The manager must act on the request task before the vacation starts. If the manager formally approves or rejects the request, the employee is notified with the decision. The notification can be an email, voice message, instant message, or a short message service (SMS) message.

The Worklist application enables task assignees to view their assignments and act or route the task as defined by the policies. The Human Task Editor tool enables you to specify task settings such as task outcome, payload structure, task participants, assignment and routing policy, expiration and escalation policy, and notification settings. The Human Task Editor creates a .task metadata configuration file that stores the task settings.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 59: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 5

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

Human Workflow Services

Composite Application

Identity service

User Metadataservice

Task Queryservice

Task AssignmentHistory/Audit

Notification service

TaskManagement

service

TaskRoutingservice

Email client

Human Task

Identity management

LDAP

Notification channels

Email Wireless

BPEL

Portal

Worklists

Human Workflow Services

The slide illustrates the key components that make up the configuration of a human workflow task. The components that can be used for configuring a Human Task include:

• Task Management service: Handles persistence of the task data, forms, and attachments; keeps an audit trail; and tracks versions

• Task Routing service: Deals with the assignment and dispatching of tasks (that is, to route tasks to various users based on the selected pattern)

• Identity service: It enables authentication of users to look up user properties, roles, and privileges. Users can integrate their applications with Oracle Identity Management services, which can be implemented with an LDAP service such as Oracle Internet Directory for added security and identity management.

• User Metadata service: Manages metadata related to workflow users, such as user work queues, preferences, vacation, and delegation rules

• Task Query service: Provides a list of tasks in progress and reporting services• Notification service: Sends notifications to users through the following channels: email

and wireless options (such as a pager, SMS, and text messaging). Other notification services supported include fax and voice channels.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 60: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 6

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

Common Workflow Exchange Patterns

Worklist (tasks, forms, attachments, reports)

List work items

Complete task

Get weekly productivity report

Assign task

Task complete

Assign tasks to role or group (from directory)

BPELprocess

Flow patterns, Routing Rules

Get approvals

All approvals complete

Change routing

Escalation and delegation rules

Escalate task

Taskresolved

Notify manager

BPELprocess

BPELprocess

Common Workflow Exchange Patterns

The graphics show a subset of the following common workflow patterns that can be configured with the Human Task Editor:

• Task assignment patterns• Task routing patterns• Task escalation and delegation patterns• Task worklist reporting patterns

The Human Task activity implements these workflow patterns by using a combination of BPEL activities. Additional services that enable workflow services are identity management for authentication of task assignees, and notification services to inform assignees of tasks requiring action. The Human Task metadata (.task) file stores workflow pattern configuration data:

• Task details, such as title, payload, and other properties• Routing slip configuration to specify:

- Task flow: simple, sequential, parallel flow, ad hoc workflow, and For Your Information (FYI) tasks. An FYI task is a notification scenario that does not require the task assignee to perform any action on the task information.

- Assignment and routing policy (assignment of a task to user, group, or role; static or dynamic assignment; rules based on task outcome or payload content and title)

- Escalation, renewal, and expiration criteriaJDeveloper enables you to generate Java-based task forms to enable customer user-interface designs to be created that display relevant task data on the Worklist application page.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 61: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 7

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

Workflow as a Service

1. Assign tasks to a user or role.

2. Wait for task completion as part of an end-to-end process flow, and manage the response.

TaskService (workflow)

Update task

Worklistapplication

WSDL (Contract)Composite

Application

Human Task

BPEL

Human Task scope

Assign task

Complete task

1

2

Workflow as a Service

Oracle SOA Suite 11g is installed with workflow services provided by the TaskManager process and a Worklist application. When you use Oracle JDeveloper wizards to create a Human Task in a composite application or in a BPEL Process. By adding a Human Task to a BPEL Process,JDeveloper:

• Creates a scope containing activities for implementing the human workflow as an asynchronous interaction

• Creates a Partner Link for the TaskService implemented by the Oracle SOA Suite 11gTaskManager service

• Assigns task data required by the TaskService• Invokes the TaskService with the task data required for manual processing by users of the

Worklist application• Receives the complete task callback from the TaskService, which contains the outcome

produced by the user action on the task• Creates a Switch activity with one case branch for each response outcome configured

The Worklist application is a Web-based interface that enables assignees to process tasks. When the tasks are completed, the TaskManager service generates the callback to the BPEL Process to enable processing to continue based on an outcome selected by a user action.

Note: A Human task can be created as a standalone component.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 62: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 8

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

Human Tasks in a Composite Application

A Human Task can be created in:

• A composite application as stand-alone component exposed as a service

• A BPEL Process as part of an orchestrated interaction

Composite application

Human Task

Composite application

BPELBPEL

Process

Human Task

Human Task component Human Task

Scope

Human Tasks in a Composite Application

Human tasks can be added to a composite application in the following two ways:• A standalone human task, where it is created as a component in the SOA Composite Editor

and not associated with a BPEL Process. A standalone human task component is useful when there is no need for automated activity in the application. In this case, the client application creates the task themselves by interacting with the operations exposed from the human task component.

• A human task associated with a BPEL Process, where the human task is created in the composite application and wired to a BPEL Process, or it is created inside the BPEL Process. In most cases, a human task is associated with a BPEL Process and integrated as part of business process flow, such as getting human approval for expenses exceeding a given amount.

During run-time, the business logic and processing rules of the human task service component are executed by the human workflow service engine. All human task service components, regardless of the SOA composite application of which they are a part, are executed in a single human task service engine on their deployed platform.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 63: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 9

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

Implementing Human Tasks in a Composite Application

Standalone Human Task

Human Task wired to a BPEL Process component

Adding a Human Task into a BPEL

Process flow

Human Task Partner Link

Implementing Human Tasks in a Composite Application

As previously stated you can create a Human Task component in the SOA Composite Editor, either as a standalone Human Task or wired to a BPEL Process, as shown in the graphics.

If you create the Human Task component and create a Composite Service with SOAP bindings, you are exposing the Human Task to clients of the composite application. Those clients interact with Human Task service by using its operations and associated message structures. Whether the component is exposed or not it can be associated to BPEL Process component.

The slide shows two ways to associate a Human Task with a BPEL Process. The first technique takes place in the Composite Editor, where you:

1. Create a Human Task component in the composite, most likely without exposing it as a composite service.

2. Create a BPEL Process component and wire it to the Human Task component. Wiring the BPEL Process to the Human Task creates the associated Partner Link in the BPEL Process. However, it does not create the .task definition file, which can be created in the BPEL Editor when you drag a Human Task into the process flow.

The second technique is performed in the BEPL Editor, where you drag a Human Task in to the BPEL Process flow, which displays the Create Human Task window (different to the one in the slide) in which you name the Human Task and create the .task definition file. The same window enables you to select a Human Task previously created and wired in the Composite Editor.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 64: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 10

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

Working with Human Workflow in BPEL

Human workflow in BPEL involves:

• Design-time actions:– Adding a Human Task into a BPEL Process flow

– Configuring task parameters, assignments, outcomes, and a workflow pattern in the .task metadata file

– Optionally, generating a Task Form to customize the task information displayed in the Worklist application

• Run-time actions:– Initiating the BPEL Process and waiting for the TaskService

to assign tasks

– Logging in to the Worklist application as an authorized user and performing an action on the assigned task

Working with Human Workflow in BPEL

Working with human workflow service in BPEL involves design-time and run-time actions. At design-time, the developer of the BPEL Process needs to:

• Add a Human Task into the process• Configure the Human Task attributes that defined all the features required for the human

workflow interaction. This information is all stored in a task metadata file that has a .task extension that is added to the BPEL project.

• Optionally, use JDeveloper wizards to generate task-displayed forms to customize what and how the task information is displayed by the Worklist application at run time.

At run time, when the BPEL Process is initiated and executes the Human Task activities, 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 into the Workflow Web 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.

After the workflow pattern is completed, the BPEL Process receives the task outcome from theTaskService callback interface. The task outcome is evaluated with a task Switch activity that provides Case branches for processing each of the possible task outcomes received.

Note: The separation of the task details from the BPEL Process into the .task file dramatically improves and eases the maintenance of task information.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 65: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 11

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

Adding a Human Task to a BPEL Process

2

3

4

Select Human Task created in

composite (if any)

Create a new Human Task

Human Task metadata and configuration file opened in Editor

Humantask1.task

Humantask1.componentType

1

Adding a Human Task to a BPEL Process

The graphics illustrate the initial steps for creating a Human Task in a BPEL process, which are:1. Dragging a Human Task activity into the process flow in the Diagram view. 2. On the Create Human Task window, you can either select an existing Task Definition (if

any) or create a new Human Task. In this case, the create option is selected. 3. On the extended Create Human Task window, configure initial task details, such as

outcomes, and data for parameters. These task detail settings are saved to an XML file in the project with a .task extension that maintains the task metadata.

4. After clicking Ok in the Create Human Task window, the .task file is created and opened in a JDeveloper Task Editor window. A .componentType file is created in the project to ensure a Human Task component is visible in the Composite Editor.

In the BPEL Process the following components are created:• A Partner Link for the Human Task service• A Scope containing activities that assign task parameters to variable, invoke the task

service, and wait for the task outcome in the response• A Switch activity containing a <case> branch for each outcome specified in the .task

file. You can add additional activities into these branches to implement process activities needed for the management of the outcome returned.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 66: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 12

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

Quiz

A Human Task can be used only by a BPEL process component.

a. True

b. False

Answer: b

A Human Task can be used as a standalone component within a composite application and any of its operations invoked as a service if its WSDL interface is exposed as a service. Mediator components can be wired to a Human Task for sending messages in a For Your Information (FYI) task scenario. For more complex human workflow patterns it is more common to used a Human Task from the context of a BPEL process.

Note: The FYI task is a form or notification that does not require the task assignee to perform some action when receiving the task information.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 67: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 13

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

Configuring the Human Task

Human task configuration is stored in a .task metadata file that is deployed with the project.

.task

Human Task Editor window

Configuring the Human Task

After creating a Human Task component in the SOA composite application or a BPEL process the .task file is opened in the Task Editor, in which you can configure task parameters and properties. The Human Task Editor enables you to configure settings in the following sections:

• Task header: To specify the task title, description, task outcomes, task category, task priority, and task owner. Many of these can be literal values or dynamically determined.

• Parameters: To defined task parameter structures (types) included with the task payload sent to the task management service. Task parameters can be displayed and modified in theWorklist application

• Assignment and Routing Policy: To assign participants to the task and create task routing policies for the workflow definition

• Expiration and Escalation Policy: To specify the expiration duration of a task• Notification Settings: To create and send notifications when a user is assigned a task or

informed that the status of the task has changed• Advanced Settings: To specify custom escalation rules among other settings• Annotations: To label different attributes of the task definition. Annotations can be used

with Oracle Business Process Analysis.

For more detail about all the parameters consult the “Oracle Fusion Middleware Developer’s Guide for Oracle SOA Suite 11g Release 1 (11.1.1).”

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 68: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 14

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

Configuring the Task Header and Outcomes

2

3

1

Configuring the Task Header and Outcomes

The task header contains the details such as, the title for the task, a priority, a task owner, a comma-separated list of outcome strings, and parameters values that provide data for the task that can be viewed and modified in the Worklist application. The initial values entered in the Create Human Task window populate the task header fields, which can be modified in the Task Editor window as shown in the slide. For example, the default outcomes are APPROVE and REJECT. To select or create Outcome values, perform the following steps:

1. Click the magnifying glass icon next to the Outcomes field in either the Create Human Task window or the Human Task Editor.

2. On the Outcomes Dialog window, select the options from list of seeded values, and to create additional outcome in the Outcomes Dialog window, click the create (green plus) icon to open the Add Custom Outcome window.

3. On the Add Custom window, enter a string for the custom outcome and click OK to add it to the list in the Outcomes dialog.

After creating custom outcome values and selecting the values desired, click OK.Note: For each outcome value selected a <case> branch is created in the task Switch activity add after and associated with the Hunan Task scope when you initially select the outcomes in the Create Human Task window. However, adding custom outcomes or changing the outcomes in the task Editor requires you manually modify the a <case> branches in the BPEL process. The task Name (the component name) and the Namespace are unique identifiers for configuration.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 69: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 15

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

Adding Human Task Parameters

Task parameters are:• Added in the Parameters section of the .task

• Defined as either simple type or XSD element type

• Exchanged with the Task Service in the task payload

1

Enables user to modify task data in Worklist application

2

Parameter name:• Can be set for a selected Type• Is the name of selected Element

Adding Human Task Parameters

Task parameters form the structure of information passed in task payload to the Task Service. Task parameters can be displayed in the Worklist application, if you generated a Task Form with the information included, so that a task assignee can view and optionally modify the data.

In the Task Editor, to add a task parameter:1. Click the Add Task Parameter icon (+) in the Parameters section.2. In the Add Task Parameter dialog box, either:

- Select the Type option to browse for a desired type, and enter the parameter name, or- Select the Element option to browse for an XSD element. Selecting this option

disables the Parameter Name field that is set based on the chosen element name.Click OK.

Note: Selecting the “Editable via worklist” option enables a task assignee to modify the task parameter values, if displayed in the Worklist application. Changes made to task parameter data are returned to the BPEL Process in the task payload along with the task outcome.

Multiple task parameters can be added to a task definition. However, each parameter must be supplied with values. The above two steps merely define the task parameter data structure passed as the payload to the Task Service. The next page discusses how to specify the source of data for task parameters.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 70: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 16

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

Setting the Task Parameter Values

To configure task parameter values:

• Edit the Human Task activity

• Choose the data source from aBPEL variable

2

Populated with modified values (if enabled)

1

3

Setting the Task Parameter Values

To supply the actual values for task parameters at run-time, you configure the Human Task properties by selecting XML element from a BPEL Variable whose type is compatible with the task parameter definition. The source of data can be an XML fragment, expression, or Partner Link. To associate a value from a BPEL variable to the task parameter:

1. On the BPEL Diagram window, right-click the Human Task activity icon, and select Edit.2. On the Human Task property window, in a Task Parameter table row next to BPEL

Variable column click the Browse (three dots) icon.3. On the Task Parameters window, in the From section select the variable type, expand the

variables and select a compatible XML element from the BPEL, and click OK.

Note: If the “Editable via worklist” option was enabled for the task parameter, then the selected XML element in the BPEL variable is populated with the modified values when the task parameters are returned from the Task Service.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 71: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 17

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

Processing the Task Outcomes

The taskSwitch contains a <case> branch for each outcome, and an <otherwise> branch for all other conditions.

Configure REJECT branch activities

Configure otherwise branch activities (if required)

Configure APPROVE branch activities

Processing the Task Outcomes

Expand the taskSwitch activity and configure the task outcome branches. The number ofbranches that exists depends on the number of initial outcome values specified in the Create Human Task window. For example, by default the REJECT case, APPROVE case, and otherwise branches are created.

To remove a branch that is not required, right-click the branch and press Delete. If you need to create additional branches for new custom outcomes, add a new case branch and configure the conditional expression based on existing conditions and use the appropriate outcome string value in the comparison.

For each outcome branch you can modify or remove existing CopyPayloadFromTaskAssign activities, and add any additional activities required to perform the processing needed for each outcome.

Note: If the task definition specifies task parameters that can be modified by the task service, then the CopyPayloadFromTask Assign activities are generated with a single copy operation to copy modified task payload data to the BPEL variable defined as a task parameter in the task definition. Otherwise, the CopyPayloadFromTask Assign activities are generated without a copy operation and can be deleted unless you wish reuse them for your own purpose.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 72: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 18

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

Configuring Assignment and Routing Policies

Assignments and Routing Policy section:

• Provides routing stages each with its own participant list

• Enables stages to be serial, parallel, and a combination

Initial stage

Adds sequential stage after the selected stage Adds parallel stage

next to selected stage

Configuring Assignment and Routing Policies

In the Assignments and Routing Policy section you configure the assignees to which the task is routed and specify how the task is routed to assignees. When you first expand the Assignments and Routing Policy section you are provided with a single stage and no participants, which needs to be configured. In simple terms, Assignment and Routing comprise:

• Stages, which organizes the approval process for a block of participant types• Participants, which are created by using an editor (a participant list builder) that configures

the sequence in which the assignees are added indicates the execution sequence

Assignments and routing can be structured in complex ways comprising of multiple stages, where each stage can have its own collection of participants (assignees) to which the task can be assigned depending of routing policy settings. As shown in the slide you can add additional stages that are processed in serial, in parallel, and a combination of both.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 73: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 19

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

Configuring Stages and Participants

2

3

Structure the stages (parallel, serial, move up, move down).

Change the stage name.

Add participants to a stage by using different

list builder types.

Change the participant list label.

1

Configuring Stages and Participants

The slide shows the different ways of configuring stages, and how to add participants to a stage:1. To change the execution order of stages:

- Select a stage and click the up or down arrow to move it up or down, respectively.- Click Make Parallel to arrange two or more selected stages for parallel execution.- Click Make Serial to arrange two or more selected stages in sequence.

2. Double-click the stage title to open the Edit window and change the stage name.3. Double-click the <no participants> box inside a stage to open the Add Participant Type

window, in which you can choose from a selection of types of list builders that creates a list of assignees from a list of users or groups that can be statically or dynamically generated.

Note: The details of the Add Participant Type window are discussed next.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 74: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 20

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

Selecting a Participant

Note: The Application server connection must be configured to connect to the LDAP server.

Selecting a Participant

On the Add Participant Type window, you can select a Type of list builder used to create the list of task assignees. The choices of type are:

• Single – specifies that any single person from a list can action the task. The task completes when any of the assignees actions the task.

• Parallel – specifies when multiple users, working in parallel, must act simultaneously on the task. Completion depends on a voting percentage specified, or setting a majority or unanimous vote.

• Serial – specifies a list of participants for a workflow to act on the task in sequence• FYI – specifies that a task is sent to a user for notification purpose, and the business

process does not wait for a user action. An FYI task does directly impact the task outcome.

To create participants lists you click the green plus icon in the Participant list section and choose to add a specified user, a group, or application role. In these cases, you get an Identity Lookup window that can be configured to search for user, group, and role names from an LDAP server.

In addition, you can select to build a list of participants using different strategies, such as:• A static list of names or dynamically populated by using an expression• A management chain that enable definition of the starting assignee and the number of

levels to process up the management chain to a specified top assignee• Rule-based where Business Rules determine the list of assignee based on conditions

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 75: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 21

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

Selecting a User Participant

• Select an Application Server connection, with an LDAP server configured (a Managed WebLogic Server instance).

• Click the Lookup icon to populate the Search User list.

2

3

1

4

Selecting a User ParticipantWhen you click the Add User option in the Add Participant Type window, the Identity Lookup window is displayed, as shown on the screen. This window enables you to lookup user, group, and application role names configured in an identity server, such as an LDAP server.In the example, the LDAP Server connection is associated with the Oracle SOA Suite Manager Server instance in the WebLogic, which provides an embedded LDAP server. The steps to select a single user is shown in the screen, which includes:

1. Selecting an Application Server connection, which can be selected from the list or created by clicking the green plus icon, if the connection does not already exist. On successful connection the Realm is populated. By default, there is only one realm.

2. For adding a user, you can select the User Name (or other LDAP field entries, such as first name) to which the Search pattern is applied option, and click the Lookup icon to populate the Search User list.

3. From the Search User list, select one or more entries and click Select to move them to the Selected User list.

4. Click OK to add the selection to the participant row in the Add Participant Type window.Note: After selecting a user in the Search User list you can click Hierarch to display their manager hierarchy, and click Reportees to list the users that report to them. Double-click an entry to view additional details about each user. You can use a open-source tool like JXplorer to populate the LDAP server, or supplied command line scripts for batch operations.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 76: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 22

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

Configuring Expiration and Escalation Settings

Expiration and escalation policy options include:

• Never Expire

• Expire after

• Renew after

• Escalate afterOptions provide a fixed duration in days, hours, and

minutes, or calculating a period by using an expression.

“Renew after” sets number of renewals

“Escalate after”sets number of

levels, and highest approver title.

Configuring Expiration and Escalation Settings

The slide lists the options available in the Expiration and Escalation Policy section of the Human Task Editor. The four choices are:

• Never Expire, in which case the task remains in the system until acted on by a participant• Expire after, where a period can be determined as a fixed number of days, hours, and

minutes, or a dynamically calculated period based on an expression.• Renew after, extends the expiration period when participant does not respond within the

specified time period. You limit the number renewals before final expiration.• Escalate after, to escalate a task up a management chain by a specified number of levels, if

a user does not respond within the time period specified

Note: An expiration duration set in the “Limit allocated duration to” field, for a participant type level, take precedence over settings specified in the Expiration and Escalation Policy section (routing slip level).

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 77: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 23

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

Configuring Notification Settings

Configures notification to users using different notification channels about task status, like assignment and completion.

23

1

45

Configuring Notification Settings

Notification Settings indicate when a user is assigned a task or informed when the status of the task is changed. Notifications can be sent through different channels, such as email, voice message, instant message, or SMS. Notifications are sent to different types of participants for different actions based on the settings selected in the Notification Settings section.

By define three Notification Settings are configured, each with default messages. When you expand the Notification Settings section you can see the three default notification entries (rows), which include a message when the task status is:

• Assign, when the task has been assigned• Complete, when the task has been completed• Error, when an there is a task error.

To configure or change Notification Settings, you can:1. Click the Add (green plus) icon to create addition notification row entries.2. Select the desired Task status for the notification.3. Select the desired Recipient for the notification.4. Configure the notification message based on an expression.5. Configure reminder options, with the Remind once option shown as an example.

Note: The “Make notification actionable” option enables task actions to be performed through the email notifications.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 78: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 24

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

Configuring Workflow Notification Channels

Notifications channels are configured in the Worklist application Preferences, and the Notification > Message Channels tab settings. 1

2

3

4

Configuring Workflow Notification Channels

Notifications can be sent through any of the following channels: email, telephone voice message, instant messaging (IM), or short message service (SMS). In Oracle SOA Suite 11g, human workflow email notification layer works with Oracle User Messaging Service (UMS) to alert users to changes in the state of a task.

For Human Workflow users their notification channels are configured in the Preferences of theWorklist application (see the slide titled "Accessing the Worklist Application" for more information on the Worklist application). To access and configure the notification channel preferences, after logging into the Worklist application the user performs the following steps:

1. On the Oracle BPM Worklist page header, click the Preferences link.2. On the Preferences page, click the Notification tab. By default the Messaging Channels sub

tab is displayed.3. On the Messaging Channels tab page, you can use the toolbar to Create new channel, Edit

existing channels, Delete existing channel entries, and Detach them. In the example, several channels have been preconfigured by using command line scripts that seed the user information into the Oracle UMS configuration. In this case, the Business Email channel is selected and the Edit button is clicked.

4. On the Modify Channel window, you can change the channel settings as shown. For example, the Business Email has been selected as the default channel.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 79: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 25

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

Accessing the Worklist Application

• Access the Worklist application by entering the URL http://host:port/integration/worklistapp in a Web browser.

• Log in as an authorized Worklist application user.

Accessing the Worklist Application

The Oracle BPM Worklist application is a Web application that is installed with Oracle SOA Suite 11g components. To access the Worklist application, enter the URL: http://host:port/integration/worklistapp.

The Worklist application login page is displayed. Log in to the application with a username authorized to use the Worklist application.

Note: Administrators can configure an LDAP Server to be used to authenticate Worklistapplication users. By default the Oracle Weblogic Managed Server instances have an embedded LDAP server, which can be used for authentication and authorization. The Embedded LDAP server can be configured by using the Oracle WebLogic Administration Server Console Web application or a client application tool such as JXplorer (http://www.jxplorer.org).

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 80: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 26

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

Viewing and Acting on Task Information

In the Worklist application, users can:

• View and manage task assignments

• View and modify task information

Task information is visible if Task Display Forms are

deployed with the composite application.

Viewing and Acting on Task Information

After users log in to the Worklist application, they can view the task assignments, work queues, and task parameter information by selecting the specific task.

The Worklist application provides a default Web page with task information, which does not include task details. However, by using Oracle JDeveloper to generate Task Display Forms for the Human Task you can view task details, which is rendered in the bottom right pane display area of the browser window, as shown in the slide. The Task Display Form can also render an Action menu and buttons. The action for an assigned task can be done either in:

• The Worklist application page containing the task information• The Task Form that displays the task parameter details. If the task parameter data was

configured to be modifiable at design time, users can view and save modified values before they perform a selected action in the page.

Note: If task data is modified then changes must be saved before the applying a selected action.

In the top-right pane containing the list of assigned tasks, you can select a task and perform an action available in the Action menu, such as APPROVE, REJECT among others. The action items correspond to the task outcomes configured in the Human Task component metadata.

Note: If you have not generated Task Forms for the Human Task the Worklist application does not display any information in the bottom right pane. However, you can still apply an action to tasks that appear in the Inbox.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 81: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 27

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

Task Display Forms

Task Display Forms are:

• Designed to display and optionally modify task information, in the Worklist application, supplied as parameters to a Human Task in a composite application

• Generated as Java Server Page XML (.jsp) files by using:– The Human Task activity in a BPEL process component

– The ADF Task Flow Based on Human Task item in the JSF category of the New Gallery window

Task Display Forms

Task Display Forms provides Worklist application users with a way to view and optionally modify task data, and data as parameters to the Human Task component in a composite application. Oracle BPM Worklist application displays all tasks assigned to a user logged in as the task assignee. By default, when a task assignee clicks on an assigned task a Task Display Form is displayed, if it has been created, to show task information. However, if the composite application containing a Human Task component is not deployed with a Task Display Form the task information details are not displayed.

Oracle Application Development Framework (Oracle ADF), which is integrated with OracleJDeveloper, enables you design Task Display Forms that display task information and parameters received from a Human Task in a SOA composite application.

The ADF-based Task Display Forms can be generated from the Human Task activity in a BPEL process or created by using the ADF Task Flow Based on Human Task item in the JSF category in the New Gallery window.

Advanced users can design their own task display forms by using ADF data controls to lay out the content on the page and connect to the workflow service engine at execution time to retrieve task content and act on tasks.

Note: Before creating Task Flow Forms change the Encoding preference to UTF-8 in the JDeveloper Tools > Preferences > Environment settings.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 82: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 28

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

Generating a Task Display Form

1

2

Task parameters obtained from task payload definition

3

Generating a Task Display Form

If the SOA Composite includes a human task, then you need a way for users to interact with the task. The integrated development environment of Oracle SOA Suite includes Oracle Application Development Framework (Oracle ADF) that enables you to design a task display form that depicts the human task in the SOA Composite. A Task Form is a Java Server Page XML (.jspx) file that defines how a task payload (from task parameters) is displayed in the Worklist application. When you create an ADF task flow based on a human task, you must select a task metadata file to generate the data control. This data control is used to lay out the content on the page and connect to the workflow service engine at execution time to retrieve task content and act on tasks. A Task Form can be auto-generated for a quick, simple interface containing task parameters, or you can generate a Custom Task Form. The example shows the steps to auto-generate a simple task form:

1. Right-click the Human Task activity, and select Auto Generate Task Form.2. On the Create Project window, enter a new project name, such as ApprovalTaskForm,

for the ADF Task Form application files, and click OK.Note: The Directory field is automatically populated and can be changed by entering or browsing for a directory name.

3. Optionally, modify the Task Form, save any changes, and close the JSP tabbed page.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 83: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 29

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

Deploying Task Display Forms

Deploy a composite application and its Task Display Form files separately in the following order:

1. Deploy the composite application by right-clicking thecomposite project name and selecting the Deploy option.

2. Deploy the Task Display Forms by right-clicking theApplication menu, and select Deploy option.

Note: This deploys the Task Display Forms files using the deployment profile from the Deployment section of the Application Properties.

Deploying Task Display Forms

As stated in the slide, before you deploy the Task Display Form files the composite application that depends on them should be deployed first by right-clicking the composite project name and selecting the Deploy option.

After deploying the composite application, you can deploy the Task Display Forms by right-clicking the Application menu, and select Deploy option. When you create the Generic Project and add the ADF Task Form Based on Human Task files a deployment profile is created for the project and for the application workspace in which the project resides. Using the Application Menu Deploy option deploys the EAR file identified by the project’s deployment profile in the Application Properties, instead of the Project Properties.

Note: The Oracle SOA Suite 11g Server will automatically associated the Task Display Form URI with the Human Task for which it was generated.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 84: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 30

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

Working with Notification Services

User Messaging

Service (UMS)

Notification Services

Web Servicesinterface

Javainterface

Emailserver

SMTPIMAP/POP3

IMserver

SMSserver

Voicegateway

Working with Notification Services

The notification service enables an asynchronous message to be sent to a user by a specific channel. The message can be sent as an email message, a voice message, or an SMS message. Actionable notification enables a user to respond.

Oracle SOA Suite 11g is configured with the Oracle User Messaging Service (UMS) application that enables composite application components, such as a BPEL Process and Human Task, Web Service clients, and Java applications to send notifications through email, voice, IM, or SMS channels messaging.

Message channels are configured with drivers that handle the sending and receiving of messages to and from devices associated with that type of channel through an appropriate server or channel service provider.

Note: Oracle User Messaging Service (UMS) is preconfigured with an email driver that supports sending email notification by using the Simple Mail Transfer Protocol (SMTP) protocol, and receiving email from Internet Message Access Protocol (IMAP)–based and Post Office Protocol (POP)–based email accounts.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 85: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 31

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

Oracle User Messaging Service (UMS)

Oracle User Messaging Service:

• Enables sending notification through email, voice, IM, or SMS channels

• Supports two-way messaging (sending and receiving messages)

• Provides User Messaging Preferences enabling users to configure how and when to receive notifications

• Integrates with Fusion Middleware components through:– BPEL notification activities, like Email, IM, Voice

– Human Workflow notifications that also provide actionable messages

– Oracle BAM alerts for monitored events

Oracle User Messaging Service (UMS)

Oracle User Messaging Service (UMS) enables two-way communication between users and composite applications. The Oracle User Messaging Service exposes operations that can be invoked from the BPEL business process or human task to send notifications through email, voice, IM, or SMS channels. Oracle UMS is integrated with Human Workflow enabling notification messages to be delivered for different events and enabling actionable email messages to be implemented.

The Oracle User Messaging Service supports:• Sending and receiving messages and statuses• Sending notifications to a specific address on a particular channel• Sending notifications to a set of failover addresses

Out of the box, the email channel is enabled. To configure additional UMS driver channels you need to deploy the driver JEE application EAR file, and ensure you have access to service provider for the type of channel driver deployed.

Oracle UMS tracks delivery status information provided by messaging gateways, so that applications can respond to a failed delivery. Applications can specify one or more failover addresses for a message in case of delivery failure to an initial address. This capability frees application developers from having to implement complicated retry logic.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 86: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 32

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

WebLogic SOA Server Instance

Oracle UMS Components and Architecture

Oracle User Messaging Service (UMS) components are:

• UMS Server

• UMS Drivers

• UMS client applications

JMS

User Messaging

Service

Email Driver Email gateway

XMPP DriverIM

gateway

SOA or EJB client

Message repository

WebCenter or

Parlay X Web

service client JMS

RMI

SOAP/HTTP

Oracle UMS Components and Architecture

The components of UMS are deployed as Java EE applications. Therefore they can be managed independently of each other. For example, a particular driver can be stopped and reconfigured without affecting message delivery on other channels.

Exchanges between UMS client applications and the UMS Server can be done with:• SOAP/HTTP requests for Web Service clients, such as WebCenter and Parlay X Web

Service client• Remote Method Invocation (RMI) for EJB calls for Java clients• Java Message Service (JMS) calls for JMS and BPEL clients

Exchanges between the UMS Server and UMS Drivers occur through JMS queues. Oracle UMS Server and UMS Drivers are installed alongside SOA and BAM environments, in their respective managed WebLogic Server instances.

Note: Oracle WebCenter installations include the necessary libraries to enable WebCenterapplications to behave as a UMS client application, invoking a UMS Server deployed in a SOA instance. Parlay X Web Services are Multimedia messaging APIs for:

• Fixed and mobile telephone networks• Sending and receiving messages through Oracle User Messaging Service

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 87: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 33

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

Configuring Workflow Notification Properties

12

3

Changes require a SOA server restart.

4

Configuring Workflow Notification Properties

The Workflow Notification services are communicated through Oracle User Messaging Service components. To configure the Workflow Notification Properties, you use the Enterprise Manager Fusion Middleware Control, and access the SOA Infrastructure page menu by performing the following steps:

1. On the Farm navigation tree, expand the SOA folder and click soa-infra.2. On the soa-infra page, click SOA Infrastructure, and select SOA Administration >

Workflow Notification Properties.3. On the Workflow Notification Properties page, set the Notification Mode to All (or Email)

and set other Email properties as appropriate to your Email server configuration, and click Apply.

4. On the Confirmation window, click Yes.

Note: After making changes to the Workflow Notification Properties, you must restart theWebLogic Managed Server (SOA Server) instance. However, do not restart the WebLogicAdministration Server.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 88: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 34

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

Configuring the User Messaging Email Driver

Changes require a SOA server restart.

1

2

3

4

Configuring the User Messaging Email Driver

In addition to configuring the Workflow Notification Properties you also need to configure the User Messaging Email Driver settings to ensure that the Email server and protocol settings are correctly specified. To access and configure the User Messaging Email Driver settings:

1. Either from the Workflow Notification Properties page, click the “Go to the Messaging Driver page” link, or On the Enterprise Manager Control page, in the Farm navigation tree. expand the User Messaging Service folder, and click usermessagingserver (soa_server1)

2. On the User Messaging Service page, click the Configure Driver icon in the User Messaging Email Driver row entry.

3. On the User Messaging Email Driver page, enter the Email Driver Properties and Driver Specific Configuration settings, that include mail protocols, such as Post Office Protocol (POP3), the outgoing Simple Mail Transport Protocol (SMTP) server name, and the incoming server name, among many other settings, and click Apply.

4. After confirming the changes to be made, you are required to restart the WebLogicManaged Server (SOA Server) instance.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 89: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 35

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

Viewing and Testing Email Notifications

1 2

3

4

Response from BPEL Email send operation

Viewing and Testing Email Notifications

It is possible to monitor and view the notification activity performed by the Human Workflow Service engine. To view and test Human Workflow Notification activity:

1. On the Enterprise Manager Fusion Middleware Control page, in the Farm navigation tree expand the SOA folder and click soa-infra.

2. On the soa-infra page, scroll down and expand the Service Engines section, and click the Human Workflow Engine link.

3. On the Human Workflow Engine page, you can examine any notification messages, in the Outgoing Notifications and Incoming Notifications sections. If you click Send Test Notification, the Send Test Notification window is displayed.

4. On the Send Test Notification window, you can select the notification channel type to test (provided it has been configured) and send a message. In the example, the Email channel is selected for the test.

Note: The test message mechanism uses BPEL notification activities to send test messages. The messages sent appear in the list under the Outgoing Notifications section. The example message in the Outgoing Notifications section is actually from the Human Task of a composite application identified by the WORKFLOW value in the Source column.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 90: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 36

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

Sending Email Notification from BPEL

BPEL Process

User Messaging

Email Driver

Emailserver

SMTPIMAP/POP

Email notification

Email activity is implemented as a Scope.

Sending Email Notification from BPEL

The BPEL Process component provides different ways to notify users, through Email, IM, SMS, and Voice activities. The example in the slide implements email notification by:

• Dragging an Email service icon into the BPEL Process and configuring the details for sending the email

• Configuring the email settings provided by the email activity

The email activity parameters may be static strings or dynamically derived from data held in BPEL Process variables. Each field, except From Account, enables you to build an XPathexpression to construct its value by clicking the XPath Expression Builder icon on its right.

Configuring the incoming and outgoing mail server information is performed in the User Messaging Service Email Driver page in the Enterprise Manager Fusion Middleware Control.

Note: An email notification may contain multipart attachments along with the message.

The course environment user XMail Server software for email server and supports SMTP and POP protocols. By default, the SMTP port number is 25, and the POP services are on port number 110. For more information about the XMail email server software, visit http://www.xmailserver.org.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 91: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 37

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

Sending Notification to Users Preferred Channel

The User Notification activity:

• Sends a message to a userpreferred channel

• Enables additional propertiesto be sent with themessage

Sending Notification to Users Preferred Channel

The User Notification activity enables a BPEL Process design in which a notification channel is not explicitly specified during design time, and simply indicates that a notification must be sent. The notification channel used is resolved at run-time based on user preferences defined in the Notifications tab of the Worklist application, or in the User Messaging Preferences user interface of the Oracle User Messaging Service. Therefore, the responsibility of notification channel selection is moved from Oracle BPEL Designer to the end user. If the end user has not selected a preferred channel or rule, email is used by default.

Note: To access the User Messaging Preference user interface as a standalone application enter the following URL: http://localhost:8001/sdpmessaging/userprefs-ui, remembering to replace localhost and the port with values suitable for Oracle SOA Suite installation.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 92: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 38

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

Quiz

Identify which of the following provides support for notification:

a. User Notification activity

b. OnMessage branch in a Scope or Pick activity

c. Mediator routing rules

d. Human Task component

e. Email activity

Answer: a, d, e

By using the Notification activity in a BPEL process the user’s preferred form of notification is used. The preferred notification channel is configured by the user in the Worklist application Preferences Notification tabbed page (refer to the page titled “Configuring Workflow Notification Channels” for more information).

The Email activity specifically uses Email to notify someone. The Human Task, as configured in the .task file, provides notification through the Worklist application user’s preferred notification channel or email by default.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 93: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 39

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

Summary

In this lesson, you should have learned how to:

• Describe Human Task concepts

• Explain the Human Task component

• Design a Human Task

• Invoke a Human Task from a BPEL Process

• Generate ADF Task Forms for Human Tasks

• Interact with the Worklist application to act on tasks

• Add email notification to a BPEL Process

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 94: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 40

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

Practice 12 Overview: Implementing Human Workflow and Notification

ApproveCCOrder

Validate CC

Notify Customer

Scope_validatecc

<case> VALID

Switch_ccvalid

Switch_checkapproval

<case> Approval Required <otherwise>

taskSwitch

Manual Approval

Assign

approved

Assign_rejected

Outcome=APPROVE Outcome=REJECT

Scope_notifycust

Email_customer

BindEntity_customercustomerEV

Fulfillment

Scope_fulfillment

Assign_approved

status=APPROVE

Order approved

Practice 12 Overview: Implementing Human Workflow and Notification

This practice covers the following topics:• Creating a Human Task to manually approve orders whose told exceeds a specified amount• Implementing email notification for customers to inform them of their order status

The slide illustrates the changes made to the ApproveCCOrder BPEL Process, which include:• Modifying the <case> VALID branch in Scope_validatecc, to check if manual approval

is required. If approval is required based on the order total, then the <case> Approval Required branch executes the Human Task labeled “Manual Approval” followed by a task switch to determine the outcome of the approval process and copy the result (approved or rejected) to the order status, other the order is considered automatically approved.

• Adding a Switch to check if the order status is approved to ensure that fulfillment is processed for approved orders

• Implementing a new scope called Scope_notifycust that contains an Entity Variable for the customer data and the Bind Entity activity to retrieve the customer data with the email address. Finally, the Email activity is used with the email address contained in the Entity Variable to notify the customer of their order status.

Note: The Entity Variable requires a Partner Link for the CustomerService. The Partner Link is created by wiring the CustomerService to the ApproveCCOrder BPEL Process in the composite assembly model, which is not shown in the slide.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 95: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 12 - 41

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

Practice 12 Overview: Changes to the POProcessing Composite

POProcessing Composite (assembly model)

CustomerService

Entry point

EnrichPO

Fulfillment BPEL

Manual Approval

(Human Task)RoutePO

ApproveCCOrder

BPEL

Practice 12 Overview: Changes to the POProcessing Composite

The slide summarize the changes made to the POProcessing composite application assembly model, as a result of the inclusion of the Human Task component and the implementation of the email notification. The diagram shows the Manual Approval Human Task component and theCustomerService external reference wired to the ApproveCCOrder BPEL process.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 96: D53946GC20_sg2

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 97: D53946GC20_sg2

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

Developing Business Rules

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 98: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 2

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

Objectives

After completing this lesson, you should be able to:

• Explain business rules concepts

• Describe the Oracle Business Rules architecture

• Describe the Oracle Rules Engine

• Explain the role of the Rule Dictionary

• Create rules with the JDeveloper Rules Designer

• Integrate a simple rule with a BPEL process

• Describe the role of the Rules SDK

Objectives

Your initial implementation of the order processing application hard-codes some rules that enable the application to select a target shipping company based on a mapping between the shipping option (two day, five day, or otherwise) and the shipping company. You realize this can become a maintenance problem if the business changes the rules that govern which orders are to be sent to the appropriate shipping companies. In addition, if the business chooses a different shipping company you have to modify the application implementation logic.

Using your keen design and development skills you convince the business uses that they can use Business Rule components to separate the decisions about which shipping choice is mapped to a target shipping company and make your application more immune to changing business requirements.

You goal is to learn how to use Business Rules definitions in the form of IF-THEN constructions for deciding when to require manual order approval, and a Decision Table construct to define the mapping of a shipping choice (made in an order) to a selected shipping company.

The implementation of Business Rules provides a way for the business to more agile to changes, while minimizing impact on requiring changes to your application implementation to meet those changing requirements.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 99: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 3

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

Introducing Business Rules

Business rules are:

• Declarative statements that describe business policies or describe key business decisions, such as:– Business policies such as spending policies and approval

matrices

– Constraints such as valid configurations or regulatory requirements

– Computations such as discounts or premiums

– Reasoning capabilities such as offers based on customer value

• Separated from code to enable their definition and modification to be made by non-technical users

Introducing Business Rules

Code is not easy for non-technical users to read and is often difficult to understand and modify. Companies frequently change their policies, which in many production environments results in the developer modifying affected applications, recompiling and redeploying the application. Depending on company policy there are more rigorous processes involved before changes can be rolled out into production systems.

Using Oracle Business Rules, the process of modifying business rules and policies can be simplified, because separating business rules from the application enables the business users to easily change business rules without the software development life cycle implications.

Oracle Business Rules allows a business analyst to change policies that are expressed as business rules, with little or no assistance from a programmer.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 100: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 4

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

Declarative Rule Concepts

Rule statements are easier to maintain than procedural code because they:

• Declare intent instead of coding logic

• Exclude control flow that is determined by the rules engine

• Relate well to business user drivers

If a customer is a Premium customer, offer them 10% discount.

If a customer is a Gold customer, offer them 5% discount.

Declarative Rule Concepts

The declarative nature of rules makes them easier to maintain because rules:• Declare intent of business drivers• Exclude flow control that is typical of procedural logic

The examples in the slide are declarative statements expressed as conditions that drive business policies with the intent of providing discounts to loyal customers based on the customer status.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 101: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 5

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

Rule Inference Concepts

Rule inference:

• Makes a statement of truth based on a former truth

• Enables powerful and modular declarative assertions

Example of inference: A results in B, and B infers C

Customer Spends $1,500

Premium Customer

Offer 10% discount

A BIf a customer spends > $1,000make them a Premium

customer

B CIf a customer is a Premium customer

offer them a 10% discount.

D EIf a customer is a Gold customer

offer them a 5% discount.

Rule Inference Concepts

The Merriam-Webster Online Dictionary provides one meaning for the term inference as “the act of passing from one proposition, statement, or judgment considered as true to another whose truth is believed to follow from that of the former.” Another Merriam-Webster Online Dictionary definition states inference as “the act or process of inferring.” Inferring means to derive a conclusion from facts. To make an inference means that one set of true conditions can imply “something else,” and then that “something else” can be used to further satisfy other conditions, which in turn imply other things.

Inferences in a Rules Engine means that these “chained” implications are done automatically as part of the normal operation of the engine.

The example illustrates that when a customer spends $1,500 (more than $1,000) it identifies them as a Premium customer, which implies that the customer receives the 10% discount. By inference, all Premium customers spend more than $1,000.Therefore, by using inference principles you decouple the rule that determines if a customer spends more than $1,000, from the rule that determines if the customer is offered a discount, resulting in modular declarative assertions.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 102: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 6

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

Guidelines for Selecting Rules Use Cases

Consider implementing rules for the following cases:

• Volatility: Rules that are likely to change frequently

• Impact: Rules that impact the business the most

• Ownership: Rules owned by particular business parties

• Compliance: Rules that express regulatory requirements

Guidelines for Selecting Rules Use Cases

The slide lists some of the common use cases for selecting a rules-based approach.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 103: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 7

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

Basic Oracle Business Rule Concepts

• Facts:– Are data or business objects on which the Rules Engine

evaluates rule conditions

• Rules:– Are declared as: “IF condition THEN action”– Have an action: Assign, Assert, Call function (or Java

method)

• Ruleset:– Has a collection of rules– Is a unit of execution– May be chained

• Dictionary:– Has a collection of fact types, global variables/constants,

functions, and rulesets

Basic Oracle Business Rule Concepts

Oracle Business Rules are stored in a rule dictionary, which is a file in the file system. A rule dictionary contains one or more definitions of:

• Facts• Constraints• Functions• Rulesets

A ruleset is a collection of one or more related rules that are seen as a unit of execution and can be chained together to yield an outcome.

Each rule is declared as a conditional expression with an action. The condition evaluates and compares facts. If the evaluation of facts is true, then one of the following actions is performed:

• Assigning values to other facts or results• Asserting values• Calling functions (or Java methods) to execute procedural code

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 104: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 8

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

Oracle Business Rule Components

Oracle Business Rules:

• Enables evaluation of dynamic decisions at run time

• Allows automation of policies, computations, and reasoning separate from application code

• Executes a Rete algorithm with the following components:– A Rule-base

– Working memory

– Inference engine

Rule-base

RulesRules

IF condition THEN actionDecision

tables

Working Memory

Inference engine

Facts

Pattern match rule to facts

Yes!

Execute Rules

Rules Engine

Oracle Business Rule Components

Oracle Business Rules enable dynamic decisions to be evaluated at run-time enabling automation of policies, computations, and reasoning that can be separated from underlying application code. Oracle Business Rules is a rule-based system based on the foundations of the Rete algorithm. The Rete algorithm was first developed by artificial intelligence researchers in the late 1970’s and is used by Oracle Business Rules to optimize the pattern matching process for rules and facts added to working memory. The Rete algorithm stores partially matched results in a single network of nodes in working memory, enabling the Rules Engine to avoid unnecessary rechecking when facts are added, modified, or deleted. To process facts and rules, the Rete algorithm creates and uses an input node for each fact definition and an output node for each rule. A rule-based system consists of the following:

• The Rule-base: business policies expressed as IF-THEN rules and Decision Tables.• Working memory: fact information added to the system by applications using assert calls.• Inference Engine (Rules Engine): processes the rules, performs pattern-matching to

determine which rules match the facts, for a given run through a set of facts.

Oracle Business Rules is a data-driven forward chaining system, such that the facts determine which rules are evaluated. When a matching rule fires, the rule may add more facts. New facts are again compared against the rules. The process repeats until a conclusion is reached or the cycle is stopped or reset. This process is called an inference cycle.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 105: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 9

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

Rule Session

Firing of Rules in a Rule Session

Client

Working Memory

Execute

Assert

Run

XML data

Java objects

Agenda

Activation

Activation

Activation

Fact

Fact

Fact

Rulesets (RL)

Rule Firing Action

Matching

Firing of Rules in a Rule SessionOracle Business Rules uses working memory to maintain fact data, asserted by client applications. A Rule Session is created for client applications and contains working memory for that session. Working memory holds rules, facts, and an agenda which includes one or more activations. When a client asserts (adds) or retracts (removes) fact instances in working memory, that is when facts are changed or rules are explicitly executed.Pattern matching of rules and facts is performed, such that:

• Matching rules added to the agenda are called Activations.• Non-matching rules are removed from agenda.

Rules are fired for activations, causing the rules to run and execute associated actions, when conditions for rules evaluate with a true result.Execution of actions may assert, modify, or retract facts and cause new activations to be added or removed from the agenda. A loop condition is possible if a rule’s action causes it to fire again. Rules are fired sequentially, but not in any predefined order. A Rule Session contains a ruleset stack, such that activated rules are fired as follows:

• Rules within top-of-the-stack ruleset are fired.• Within a ruleset, firing is ordered by user-defined priority.• Within the same priority, the most recently activated rule is fired first.

Only rules within the ruleset stack are fired. However, all rules in a session are pattern-matched, and if matched they are activated.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 106: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 10

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

Overview of the Business Rules Component

A Business Rules service component, also called a Decision component, can be used in an SOA composite application:

• Wired and executed by a BPEL process component

• Exposed as a service directly to run business rules

• Executed to implement dynamic routing with a Mediator component

• Implemented as advanced routing rules in Human Task definitions

Overview of the Business Rules Component

An SOA composite application can be created that includes a BPEL Process, a Business Rule, and a Human Task component as complementary technologies where:

• The BPEL Process performs the orchestration of systems, services, and people.• The Business Rule evaluates decision making and policies.• The Human Tasks models a workflow for people to perform as part of an end-to-end

business process flow.

Examples for using business rules can include:• Dynamic processing: Rules can determine intelligent routing paths within a business

process based on service level agreements or other guidelines.• Externalize business rules in the process: Rule conditions evaluated as part of a business

where parameters can be changed are best implemented separate from the process.• Data validation and constraint checks: Rules can validate input documents or apply

additional constraints on requests.• Human task routing: Rules can be used to perform:

- Policy-based task assignments dispatch tasks to specific roles or users.- Load balancing of tasks among users to control the task assignment load.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 107: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 11

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

Developing Business Rules for an Application

Rule Dictionary

XML Schema

Facts

Java classJDeveloper

Rules DesignerGlobals

Create or import

2

Data model

Ruleset

Rule

4

Rule5

Define business policies

Bucketsets

.rules

1

XML Facts are mapped to Java with JAXB

Java Facts

XML Facts

3

3

IF condition1 THEN action

IF condition2 THEN action

RL Facts

ADF-BC Facts

Developing Business Rules for an Application

When developing Oracle Business Rules you use the JDeveloper Rules Designer to create a set of rules that can be evaluated by an application at run-time. Creating a Rule Dictionary requires:

1. Creating or importing a dictionary into a project using the JDeveloper Rules Designer. 2. Populating the Rule Dictionary with the set facts, functions, globals, bucketsets, links,

decision functions, and rulesets. A data model contains business data definitions for facts or data objects used in rules. The Rule Dictionary is an XML file that stores the data model for an application in a .rules file.Note: Globals are variable or constant data that are visible to all rulesets in the dictionary. Bucketsets can be used as a list of values, to represent a value range, or as an enumeration.

3. Creating one or more facts, which represent data or objects added and maintained in working memory of a Rule Session. Facts can represent a sales order or a customer credit history. Facts can be created as XML Facts (derived from XML Schema elements), Java Facts (based on a Java class), Rule Language (RL functions) facts, or ADF Business Component Facts (based on View Object definitions).Note: At run-time, mapping between the XML Schema definition and the XML Fact typesuses the Java Architecture for XML Binding (JAXB).

4. Creating rulesets as a container for a set of one or more rules or decision tables.5. Defining rules to express the business policies based on the facts in the data model.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 108: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 12

Developing Business Rules for an Application

Oracle Business Rules is installed with Oracle SOA Suite and includes:• A Rules Designer is a general-purpose application, layered upon the Rules SDK.

- Used by business users to create and edit rules in Oracle JDeveloper 11g- Implemented as a business dialect rather than a developer language

• A Rules Engine is an efficient implementation of the industry-standard Rete pattern-matching algorithm for implementing rule-based “expert” systems. Functionality includes:

- Loading rules and asserting or retracting facts into working memory - Performing inferences and interfaces to expose working memory status- Executing as a Java-callable library or a stand-alone service. In each case, it

consumes a modest amount of resources (working overhead is less than 2 MB).- Relying on a Rule dictionary

• Rule Dictionary provides persistent storage for rulesets, other metadata (such as the data model), and rules. The dictionary is a file in the local file system with a .rulesextension.

• Rules SDK enables the development of Java GUI or Web applications through which business users create, edit, and view rules. Rules SDK provides:

- A dictionary API, which allows the developer to define business objects and edit templates to be made available to the business user

- A general API, which is used for editing, validating, or debugging business rules, and for generating correct run-time structures

- A run-time API, which is used for loading, executing, monitoring, and auditing business rules

Note: Rules SDK generates Rule Language for use by the Rules Engine. JSR 94 is a standard API that defines how to access a Rules Engine from a Java SE or Java EE client, and it provides API specifications to:

- Register and remove rules- Parse rules- Inspect rule metadata- Execute rules, and retrieve and filter results

JSR 94 does not standardize the Rules Engine implementation, including the rule execution, the language used for rule, and the deployment mechanisms used. For more information about the JSR 94 API architecture, refer to http://java.sun.com/developer/technicalArticles/J2SE/JavaRule.html.

• Oracle Rule Language (RL), directly executed by the Rules Engine, is interpreted rather than compiled to enable rules to be changed without rebuilding, redeploying, or even restarting applications. RL has a Java-like syntax and type-checking and can assert any Java object as a fact. A rule can reference any object property and invoke any method in its condition and actions. Developers can use RL as a full-featured rules programming language, or business analysts can use Rules Designer and generate RL from the rule dictionary. The Rules Engine has a command-line interface for interactive RL development and debugging.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 109: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 13

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

Facts, Bucketsets, Globals, RL Functions

• Rules Facts, which must be created before the rule, are:– Defined in the Rule Dictionary as a:

— XML Fact based on an XML Schema element— Java Fact based on a Java class— RL Fact based on a Rule Language function— ADF-BC Fact based on a ADF-BC View Object

– Asserted (added to Rule Session working memory) as data objects at run time

• Bucketsets are constraints defined in the Rule Dictionary as lists of values, list of range values, or enumerations

• Globals are shared constants or variables defined in the Rule Dictionary that are accessible to all rules

• RL Functions are used in rules and defined in the Rule Dictionary using the Oracle Business Rule Language

Facts, Bucketsets, Globals, RL Functions

Rules facts are data objects that have been asserted and added to the Rule Session working memory. Each data object instance corresponds to a single fact. If an object is re-asserted (whether it has been changed or not), the Rules Engine is updated to reflect the object’s new state. Re-asserting the object does not create a fact. To create multiple copies of a fact type, you must assert separate object instances. Rules fact definitions make up part of a data model, and must be defined before you can create rules.

Bucketsets define a list of values, a range of values, or an enumeration of values for a specified type. A bucketset can be associated with a fact property of matching type, causing Oracle Business Rules to use bucketset as a constraints for values asserted for the fact in rules or in Decision Tables.

Globals, which are similar to a public static variable in the Java language, specify that a definition for a value that is either a constant or variable (modifiable). Global definitions are used to share information among several rules and functions.

RL Functions, while similar to a Java method, are Oracle Business Rules functions that do not belong to a class. However, RL Functions can extend a Java application object model enabling operations to be executed in rules without modifying the original Java application code. Rules functions can be used in a rule condition or in an rule action associated with a rule or a Decision Table.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 110: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 14

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

Decision Service Architecture

A Decision Component is:

• A mechanism for publishing rules and rulesets as a reusable service

• Is an SCA component within a composite and wired to a BPEL component for rule execution, used in a Mediator component for dynamic routing, and used for Advanced Routing Rules in Human Task components

Rules Engine

Composite application

Stateless Rule Session pool

Stateful Rule Session Cache

Decision Service 2

Decision Service 1

Decision Component Metadata

Deployment artifacts (JAXB

classes)

Decision Service Architecture

A Decision Component, in Oracle Business Rules, is a mechanism for publishing rules and rulesets as a reusable service that can be invoked from multiple business processes. A Decision service consists only of the service description. All other artifacts are shared within a decision component, as shown in the image. A Decision Component is an SCA component that can be used within a composite application that can be:

• Wired to a BPEL component for executing rules as part of a process flow• Used for the dynamic routing capability of a Mediator component• Configured in Advanced Routing Rules of a Human Task components for manage human

workflow.

Decision Component consists of:• Rules or Decision Tables, defined in a Rules Dictionary, that are evaluated using the Rules

Engine.• Metadata that describes facts required for specific rules to be evaluated. Each ruleset that

contains rules or Decision Tables is exposed as a service with facts that are input and output. These facts must be exposed through XSD definitions.

• A Web Service wraps the input facts, output facts, and the call to the underlying rule engine. The Web Service provides operations to assert and retract facts in separate or one invocation session. Therefore, the Web Service supports stateless and stateful interactions.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 111: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 15

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

Working with Decision Service

A Decision Service:

• Is a Web Service interface for executing exposed decision functions for underlying Oracle Business Rules

• Is invoked from multiple business processes, such as a Java and composite applications

Rules EngineBusiness application

Display logic

Policy and rules

Business process

Rule Dictionary

Decision Web Service Maps to a

Decision Function

.decs

Decision Service metadata file

Working with Decision Service

A Decision Service is a mechanism for publishing executable decision functions, such as rules in a ruleset, as a reusable service that can be invoked from multiple business processes. Decision Service metadata (in a .decs file added to the composite application) defines the decision function name exposed through a Web Service interface.

The goal is to separate volatile policy logic from other business logic. The policies are implemented in rules executed on a Rules Engine, and other business logic is implemented in Java executing in Java Virtual Machines (JVMs).

A Decision Service is configured declaratively and performs the following operations:• Collects rulesets and other decision functions under a single executable umbrella• Handles the assertion of inputs as rule facts into the Oracle Business Rules Engine working

memory• Collects the consequent actions to be executed• Runs rulesets• Returns results

In a Decision Service the rules executed are organized into several rulesets, which can be executed in a prescribed order. For example, the business application can send facts that flow to the first ruleset, which in turn may assert additional facts that are used by a second and subsequent rulesets until finally result facts flow back to the caller of the Decision Service as output facts.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 112: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 16

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

Creating a Business Rule Component in a Composite Application

1

2

3

4

5

Defines initial XML Facts

Define Decision Service name in Advanced tab

Creating a Business Rule Component in a Composite Application

A Business Rule component can be created in the Composite Editor or in a BPEL Process. To create a Business Rules component in a composite application use the following steps:

1. On the Composite Editor, drag a Business Rule component into the Components column2. On the Create Business Rules window, you can either select to create or import the

dictionary. The example depicts selecting the Create Dictionary option.3. On the Create Business Rules window, after specifying the name and package values for

the Business Rules component you click the Create > Input, or Create > Output to define the initial XML Fact structures, which are added to the Business Rules Dictionary, and define the default Decision Service input and output message structures.Note: The Java package name is used for generating the JAXB classes for XML Facts.

4. On the Type Chooser window, select an XML Schema element to define either the Input or Output fact structures.

5. Back on the Create Business Rules window, click OK to create the component.Note: You can select the “Expose as Composite Service” option to enable clients to directly invoke the Business Rules component services.

When you create a Business Rules component in the Composite Editor it creates a standalone Business Rule in the composite application, and the Rules Dictionary. The Rule Dictionary is created with a default Decision Function for the Decision Service. However the Rule Dictionary is not opened in the Rules Designer. The Decision Service name is defined in the Advanced tab.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 113: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 17

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

Creating a Business Rule in a BPEL Process

To integrate Oracle Business Rules with BPEL, drag a Business Rules component into the BPEL Process flow.

1

2

Creating a Business Rule in a BPEL Process

Creating a Business Rule in a BPEL Process provides you with the option to create a new Business Rules component in the composite application, or select a Business Rules component that already exists in the composite application. In addition, creating a Business Rule in the context of BPEL process enables you to create the Rule Dictionary and specify the Rulesets that are invoked.

To create a Business Rule in your BPEL process:1. On the BPEL Designer window, drag a Business Rules component into your BPEL flow.

This opens the Business Rule activity window.2. On the Business Rule activity window, specify the business rule (Scope) activity name,

and either:- Click the Create (green plus) icon, to create a new Rule Dictionary, or- Select an existing Rule Dictionary from the pull-down menu.

Note: The next page titled “Configuring a Business Rule in BPEL” discusses the remaining options in the Business Rule window. When you complete the details in the Business Rule activity window the Rule Dictionary is opened in the Rule Editor ready for you to create the dictionary components.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 114: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 18

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

Configuring a Business Rule in BPEL

To configure the Business Rule:

• Specify the activity name

• Create or select a dictionary

• Select the operation

• Assign the input facts

• Assign output facts

Select existing dictionary

Creating or Editing a

dictionary opens the Rules Designer

Select the operation

Add input and output fact structures from

an XSD

Scope activity and Rule Dictionary

name

Configuring a Business Rule in BPEL

The slide shows the remaining settings that need to be configured in the Business Rule activity window. After creating or selecting a Rule Dictionary, the Service field is populated with the default Decision Service created in the Rule Dictionary. At this time the Rule Dictionary does not yet have rule definitions to be executed. The Operation field is selected as:

• The “Execute function and reset the session” value to execute the function in a stateless session, or to execute the function and end a stateful session

• The “Execute function” value to execute the function and keep a stateful session. This is useful if you assert facts that you may require in subsequent invocations.

Additional configuration items include:• Assign Input Facts tab enables you to assign the actual fact values from a BPEL variable to

be sent to the Business Rule Decision Service for the executing the rule function• Assign Output Facts tab enables you to assign the return fact values to a BPEL variable

that store the results from executing the rule function

Note: The Name defines part of the Decision Service name as well as the Rule Dictionary name.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 115: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 19

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

Configuring Business Rule Input Facts

1

2

Configuring Business Rule Input Facts

After the Rule Dictionary, Service, and Operation are chosen, the data for Input and Output Facts need to be supplied. The slide shows the steps for populating the Input Fact:

1. In the Assign Input Facts tab, click the Create (green plus) icon to open the Decision Fact Map window, which is like a Create Copy Operation window for an Assign activity.

2. On the Decision Fact Map dialog box, in the From section select the BPEL variable elements as the source of the date for this Input Fact. By default, the To section Type can only be a Business Rule Facts option. Select the target input Rule Fact on the To side to receive the data, and click OK.

Before closing the Business Rules dialog window, you may need to define an Assign Output Fact to obtain the results from executing the business rule function.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 116: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 20

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

Configuring Business Rule Output Facts

1

2

Configuring Business Rule Output Facts

After specifying the Assign Input Facts details, if you are expecting results to be returned from executing a business rule function, click the Assign Output Facts tab to create a copy operation to retrieve the results into a BPEL process variable. To retrieve result facts:

1. In the Assign Output Facts tab, click the Create (green plus) icon to open the Decision Fact Map window.

2. On the Decision Fact Map dialog box, the Type (in the From section ) is Business Rule Facts from which you are require to select the result elements to copy into the target BPEL variable (in the To section). Click OK.

At this point the Business Rules dialog window configuration is complete, and you can click OK to close the Business Rule dialog window.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 117: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 21

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

Examining Business Rule Component Files

• The Decision Service XML Schema• The Decision Service WSDL• The Business Rules dictionary• The Metadata .decs file• The .componentType file

Scope with activities for invoking the

Decision Service

Examining Business Rule Component Files

After creating the Business Rule component in your composite application, or BPEL process, several files are created in the project folder. The files are:

• A Decision Service XML Schema that defines the structures for the input and output facts• A Decision Service WSDL document that defines the basic stateless and stateful Web

service operations that can be invoked• A Business Rules Dictionary (.rules file) for containing the ruleset definitions, rule,

facts, and globals added to the dictionary• The Business Rules metadata (.decs file) defining the mapping of Decision Service

operations to the Decision Functions that can be executed• The Business Rules .componentType file representing the component definition for the

Composite Editor

Note: When you expand the Business Rule activity in the BPEL process, you find it is in fact a Scope that contains:

• A few Assign activities to prepare the input fact data• An invoke activity to execute the business rule functions• A few more Assign activities to receive output facts.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 118: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 22

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

Opening the Business Rules Designer

In the BPEL Design

In the Composite Editor

In the Application navigator

1 2 3

Opening the Business Rules Designer

Depending on how the Business Rule component is create, the Business Rules Designer may automatically open. The slide shows any of the three ways to explicitly open the Rules Designer:

1. On the BPEL Design window, right-click the Business Rule activity and select Open Component Editor

2. On the Composite Editor window, double-click the Business Rules component, or right-click the Business Rules component and select Edit.

3. On the Application Navigator window, double-click the .rules file, or right-click the .rules file and select Open.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 119: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 23

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

Editing the Rule Dictionary

Creating or editing the Rule Dictionary (.rules file) is done in the Rules Designer, in which you can define:

• Rulesets with one or more Rules, Decision Tables, or both

• Create Facts, Functions, Globals, bucketsets, Links, Decision Functions

Editing the Rule Dictionary

A dictionary holds rules that are executed by an application. The Rules Designer saves rules and their associated definitions in the Rule Dictionary (a .rules file) within a project subfolder. The Rule Dictionary is created when you first add the Business Rule component to your composite or BPEL Process flow. By using the Rules Designer you can define:

• Facts, such as Java facts, XML facts, RL facts, and ADF Business Components facts• Rulesets, which are containers for one or more rules executed in sequence• Decision tables, which contains a set of related rules in a table format• Rules, which are IF-THEN constructs that evaluate conditions and execute actions• A constraint, which can be an enumeration, range, or regular expression • Globals (variables and constants), which are named types that can be based on object,

string, or standard primitives, which can be used in rule definitions and actions• Functions, which are parameterized functions based on the Rule Language (RL) syntax• Bucketsets, which provide the ability to define a list of values or range of values to be used

within your business rules• Links, which you used to add, edit, delete, or view dictionary links• Decision functions, which you use to create or edit decision functions

Note: Decision functions provide access to rules through a Decision Service invoked as Web service or from a Java program through the Rules SDK API.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 120: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 24

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

Creating XML Facts

2

3

Click to create an XML Fact

Click to Add a schema

1

Either import a new schema or choose from already

imported schemas

View XML Fact entries added

Reload updated schemas

Creating XML Facts

Facts define the structure of data objects asserted and saved in working memory. Facts can be created from XML Schema elements, Java classes, RL functions, and ADF-BC View Objects. The slide shows how to create an XML Fact. To create an XML Fact:

1. Click the Facts tab, click the XML Facts subtab, and click the Create (+) icon.2. On the Create XML Fact window, either click the Add Source Schema (+) icon to add a

new XML Schema file to the Source Schema list, or select an existing Source Schema entry. In the Target Classes section expand and choose element options, and click OK.Note: If you are importing a new schema, on the Add Source Schema window, you select the XML Schema location, the JAXB Classes Directory, and a Target (Java) Package name for the generated classes.

3. On the XML Facts subtab window, you can view XML Fact entries added to the Rule Dictionary.

Note: After adding XML Fact entries to the dictionary and changes have been made to the XML Schema that defined the elements from which the XML Fact structures are derived, you can update (update the imported XML Schema structures) by performing the following steps:

a. On the Rules Designer window, select the Facts navigation tab.b. On the Facts tab, select the XML Facts subtab.c. On the XML Facts page, click the Reload XML Facts from Updated Schemas icon.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 121: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 25

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

Creating RL Functions

To create a RL function:

1. On the Functions tab, click the Create (+) icon

2. Enter a function name and select a return type

3. Create arguments and the body from predefined actions

2

3

1

Creating RL Functions

Oracle Business Rules functions are similar to a Java method. However, unlike Java methods, Business Rules functions do not belong to a class. Business Rules functions can be used:

• To extend a Java application object model to perform rule operations without modifying the original Java code.

• In a condition or an action associated with a rule or a Decision Table• To share the same expression between several rules• To return results to the application.

When you define an Oracle Business Rules function you includes the following parts:• The Name, which function name• The Return Type, which can be set to void if there is no return value• A Bucketset, which optionally associates allowable values to the function return value• Arguments, which are defined by a name and a type• The Body, which contains predefined actions. Predefined actions provided by the Rules

Designer assures that a function is well formed and can be validated.

Note: A rule function can be used to test others rules from within Rules Designer. The slide shows an example of a simple function called changeUnknownStatus, that converts the status string "unknown" to the value "gold" that is returned as the result.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 122: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 26

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

Creating Globals (Variables and Constants)

1

32

4

Constant option

Creating Globals (Variables and Constants)

Globals are similar to public static variables in the Java language, that is they are single values that are shared across rules in the Rule Dictionary. A global represents a data value or expression that can be evaluated in rule conditions and expressions. For example, if a 10% discount is used in several rules, you can create and use a defaultDiscount global variable, so that changes to the value need only be done in one place while discount is applied to many rules in the dictionary. To add a global, perform the following steps:

1. On the Rule Designer, click the Globals tab and click the Create (+) icon.2. On the Edit Global page, enter a Name, such as defaultDiscount, select a Type (for

example: int), and in Value field click the Expression Builder icon.3. On the Expression Builder window, create an expression or enter a literal value, for

example 10 in the example, and click OK.4. On the Edit Global window, select the Constant option to make it a Constant, and the Final

option to make it a Final value, and click OK to create the Global.

Select the Final option to use the global in a rule test condition. In this case, the global is initialized once at run-time and cannot be altered. A non-Final global is modifiable in assign actions. If the Constant option is selected it does not require double quotes around string literal values, and can be selected from expression value choice lists. Constant expression values must be constant to be valid.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 123: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 27

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

Working with Bucketsets

A Bucketset is used as a constraint that defines a set of acceptable values for a fact or property of a fact. A Bucketset can be defined as:

• A list of values

• A list of value ranges

• An enumeration of values

1

3

2

Working with Bucketsets

A bucketset defines a set or range of values that can be used as a constraint to limit the acceptable set of values for a fact or a property of a fact in Oracle Business Rules. You can define a bucketset as a global construct that allows reuse, or as a local construct that only applies to one condition expression. You can associate fact type properties with bucketsets. There are three forms of bucketsets:

• List of values (LOV): that defines a list of values.• List of Ranges: that defines a list of value ranges, defined by the range endpoints.• Enumeration: that defines a list of fixed types. Enumerated types can be imported from

XML or Java facts.

The example creates a global List of Values bucketset called statusLOV using these steps:1. On the Rule Designer Bucketsets tab, click the Create (+) icon > List of Values to create a

row as shown in step 2.2. On the new bucketset row, select the row and replace the Name and click the Edit icon to

open the Edit Bucketset window.3. On the Edit Bucketset window, click the Create (+) icon to add values and aliases.

There are five buckets in the list values: otherwise, "bronze", "silver", "gold", and "platinum".Note: The otherwise entry is always present, and cannot be deleted. However, as shown in the example the “Allowed in Actions” options is deselected meaning it cannot be referenced.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 124: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 28

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

Creating a List of Ranges Bucketset

21

3

Creating a List of Ranges Bucketset

To create a List of Ranges bucketset, perform the following steps:1. On the Rules Designer, click the Bucketsets tab, and click the Create (+) icon, and select

List of Ranges. This adds a row to the Bucketsets table.2. In the Bucketsets table, double-click icon for the new bucketset to display the Edit

Bucketset window.3. On the Edit Bucketset dialog, enter the bucketset name, select the desired data type for the

range values, and click the “Add Bucket With Lower Endpoint Included” icon repeatedly to add the number of buckets required. In each bucket row added, click the Endpoint cell and set the lower endpoint for each range. Click OK to create the List of Ranges bucketset.

Note: The Rules Designer always adds the negative Infinity (-Infinity) bucket in List of Ranges bucketset definitions.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 125: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 29

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

Creating Links to Other Dictionaries

Links to other dictionaries:

• Provide data model sharing within and between projects

• Create a combined dictionary composed of the main dictionary and the linked dictionaries

MDS connection

Another project

Creating Links to Other Dictionaries

An Oracle Business Rules dictionary may have links to other dictionaries in addition to the built-in dictionary, which includes the standard functions and types that all Oracle Business Rules applications require.

In addition to creating a main dictionary, you may create additional application-specific dictionaries to read and write their properties. The complete data model defined by a main dictionary and its linked dictionaries is called a combined dictionary. This is useful for data model sharing. A fully qualified dictionary name is called a DictionaryFQN, which consists of:

• The dictionary package name• The dictionary name

A dictionary refers to a linked dictionary using its DictionaryFQN and an alias. Oracle Business Rules uses the DictionaryFQN to find a linked dictionary.

The example shows how to create a linked dictionary by selecting the Create > Resource Picker option, and in the SOA Resource Browser either:

• Select a linked dictionary from a deployed composite through an MDS connection, or• Select a linked dictionary from another project in the same application workspace.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 126: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 30

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

Creating a Rule Set

1

2

3

A default ruleset is created

A ruleset is a container for one or more rules and decision tables

Creating a Rule Set

Rulesets provide a way of organizing your rules. Before rules can be created, you need to create a ruleset as a container for the rules. To create the ruleset, perform the following steps:

1. In the Rules Designer, click the green plus (+) icon next to Rulesets.2. In the Create Ruleset dialog box, enter a name for the ruleset (for example, OrderRules)

and, optionally, a value in the Description field. Click OK.3. Back in the Rules Designer, confirm that the new ruleset has been added.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 127: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 31

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

Identifying the Structure of a Rule

Rules are structured in the form of “IF condition(s) THEN action(s)” constructs.

Rule name

Rule test condition

Rule action

Identifying the Structure of a Rule

A rule has a specific structure to be meaningfully evaluated. The parts are listed and shown in the slide. The following is a brief description of each part:

• The name identifies a specific rule in the ruleset.• The rule test defines a condition that is evaluated for the matching pattern to limit rule

evaluation for particular instances of the pattern matched type specified.• The rule action is the functionality executed for the matching pattern and test of the rule.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 128: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 32

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

Creating Business Rules

1

2

3

Left-side <operand>

Right-side <operand>

Click <add property>to view the Properties

window4

Creating Business Rules

Rules define your business policies. For example, manual approval is required for orders with an amount greater than $1,000; otherwise, the order should be automatically approved. Create the manual order approval business rule by performing the following steps:

1. Click the ruleset you want to work with, and then click the Create (+) icon and select Create Rule (as shown in the slide), or Create Decision Table. A new rule is added in the ruleset definition.

2. In the new Rule name, click the existing name to rename the rule, and press Enter.3. On the rule IF section, click the <insert test> template to create a condition, which

expands into a template with <operand> == <operand>. For the left-side <operand> select the fact, accept the double-equals or click the operator to replace it with another comparison operator, and for the right-side <operand> select the comparison value.

4. In the THEN section, click the <insert action> to defined the action executed if the condition is true. In the OrderApprovalRule example, when the Order.price fact matches (equals or exceeds $1000), the Rules Engine executes the assert new action to create a new fact object that indicates manual approval is required. Typically, the fact object created would be the result fact returned to the client application executing the Rule. In the example, you set a fact object property value by clicking the <add property>template. In the Properties window, enter values in each of the object property value columns.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 129: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 33

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

Creating a Rule Test

A rule test evaluates a condition that can be logically connected with other conditions. When true, the action is executed.

12 3

4

Click the and logical operator to change it to an or operation

Creating a Rule Test

Creating a test ensures that a matching pattern is applied in the correct context. To create a rule test, perform the following steps:

1. Click the left operand and choose the desired value from the list provided (for example, Order.price).

2. Click the comparison operator (initially the type is ==) and choose the operator you want to use (for example, >=).

3. Click the right operand and choose the desired value from the list provided, or enter your own value (for example, 1000).

4. If you need to add more rules tests, click the <insert test> link and repeat steps 1–3 for this new test.

Note: When a rule test contains multiple conditions, the and operator is initially added. If you click the and operator, then you can change it to an or operation.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 130: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 34

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

Creating the Rule Action

1 2

3Set property values in the fact object

returned to the client executing the rule

Creating the Rule Action

Actions are associated with test pattern matches. When the IF part of a rule is matched by the Rules Engine, then the THEN part of the rule is used to run the associated actions. To add the action that assigns values to the fact object returned to the client, perform the following steps:

1. Click the <insertAction> link. Select the insert action you want to perform (for example, assert new). Other supported action types include:

- Modify, to change a data value associated with a matched fact- Retract, to remove a fact from a pattern if you want to remove the fact or to change

the state of the fact- Call, to invoke a function to be performed by the action

2. Select <target> to display the option list. For example, select DiscountAndShipping as shown in the slide.

3. Select <add property> to display the Properties dialog box. In the Properties dialog box, in the Value column, select or enter the appropriate values for the properties and press the Enter or Return key to accept the values. Click Close in the Properties dialog box to complete the rule action.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 131: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 35

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

Quiz

A __________ is a collection of one or more rules that are seen as a unit of execution.

a. Fact

b. Ruleset

c. Dictionary

Answer: b

A Ruleset is a collection of rules that is considered as a unit of execution and may be chained together to yield an outcome.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 132: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 36

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

Working with Decision Tables

A decision table:

• Executes a matrix of IF-THEN rules displayed in a single spreadsheet-style view

• Contains a collection of related business rules with condition rows, rules, and actions

Each column is a rule

Conditions

Actions

Working with Decision Tables

A Decision Table enables you to create and use business rules in an easy to understand format that provides an alternative to the IF-THEN rule format. The Decision Table format is intuitive for business analysts who are familiar with spreadsheets. The formal structure of a Decision Table makes it easier to author, understand, and change multiple similar rules.

Oracle Business Rules Decision Tables provide the following features:• Powerful Visualization: Compact and structured presentation. This visualization matches

the way real world business policies are expressed with many tables and organized into simple steps.

• Error Prevention: Avoids incompleteness and inconsistency. Because a Decision Table is well structured, automated tools can check for conflicts, redundancy, and incompleteness to speed development of valid, consistent business rules.

• Modular Knowledge Organization: Group rules into a single table. A spreadsheet metaphor puts groups of rules that work together onto a single viewable pane. For example, if there are six rules that check an applicant's eligibility, it is more convenient to see all the rules than to view the rules as individual but related rules.

• Optimization of Rules and Performance Benefits: Oracle Business Rules Decision Tables provide automated features that can reduce the number of required rules, as compared to the IF-THEN rules (this is called rule coalescing).

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 133: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 37

Working with Decision Tables (continued)• Rule Validation and Verification: Provides capabilities for ensuring the logical consistency

of rules before deployment. Automated tools for checking conflicts, incompleteness, or gaps, help speed development of valid, consistent business rules.

To help understand Decision Table concepts, consider the example on the slide that presents a set of IF-THEN rules that determine if a driver is eligible for a license, and an equivalent Decision Table. If a driver has taken a driver training class then the driver has training certification. The IF-THEN rules defined are:

• if driver.age < 20 and driver.has training then the action is to modify driver.eligible = true

• if driver.age < 20 and driver.has training = false then the action is to modify driver.eligible = false

• if driver.age >= 20 then the action is to modify driver.eligible = true (do not care about training for this case)

The Conditions area in a Decision Table includes one or more condition rows. Each condition row has a condition expression and, for each rule, a condition cell. A condition expression applies to a data model fact (either a Java Fact, an XML Fact, an RL Fact, or an ADF Business Components fact).

One or more Actions may be associated with each rule column in a Decision Table. At runtime, when facts match all the condition cells, then the Rules Engine prepares to run the actions associated with the rule. Therefore, multiple conditions are combined using the logical andoperation and if it yields a true result then all the enabled actions are executed.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 134: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 38

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

Creating Decision Tables and Conditions

1

2

3

4

Creating Decision Tables and Conditions

To create a Decision Table and a condition operand, execute the following steps:1. From Rules Designer select an existing ruleset. Click the Add icon and from the list select

Create Decision Table option. 2. In the Decision Table area, from the list next to the Add icon select Condition. 3. Each condition row requires a bucketset from which to draw the values for each cell.

Select the global bucketset, as shown in the slide.4. In the Conditions area, double-click <edit-condition> to display the navigator to

select or enter an expression. O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 135: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 39

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

Creating Decision Tables Rules

1

3

4

2

Creating Decision Tables Rules

To create the decision table rules perform the following steps:1. In the R1 (first rule) area, double-click the empty row to display the navigator to select or

enter an expression.2. In the Decision Table area, from the list next to the Add icon select Rule to add a new rule 3. In the R2 (second rule) area, double-click the empty row to display the navigator to select

or enter an expression.4. The decision table contains one condition with two rules.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 136: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 40

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

Creating Decision Table Actions

1

2

34

Creating Decision Table Actions

To create an action in a Decision Table, execute the following steps:1. In the Decision Table click the Add icon and from the list select Action > Assert New.2. In the Actions area, double-click "assert new (" entry.3. In the Action Editor dialog box, in the Facts area select discountAndShipping. In the

Properties table select the Parameterized checkbox. This specifies that each rule independently sets the parameter.

4. Specify the parameters for each of the properties. For example, all the orders that cost less than $5000 does not require manual approval, but orders costing more than or equal to $5000 require manual approval.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 137: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 41

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

Business Rules and Decision Functions

A Business Rules Dictionary defines Decision Functions that:

• Specify the Service Name invoked to execute its rules

• Enables other applications to execute rules associated with the Decision Function

• Configures the collection of rulesets and decision functions as a single execution unit

• Stores input data assertions in working memory

• Collects rule actions to be executed

• Executes the matching rulesets

• Returns results to the calling application

Business Rules and Decision Functions

Use a decision function to call rules from a Java application, from a composite, or from a BPEL process. A decision function is a function that is configured declaratively. A decision function performs the following operations:

• Collects rulesets and other decision functions under a single executable umbrella• Handles the assertion of inputs as rule facts into the Oracle Business Rules Engine working

memory• Collects the consequent actions to be executed• Runs rulesets• Returns results

You can create a decision function to simplify the use of Oracle Business Rules from a Java application or from a BPEL process. In a decision function, the rules you use can be organized into several rulesets, and those rulesets can be executed in a prescribed order. Facts may flow to the first ruleset, and this ruleset may assert additional facts that flow to the second and subsequent rulesets until finally facts flow back to the decision function as decision function output.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 138: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 42

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

Creating and Editing Decision Functions

Expose as a Web Service

Moves a Ruleset to the Selected list

Input facts

Result facts

Stateless option

Changes execution sequence

of Selected rulesets

Creating and Editing Decision Functions

On the (Create or) Edit Decision Function window, you specify the name of the Decision Function being invoked, and the Decision (Web) Service name when the “Will Be Invoked As A Webservice” option is selected. Other fields in the Edit Decision Function window are:

• Will be invoked as a Web Service: indicates the Decision Function can be invoked as a Web Service.

• Check Rule Flow: when selected ensures that facts of the appropriate type are either explicit inputs to the decision function or are asserted by rules in the rule flow.

• Stateless: specifies the decision function is stateless. This option is selected by default.• Inputs table: enables you to define input variable names and their data type as supplied to

the Decision Function.- The Tree option when selected uses the assertTree function when input is

asserted, otherwise it uses the assert function.- The List option when selected indicates the input is a collection not a single object.

• Outputs table: enables you to define output (result) variable names and their data type as returned from the Decision Function.

- The Tree option when selected, with multiple Decision Functions called in sequence, implies the input of subsequent decision functions are expecting a tree.

- The List option when selected indicates the result is a collection not a single object• Rulesets and Decision Functions: specifies the rulesets executed by the Decision

Function.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 139: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 43

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

Invoking Rules in a Decision Function

The Business Rule Invoke activity executes rules specified by:

• The Dictionary, which defines the .rules file used, and

• The Service Name, a Decision Function’s Service Name

In BPEL Process

In .rules dictionary

Invoking Rules in a Decision Function

In a BPEL process the Business Rule activity is in fact a Scope that contains other standard BPEL activities, one of which is the Invoke activity that executes the rules defined in the rulesets selected in the Decision Function dictionary definition.

The two components that define which Decision Function is executed are:• The Rule Dictionary in which the Decision Function is defined, where it is associated with

a Decision Service by specifying the Service Name field in the Decision Function definition.

• The Service Name specified in the Decision Function is selected as the Service for the Business Rule added to the BPEL process. This links the Invoke operation to the required Decision Function.

Note: Choose meaningful names and naming conventions for the Service Name and associated Decision Function to help document the purpose of the rulesets executed by the BPEL process.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 140: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 44

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

Testing Business Rules at Design-Time

The Rule Designer can execute a design-time test function that:

• Supports running functions without application deployment• Returns a boolean result, has no arguments, and a body

that creates input facts, calls a decision function, and checks the output facts

Return Type is boolean

No arguments

Test Function

Result window for a false return value

Testing Business Rules at Design-Time

You can use Oracle Business Rules Functions to test rules from within Rules Designer. The Test Function icon is active only for functions that take no parameters and return a boolean value. In the body of the function you create input facts, call a decision function, and check the output to validate the facts the decision function returns are as expected.

Note: The Test Function icon is disabled if the dictionary associated with the test function contains any validation warnings. A test function can only be executed if the dictionary is valid.

The example illustrates a simple testHello function that uses the built-in print statement to display the text "Hello World" in the text window, and returns a true result.

When a test function returns a true result, the “Test Passed!” icon and message is shown in he Function Test Result window. If the function returns a false result, then the Function Test Result widow displays a “Test Failed!” icon and message.

Tip: To enable logging in a test function call the RL.watch.all() function.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 141: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 45

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

Testing Business Rules at Run-Time

To perform a post-deployment (run-time) test of an SOA composite application that uses Oracle Business Rules:

1. Login to the Oracle Enterprise Manager Fusion Middleware Control

2. Locate the WSDL for the SOA composite application containing the Business Rule component

3. Test the Rule-enabled SOA composite application by using the Web Service Test tool

Testing Business Rules at Run-Time

To test an SOA composite application that uses Oracle Business Rules (with a Decision Service) at run-time:

1. Login to Oracle Enterprise Manager Fusion Middleware Control, and enter the username weblogic with the appropriate password.

2. On the Oracle Enterprise Manager home page, navigate to the deployed Rule-enabled SOA composite application page.

3. On the composite home page, click Test to initiate a composite application instance.Note: This is the same test tool used for other composite applications.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 142: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 46

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

Describing the Rules SDK

The Rules Software Development Kit (SDK) is a Java API for:

• Creating and updating a Rule Dictionary and its contents

• Creating custom applications for managing rules

Rule dictionary

Rules SDK

JDeveloper Rules

DesignerCustom Java Application Java API

Create, modify, and maintain rules

Describing the Rules SDK

Oracle JDeveloper Rules Designer uses the Rules SDK to create, modify, and access rules and the data model using well-defined API interfaces. Oracle Business Rules SDK (Rules SDK) is a Java library that:

• Provides business rule management features• Enables developers to write:

- A rule-enabled program that accesses a dictionary- Customized rules programs that add rules or modify existing rules

• Enables customer developed applications to access, display, create, and modify collections of rules and the data model.

The Rule Dictionary with its rules and associated data model can be initially created by a custom application or using JDeveloper Rules Designer (Rules Designer).

Oracle Business Rules SDK provides a Decision Point API, which can be used to access a dictionary and run the rules in the dictionary. For more information about Oracle Business Rules SDK APIs, refer to the Oracle Fusion Middleware Java API Reference for Oracle Business Rules.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 143: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 47

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

Quiz

Which of the following components can execute Business Rules?

a. Mediator components

b. Clients of the composite application

c. BPEL components

d. Database Adapter components

e. Human Task components

Answer: a,b,c,e

Business Rules is a component like the BPEL or Mediator component, and therefore it provides a WSDL interface to expose the decision service through which rules can be executed. Therefore a composite application that exposes a Business Rule component as a service entry point enables any of its clients to execute the Business Rule and obtain the results. Mediator components can use routing rules to execute a Business Rules component. In fact, when you create a dynamic routing rule this creates a Business Rule component whose results determine the target service invoked. BPEL components can invoke business rules and use results to influence process flow. The Human Task participant list builders can use Business Rules to generate a list of approvers for a stage in the human task configuration.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 144: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 48

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

Summary

In this lesson, you should have learned how to:

• Explain business rules concepts

• Describe the Oracle Business Rules architecture

• Describe the Oracle Rules Engine

• Explain the role of the Rule Dictionary

• Create rules with the JDeveloper Rules Designer

• Integrate a simple rule with a BPEL process

• Describe the role of the Rules SDK

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 145: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 13 - 49

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

ApproveCCOrder BPEL

Scope_validatecc

<case> VALID

Switch_checkapproval

<case> Approval Required

<otherwise>

Practice 13 Overview: Implementing Business Rule Components

POProcessing Composite (assembly model)

Entry point

RoutePO Fulfillment BPEL

ApproveCCOrder BPEL ApprovalRules

ShippingRules

BusinessRule_approvalrule

Fulfillment BPEL

Scope_shiporder

Switch_shiporder

BusinessRule_shippingrule

<case> UPS

<case> USPS

<case> FedEx

EnrichPO

Modify conditions

Modify conditions

Modify conditions

Modify conditions

Invokes Business

Rules

Execute Business

Rule

Practice 13 Overview: Implementing Business Rule Components

This practice covers the following topics:• Creating Business Rules components in a composite application assembly model and

wiring them to other components, thereby creating a decision service that can be invoked by other components.

• Creating a Rule Dictionary based XML Fact structure that are evaluated through the use of- Rulesets comprised of one or more rules- Decision tables containing a set of rules

• Invoking the decision service created for each Business Rules component by using the Business Rules activity in a BPEL Process.

The slide illustrates the practice changes to the POProcessing assembly model and BPEL components to integrate the following two Business Rule components:

• An ApprovalRules Business Rule component that returns true if manual approval is required for orders with a total above a specific limit. Discounts are applied to order totals based on total price. The decision service for the component is invoked from the ApproveCCOrder BPEL Process.

• A ShippingRules Business Rule component that returns the carrier selected to ship the ordered products, based on supplied shipping information. The decision service for the component is invoked from the Fulfillment BPEL Process.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 146: D53946GC20_sg2

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 147: D53946GC20_sg2

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

Testing and Debugging Composite Applications

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 148: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 2

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

Objectives

After completing this lesson, you should be able to:

• Create Test Suites for composite applications

• Create Test Cases to initiate inbound messages, and emulate outbound, fault, and callback messages

• Create Test Cases with value-based and XML-based assertions

• Discuss strategies for debugging and troubleshooting applications

Objectives

As a designer and developer committed to creating robust applications that perform the task required, you explore implementation of unit tests and test suites (a collection of unit tests) to test various use-cases and conditions that verify correctness of your application implementation coding paths.

With Oracle SOA Suite 11g components in a composite application testing becomes important when you have an application that depends on other services that may not yet be implemented. By using test suites and test cases, you learn to use emulations and assertion to test you application in the absence of dependent services to find out if you application works as if those services existed.

In addition, you learn that unit tests are useful ways to debug an application even with the presence of dependent services to ensure that you application interactions are consistent with the requirements of the services the application invokes.

The goal is to learn how to create test cases and test suites in JDeveloper, deploy them with the application so that you execute the test cases and suites in Oracle Enterprise Manager Fusion Middleware Control and examine the results.

Test cases and test suites provide you with a useful way to debug composite applications and its interactions.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 149: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 3

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

Testing SOA Composite Applications

The goals of testing SOA composite applications are to:

• Automate testing of internal and external interactions performed by a SOA composite application

• Enable simulation of interactions between a SOA composite application and the Web services it references

• Ensure component and Web service partner interaction behave as expected before production deployment

• Use the Composite Test Framework to execute tests

Testing SOA Composite Applications

The goals of testing a SOA composite application are to use different Test Cases to:• Automate testing of interactions between internal components and with external services• Simulate the interactions between a SOA composite application and its partner Web

services• Ensure that a composite application interacts with Web service partners as expected before

deployment in a production environment

Oracle SOA Suite provides an automated Test Suite framework, called the Composite Test Framework, for creating and running repeatable tests of an SOA composite application.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 150: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 4

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

Introducing the Composite Test Framework

The Composite Test Framework:

• Simulates Web service partner interactions

• Validates process actions with test data

• Creates reports of test results

• Supports creation of tests at the SOA composite application level for:– Wires

– Service binding components

– Service components (such as BPEL processes and Mediator service components)

– Reference binding components

Introducing the Composite Test Framework

Oracle SOA Suite provides an automated Test Suite framework for creating and running repeatable tests on an SOA Composite application. The Test Suite framework:

• Simulates Web service partner interactions• Validates process actions with test data• Creates reports of test results• Supports creation of tests in the composite application for components listed in the slide

Note: The Test Suite framework calculates the percentage of BPEL process service component source code executed in terms of the percentage of simple activities executed.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 151: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 5

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

Overview of Test Suites

For each composite application, the Composite Test Framework supports:

• Creating one or more Test Suites, each comprising a collection of Test Cases

• Deploying the composite application with its Test Suites to a run-time environment

• Running a composite application Test Suite, called a test run, by using the Oracle Enterprise Manager Fusion Middleware Control

Note: Each test run corresponds to a single composite application instance.

Overview of Test Suites

The Composite Test Framework supports testing various components at the SOA composite application level, as listed in the slide.

The Composite Test Framework enables creating one or more Test Suites, each of which consists of a logical collection of one or more Test Cases. Each Test Case contains a set of commands that is performed when a Test Case instance is executed. The execution of a Test Suite is known as a test run. Each test run corresponds to a single SOA composite application instance.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 152: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 6

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

Overview of Test Cases

A Test Case:

• Is a component of a Test Suite

• Is a specific test included in test run

• Can be thought of as a unit test that comprises the following components:– Process initiation, to initiate your process with an input

payload

– Emulations, to emulate interactions

– Assertions, to validate message contents for interactions

– Message files, containing test message samples used in process initiation, emulations, and assertions.

Overview of Test Cases

Each Test Case must belong to a Test Suite and can be thought of as a unit test for a composite application. Each Test Case is executed when the Test Case that contains it, is run. Test Cases comprise the following components:

• Process initiation, which enables simulation of input messages that initiate your composite process to test behavior from the application service entry points

• Emulations, which enable you to simulate the behavior of internal and external components with which your SOA composite application interacts

• Assertions, which enable you to verify the contents of variable data messages exchanged during service interactions and process flow

• Message files, which contain sample XML message structures used for execution of process initiation, emulation, and assertion components

Note: Message data can be embedded in each component or loaded at run-time from the message files, which must be deployed with the Test Suite.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 153: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 7

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

Creating a Test Suite

After opening a composite.xml file in the Composite Editor, use one of these two ways to create a Test Suite:

• In the Application Navigator under the Project folder, right-click the testsuites folder and select Create Test Suite.

• In the Structure window, right-click the Test Suites folder and select Create Test Suite.

Note: To delete a Test Suite and all its Test Cases, right-click the Test Suite folder and select Delete Test Case.

Creating a Test Suite

Test Suites consist of a logical collection of one or more Test Cases. Each Test Case contains a set of commands to perform as the test instance is executed. The execution of a Test Suite is known as a test run.

After opening a composite.xml file in the Composite Editor, you can use one of the following two ways to create a Test Suite:

• In the Project folder, right-click the testsuites folder, and select Create Test Suite.• In the Structure window, right-click the Test Suites folder and select Create Test Suite.

Note: In this second method, you must first click in the Composite Editor Design window to see the Structure window.

With each method used the Create Test Suite window is displayed, and you can enter a name for the Test Suite. After entering a Test Suite name and clicking OK, the Create Composite Test window is displayed where you can enter the name and description for the first Test Case to be added to the Test Suite.

Note: The next slide titled “Creating a Test Case” discusses the creation of the Test Case and the results.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 154: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 8

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

Creating a Test Case

• The first Test Case is created after creating a Test Suite, when the Create Test Case window is displayed.

• Additional Test Cases are created by right-clicking the Test Suite name, and clicking Create Test.

Test Case is an XML file that resembles the composite.xml

1 2

Creating a Test Case

There are many ways to create a Test Case in a Test Suite. The slide shows the following two ways to create a Test Case:

1. The first Test Case is created, after you enter a Test Suite name in the Create Test Suite window, and click OK.

2. After creating the first Test Case, you can create new Test Cases in the same Test Suite by right-clicking a named Test Suite folder (either in the Application Navigator as shown in the slide, or the Structure window), and click Create Test.

In both of the two cases described, JDeveloper opens the Create Test Case window, in which you can enter a Test Case name and an optional description for the Test Case, and click OK.

Note: When you create a Test Case, a Test Case XML file is created in the project, and the Test Case file appears in the Application Navigator window as a child of the Test Suite, and the XML file is opened in the Test Case window. The Test Case XML file visually resembles the composite.xml. However, you know it is the Test Case file by the name of the tab window and because JDeveloper changes the color of the Exposed Services and External References column.

You can now visually edit the Test Case file by adding process initiations, emulations, and assertions.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 155: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 9

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

Examining Test Suite and Test Case Files

Test Suite and its Test Case files are:

• Kept in the same project as the composite application

• Structured hierarchically with the Test Case files as children of its owning Test Suite, in the Application Navigator and Structure windows

• Deployed together with the composite application

Application Navigator Structure

Examining Test Suite and Test Case Files

The Test Suite is a container for all its Test Case files. This hierarchical relationship is visually evident in the Application Navigator and Structure windows, which mirror the parent child relationship between the Test Suite and its Test Cases.

In the Application Navigator you can observe additional subfolders within each Test Suite. The Test Suite folders are:

• The componenttests folder, which is not used in Oracle SOA Suite 11g release 1• The includes folder, which is not used in Oracle SOA Suite 11g release 1• The messages folder is used to save message files that are used to provide messages for

emulations and assertions. Message files are XML files that contain XML message fragments, and can be reused by copying them between Test Cases and Test Suites.

• The tests folder contains all the Test Case XML files

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 156: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 10

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

Contents of a Test Case

A Test Case can contain one or more:

• Inbound message initiations

• Outbound message emulations

• Callback message emulations

• Fault message emulations

• Value-based or XML-based assertions

Contents of a Test Case

Test Cases consist of a collection of process initiations, (inbound, outbound, and callback) emulations, and assertions. Each of these test action types can be added to Test Cases, when in the test mode of the SOA Composite Editor.

You create process initiations to initiate client inbound messages into your SOA Composite application. You create emulations to simulate either message data, fault data, or both types that your SOA Composite application receives from Web service partners. You create assertions to validate test data in a variable or XML document as a process is executed.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 157: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 11

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

Initiating Inbound Messages

To create an initiating inbound message:1. Right-click an exposed service (entry point).2. Select Create Initiate Messages.3. Observe the resulting icon. 1

2

3

Circled arrow icon indicates presence

of an initiate message

Generate and edit

Save for reuse

Initiating Inbound Messages

Initiating inbound messages emulates a client message sent to a service operation in the WSDL exposed by composite application. Because there is no explicit client to start a Test Case, each Test Case must provide at least one initiating inbound message. The steps to create an initiating inbound message are:

1. On the composite application Test Case XML file, right-click the exposed service entry point to emulate, and click Create Initiate Messages.

2. On the Initiate Messages window, select the initiating operation (in the example there is one operation that is selected by default). The other fields to be set are:

- Part, which selects the request message part name (for example, request)- Value, which contains the simulated client message, which can be created by:

- Selecting the Enter Manually option, and typing the XML message data or click Generate Sample and edit the sample data- Selecting the Load From File option, to load the message data from a file, which is copied to the messages folder, if located outside the current project

- Delay, which enables you to emulate a wait period before the message is sent3. Click OK, and an icon with an arrow in a circle is added to the exposed service icon.

Note: You can double-click the exposed service icon to create or edit an initiate message. You can also right-click the exposed service icon to edit and delete the initiate message.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 158: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 12

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

Emulating Outbound Messages

Outbound messages simulate response messages from service partners.

1

2

3

Wire action icon

Wire

Emulating Outbound Messages

An outbound message emulation simulates a synchronous response message from a Web service partner. To create an outbound message emulation:

1. On the SOA Composite Test Case window, right-click a wire and select Create Wire. Actions, to open the Wire Actions window.

2. On the Wire Actions window, for the selected operation select the Emulates tab, and click the Add Emulate (+) icon.

3. On the Create Emulate window, select the Emulate Output option, and set the following fields values:

- Part, which chooses the message part to be emulated (for example, return)- Value, which contains the simulated output message XML structure. Similar to the

Initiate Inbound Messages you can select the Enter Manually option to enter the message text or generate one, or select the Load From file option and click Browse icon to load message data from a file, which is added to the messages folder if copied from an external folder.

Note: Because the emulation is for a synchronous operation the Emulate Callback option is disabled (grayed out), and the Emulate Fault is an option for emulating a fault response from a service partner. The wire action icon appears on the wire after creating an emulation, or assertion. Right-click the wire action icon to edit or delete the action.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 159: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 13

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

Emulating Callback Messages

Callback messages simulate asynchronous responses.

2

1

3

Emulating Callback Messages

You can simulate a callback message returned from an asynchronous Web service partner. To create a callback message emulation:

1. On the SOA Composite Test Case window, right-click a wire connecting an exposed service with an asynchronous service partner and click Create Wire Actions.

2. On the Wire Actions window, for the selected operation select the Emulates tab, and click the Add Emulate (+) icon.

3. On the Create Emulate window, the Emulate Callback option is selected by default, and similar to other emulations enter the following fields values:

- Part, which chooses the message part to be emulated (for example, return)- Value, which contains the simulated output message XML structure. Similar to the

Initiate Inbound Messages you can select the Enter Manually option to enter the message text or generate one, or select the Load From file option and click Browse icon to load message data from a file, which is added to the messages folder if copied from an external folder.

Note: Because the emulation is for an asynchronous operation the Emulate Callback option is the only one enabled and selected. The Emulate Outbound and Emulate Fault options are disabled.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 160: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 14

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

Emulating Fault Messages

Fault emulations simulate a fault response from a synchronous service partner.

1

2

3

Fault emulations display with the wire action icon on a dotted line

Emulating Fault Messages

You can simulate a fault message returned from a synchronous Web service partner. This enables you to test fault-handling capabilities in your composite application. Creation of a fault emulation is similar to creating an outbound emulation, by performing the following steps:

1. On the SOA Composite Test Case window, right-click a wire connecting to a synchronous service partner and click Create Wire Actions.

2. On the Wire Actions window, for the selected operation select the Emulates tab, and click the Add Emulate (+) icon.

3. On the Create Emulate window, select the Emulate Fault option, and similar to other emulations enter the following fields values:

- Part, which chooses the message part to be emulated (for example, return) - Value, which contains the simulated output message XML structure. You can select

the Enter Manually option to enter the XML message or generate one, or select the Load From file option and click Browse icon to load message data from a file.

Note: Fault emulation wire actions are displayed in the Test Case design with the wire action icon on a dotted line.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 161: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 15

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

Creating Variable or XML Assertions

Assertions are wire actions that verify:

• The contents of a leaf element (variable assertions)

• The message (or non-leaf) structure (XML assertions)

Fields change depending on Assert target

Select the message or a part

1

2

3

Creating Variable or XML Assertions

You perform assertions to verify variable data or process flow. Assertions enable you to validate test data in a variable or an entire XML document as a process is executed. This is done by extracting a value from a variable or an XML document and comparing it to an expected value.

1. On the Test Case diagram, right-click a wire and select Create Wire Actions.2. On the Wire Actions window, select the Asserts tab and click the Add Assert (+) icon.3. On the Create Assert window, you can select one of the following assertions options

(depending on the type of interaction underlying the wire):- Assert Input, to create an assertion for the inbound direction- Assert Output, to create an assertion for the outbound direction- Assert Callback, to create an assertion on a callback- Assert Fault, to create an assertion for an application fault

On the Create Assert window, the example shows that you can click Browse next to the Assert Target field to choose if you are asserting something about the whole message structure or a particular child element within the message.

Note: Subsequent configuration steps depend on the type of assertion you choose to perform:• A variable assertion can be done for leaf nodes of an XML structure• An XML assertion is done for the entire message or any non-leaf part of the message

Note: You can create multiple assertion on a the same wire.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 162: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 16

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

Configuring Variable-Based Assertions

• In the Create Assert window, click Browse next to the Assert Target field.

• In the Select Assert Target window, select a leaf node.

• In the Create Assert window, choose the Compare By comparison type string, number, or pattern-match.

1

2

3

Select a leaf node for a variable (value) based

assertionPattern-match uses JDK regular expression syntax

Enter comparison value

Configuring Variable-Based Assertions

A variable-based assertion can be created in the Create Assert window, which is opened after you click the Create Wire Action that opens the Create Wire Action window, and selecting the Assert tab and clicking Add Assert (+). To create a variable-based assertion:

1. On the Create Assert window, select one of the Assert Input, Assert Output, Assert Callback, or Assert Fault options as required for the wire context, and click Browse to open the Select Assert Target window. In the example, the Assert Callback is not possible.

2. On the Select Assert Target window, expand the message structure for the wire interaction and select a leaf node to be asserted, and click OK.Note: It must be a leaf node to be a variable-based (value-base) assertion (or comparison). In the example, the NewMessage structure is expanded and the input leaf node is selected.

3. On the Create Assert window, the Assert Target is updated with the selected leaf node, and then you can select one of the following Compare By options:

- string, to perform a string-based comparison with the data value- number, to perform numerical value comparison- pattern-match, to compare the value using a Java-based regular expression (regex)

pattern syntax. For example, a pattern of “ab[0-9]*cd” matches values such as ab123cd and ab4567cd.

Enter a comparison value based on the Compare By option, and click OK.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 163: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 17

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

Configuring XML-Based Assertions

• In the Create Assert window, click Browse next to the Assert Target field.

• On the Select Assert Target, select the message (the default), a part, or a non-leaf node.

• In the Create Assert window, choose the Compare By comparison option from:– xml-identical to match the exact XML element structure

and sequence of the message (not the values)– xml-similar to match a similar XML element structure

Configuring XML-Based Assertions

An XML-based assertion can be created, in the Create Assert window, to compare the structure of the XML message, or a fragment (subset, or non-leaf node) of message to an identical or similar XML structure specified in the assertion configuration. The type of comparison used is based on the value you select from the Compare By option, which can be:

• xml-identical, to perform an exact comparison between the elements and attributes of the XML message and the assertion value. If there is any difference between the two XML structures, the comparison fails. For example, a failure occurs if one document uses an element name of purchaseOrder, while the other uses an element name of invoice. A failure occurs if a child attribute of two elements are the same, but appear in a differ order in each XML structure. The xml-identical is a strict match comparison.

• xml-similar: to perform a comparison based on similar XML content, not an exact match. For example, comparison succeeds if both XML structures use the same XML Namespace string, but different namespace prefixes. Comparison succeeds the same element with the same child attributes exist, but the attributes appear in different orders in each element. Both of these examples, are considered similar and therefore recoverable.

Note: The values contained in the XML element is not part of an XML-based assertion.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 164: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 18

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

XML-Identical Assertion Example

The xml-identical option requires an exact match between the XML message (or fragment) structure and the assertion value.

XML-Identical Assertion Example

Selecting the xml-identical Compare By option requires an exact match between the XML message (or fragment) structure and the assertion value, otherwise an assertion failure occurs. This means the Test Case completes with a failure condition.

In the example, the value entered for comparison with the xml-identical Compare By option is used to ensure the input data matches all the specified XML parts exactly, such as:

• XML element names• XML element hierarchical structure• XML element sequence• XML Namespace

Note: If an XML Namespace prefix (not used in the example) is specified, then the input value must use the same prefix for an xml-identical comparison to pass the assertion test.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 165: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 19

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

XML-Similar Assertion Example

The xml-similar option performs a similarity (less strict) comparison between the XML message (or fragment) structure and the assertion value.

Namespace prefix (s1) is different in the assertion value

XML-Similar Assertion Example

Selecting the xml-similar Compare By option performs a similarity match between the XML message (or fragment) structure and the assertion value, otherwise an assertion failure occurs.

In the example, the valued entered for comparison is used such that the XML element names, XML hierarchical structure, and XML Namespace string are the same. However, if there are multiple child elements at the same level in a different order, or the namespace prefix (which is shown in the example) is different, a similar match is possible and the assertion succeeds.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 166: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 20

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

Quiz

For a Test Case definition, which of the following must be present in order for it to be run as a unit test?

a. Inbound message initiation

b. Outbound message emulation

c. Callback message emulation

d. Fault message emulation

Answer: a

An Inbound message initiation is required in order to run a Test Case. The absence of an inbound message initiation prevents execution of the Test Case. The other way to ensure a Test Case can run is by using an event message emulation. O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 167: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 21

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

Selecting the Test Cases to Run

To run a test, called a test run:• Deploy the composite application with

all the Test Suites.• Run Test Cases in the Unit Test tab in

the home page of a deployed composite application.

1

2

3

Selecting a Test Suite selects all its Test Cases

Select a specific Test Case

Selecting the Test Cases to Run

Before you can run a Test Suite or any Test Cases within a Test Suite you must deploy the composite application project along with all the Test Suites it contains to an Oracle SOA Suite 11g run-time environment, such as a development or test system. Test Suites must be deployed with the composite application, because a composite application instance is created to execute the selected Test Cases forming the test run. A test run is an instance of a test.

After deploying the composite application you can login to the Oracle Enterprise Manager Fusion Middleware Control and perform the following steps to select the Test Cases to be run:

• On the Farm navigator, expand the SOA tree and click the name of the composite application name [version] deployed with the Test Cases.

• On the composite application home page, click the Unit Tests tab link (do not click the Test drop-down menu). The Unit Tests tab link opens the Test Cases subtab page.

• On the composite application Unit Tests > Test Cases tabbed page, if needed expand the Test Suites and select the specific Test Case to be run, or click the option next to a Test Suite name to select all the Test Cases in that Test Suite. The collection of Test Cases selected form a test run. There a test run is a collection of Test Cases executed at one time.

After selecting the Test Cases to be run, click Execute.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 168: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 22

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

Running the Test Cases

• In the Unit Tests > Test Cases subtab of the composite application page, select the Test Suites, and Test Cases.

• Click Execute to initiate the test run. Click Execute to initiate the test run

Click Test Runs to monitor and view results

A composite application instance is create for each Test Case

12

Running the Test Cases

On the Unit Test > Test Cases page of the composite application after selecting the Test Suites, and Test Cases you wish to run, to start a test run:

• Click Execute, which opens a “Details of test run” window.• On the “Details of test run” window, enter a name string for the test run. Choose a naming

convention for the names to make it easier to search for the test run results in Test Runs tab page. You can change the timeout each test. A test is terminated if it exceeds the timeout. Set the “Number of Concurrent Test Instances” to create the specified number of test instances (for simulating load tests). Click OK to start the test run.

When you click OK “Details of test run” window, an instance of the composite application is created for each Test Case executed in the test run. The Test Cases are initiated using the initiations, emulations, and assertions defined in each Test Case. The composite application instances run without user intervention (unless your code involves a Human Task, which still needs to be managed via the normal Worklist application).

Note: After clicking Execute to initiate the test run, the Web browser page is refresh with the Test Runs page being displayed. This enables you to monitor the test run progress, and view the test run results. The next page titled “Examining Results of a Test Run” provides an example of the Test Runs tab page.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 169: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 23

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

Examining Results of a Test Run

12

Examining Results of a Test Run

The Test Runs tab page is displayed after you initiate a test run. Initially, the Test Runs page may not contain any information. To update the contents of the page and view the progress or results for the Test Cases in a test run perform the following steps:

1. Either click Refresh Test Status, or enter search criteria, such as the test run name and click Search.

2. In the table immediately under the Search section, (or just above the “Result of Rest Run”section) the name of the test run should appear. Click the test run row entry that appears to populate the “Result of Rest Run” section with a table of the Test Suites and Test Cases either in progress or completed and the status of each test.

Note: In the “Assertion details for” section you can see the list of failed Test Case composite application instance IDs, and also click the [XML] links in each instance row to examine test assertion information, such as assertion failures. An example is shown in the next page titled “Viewing Assertion Information.”

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 170: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 24

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

Viewing Assertion Information

• Click the [XML] links in a row of the “Assertion details for”section to view assertion information.

• Click the composite application instance link to access the Flow Trace page to examine the composite application instance details.

Composite application instance ID link to access

Flow Trace page

Examine cause of Assertion failure

Viewing Assertion Information

In the “Assertion details for” section of the Test Runs tabbed page, you can view the details of test run assertions. The example shows some assertion failures. When you click any of the [XML] links in one of the “Assertion details for” table rows you can view the data compared by the specific assertion and view the reason for any failures.

Note: The instance link in each row, is the instance ID for the composite application used to perform the Test Case. If you click the instance ID link you can access the Flow Trace page for that instance to examine and drill down into the composite application and component details, as you would for any other composite application.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 171: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 25

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

Quiz

You start a Test Suite or Test Case by clicking the Test button in the composite application home page in Oracle Enterprise Manager.

a. True

b. False

Answer: b

A Test Suite or Test Case is executed by clicking the Execute button on the Unit Tests > Test Cases subtab of the composite application page, after selecting the Test Suites and Test Cases to be run. A test run creates a new composite application instance to run the test using the inbound message initiation as initial input. The Test button on the composite application home page creates a test of an instance that does use any Test Case definitions.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 172: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 26

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

Debugging Composite Applications

Debugging options include:

• Deploying Test Suites to perform Unit Tests

• Working with the Web Service testing tools in JDeveloper or Enterprise Manager

• Working in the Flow Trace pages of composite application instances

• Setting the SOA Infrastructure Audit Level property on the soa-infra home page, by clicking SOA Infrastructure >SOA Administration >Common Propertiesand choose Developmentfor the Audit Level option forall applications

Change to Development

Debugging Composite Applications

The slide lists some of the test tools that can used as techniques for debugging services and their interactions. In addition, in Enterprise Manager Fusion Middleware Control you can set the SOA Infrastructure Audit Level property The values for the Audit Level are:

• Off, to stop composite instance collecting and tracking and payload tracking from being collected. A slight performance increase for processing instances may be observed. However, although instances are created, no information is displayed.

• Development, enables both composite instance tracking and payload detail tracking. This setting may impact performance and is useful for testing and debugging.

• Production, enable composite instance tracking. However, the Mediator service engine does not collect payload data, and the BPEL service engine collect payload data for all activities except assign activities This level is optimal for most normal production operations.

Note: Information collected is written to the instance data store (database) associated with the SOA Infrastructure, and has no impact on what is written to log files.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 173: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 27

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

Troubleshooting Guidelines

Oracle SOA Suite 11gClient

Request

Response?

HTTP Analyzer

WSDL

XML schema

2

3

Defines

Imports

ExaminesSOAP/HTTP

1Server logs

Composite Application

Web Service

Web Service

JDeveloper

Enterprise Manager

4

Web Service Test tool

Service Testing

Troubleshooting Guidelines

To troubleshoot SOA applications, one approach is to follow the life cycle of a client request and response (if any) through all the components involved in the interaction. Using this approach you track the flow of a message through the system and examine possible sources of an error in a systematic way. First look at error messages, if available, and take action or make an “educated guess” as to where to start looking next. Usually, an error message points to the probable cause and source of the error, and or log files to be consulted for more information. The graphic depicts a simple request–response life cycle, highlighting key service artifacts that maybe a source of errors. The picture shows tools to help test and debug application, and highlights the importance of log files as sources of information. The numbers in the graphic represent common sources of problems:

1. The WSDL document types, message, port type, and operations definitions, the URL defining the endpoint, and service binding definitions

2. The XML schema validity, and whether it is accessible to the WSDL importing it3. The actual contents of the request and response messages. If the SOAP/HTTP Bindings are

used, these exchanges can be monitored by using a HTTP Analyzer tool.4. The service logic and its run-time environment. Application (service)-level and server log

files. Enterprise Manager Fusion Middleware Control provide access to all log files.

Note: For more product-specific troubleshooting tips refer to Oracle Fusion Middleware Administrator’s Guide for Oracle SOA Suite 11g Release 1 (11.1.1).

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 174: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 28

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

Summary

In this lesson, you should have learned how to:

• Create Test Suites for composite applications

• Create Test Cases to initiate inbound messages, and emulate outbound, fault, and callback messages

• Create Test Cases with value-based and XML-based assertions

• Discuss strategies for debugging and troubleshooting applications

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 175: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 14 - 29

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

Practice 14 Overview: Creating and Running a Test Suite and Test Case

This practice covers the following topics:

• Creating a Test Suite for a composite application

• Creating Test Cases in the Test Suite

• Deploying the composite application with its Test Suite

• Executing the Test Suite and cases by using the Enterprise Manager Fusion Middleware Control

• Viewing the test run resultsCredit Card Validation Composite

Validate Credit Card (Mediator)

Entry point

CREDITCARDS table

Check CC Limit (BPEL)

Credit Card DB Service

Initiate inbound message

Emulate reply message

Add assertions

Practice 14 Overview: Creating and Running a Test Suite and Test Case

The goal of the practice is create Test Suite containing three Test Cases, and deploy the composite application with its Test Suite. After the composite application has been deploy you use Oracle Enterprise Manager to run the Test Suite and one Test Case.

The slide illustrate the concept of a composite application Test Case, which comprises:• An initiating inbound message that provides the input data for the composite application

when the Test Case is initiated. This initiating inbound message is created on the composite entry point that is used to initiate the test.

• An emulation for the reply from the CreditCardDBService. The reply emulates the response to the ValidateCreditCard Mediator component from the CreditCardDBService.

• An assertion to verify that all or part of the response data contains data and values we expected to be returned from the Mediator component to the client initiating the request.

Emulations and assertions are wire actions, and can be created on any wire in a composite application. When an emulation for a reply is created the actual service for which the emulation has been created does not have to exist. In this case the CreditCardDBService does exist, however, we are emulating a scenario that does not return useful data because of the information not being present in the database.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 176: D53946GC20_sg2

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 177: D53946GC20_sg2

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

Securing Services and Composite Applications

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 178: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 2

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

Objectives

After completing this lesson, you should be able to:

• Describe Web Services Security

• Describe Oracle Web Service Manager and its usage in securing SOA composites

• Discuss security and identity propagation in SOA composites

• Attach security policies to end points at design time and run time

Objectives

The composite application you are building interacts with a credit card validation service. The business owner of the credit card information requests that you secure the interaction with credit card validation processing. Your task is to learn how security can be applied to service end points. Your goal is to learn how to apply security:

• At design time by using JDeveloper to attach policies to service end points• After deployment by using the Oracle Web Services Manager (OWSM) Web interface,

exposed through Oracle Enterprise Manager Fusion Middleware Control, to attach policies to appropriate service end points

As a result you are better informed about the choices you can make about when to apply security policies to your application. This can be a developer or administrative task.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 179: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 3

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

Introduction to Web Service Security

Securing Web services using WS-Security standards:

• Supported by WS-SecurityPolicy standards, among others

• Applied to service end points, to provide:– Authentication and authorization

– Signing and encrypting the whole message or parts thereof

– Integrity (reliable messaging), confidentiality, and propagation of credentials

Client ServiceEnd point

Request

Response

AuthenticationWho?

Policy enforcement

point

Allow (Y/N)?Authenticate and authorize

WS-SecurityPolicy

WS-Security UsernameTokenProfile

(sign, encrypt, propagate)

Introduction to Web Service Security

Securing Web services (or any services) involves protection of:• The service end point, the entry point to the service functionality• The message contents, through digital signing, encryption, and ensuring message integrity

Web service security is addressed by many standards, such as WS-Security, WS-Security Policy, and so on, which define various elements for securing Web service end points and the messages that flow between the service consumer and provider. WS-Security standards cover:

• Authentication, the process of obtaining a username and password that is validated by using some kind of identity store

• Authorization, the process of allowing or disallowing access to some functionality or data, usually implemented through privileges assigned to roles, or attaching policies to the environment

• Signing and encryption of the message flowing from the client to a service end point

Using the WS-* security standards, much of the configuration is declarative, removing most requirements for adding security logic to the code. The key benefit of a declarative approach is the ability to change things at post-deployment time—that is, no code changes.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 180: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 4

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

Introduction to Web Service Security

WS-Security (WSS) 1.0 and 1.1 standards enable:

• Authenticating in multiple ways with security tokens

• Associating different identities with service requests

• Signing or encrypting the whole message body, or a single XML element of the body payload

• Adding credentials in the SOAP header, for example:<soap:Envelope xmlns:soap="..." xmlns:wsse="...">

<soap:Header> ...<wsse:Security>

<wsse:UsernameToken><wsse:Username>jcooper</wsse:Username><wsse:Password>welcome1</wsse:Password>

</wsse:UsernameToken></wsse:Security> ...

</soap:Header> ...</soap:Envelope>

Security token

Introduction to Web Service Security (continued)

Oracle supports the OASIS standard for Web services security (WS-Security) to provide both message-level and transport-level security for Web services. WS-Security defines a mechanism for adding transport independence and different levels of security to SOAP messages.

If there is a need to apply integrity and confidentiality at a fine-grained level instead of applying to the entire SOAP message, XML signature and encryption can be used to protect the SOAP body, header block, or portions of either. If the SOAP message needs to be protected beyond the transport session, message-level security can be used. If there is a need to use different forms of authentication, then message-level security authentication tokens can be used, such as username token, X.509 token, or Security Assertion Markup Language (SAML) token.

In the Oracle implementation, all WS-Security features, including digital signatures, encryption, and authentication, are implemented using a prebuilt JAX-WS handler called an interceptor. The interceptor adds the authentication, signature, and encryption WS-Security elements to the SOAP message, and then forwards the message to the receiving Web service. A receiving Web service also has interceptors to decrypt, verify signatures, and authenticate incoming messages.

The Oracle implementation of WS-Security integrates with Java Authentication and Authorization Service (JAAS) and a variety of authentication providers.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 181: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 5

Introduction to Web Service Security (continued)

Many Web service standards are involved with Web Service security implementations. Remember that authentication for Web services is done using Oracle Platform Security Services (OPSS) login modules. For SOA composites and components, security is implemented through the WS-PolicySecurity standard, where the policies are stored in the WS-Policy 1.2 format, and the policies used are advertised through WSDL in the WS-Policy 1.2 format as well.

The Oracle Platform Security Services (OPSS) and services enable the same policy to be reused and applied to more than one service, which provides the capability to do bulk attachment.

Policy versioning can be versioned so that older policies can be re-established by a policy rollback operation. Oracle Platform Security for Java provides automatic Identity propagation. Other supported Web Service standards include:

• WS-Security 1.0• WS-Security 1.1• WS-SecurityPolicy 1.1• WS-Security-SwA• UsernameTokenProfile 1.1• X509TokenProfile 1.1• Security-Policy Use cases Working Draft 2

Note: Oracle Platform Security Services (OPSS) make use of the Oracle Fusion Middleware Application Server Java Platform Security (JPS) implementation.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 182: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 6

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

Securing End Point Examples

In the composite.xml, security policies are attached in the bindings of:

• Service end points. For example:

• External reference end points. For example:

<service name="receiveOrder" ui:wsdlLocation="receiveOrder.wsdl"><interface.wsdl interface=".../receiveOrder#wsdl.interface(execute)"/><binding.ws

port=".../receiveOrder#wsdl.endpoint(receiveOrder/execute)"><wsp:PolicyReference URI="oracle/wss_username_token_service_policy"

orawsp:category="security" orawsp:status="enabled"/></binding.ws> </service

<reference name="getCreditCardStatus" ... ><interface.wsdl interface=".../getStatusByCC#wsdl.interface(execute)"/><binding.ws

port=" ... /getStatusByCC#wsdl.endpoint(getStatusByCC/execute_pt)"location=" ... /validationForCC/getStatusByCC?WSDL"><wsp:PolicyReference URI="oracle/wss11_saml_token_client_policy"orawsp:category="security" orawsp:status="enabled"/>

</binding.ws> </reference>

Policy name used enforce assertions

Securing End Point Examples

The examples are presented here to give a brief example showing how security policies can be attached to service end point bindings in the composite.xml file.

In this way, security policies can be declaratively attached to the inbound requests (the service end points) to an SOA composite, and outbound requests (the external reference end points) from the SOA composite.

The URI attributes in each example identify the policy names, which define one or more security assertions that are applied at run-time to enforce the policy rules during the request-response message life cycle.

Note: The various URL references in the examples were shortened to make it easier to read the examples. The details about security policies and those used in the examples are discussed in subsequent pages of this lesson.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 183: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 7

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

Quiz

Authentication can be incorporated using _____________ .

a. Signature

b. Security Tokens

c. Encryption

Answer: b

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 184: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 8

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

Oracle Web Service Manager

• Oracle Web Services Manger (OWSM) is a security and management system that provides a common security infrastructure for Web services application.

• OWSM is based on three main operations:– Define

– Enforce

– Monitor

Oracle Web Service Manager

The Oracle Web Services Manager (OWSM) is designed to define and implement Web services security in heterogeneous environments. Instead of coding security logic in the application, you can use OWSM to implement declarative security and management through predefined policies. The three main operations on which the OWSM is based are:

• Define consists in attaching security and management policies to the Web services to be protected

• Enforce is the ability provided by OWSM to distribute policies from a central policy manager to policy enforcement points that execute security and management policies at runtime.

• Monitor is the tracking of runtime security and management events captured by OWSM.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 185: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 9

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

Oracle Web Services Manager Policy Framework

• It provides a policy framework to manage and secure Web services consistently.

• The policy framework is built using the WS-Policy standard and leverages the Oracle Platform Security Services (OPSS) Login Module and Oracle WebLogic Server authenticator for authentication and authorization.

Oracle Web Services Manager

Policy Enforcement Point

Oracle Platform Security

Login Module

Oracle WebLogic Server

Authenticator

Oracle Web Services Manager Policy Framework

OWSM can be leveraged from the Oracle Enterprise Manager Fusion Middleware Control to:• Centrally define policies using the OWSM Policy Manager.• Enforce OWSM security and management polices locally at runtime.

The tasks that can be performed from OWSM are:• Handle WS-Security (for example, encryption, decryption, signing, signature validation,

and so on)• Define authentication and authorization policies against an LDAP directory• Generate standard security tokens, such as SAML tokens, to propagate identities across

multiple Web services used in a single transaction• Segment policies into different namespaces by creating policies within different folders• Examine log files

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 186: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 10

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

Components of Oracle Web Services Manager Architecture

Oracle JDeveloper

OWSM Policy

Manager

Metadata Store (MDS)

Oracle Fusion

Middleware Database

Reliable Messaging

ManagementAddressingSecurityMTOM

Oracle Enterprise Manager

Fusion Middleware Control

Components of Oracle Web Services Manager Architecture

The components of the Oracle Web Services Manager Architecture can be described as follows:• Oracle Enterprise Manager Fusion Middleware Control – Enables administrators to access

Oracle Web Services Manager's functionality to manage, secure, and monitor Web services • Oracle Web Services Manager Policy Manager - Reads/writes the policies, including

predefined and custom policies from the metadata store• Oracle WSM Agent - Manages the enforcement of policies via the Policy Interceptor

Pipeline• Policy Interceptors - Enforce policies, including reliable messaging, management,

addressing, security, and Message Transmission Optimization Mechanism (MTOM) • Metadata Store – Used for storing policies. Policies can be stored either as files in the file

system (supported for development) or to the Oracle Fusion Middleware database (supported for production).

• Oracle Fusion Middleware Database - Provides database support for the MDS

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 187: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 11

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

Introduction to Policies

Policies describe the capabilities and requirements of a Web service. The different types of policies supported in Oracle Fusion Middleware 11g R1 are:

• WS-ReliableMessaging

• Management

• WS-Addressing

• Security

• Message Transmission Optimization Mechanism (MTOM)

Introduction to Policies

The different type of policies available are as follows:• WS-ReliableMessaging - Reliable messaging policies that implement the WS-

ReliableMessaging standard describes a wire-level protocol that allows guaranteed delivery of SOAP messages, and can maintain the sequential order in which a set of messages are delivered.

• Management - Management policies that log request, response, and fault messages to a message log. Management policies may include custom policies.

• WS-Addressing - WS-Addressing policies that verify that SOAP messages include WS-Addressing headers in conformance with the WS-Addressing specification. Transport-level data is included in the XML message rather than relying on the network-level transport to convey this information.

• Security - Security policies that implement the WS-Security 1.0 and 1.1 standards. They enforce message protection (message integrity and message confidentiality), and authentication and authorization of Web service requesters and providers. The following token profiles are supported: username token, X.509 certificate, Kerberos ticket, and Security Assertion Markup Language (SAML) assertion.

• Message Transmission Optimization Mechanism - Binary content, such as an image in JPEG format, can be passed between the client and the Web service. In order to be passed, the binary content is typically inserted into an XML document.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 188: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 12

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

Policy Interceptor Pipeline

Client

Web service

Reliable Messaging

ManagementAddressingSecurityMTOM

response

response

request

request

Reliable Messaging

Management Addressing Security MTOM

Network

Policy Interceptor Pipeline

The slide depicts Policy Interceptors acting on messages between a client and Web service. The messaging order can be described as follows:

• The client sends a request message to a Web service.• The policy interceptors intercept and execute the policies attached to the client. After the

client policies are successfully executed, the request message is sent to the Web service. • The request message is intercepted by policy interceptors which then execute any service

policies that are attached to the Web service. • After the service policies are successfully executed, the request message is passed to the

Web service. The Web service executes the request message and returns a response message.

• The response message is intercepted by the policy interceptors which execute the service policies attached to the Web service. After the service policies are successfully executed, the response message is sent to the client.

• The response message is intercepted by the policy interceptors which execute any client policies attached to the client.

• After the client policies are successfully executed, the response message is passed to the client.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 189: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 13

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

Policy

Policy Assertions

• Oracle Web Services Manager policies are made of one or more assertions that exhibit a particular behavior.

• Assertions are executed in the order in which they are listed in the policy.

Assertion 1 Assertion 2 Assertion nRequest

Response

Policy Assertions

Oracle Web Services Manager (OWSM) policies consists of one or more assertions exhibiting a particular capability/behavior. For example, a security policy could be made up of two assertions: a Log assertion and a WS-Security assertion. If this particular security policy is attached to a service endpoint, then for the request message the log assertion gets executed first logging the request message to a log file followed by the WS-Security assertion that authenticates the requestor based on the token sent in the message and decrypts the message if the message is encrypted.

OWSM policy assertions are instances of policy assertion templates that are added to a policy at policy creation time. OWSM:

• Provides a set of predefined policy assertion templates • Enables users to define custom policy assertions that can be combined with predefined

policy assertions

Note: Custom policy assertions are used when specific functionality is not provided.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 190: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 14

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

Types of Security Tokens

Security tokens are used to convey credential information to services. Supported security tokens are:• UsernameToken: With plain type and digest password• BinarySecurityToken: For embedding certificates• EncryptedData: For representing a SOAP node or

attachment, which is encryptedNote: Security Assertion Markup Language (SAML) is used to exchange authentication and authorization data, such as sending security tokens between security domains.

Example: UsernameToken in plain text (in a SOAP header) <wsse:UsernameToken>

<wsse:Username>jcooper</wsse:Username><wsse:Password>welcome1</wsse:Password>

</wsse:UsernameToken>

Types of Security Tokens

Specific WS-Security (WSS) 1.0 tokens include:• WSSUsernameToken: This uses a plain username and password either in plain text or

digest form• WSS10UsernameWithCerts: Along with UsernameToken, it sends sensitive data, which

could be signed or encrypted. Certificate information is also passed either in BinarySecurityToken, IssuerSerial, or KeyIdentifier.

• WSS10AnonymousWithCerts: No username or password is sent. Client does not identify itself to the server. The message exchange has to be secure using signatures or encryption.

• WSS10UsernameTokenOverSSL: This is similar to the plain username token. The “transport security” part is different.

• WSS10MutualAuthWithCerts: The client goes for strong authentication by identifying itself using X509 credentials. The client X509Token is embedded in the message signature.

Additional tokens defined for WS-Security 1.1 include:• WSS11AnonymousWithCerts: Similar to WSS10, the requestor is not identified to the

service. The request may be signed or encrypted using ephemeral keys, or keys derived from ephemeral keys. The response is signed with the same ephemeral key or derived key.

• WSS11MutualAuthWithCerts: The request message data is signed using symmetric key mechanisms. (The signature is computed with a ephemeral key or derived key using asymmetric key mechanisms.)

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 191: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 15

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

Security Assertion Markup Language (SAML)

Security Assertion Markup Language (SAML):

• Exchanges security information between different parties

• Conveys information about subjects, human users, or any entities with the following types of “assertions”:– An authentication assertion

– An authorization assertion

– An attribute assertion

Security Assertion Markup Language (SAML)

Security Assertions Markup language (SAML) is meant for exchanging security information between different security domains (parties), especially authentication details such as user login information, user attributes, and authorization information in the form of policies.

SAML contains one or more “assertions,” each of which conveys information about subjects (human users or any entities). Each assertion may contain multiple statements about authentication, authorization, and additional attributes.SAML supports the following types of “assertions”:

• Authentication Assertion: Convey information that a certain subject was authenticated at a certain instant.

• Authorization Decision: Convey information of access privileges for a user to certain resources.

• Attribute: Convey information about subject attributes.

SAML assertions are typically used for achieving Single Sign On (SSO). When the user is authenticated in one domain, the user does not required to authenticate again in other domains. This is possible because authentication information is conveyed to all relevant parties, which then use the information to testify that the user or entity was indeed authenticated at the instant claimed. Remember, the user could be a program.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 192: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 16

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

Introduction to Security Policies

Preseeded Oracle Web Server Manager authentication policies are:• oracle/wss_username_token_service_policy• oracle/wss11_saml_token_client_policy • oracle/wss11_saml_token_service_policy

Note: Policies contain one or more assertions (called a security pipeline), such as log, extract token, log, and decrypt.

Client Service

Request

Response

Authenticate: Sets UsernameToken

values

Policy enforcement

point

WS-SecurityPolicy: The oracle/wss_username_token_service_policy

policy can be used to extract token data, apply authentication and

authorization, and set the Subject

WS-Security: Carries

UsernameToken

Introduction to Security Policies

Oracle Fusion Middleware uses a policy-based model to manage Web services. Policies apply standards to the delivery of messages. Policies are part of an enterprise policy framework. This enables policies to be centrally created and managed.

Policies are comprised of one or more assertions. A policy assertion is the smallest unit of a policy that performs a specific action. Policy assertions are executed on the request message and the response message, and the same set of assertions are executed on both types of messages. The assertions are executed in the order in which they appear in the pipeline.

Policies are configured by using Oracle JDeveloper at design time, and the Oracle Enterprise Manager Fusion Middleware Control console at runtime. Predefined OWSM authentication policies are:

• oracle/wss_username_token_service_policy • oracle/wss11_saml_token_client_policy • oracle/wss11_saml_token_service_policy

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 193: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 17

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

Quiz

Policies are made up of one or more _____________ .

a. Tokens

b. Protocols

c. Assertions

Answer: c

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 194: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 18

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

Securing SOA and Identity Propagation

Web client

Credit Authorization

Service

OrderProcessComposite

ProcessOrder

(BPEL)

Finalize

CCAuth

Binds

Fulfillment

Username Token

• Verify security

• Authenticate

• Set SubjectAuthorize user

oracle/wss_username_token_service_policy

SAML

• Read Subject

• Insert SAML token

receive

oracle/wss11_saml_token_client_policy

• Verify SAML token

• Authenticate

• Set Subject

oracle/wss10_saml_token_service_policy

Securing SOA and Identity Propagation

The graphic example illustrates the use of three different policies used to authenticate, authorize, and propagate username credentials. Following the request flow, Web service policies are used for authentication and identity propagation:

• The Web client obtains the username and password from the user and authenticates the information and populates the Username token using WS-Security headers.

• The ProcessOrder BPEL service entry point applies the oracle/wss_username_token_service_policy attachment to verify security, authenticate the user, and set the Subject with identity details.

• The authorization part may then be applied using a specified policy.• The ProcessOrder BPEL component is configured with

oracle/wss10_saml_token_client_policy attached to the external reference for the Credit Authorization Service, causing the process to read the Subject and insert the identity information into the SAML token sent in the request to the external services.

• The Credit Authorization Service has oracle/wss11_saml_token_client_policy attached so that it can verify the SAML token, authenticate, and set the Subject completing identity propagation between service.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 195: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 19

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

Attaching a Policy to an Inbound Request

• Scenario: UsernameToken-based identity authentication• Result: User is authenticated, and Subject is associated

with the current thread.• Policy: oracle/wss_username_token_service_policy• Attachment added to service (entry point) in

composite.xml:<service name="receiveOrder" ui:wsdlLocation="receiveOrder.wsdl"><interface.wsdl

interface=".../receiveOrder#wsdl.interface(execute_ptt)"/><binding.ws

port=".../receiveOrder#wsdl.endpoint(receiveOrder/execute_ptt)"><wsp:PolicyReference URI="oracle/wss_username_token_service_policy"

orawsp:category="security"orawsp:status="enabled"/>

</binding.ws></service>

Attaching a Policy to an Inbound Request

The example shows the policy attachment fragment for the following scenario:• The scenario: UsernameToken-based identity authentication. In this case:

- The policy enforces the authentication of credentials provided via the UsernameToken WS-Security SOAP header (both plain text and digest mechanisms are supported)

- The credentials obtained are authenticated against the currently configured JPS identity store

• The result: User is authenticated and the Subject is associated with the current request thread.

• The policy: oracle/wss_username_token_service_policy

Note: This policy can be applied to any SOAP-based endpoint.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 196: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 20

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

Attaching a Policy to an Inbound Request by Using Oracle JDeveloper 11g

1

2

Attaching a Policy to an Inbound Request by Using Oracle JDeveloper 11gYou use Oracle JDeveloper 11g to attach policies for testing security in a design-time environment. When your application is ready for deployment to a production environment, you can attach runtime policies in Oracle Enterprise Manager Fusion Middleware Control console.

To attach a policy to an exposed service, execute the following steps:

1. Right-click the exposed service. Select Configure WS-Policies.

2. Click the Add icon for the type of policy, and select the respective policy to attach. Theslide shows an example to attach anoracle/wss_username_token_service_policy security policy to thereceiveOrder service.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 197: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 21

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

Attaching a Policy to an Outbound Request

• Scenario: SAML-based identity assertion

• Result: Identity is propagated and the payload is encrypted.

• Policy: oracle/wss10_saml_token_client_policy

• Attachment added to external reference in composite.xml:

<reference name="getCreditCardStatus"ui:wsdlLocation="... /getStatusByCC.wsdl">

<interface.wsdlinterface=" ... /getStatusByCC#wsdl.interface(execute_ptt)"/>

<binding.wsport=" ... /getStatusByCC#wsdl.endpoint(getStatusByCC/execute_pt)"location=" ... /validationForCC/getStatusByCC?WSDL"><wsp:PolicyReference URI="oracle/wss10_saml_token_client_policy"

orawsp:category="security"orawsp:status="enabled"/>

</binding.ws></reference>

Attaching a Policy to an Outbound Request

The example shows the policy attachment fragment for the following scenario:• The scenario: SAML-based identity assertion. In this case:

- The policy enables SAML token population for outbound SOAP requests using mechanisms described in WS-Security 1.0

- A SAML token is included in the SOAP message for use in SAML-based authentication with the sender vouching confirmation.

• The result: Identity is propagated and the payload is encrypted.• The policy: oracle/wss10_saml_token_client_policy

Note: This policy can be applied to any SOAP-based reference, such as getCreditCardStatus service.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 198: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 22

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

Attaching a Policy to an Outbound Request by Using Oracle JDeveloper 11g

1 2

Attaching a Policy to an Outbound Request by Using Oracle JDeveloper 11gTo attach a policy to an external reference, execute the following steps:

1. Right-click the external reference. Select Configure WS-Policies.

2. Click the Add icon for the type of policy, and select the respective policy to attach. Theslide shows an example to attach anoracle/wss10_saml_token_client_policy security policy to theCreditCardValidation service.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 199: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 23

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

Managing SOA Composite Application Policies

Policies page

Specifying the component to

which the policy is to be attached

Managing SOA Composite Application Policies

Policies apply security to the delivery of messages. You can attach or detach security policies to and from currently deployed SOA composite applications. To manage SOA composite application policies:

1. On the Oracle Enterprise Manager home page, expand the soa-infra > SOA folders, and click a SOA composite application link.

2. On the SOA composite home page, click the Policies tab.Note: The Policies page enables you to attach and detach policies to Web service binding components and service components of the SOA Composite Application. The policies table displays the attached policy name, component to which the policy is attached, policy reference status (enabled or disabled) that you can toggle, category (Management, Reliable Messaging, MTOM Attachment, Security, or WS Addressing), violations, and authentication, authorization, confidentiality, and integrity failures since the SOA Infrastructure was last restarted.

3. On the Policies page, click Attach To/Detach From. 4. Select the component to which to attach or detach a policy. This invokes a dialog for

attaching or detaching policies.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 200: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 24

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

Managing SOA Composite Application Policies

Attaching the policy

Executing the Validation test

Managing SOA Composite Application Policies (continued)

5. Select policies to attach that are appropriate to your environment, and click Attach. Note: Attach additional policies, as required.

6. When you are finished attaching policies, click Validate.Note: If an error message appears, make the necessary corrections until you no longer have any validation errors.

7. Click OK.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 201: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 25

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

Summary

In this lesson, you should have learned how to:

• Describe Web Services Security

• Describe Oracle Web Service Manager and its usage in securing SOA composites

• Discuss security and identity propagation in SOA composites

• Attach security policies to end points at design time and run time

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 202: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 15 - 26

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

Practice 15 Overview: Attaching Security Policies

This practice covers the following topics:

• Securing the POProcessing composite application with the UsernameToken policy

• Securing the CreditCardValidation composite application with a SAML service security policy

• Propagating security identity to the credit card validation service by using the SAML client security policy

POProcessing Composite

ReceivePO

wss_username_token_service_policy

ValidateCCService

ApproveCCOrder CreditCardValidation

Composite

ValidateCreditCard_ep

wss11_saml_token_client_policy

wss11_saml_token_service_policy

Receive security identity

Propagate security identity

Practice 15 Overview: Attaching Security Policies

The goal of the practice is to implementing security on end-points of composite applications, such as the POProcessing and CreditCardValidation interactions. In this practice you:

• Apply UsernameToken security to the POProcessing composite application, which requires an authenticated username and password to be provided in the WS-Security headers from its client. Upon receiving valid credentials the policy sets the security identity.

• Attached a SAML client policy to the ValidateCCService external reference, which propagates the security identity to the CreditCardValidation composite application entry point.

• Enforce a SAML service policy on the ValidateCreditCard_ep, the entry point to the CreditCardValidation composite application, which requires valid security credentials to be provided to allow the invocation to proceed.

You first attach the security policies to deployed applications by using Oracle Enterprise Manager. After detaching the policies you repeat the process at design-time by attaching the policies to the end points in JDeveloper and deploy the applications. You then deploy the applications with the security policies disabled.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 203: D53946GC20_sg2

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

Designing and Managing Business Events

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 204: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 2

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

Objectives

After completing this lesson, you should be able to:

• Describe business events

• Describe the Event Delivery Network

• Explain the Event Delivery Network Configuration

• Create a business event

• Publish an event

• Subscribe to an event

• Emulate an event message

• Manage events in the Enterprise Manager Fusion Middleware Control

Objectives

In your role as a SOA expert you find you are constantly challenged with new requests and requirements from the business. The business wish to automatically initiate order fulfillment processing for orders with a waiting status. Waiting orders could not be fulfilled due to lack of available stock in the online and internal stores.

Your goal is to learn how to:• Publish an event to indicates the stock for a given product has been updated (increased)• Subscribe to the event for the product inventory update event and process all orders

waiting for that product to become available

To assist you with these goals the lesson discusses Oracle SOA Suite 11g Event Delivery Network (EDN), and how to use Mediator components to publish and subscribe to events. You learn how to create event definitions using the Event Definition Language (EDL) standard.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 205: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 3

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

Introduction to Business Events

• Event: A message structure that represents the occurrence of a business event that must be communicated to other applications

• Business Event: Defines the occurrence and structure of an event when it occurs

• Events are a fire-and-forget interaction.

Newcustomer

Stocklow

Stock received

Introduction to Business Events

An event is a message structure that represents an occurrence of a business event that must be communicated to other applications. A business event is a name to define the occurrence and structure of an event when it occurs. Business events consist of message data sent as the result of an occurrence in a business environment. When a business event is published, other service components can subscribe to it. Developers declaratively define business events and specify raise conditions that dictate when the event is raised. As data is changed, these conditions are evaluated and all events whose raise conditions are met are fired.

You raise business events when a situation of interest occurs. Business events are a one-way, fire-and-forget, asynchronous interaction to send a notification of a business occurrence. The business process does not:

• Rely on any service component receiving the business event to complete• Care if any other service components receive the business event• Need to know where subscribers (if any) are and what they do with the data

These are important distinctions between business events and direct service invocations that rely on the Web Services Description Language (WSDL) file contract (for example, a SOAP service client). If the author of the event depends on the receiver of the event, then messaging typically must be accomplished through service invocation rather than through a business event. Unlike direct service invocation, the business event separates the client from the server.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 206: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 4

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

Event Delivery Network (EDN) Concepts

Event Delivery Networks:

• Supports events processing, it is not messaging infrastructure

• Provides a way to declaratively work with publish-subscribe implementations

• Offers subscription capabilities based on:– Namespaces

– Event names

– Content-based XPath filters

• Handles events defined in Event Definition Language (EDL) format

Event Delivery Network (EDN) Concepts

An Event Delivery Network (EDN) provides a true publish-subscribe abstraction. Therefore, developers do not need to know about the underlying event infrastructure. EDN supports a fully declarative approach and does not require explicit wiring between components leading to truly decoupled applications.

A business event is defined using the event definition language (EDL), which is an XML language. Each event is identified by a QName, such that it is uniquely identified by name qualified by a namespace. Therefore, an EDN offers the following three levels of subscription granularity:

• Namespaces, where the subscriber receives any event with a specific namespace• Event names, where the subscriber receives an event with a specify QName• Content-based XPath filters, where a subscriber can add content-based filters to accept or

reject events

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 207: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 5

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

Event Delivery Network and Business Events

The Event Delivery Network distributes events within Oracle Fusion Middleware service infrastructure. Events are:• Created when a business event occurs• Defined in Event Definition Language (EDL)

ServiceInfrastructure

Service/Event Delivery API and Event Delivery Network (EDN)

Mediator Component

Subscribe

PublishFilter

Mediator ComponentADF-BC

Application

Publish

Subscribe

Publish

FilterEDL XSD

JMS

Policy enforcement

Event Delivery Network and Business EventsThe Event Delivery Network (EDN), is provided by Oracle Fusion Middleware to reliably distribute events within the SOA Suite service infrastructure. EDN offers:

• Various qualities of services• Declarative, graphical UI, to abstract the underlying messaging infrastructure (JMS-based).

The JMS resource used to deliver event information needs to be configured.Events are defined by an XML file in Event Definition Language (EDL) format, whose XML structure is defined by an associated XML Schema Definition (XSD). The EDL contains

• The event information• The description of the payload structure and elements derived from the XSD file

Events are one-way asynchronous interactions and immutable, that is events are not alterable – a new event is required to alter a previous fact. Mediator components are the only SOA components that can subscribe to and publish events. ADF-BC applications can publish events.Note: Oracle SOA Suite 11g provides two implementations of EDN:

• A JMS implementation, which is configured by default• An Oracle AQ implementation, which provides support for PL/SQL APIs to publish and

subscribe to events.Note: Events pass the security Principal through the security interceptor for component-level authorization policy enforcement.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 208: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 6

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

Event Definition Language (EDL)

A business event defined in EDL:

• Is uniquely identified by a name, qualified by a namespace

• Has an payload structure for event information defined by an element in an associated XML schema

<definitionsxmlns="http://schemas.oracle.com/events/edl"targetNamespace="http://oracle.com/events/edl/EvtDef"><schema-import namespace="http://xmlns.oracle.com/singleString"location="xsd/singleString.xsd"/><event-definition name="DemoEvent1"><content xmlns:ns0="http://xmlns.oracle.com/singleString"

element="ns0:singleString"/></event-definition>

</definitions>

QName

Payload

QNameXML schema

Event Definition Language (EDL)

A business event is defined using the Event Definition Language (EDL). EDL is defined by a standard XML schema. The slide shows an example of an event called DemoEvent1 defined in EDL format. The EDL schema is used to build business event definitions.

Publishers and subscribers work with instances of the business event definition. An EDL file that defines an event that comprises:

• A global name, which is the QName uniquely defining the event name• Custom headers, which can be used for fast routing based on the value of the header more

quickly than using an XPath query on the event payload• A payload definition, which commonly uses an XML Schema Definition (XSD) to define

the structure of payload information.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 209: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 7

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

Aligning SOA and EDA through EDN

EDN brings the proven concepts and convenience of SOAP to the event-driven world.

Services Messaging EDN

WSDL:Standard service interface model

JMS API:Application Programming Interface

EDL:Event Definition Language

XSD: Strong typing Handful of raw types XSD

Business-oriented Developer-oriented Business-oriented

Wealth of tools Mostly coding tools Fully declarative

Aligning SOA and EDA through EDN

The table in the slide provides both some contrasts and similarities between SOAP (Service), JMS (Messaging), and EDL (Events). When used together you can create a rich and highly functional combination of Service-Oriented Architecture (SOA) and Event-Driven Architecture (EDA) approaches to implementation varied business requirements.

EDN provides a way for events to coexist with services. Therefore the EDN enables the SOA and EDA worlds to be aligned.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 210: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 8

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

EDN Support in Oracle SOA Suite 11g

Oracle SOA Suite 11g provide support for EDN and events as described by the following table:

Component Publish Subscribe

Mediator Yes (Routing Rule) Yes

ADF-BC Yes (CRUD methods) No

EDN Support in Oracle SOA Suite 11gThe table summarizes the Oracle Fusion Middleware 11g components that support publishing of and subscribing to events.

In the case of Mediator, the component can either have a WSDL interface or subscribe to events, but not both at the same time. A Mediator routing rule is used to publish an event.

An ADF-BC component can be configured to publish events for the CRUD operations it can perform. The CRUD operations are:

• Create, when data is inserted• Read (retrieve), when data is queried• Update, when data is updated• Delete, when data is deleted

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 211: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 9

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

Creating a Business Event

1

3

4

2

Open EDL file in the Events Editor to manage events

5

Creating a Business Event

The steps to create events definitions for a composite application are:1. On the SOA Composite Editor, click the Event Definition Creation icon in the

composite.xml window toolbar, as shown in the slide.Note: Alternatively, to open the Event Definition Creation window, from the JDeveloper File menu, select New > SOA Tier > Service Components > Event Definition.

2. On the Event Definition Creation window, enter:- The “Event Definition name,” which is used for the EDL file that contains the event

definitions that are added to the project- The Directory, to specify where the EDL file is stored- The Namespace, to specific the XML namespace for event definitions

Click the “Add an Event” (+) icon to create a new event.3. On the “Add an Event” window, select an XML element, from an XML schema, that

defines the event payload structure, and enter a Name for the event. Click OK. This adds the event in the Events table in the Event Definition Creation window and EDL file.

4. On the Event Definition Creation window, either add additional events or click OK to create the EDL file in the project folder. The EDL file is opened in the Events Editor.

5. On the EDL Events Editor window, you can add, edit, and delete events from the EDL file.

Note: To open the EDL file you can right-click the file and select Open, or double-click the file.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 212: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 10

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

Subscribing to Events in Mediator Components

1 2

3

4

The Mediator component shows the Subscribed Events icon and event name in the Composite

Editor.

Subscribing to Events in Mediator Components

To subscribe to a business event in a Mediator component, drag a Mediator component into the Components column in the Composite Editor:

1. On the Create Mediator window, select Subscribe to Events from the pull-down menu.2. On the Create Mediator window, click the “Subscribe to New Event” (+) icon to open the

Event Chooser.3. On the Event Chooser window, click Browse icon to locate an existing EDL file, or click

the Create new EDL file icon. In the Event Chooser dialog example, after clicking the Browse icon, the DemoEvent1 event is selected, and then click OK. The selected event is added to the subscribed events table in the Create Mediator window.

4. On the Expression Builder window, select the subscribed event entry and click the filter to open the Expression Builder, in which you can create a filter expression.

After you click OK on the Create Mediator window, the Mediator icon appears in the Composite Editor with the following visual clues:

• The left edge of the Mediator component has a Subscribed Events icon to indicate it subscribes to events.

• The body of the Mediator component displays the subscribed event names.

Note: A Mediator component cannot have a service interface and subscribe to events at the same time. A Mediator component can subscribe to multiple events.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 213: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 11

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

Setting Event Delivery Consistency

To set the subscribed event delivery consistency level:

• Click the Consistency cell of an event entry

• Select one of the following levels:– one and only one

– guaranteed

– immediate

Run as Roles defines a execution security role

Setting Event Delivery Consistency

After you have selected the event you want, you can set the level of delivery consistency for the event in addition to desired filters. The following delivery consistency levels are available:

• one and only one: Events are delivered to the subscriber in its own global (JTA) transaction. Changes made by the subscriber within that transaction are committed after event processing has completed. If the subscriber fails, the transaction is rolled back. Failed events are retried a configurable number of times before being delivered to an error queue.

• guaranteed: Events are delivered to the subscriber asynchronously without a global transaction. The subscriber can create its own local transaction for processing, which is committed independently of other event processing. The event is guaranteed to be handed to the subscriber. However, because there is no global transaction, a system failure can cause an event to be delivered multiple times. If the subscriber throws an exception (fails), the exception is logged, and the event is not resent.

• immediate: Events are delivered to the subscriber on the same transaction and thread as the publisher. The publisher call does not return until all immediate subscribers have completed processing. If any subscribers throw an exception, no additional subscribers are invoked and an exception is thrown to the publisher.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 214: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 12

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

Publishing an Event from a Mediator Component

• On the Mediator Editor, create a Static Routing Rule.

• On the Select Type, choose Event and select the event.

1

The Mediator component shows the published icon

and event names

2

3

Publishing an Event from a Mediator Component

To publish an event from a Mediator component, perform the following steps:• After opening the Mediator Editor, for a selected operation click the Create (+) icon and

select “Static routing rule.”• On the Target Type window, click Event.• On the Event Chooser window, browse for an existing EDL, or create a new EDL file, with

events to be published. Select the event entry to be published, and click OK.

Note: In the Mediator Routing Rule properties the event icon appears next to the target field, and the event name is formed by concatenating the string Event:: to the event name, for example Event::Event1. In the Composite Editor window, the Mediator component icon has a Published Events icon (a lighting within a blue circle) on the left edge as a visual indicator for published events. The name of the published events appears inside the Mediator component icon. A Mediator component can publish more than one event. Each event is published in its own Routing Rule definition.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 215: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 13

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

Initiating a Composite with ADF-BC Events

ADF application

Entity object

Business Event

EDL XSD

ADF-BC-Project

src

package-name

events

Composite-Project

SOA Composite

EDL XSD

publish

Subscribe

Mediator

Copied

CreatesSubscribe

1

2

3

4

Initiating a Composite with ADF-BC Events

You can create Application Development Framework (ADF) business component (BC) event conditions that can be subscribed to by a Mediator component. The slide illustrates the following steps to perform this task:

1. Create or open a business component project.2. Locate and edit an Entity Object, and select the Business Events tab and create a business

event definition to the project.Note: This action generates an EDL file and an XSD file. The XSD file contains the definition of the payload. Ensure also that you specify that the event be raised by the ADF-BC upon creation.

3. Create an SOA Composite with an empty composite application.4. In the SOA Project composite, create a Mediator component as the subscriber to an event.

In the Event Chooser window, select the event by selecting the EDL file, from the ADF-BC project in which it was created (or the Metadata Store if deployed), and select the event or events to be subscribed.Note: When you select the EDL file containing the event definitions JDeveloper copies the EDL and associated XSD files into SOA Project of the subscribing component.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 216: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 14

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

Publishing an ADF-BC CRUD Event

3

4

2XML Payload

5

1

Publishing an ADF-BC CRUD Event

An ADF-BC Entity Object represents a database row instance, You can publish events for the Create, Update, and Delete operations performed on a database row through the Entity Object. In an ADF-BC model project) the Entity Object is located under the Application Sources folder. To create and publish an CRUD event for the Entity Object:

1. On the Application Navigator, double-click the Entity object (EO) to open the Entity Object editor.

2. On the Entity Object editor window, click the Business Events tab and click the “Create new event definition” (+) icon in line with the Event Definitions heading.

3. On the Create Business Event Definition window, enter a name for the event, and click New for each Entity Object attribute you want to include in the event payload. Click OK to create the event and it appears in the Event Name table in the Event Definitions section.Note: In the example New is disabled, because there are no more attributes to be added.

4. On the Business Events tab, click the “Edit event publications” (pencil) icon next to the Event Publication heading.

5. On the Edit Event Publications window, click New and select the Event and Event Point (the operation: Create, Update, or Delete) for the event being published.

After saving the Business Events setting the following two files are created in the project:• An Event Definition Language (.edl) file with event definitions• An XML Schema Definition (.xsd) file associated with the .edl file

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 217: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 15

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

Summary of ADF-BC CRUD Events

A definition of an ADF Business Event comprises:

• Creating an event definition with:– The event name

– The event payload

• Publishing the event– Associating the event name with one of these event points:

— Create: When a new entity is made

— Update: When a change to an existing entity is made

— Delete: When an existing entity is removed

– Defining optional event conditions (to filter event points based on payload values)

• Delivering the event at run-time occurs when a commit operation is executed by the ADF-BC application

Summary of ADF-BC CRUD Events

As we have seen the creation of business events in an ADF application requires that you create the events and publish them from the Entity Object Business Events settings. The EDL and XSD files created for the business event definitions are stored in the ADF-BC project, and can be deployed to a shared location, such as the Metadata store.

A subscriber to the events must locate the EDL file and copy them to its own project. This is done automatically by JDeveloper when you browse and select the EDL file in the subscribing component event definition.

Note: At run-time, the event point occurs when an entity object is created, updated, or deleted. However, the actual delivery of the event is performed when the ADF-BC application executes a commit operation. If a commit is not performed by the ADF-BC application the event is not delivered.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 218: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 16

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

Emulating Events in a Test Case

A test case, in a test suite, can emulate publishing an event, by using the Emulate Event Message icon in a test case window.

1

2

Emulating Events in a Test Case

The unit test framework enables you to create a test cases, in a test suite, that publishes an event to a subscriber component, such as a Mediator component. The steps to emulate an event are:

• On a test case XML editor window, click the Emulate Event Messages icon in the test case XML file window.

• On the Event Messages window, select the event to be emulated from the Events section (on the left of the window), and select the target subscriber component from the Publish Event To drop down list. Generate, manually enter, or load a XML value for the event payload, and click OK.

The test case can be executed in the same way as other test cases, by using Enterprise Manager Fusion Middleware Control.

Note: An error message window is displayed if you attempt to create an event emulation in a composite application without event definitions.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 219: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 17

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

Quiz

Which of the following can publish events?

a. BPEL component

b. ADF-BC application component

c. Mediator component

d. Human Task component

Answer: b, c, d

An ADF-BC component can be configured to publish events for its CRUD operations, which are:

• Create, when data is inserted• Read (retrieve), when data is queried• Update, when data is updated• Delete, when data is deleted

The other component that can publish events is the Mediator component. The Oracle Fusion Middleware Developer’s Guide for Oracle SOA Suite 11g Release 1 (11.1.1) documentation in section 25.3.10.5.2 discusses how the Human Task component can create and generate business events, and how a Mediator component can subscribe to these events.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 220: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 18

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

Managing EDN in Enterprise Manager

The Business Events page:

• Is found in Oracle Enterprise Manager Fusion Middleware Control with tools for tracking, testing,and managing events in the EDN

• Can be accessed fromthe soa-infra folder or theSOA Infrastructure menu

Managing EDN in Enterprise Manager

Oracle Enterprise Manager Fusion Middleware Control provides a Business Events page that can be accessed to manage, track, and test events in the EDN. After you log in to Oracle Enterprise Manager Fusion Middleware Control, to access the Business Events page you must expand the SOA folder in the Farm navigator and either:

• Right-click the soa-infra node, and click Business Events, or• Click the soa-infra page, to open the soa-infra page, click the SOA Infrastructure >

Business Events.O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 221: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 19

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

Viewing Events in Enterprise Manager

1

2

Viewing Events in Enterprise Manager

The slide shows the Business Events home page displayed when you select the Business Events menu option from the soa-infra context menu, or the SOA Infrastructure menu in the soa-infra home page. The Business Events page gives you visibility of all the events in the SOA Infrastructure EDN by:

• Clicking the Events tab, to view event definitions, as shown in the example. To do so:1. Select an event entry, and click Show Event Definition.2. On the XML Definition window, view the XML syntax for the event, and click OK.

• Clicking the Subscriptions tab, to create database subscriptions (see the slide titled “Subscribing to Database Events.”).

• Clicking the Faults tab, to view faults related to events published on the EDN.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 222: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 20

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

Testing Events with Enterprise Manager

On the Events tabbed page:

1. Select the event to be tested, and click Test.

2. In the Test Event window, enter an XML payload and click Publish.

1

2

Testing Events with Enterprise Manager

While in the Events tabbed page, you can:1. Select an event and click Test. This opens a Test Event window.2. On the Test Event window, you can enter the XML data needed to form the event payload

you wish to test. This initiates any application subscribing to the event being tested.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 223: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 21

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

Subscribing to Database Events

1

3

2

Subscribing to Database Events

To subscribe to a database event, a PL/SQL procedure must exist to be used as a database agent. In the example a PL/SQL database agent does not exist. However, the subscription steps are:

1. Selecting an event and clicking Subscribe.On the Create Database Subscription window:2. Clicking the magnifying glass icon to select the PL/SQL procedure as the database agent.3. Setting Subscription Properties, such as the Consistency Level and an XPath Filter.

Click Subscribe. The Consistency Level options are:- Immediate, enables events to be delivered to the subscriber on the same transaction

and thread as the publisher. The publisher call does not return until all immediate subscribers have completed processing. If any subscribers throws an exception, no additional subscribers are invoked and an exception is thrown to the publisher.

- Guaranteed: enables events to be delivered to the subscriber asynchronously without a global transaction. The subscriber can choose to create its own local transaction for processing, but it is committed independently of the rest of the event processing. The event is guaranteed to be handed to the subscriber. However, without a global transaction, it is possible for a system failure to cause an event to be delivered more than once. If the subscriber throws an exception (or fails in any way), the exception is logged, but the event is not resent.

Note: The Create Database Subscription window can be accessed from either the Events or the Subscriptions page.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 224: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 22

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

Viewing Event Subscriptions

Click the Subscriptions tab, search for and view different typesof subscriptions.

Viewing Event Subscriptions

The subscriptions tab page, enables you to display and search for information about all subscriptions, and also create database subscriptions (although the screenshot has collapsed the Database Subscriptions section). However, in the example you can see the Search section and some of the options that enable you to search for different Subscription Types: such as:

• Database Subscriptions, to narrow the search result to database subscriptions• Component Subscriptions, to narrow the search result to components subscriptions• Database and Component Subscriptions, the default setting

In the Component Subscriptions section, a table lists the events and the components and their owning composite application subscribing to the event, the event consistency settings, and number of delivery failures if any. This enables you to quickly monitor the state of events in the EDN.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 225: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 23

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

Viewing Event Faults

Click the Faults tab, and enter search criteria to locate event faults of interest.

Viewing Event Faults

To view details about event faults, in the Business Events page, click the Faults tab. In the Faults tab you are able to search for specific faults and view faults and their error messages (if any).

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 226: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 24

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

Quiz

What does EDL mean?

a. Event Description Language

b. Event Definition Language

c. Event Documentation Language

Answer: b

EDL means Event Definition Language.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 227: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 25

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

Summary

In this lesson, you should have learned how to:

• Describe business events

• Describe the Event Delivery Network

• Explain the Event Delivery Network Configuration

• Create a business event

• Publish an event

• Subscribe to an event

• Emulate an event message

• Manage events in the Enterprise Manager Fusion Middleware Control

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 228: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 16 - 26

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

POProcessing Composite

Practice 16 Overview: Publishing and Subscribing to an Event

This practice covers the following topics:

• Publishing an event when updating product inventory stock counts by using a composite application

• Subscribing to the product update event to fulfil orders waiting for stock to become available

AddStockToStore Composite

fulfillment_clientUpdate

Stock BPELPublish Update Event Mediator

FulfillWaitingPO Composite

Subscribe Update Event Mediator

Fulfill Waiting Orders BPEL

Fulfillment BPEL

Event:StockUpdate[productID]

Fulfillment Service

publish

subscribe

invoke

Practice 16 Overview: Publishing and Subscribing to an Event

The aim of this practice is to create and implement event publication and subscription in the application. To implement the business requirement to manage the fulfillment of waiting orders:

• Copy the AddStockToStore composite application project folder, from the D:\labs\files, into the POApplication workspace in the D:\labs\mywork\POApplication folder. You modify the composite application to publish a stock update event containing the product ID of the stock item updated.Note: When updating the AddStockToStore project you create the event definition language files and XML schema.

• Copy the FulfillWaitingPO composite application project to the POApplication workspace, and modify it to subscribe to the stock update event. You first test that an event is delivered from the AddStockToStore composite application to the FulfillWaitingPO composite application. You then modify the FulfillWaitingPO composite application to invoke a new Fulfillment BPEL component entry point that you create in the POProcessing composite application,.

Note: Creating the new Fulfillment BPEL process entry point, in the POProcessing composite application, requires that you its flow to determine if the internal order received has a waitingstatus, and if so, you use a Bind Entity activity to retrieve an existing order, instead of inserting an order that is already present.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 229: D53946GC20_sg2

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

Monitoring Composite Applications with Sensors and Oracle BAM

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 230: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 2

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

Objectives

After completing this lesson, you should be able to:

• Create and configure BPEL sensors

• Create and configure Composite sensors

• Publish sensors with a Database Sensor Action and an BAM Sensor Action

• View BPEL sensor information in a BAM Dashboard

• Explain the role of Complex Event Processing

Objectives

You already have an important milestone for your project, that is you have a completed application that processes orders, fulfills orders, and handles events to process orders waiting for fulfillment. You are ready to roll out the application into the business when the CEO of your company has requested the ability monitor and track the order totals and report in real time on the volume of sales for orders paid by credit card and those paid by other means.

You now find yourself looking for techniques to monitor business activity flow and track the changes to orders as the data flows through the composite applications you have created.

To assist you with resolving the request to track order information in real time, you are introduced to Oracle Business Activity Monitoring (Oracle BAM) as an Oracle SOA Suite 11gcomponent that can provide the real-time monitoring requirements you need to address.

You also learn how to use the BAM Adapter and BPEL Sensors with a BAM Sensor Action in your composite application to send order data changes in real-time to an Oracle BAM server instance.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 231: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 3

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

What Are Sensors?

Sensors are:

• Listening points to monitor process activities, variables, and faults at run time

• Published to various publish types

• Used to monitor business activity

Activity Sensor icon indicator Evaluation time

Publish types

What Are Sensors?A sensor is an Oracle construct that enables users to monitor key execution points or data in their BPEL process. There are three types of sensors:

• Activity sensors: monitor the execution of activities within a BPEL process. For example, they can monitor the execution time of an Invoke activity or how long it takes to complete a scope. Along with the activity sensor, you can also monitor variables of the activity.

• Variable sensors: monitor BPEL process variables (or part of its contents). For example, variable sensors can be used to monitor the input and output data of a BPEL process.

• Fault sensors: monitor BPEL faultsSensors are associated with sensor actions that can send data to the following publish types:

• Database: Writes sensor information in BPEL Reports to a database schema• JMS Queue or JMS Topic: Publishes data to a JMS destination. You must specify the

queue or topic name and the connection factory details. • Custom: Publishes data to a fully qualified Java class, which implements the DataPublisher

interface. The sensors are published as XML, and also as a schema object.• JMS Adapter: Writes sensor data to any JMS destination

Note: A BAM Sensor Action (not shown in the slide) can be created to send information to a BAM Data Control in an Oracle Business Activity Monitoring (Oracle BAM) server that enables the data to be visualized in a BAM Report (Dashboard). BAM Sensor Actions are discussed on the page titled “Creating a BAM Sensor Action.”

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 232: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 4

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

Creating BPEL Sensors

BPEL Activity, Variable, and Fault Sensors can be created in the Sensors tab of a BPEL Activity or Variable property window or through the Sensors tree ofthe Structure pane. 1

3

4

2

Creating BPEL SensorsTypically, you add or edit sensors during design and modeling of activities, faults, and variables in a BPEL process. In general, to create a BPEL Activity or Variable Sensor:

a. Edit the activity or variable to open their properties window,b. On the properties window, click the Sensors tab, and click the Create icon.

Alternatively, you can create an Activity, a Variable, and a Fault sensor by expanding the Sensor folder in the Structure pane, select the folder for the type of sensor to be added, and click the Create icon. In the slide, an example of an Activity Sensor is shown in the Create Activity Sensor window, in which following four components of a sensor have been configured:

1. The sensor Name which is used to track the sensor information in Sensor sections of the BPEL Process component Audit Trail pages in Oracle Enterprise Manager.

2. The Evaluation Time to configure when the sensor action is processed. Choices include: Activation (shown in the slide), Completion, Fault, Compensation, Retry, and All.

3. The Activity Variable Sensor configure the data values being monitored. Click the Create icon to add a variable or XPath expression for an XML fragment on a variable to the list.

4. The Sensor Actions to publish the sensor information. Click the Add icon to create one or more sensor actions for each sensor.

Note: Sensor actions can be added by right-clicking the Sensor Actions folder in the Structure pane, and selecting Create > Sensor Action or Create > BAM Sensor Action.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 233: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 5

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

Configuring BPEL Sensors

1

23

4

5

7

8

6

Configuring BPEL SensorsAs an example, to add a sensor to the receiveInput activity in the ApproveCCOrder BPEL process, perform the following steps:

1. On the BPEL Diagram window, to edit the receiveInput activity double-click its icon, and on the Receive property window, click the Sensors tab and click the Create icon.

2. On Create Activity Sensors window, after entering the name, selecting the Evaluation Time (Completion in this case), in the Activity Variable Sensors section, click Create.

3. On the Create Activity Variable Sensor window, click the Variable XPath Builder icon.4. On the Variable XPath Builder window, expand the Variables tree, select the variable

(such as inputVariable) or an element inside a variable, and click OK. This populates the Create Activity Variable Sensor window, in which you click OK to add the variable to the Activity Variable Sensors section in the Create Activity Sensor window.

5. Create Activity Sensor window, in the Sensor Actions region, click Add.6. On the Sensor Action Chooser window, select the Sensor Actions folder and click Create >

Sensor Action. 7. On the Create Sensor Action window, set the Sensor Action name, select the Publish Type

(for example Database), and enter remaining fields as appropriate, then click OK.8. On the Sensor Action Chooser window, select the new Sensor Action name, click OK.

Note: The Publish Type you can choose are Database, JMS Queue, JMS Topic, Custom, and JMS Adapter for saving or storing sensor information. The BAM Sensor Action cannot be created until you have a variable sensor, and must be created in the Structure pane. A BAM Sensor Action cannot be created in the Sensor Action Chooser window.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 234: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 6

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

Sensor Files

Sensor files added to the composite application project include:

• Various XML Schema Document files for sensor configuration

• For each BPEL process with sensors the following files:– A bpel_process_name_sensor.xml file, which contains

the sensor definitions– A bpel_process_name_sensorAction.xml, contains

the sensor action definitions

Note: The text bpel_process_name in the file names are replaced with the name of the BPEL process.

Sensor Files

When you model sensors in Oracle JDeveloper, in addition to the XML Schema files created for sensor definitions, the following two files are created for each BPEL process configured with sensors:

• The bpel_process_name_sensor.xml file, which contains the sensor definitions of a BPEL process. For example: ApproveCCOrder_sensor.xml contains the activity, variable, and fault sensor definitions for the ApproveCCOrder BPEL process.

• The bpel_process_name_sensorAction.xml file, which contains the sensor action definitions of a BPEL process. For example:ApproveCCOrder_sensorAction.xml contains the sensor action added toApproveCCOrder BPEL process.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 235: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 7

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

Composite Sensors

Composite sensors:

• Provide a method for implementing tracking fields on messages

• Support monitoring of incoming and outgoing messages

• Can be located using the Instance page search functions in the Enterprise Manager Fusion Middleware Control

• Are defined on service and reference binding components

• Are persisted to the SOA database schema by using the predefined DBSensorAction

Composite Sensors

Composite sensors provide a method for implementing tracking fields on messages.

You use Composite sensors to perform the following tasks:• Monitor incoming and outgoing messages.• Specify composite sensor details in the search utility of the Instances page of an SOA

composite application in Oracle Enterprise Manager Fusion Middleware Control Console. This action provides you with a way to locate a particular instance.

You define composite sensors on service and reference binding components in OracleJDeveloper. This functionality is similar to variable sensors in BPEL processes. During runtime, composite sensor data is persisted in the database.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 236: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 8

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

Creating a Composite Sensor

A variable or part thereof, an XPath expression, or a

normalized message property header expression

2

3 4

5

1

Filter expression

Sensor indicator icon

Creating a Composite Sensor

To create a composite sensor in the SOA Composite Editor, perform the following steps:1. Click the Composite Sensor icon in the SOA Composite Editor toolbar.2. On the Composite Sensor window, select an exposed service or reference name in the

Service or References folder, and click the Create Composite Sensor icon.3. On the Create Composite Sensor window, enter a name for the sensor, click the Create

Expression icon and select Variable, Expression, or Properties to form an expression to select the data values monitored by the sensor. The Variables and Expression options operate on the message structure for the selected service or reference operation, and the Properties monitors message header properties associated with the payload.

4. On the Select XPath Expression, select a variable or part of the message. For Expressions, functions can only be used with the payload, and XPath functions such as concat cannot be used with properties. Header-based sensors are only supported for Web service bindings. Composite sensors with expressions capture values as strings.

5. Optionally, click the icon to create a filter expression.

Note: Sensor values can only be one of the following types: STRING, NUMBER, DATE, DATE_TIME. Complex XPath expression for filtering should return a node set explicitly cast as a string. Composite sensors only support the predefined DBSensorAction, which is similar to the BPEL Database Sensor Action.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 237: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 9

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

Creating a Composite Sensor

To create a composite sensor for an exposed (or referenced) service:

1. In the Composite Editor window, right-click the exposed (or referenced) service icon, and select Composite Sensors.

2. In the Composite Sensors dialog box, click the “Create new Composite Sensor” icon.

21

Select the operation for the exposed (or referenced) service

if there is more than one

Creating a Composite Sensor

The slides shows the screenshots and lists the steps for creating a composite sensor for a specific service or reference to a service. These steps produce the same results as the previous page also titled “Creating a Composite Sensor.”

In the example shown, the fulfillment_client exposed service is an asynchronous service that provide the process (request) operation and the processResponse (callback) operation. The example highlights that you must ensure you select the appropriate operation for the sensor you create. In the Create Composite Sensor dialog box, all other fields are identical to those discussed on the previous page.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 238: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 10

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

Quiz

BPEL Sensors can be created only for variables and activities.

a. True

b. False

Answer: b

You can create BPEL sensors for variables, activities, and faults.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 239: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 11

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

Overview of Business Activity Monitoring

Business Activity Monitoring (BAM):

• Sits between the historical and analytical focus of BI and the forward business planning of Corporate Performance Management

• Focuses on what is happening, not what has happened or might happen

“Has happened” “Happening” “Could/should happen”

BI (analysis and reporting)

BAM CPM(forecasting and data mining)

In real-time

Overview of Business Activity Monitoring

BAM sits between the historical data that feeds the analytical focus of business intelligence (BI) and the forecasting and data mining involved in Corporate Performance Management (CPM). An example of this relationship can be the issuing of loans:

• BAM can tell us what the current state of the orders being processed is and how many orders are at each stage of the process, like initial, waiting, approved, rejected, or completed.

• BI can tell us about the value of the orders, how much money has been made, and in which market segments they have been made. Analysis can be done on the risk and exposure.

• CPM can be used to guide planning—identifying where an organization wants to go and the steps to achieve goals, that can direct company activity toward specific areas.

As a BAM server tracks operational events, it maintains these events in a cache that is used by a reporting and analysis engine running under the control of the BAM server. The analysis engine can access existing BI and data warehouse information. This allows BAM to put the operational events being tracked into a business context and produce scorecards of operational business performance. The BAM environment, however, also provides the ability to do more detailed analysis and mining of information in the analytics engine.

Note: The key benefit of a BAM environment is that operational processes can be monitored and exceptions acted on in close to real time.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 240: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 12

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

Introduction to Monitoring with Oracle BAM

RFID and sensors

Security

Database

System management

Business Process Management

Messaging

systems

Business applications

Introduction to Monitoring with Oracle BAM

Oracle Business Activity Monitoring (BAM) is a powerful software tool to capture real-time data to analyze business processes, trends, data, and context. Oracle BAM can be used to monitor:

• Business applications to track business events and state transitions• Sensors, such as those from BPEL processes, to monitor active and passive business events

and data• Radio-frequency identification (RFID) information such as location, temperature,

moisture, and motion among others• System management data for performance metrics and analysis of data logs

Oracle BAM provides some of the following ways to efficiently collect data for real-time reporting and analysis:

• Through Web Service interfaces that can be accessed by composite application components that use the BAM Adapter

• Through JMS topics and queues that can leverage different messaging systems, such as Java Message Service (JMS), MQSeries, and through Oracle Database Streams Services

• Through a BPEL Process component that can send sensor data directly to Oracle BAM through a BAM Sensor Action.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 241: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 13

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

Interfacing with Oracle BAM

Key features:

• Event capture

• Correlation, metrics,and KPI

• Real-time dashboardsand alerts

• Web Service interfacesand JMS messaging

Composite Application

Database

JMSBPEL

BAM AdapterMediator

BAM Sensor Action

BAM report (dashboard)

Interfacing with Oracle BAM

As already discussed earlier in this lesson, the BPEL Process designer enables you to add sensors and sensor actions to BPEL process activities that enable the BPEL Process to monitor events and components associated with each activity. A BPEL Process component can interface with Business Activity Monitoring (BAM) through:

• The BAM Sensor Action from a BPEL component• The BAM Adapter from a Web client• The JMS publish type that uses a Java Message Service (JMS) from a BPEL Sensor Action• The ADF-BC BAM Data Control from ADF applications

Oracle BAM provides a modeling tool to create reports, called real-time dashboard, that can be configured with alert facilities based on data collected from providers that store the sensor monitor information in the BAM Server through the various interfaces provided. Oracle BAM Active Studio is a report modeling tool that enables:

• Capturing of events• Producing correlation metrics and key performance indicators (KPIs) that are meaningful

to the business

Sensor data can be viewed and monitored in real-time in the BAM Active Viewer, or the BAM Active Studio.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 242: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 14

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

Oracle BAM Tools and Roles

Oracle BAM tools are accessed through the Oracle BAM Web application at http://localhost:9001/OracleBAM

Data Designer

Business User

System Administrator

Power UserView reports (dashboards)

Design and edit reports

Design and manage data objects

Manage and administer BAM server

BAM tools are supported in the Internet Explorer Web browser

Oracle BAM Tools and Roles

Oracle BAM offers the following four tools, each catering to the needs of four different users.• Architect (data designer): The Architect tool is used by a data designer who creates data

objects in the BAM Server so that power users can create reports based on data added to data objects. The Architect, enables data designer to maintain data objects, rules, and data.

• Active Studio (power user): Through Active Studio, the power user can create and edit reports. Report definitions include data object and field selection, formatting, and filtering, calculated fields, and field summaries. Reports can be published and rules created to determining the scheduling and delivery of the reports. Report display formats include bar-chart, 3D pie-charts, updating lists (tabular format), cross-tab, spreadsheet, among others.

• Active Viewer (business user): A business user uses Active Viewer to monitor and view pertinent information represented by reports created in the Active Studio. BAM can be configured to send a business user an instant message with link to the report, that can be opened in the Active Viewer.

• Administrator (system administrator): The system administrator manages and configures the BAM Server through the Administrator tool, which enables adding or deleting users, defining security levels for users and objects, and managing the BAM Server data.

Note: All these functions are performed through the Internet Explorer Web browser interface.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 243: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 15

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

BAM Architect

BAM Architect is used to:

• Define and maintain data objects

• Add security filters to data

• Define and maintain Enterprise Message Sources

• Build and maintain alerts

2

1

4

5

3

BAM Architect

BAM Architect is primarily used to define and maintain data objects. Architect is also used to add security filters to data so that only specific users can view certain data. One can also define and maintain Enterprise Message Sources for data to be added to data objects in the Active Data Cache (ADC) in the BAM Server. Architect can build and maintain alerts, which can be used to identify important changes in information.

Note: The Active Data Cache is a high-performance, persistent, memory-based storage system, designed to support active data and monitoring, and stores real-time data in memory and an internal repository. It contains the data that populates data objects defined in the BAM Server.

The slide shows the key steps needed to create and view a data object:1. On the Oracle BAM home page, click Architect2. On the BAM Architect page, you can create folders for data objects. To create a new data

object click the Create Data Object link (which can also be done after selecting the folder).3. On the Create Data Object page, you can enter the name and change the folder location

where the object will reside, and click the “Add a field” link to define the structure of the data object contents. The slide does not show a sample definition of the Orders data object.

4. On the BAM Architect page, navigate to the folder containing the data object, click the data object name link, such as Orders, and click the Layout link to edit the data object.

5. On the Data Object Contents page, view and modify data object values in the ADC.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 244: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 16

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

BAM Active Studio

BAM Active Studio is used to:

• Design reports, dashboards, and alerts

• Share reports with other users

• Create alert rules for report delivery

2

1

43

BAM Active Studio

BAM Active Studio is used by power users to create and edit reports, called dashboards. As shown in the slide, the basic steps to create a report definition are:

1. On the Oracle BAM home page, click Active Studio2. On the BAM Active Studio page, click the My Reports or Shared Reports tab to choose if

the report is private or shared. Then create or navigate to the folder for the new report, and click Create A New Report.

3. On the BAM Active Studio page, in the right window pane you can select the report layout from many different choices. The example shows selecting the “Two vertical tiles” layout, which opens that report structure in the same pane.

4. On the BAM Active Studio page, in the right window pane, enter a title for the report, such as “My Report,” and in each section (vertical tile in the example) you can define different display types, such as a Bar Chart in the left tile, and (as shown in the slide) a 3D Pie Chart in the right tile.

Note: After selecting a chart display for a report tile, a wizard guides through steps that enable you to select data object and fields used to control the display results, the formatting, filtering, if you wish to add calculated and summary fields to the report. Reports can be published and rules created to determining the scheduling and delivery of the reports. The chart in each tile can display data from the same or different data objects.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 245: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 17

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

BAM Active Viewer

BAM Active Viewer is used to:

• View predefined reports and alerts

• Personalize the delivery channel

2

1

4

3

BAM Active Viewer

The Active Viewer is intended for business users to monitor and view pertinent information represented by reports created in the Active Studio. The administrator can configure Oracle BAM to send a business user an instant message with a link to the report, which can be opened in the Active Viewer. To select and display a report in a Web browser, perform the following steps (as shown in the slide):

1. On the Oracle BAM home page, click Active Viewer.2. On the BAM Active Viewer page, click Select Report.3. On the “Select a Report – Webpage dialog” dialog box, use the Look In field and icon to

navigate to the folder where the report is stored, select the report and click OK.4. On the BAM Active Viewer page, the selected report is opened and is actively updated

with information that is stored in the associated data objects. The report is updated in real-time as new data is added to, and existing data updated in, the data objects used by the report definition.

Note: The Personalize button opens a window where you can set time zone, report loading indicator, and print preferences. The example POProcessing Orders report displays the results for a single row in the Orders data object that supplies the data for the three tiled window layout used for the report. In the report, the top tile contains a Updating Ordered List, the left tile contains a 3D Pie Chart, and the right tile contains a 3D Bar Chart.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 246: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 18

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

BAM Administrator

BAM Administrator is used to:

• Manage users and roles

• Create distribution lists to send alertsand reports

Note: Oracle University provide Oracle BAMspecific training courses.

BAM Administrator

The system administrator manages and configures the BAM Server through the Administrator tool, which enables adding or deleting users, defining security roles for users and objects, and managing the distribution lists for alerts and reports. To use the Administrator tool, perform the following steps:

1. On the Oracle BAM home page, click Administrator.Note: The first time you access the Administrator tool you are prompted to login with valid credentials. By default, the WebLogic Server administrator username and password is registered as a valid BAM Administrator user.

2. On the BAM Administrator page, from the pull-down menu select the management function you wish to perform, such as “User management.”

Note: Oracle University provides a course titled “Oracle Business Activity Monitoring: Build Real-Time Dashboards” (for Oracle SOA 10g release) and “Oracle Business Activity Monitoring 11gR1: Build Real-Time Dashboards” for detailed training for the Oracle BAM product.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 247: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 19

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

Preparing an Oracle BAM Dashboard

To create a BAM Report (dashboard) for use in the active viewer, perform the following steps:

1. Use BAM Architect to create the data object.

2. Use BAM Active Studio to create the report that obtains data from the data object.

Note: Alternatively, use the ICommand tool to import the data object and report definitions from an XML file.

Preparing an Oracle BAM Dashboard

To create a BAM Report (dashboard) to view information, such composite sensor data, in real-time requires using the following Oracle BAM tools:

• The BAM Architect to create a BAM data object structure to store data received from external sources, and for the Active Studio to create its report definitions.

• The BAM Active Studio to create and design reports that display data stored in associated data objects in real-time. The BAM data objects must exist prior to creating the report definitions.

As an alternative to the using the above two tools, you can use the ICommand command line tool to import data object and report definitions from XML file. The course practice makes use scripts that execute the ICommand command line tool.

Note: Oracle BAM tools can be accessed after logging into the Oracle BAM Web application at http://localhost:9001/OracleBAM.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 248: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 20

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

ICommand Utility

BAM ICommand is an application that:

• Performs import and export functions with a BAM Server

• Reads and writes files in XML format

• Generates files for archiving or source control

• Simulates data input (with delay)

• Runs as a command-line tool or Web service

ICommand Utility

BAM ICommand is a command-line utility and Web service that provides a set of operations that are performed in the BAM Server. Commands may be supplied from an input XML file, or provided on the command line. For example, ICommand is useful for exporting information to re-create problems for support incidents and to migrate definitions and data between systems.

ICommand is also available as a Web service for application developers who want to interact with ICommand features over HTTP. You can use the ICommand Web service to delete a data object, create a user account, import rows into a data object, export a report, and run a plan.

To access the ICommand Web service use the following URLs: http://<host>:<http_port>/oraclebam/services/ICommand.asmx

In addition, a WSDL document describing the Web service can be found at: http://<host>:<http_port>/oraclebam/services/ICommand.asmx?WSDL

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 249: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 21

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

Importing and Exporting with ICommand

Use ICommand to:

• Import a data object defined in an XML file:

• Import a data object by using an XML command file:

The XML command file for the import operation is:

Note: Supply a password when prompted by the command.

ICommand -cmdfile po-import-cmd.xml -domain soa_domain-username weblogic

<?xml version="1.0" encoding="utf-8"?><OracleBAMCommands continueonerror="1">

<Import file="po-orders-dco.xml" /></OracleBAMCommands>

ICommand –cmd import -domain soa_domain-file po-orders-dco.xml -username weblogic

Importing BAM Components with ICommand

The command line parameters for ICommand are in the form of -name value pairs. Values containing spaces and other special characters must be enclosed in double-quotes. For example, to export a data object the command is:ICommand -cmd export -file po-orders-dco.xml -type dataobject

-domain soa_domain -username weblogic-name "/Training/POProcessing/Orders"

Using an XML command file, the operation is specified by the XML element name. For example, to import a data object defined with an XML command file use the following command:ICommand -cmdfile po-export-cmd.xml -domain soa_domain

-username weblogic

The contents of the XML command file for the export operation is:<?xml version="1.0" encoding="utf-8"?>

<OracleBAMCommands continueonerror="1“><Export name="/Training/POProcessing/Orders"

file="po-orders-dco-sample.xml" contents="1" /></OracleBAMCommands>

Note: On Linux the ICommand utility is entered as icommand (in lowercase.)

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 250: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 22

Importing BAM Components with ICommand (continued)

Note: To run ICommand set the JAVA_HOME environment variable to the folder containing the JDK. The folder SOA_HOME\bam\bin contains the ICommand tool (a script), where SOA_HOME is where Oracle SOA Suite 11g software has been installed. Since the password cannot be supplied as a command line parameter you are prompted to enter the password when the command is executed.

The following XML data is a representation of the contents of the po-orders-dco.xml file that defines the data object structure:<?xml version="1.0"?>

<OracleBAMExport Version="2024">

<DataObject Version="14" Name="Orders" ID="_Orders2“Path="/Training/POProcessing" External="0">

<Layout>

<Description><![CDATA[Orders information from SOA POProcessingComposite Application]]></Description>

<Column Name="Customer ID" ID="_Customer_ID" Type="string"MaxSize="20" …/>

<Column Name="Order ID" ID="_Order_ID" Type="integer" …/>

<Column Name="Payment Type" ID="_Payment_Type" Type="string"MaxSize="20" …/>

<Column Name="Shipping Choice" ID="_Shipping_Choice" Type="string“MaxSize="20" …/>

<Column Name="Order Total" ID="_Order_Total" Type="float" …/>

<Column Name="Status" ID="_Status" Type="string" MaxSize="20" …/>

<Column Name="Item Count" ID="_Item_Count" Type="integer" …/>

<Indexes/>

</Layout>

</DataObject>

</OracleBAMExport>

Note: Some of the <Column> elements have been trimmed for readability. For more information about ICommand and XML file formats refer to the appendix titled “Oracle BAM ICommand Operations and File Formats” in the Oracle Fusion Middleware Developer’s Guide for Oracle SOA Suite 11g Release 1 (11.1.1) documentation.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 251: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 23

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

Integrating Oracle BAM with the BAM Adapter

To feed information to Oracle BAM with a BAM Adapter, perform the following key steps in a composite application:

1. Create a BAM connection in the Application Resources.

2. Add and configure a BAM Adapter service reference, and select the target BAM data object to receive the data.

3. Wire the BAM Adapter to an existing component, such as the Mediator component.

4. Configure the component to copy (or transform) appropriate data to the message structure exposing the BAM data object.

Integrating Oracle BAM with the BAM Adapter

The slide lists the main steps to send data to Oracle BAM through the BAM Adapter in a composite application. Before you can configure the BAM Adapter, the BAM connection needs to be created as an Application Resource, that is, in the Application Workspace and not as an Integrated Development Environment (IDE) connection in the Resource Palette.

Creating a BAM Adapter is similar to creating other adapters, by dragging the BAM Adapter component into the External References column, and stepping through the Adapter Configuration Wizard. Refer to the pages titled “Creating and Configuring the BAM Adapter” in this lesson.

Note: In a BPEL Process component, you have the option of using the BAM Adapter or BAM Sensor Actions to send information to Oracle BAM. Using the BAM Adapter with a BPEL process requires that you create process flow activities to invoke the BAM Adapter as a service, whereas to use a BAM Sensor Action you create a Variable Sensor (or Activity Sensor) and set the Sensor Action to the BAM Sensor Action without altering the process flow.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 252: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 24

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

Creating a BAM Connection

2

1

3

4

Creating a BAM Connection

The slide illustrates the steps to create a BAM connection in the Application Resources of an application. The steps are:

1. On the JDeveloper Application Navigator window, click the Application Resources pane to expand it, right-click the Connections folder, and select New Connection > BAM

2. On the “BAM Connection Wizard – Step 1 of 3: Name” page, enter the Connection Name and ensure that Application Resources option is selected, and click Next.

3. On the “BAM Connection Wizard – Step 2 of 3: Connection” page, enter the connection details, such as the BAM Web Host, HTTP Port, BAM Server Host, JNDI Port, User Name, Password, and click Next.

4. On the “BAM Connection Wizard – Step 3 of 3: Test Connection” page, click Test Connection to ensure you see the Status value “Success” displayed, and click Finish.

The Connection Name you entered in “BAM Connection Wizard – Step 1 of 3: Name” page should appear under the BAM node of the Connections tree in the Application Resources pane.

Note: You must ensure the connection is created as an Application Resource, because the BAM Data Object Chooser window cannot use a BAM connection created in the Resource Palette.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 253: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 25

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

Creating and Configuring the BAM Adapter

Drag a BAM Adapter into the ExternalReferences column, and step throughthe Adapter Configuration Wizard.

2

1

3

Creating and Configuring the BAM Adapter

To create and configure a BAM Adapter in a composite application:1. Drag a BAM Adapter component from the Component Palette into the External

References. This action causes the Adapter Configuration Wizard to be displayed.2. On the “Adapter Configuration Wizard – Step 1 of 5” Welcome page, click Next.3. On the “Adapter Configuration Wizard – Step 2 of 5” Service Name page, enter the service

name, such as OrdersBAMAdapter, and click Next.

The remaining wizard steps are discussed on the next page.O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 254: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 26

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

Creating and Configuring the BAM Adapter

5

4

6

7

8

9

Creating and Configuring the BAM Adapter (continued)4. On the “Adapter Configuration Wizard – Step 3 of 5” Data Object Operation and Keys

page, next to the Data Object field, click Browse.5. On the BAM Data Object Chooser window, expand the BAM Data Object Explorer tree

for the BAM server connection you created in the Application Resources, and select a data object such as the /Training/POProcessing/Orders, click OK.

6. On the “Adapter Configuration Wizard – Step 3 of 5” Data Object Operation and Keys page, the Data Object field is populated with the selection from the BAM Data Object Chooser, select the Operation, either Insert, Update, Delete, or Upsert (as shown). Enter an Operation Name, and move the data object field that represents the key (such as _Order_ID is the unique ID) of a data object entry (instance or record). Click Next.Note: The Upsert operation performs an insert if an entry with the specified key does not exist, otherwise the entry is updated.

7. On the “Adapter Configuration Wizard – Step 4 of 5” JNDI Name page, enter the JNDI Name of a connection pool that matches the run-time server configuration. Click Next. Note: Refer to the pages titled “Configuring the Run-time OracleBamAdapter” for steps to configure the run-time JNDI resource for the eis/bam/soap JNDI resource name.

8. On the “Adapter Configuration Wizard – Step 1 of 5” Finish page, click Finish.9. The configured BAM Adapter icon appears in the External References column.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 255: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 27

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

Configuring the Run-Time OracleBamAdapter

To configure the OracleBamAdapter in WebLogic Administration Server Console:

1. In the Deployments, find OracleBamAdapter and configure eis/bam/soap JNDI name connection pool properties.

2. Restart the OracleBamAdapter.

21

3

4

Configuring the Run-Time OracleBamAdapter

When using the BAM Adapter in a design-time context, such as the Composite Editor or as a Partner Link in a BPEL Process, your design-time JNDI Name resource must match a corresponding JDNI Name resource whose connection pool properties have been configured in the run-time server environment. To configure run-time JNDI resource name properties for the BAM Adapter, you log into the WebLogic Server Administration Console Web application and perform the following steps:

1. On the WebLogic Server Administration Console home page, click the Deployments link in the Domain Structure pane.

2. On the Deployments page, click Next on top of the table of deployments until you located the OracleBamAdapter entry, and click the OracleBamAdapter link.

3. On the “Settings for OracleBamAdapter” page, click the Configuration tab, and then the Outbound Connection Pools tab.

4. On the Outbound Connection Pool Configuration Table page, expand the oracle.bam.adapter.adc.soap.SOAPConnectionFactory entry, and click theeis/bam/soap link.Note: There is a RMI-based connection pool that can be used for connections with the Oracle BAM Server. In this course you use the SOAP-based connection.

Remaining configuration steps are discussed in the next page.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 256: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 28

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

Configuring the Run-Time OracleBamAdapter

5

6

7

8

Stop and restart run-time BAM Adapter

Stop and restart run-time BAM Adapter

Configuring the Run-Time OracleBamAdapter (continued)5. On the Settings for oracle.bam.adapter.adc.soap.SOAPConnectionFactory page, click the

Properties tab and set the various properties as appropriate for your installation. TheHostName, PortNumber, UserName, and Password are set to match the your BAM Server configuration settings. Click Save after entering the property values, to display the Save Deployment Plan Assistant page.

6. On the Save Deployment Plan Assistant page, enter a path and file name for the new configuration settings, and click OK.

To restart the OracleBamAdapter with the new deployment settings perform the following remaining steps:

7. Return to the Deployments table, and click Next until you locate the OracleBamAdapterentry, select the check box next to the OracleBamAdapter entry and the click Stop > Force Stop Now option.Note: The Force Stop Now option is not a graceful termination. Therefore, if you wish to perform a graceful stop without affecting existing applications, click the Stop > “When work completes” option.

8. The stop action refreshes the deployments table, so that you need to click Next until you locate the OracleBamAdapter entry, select the check box next to the OracleBamAdapterentry and click the Start > “Servicing all requests” option.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 257: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 29

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

Using a Mediator Component with a BAM Adapter

To send data to Oracle BAM from a Mediator component:

1. Create a wire from a Mediator component to the BAM Adapter references

2. Create a routing rule transformation to supply the data for the data object

Note: In BPEL you can use an Invoke activity with a BAM Adapter partner link.

Using a Mediator Component with a BAM Adapter

To send data to Oracle BAM from a composite application you can use a Mediator component or a BPEL component wired to the BAM Adapter. Using the BAM Adapter with a BPEL process requires you change the process flow with activities process flow to invoke the BAM Adapter. In the case of a Mediator component you can simply edit the routing rule created for the corresponding wired target and create an appropriate filter (if required) and a transformation to provide data in the format expected by the BAM data object exposed through the BAM Adapter.

Note: The example shows a Mediator component, called EnrichPO, that is wired to a BAM Adapter, called OrdersBAMAdapter. The configuration settings for the routing rule transformation is not shown in the example.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 258: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 30

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

Creating a BAM Sensor Action in a BPEL Process

To send data from a BPEL Process for monitoring in Oracle BAM using sensors:

1. Create a variable (activity, orfault) sensor

2. Create a BAM Sensor Actionin the Structure pane

3. Configure the BAM Sensor Action with the sensor variable, the target BAM data object, an operation, and transformation (see next slide)

Note: A BPEL Process can use the BAM or JMS Adapter. Using sensors does not require additional BPEL activities.

Creating a BAM Sensor Action in a BPEL Process

As mentioned on the previous page, a BPEL Process can send data to Oracle BAM through the BAM Adapter, as a partner link. However, using the BAM Adapter requires the BPEL process flow to include appropriate activities. The best approach to send data to Oracle BAM from a BPEL Process component is to use the BAM Sensor Action.

Note: A BPEL Process can also use a Sensor Action with a JMS publish type, or a JMS Adapter. In either case, you need to configure JMS JNDI resources for JMS approaches.

The slide discusses using the BAM Sensor Action approach. Before you can create a BAM Sensor Action in JDeveloper, the following items should exist:

• A BAM Server connection, to select the BAM data object that receives sensor data• An activity, variable, or fault sensor to which the BAM Sensor Action can be applied

To create a BAM Sensor Action you must use the Structure pane for a BPEL process. The steps to create a BAM Sensor Action are:

1. In the Structure pane, right-click the Sensor Actions folder, and select Create > BAM Sensor Action.

2. In the Create Sensor Action window, configure the details applicable to the BAM Sensor action. The BAM Sensor Action configuration is discussed in the next page.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 259: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 31

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

Configuring a BAM Sensor Action

1

2

34

5

6

Requires a BAM Server Connection

Operations

Configuring a BAM Sensor Action

To configure BAM Sensor Action in the Create Sensor Action window specify:1. The Action Name for the sensor action, and the Sensor value, which is the variable

(activity, or fault) sensor named you created prior to creating the BAM Sensor Action.Note: If a sensor does not exist you are unable to complete this step.

2. The Data Object, which can be selected from the BAM Data Object Chooser, as shown in the slide, and then select a BAM data object through an existing BAM Server connection.

3. The Operation, which is Upsert (a merge operation), Insert, Update, or Delete. The Upsertoperation is effective for a scenario where you want to track changes to data, and are not sure when the initial instance is created.

4. The Selected Keys to uniquely identify a BAM data object instance for the selected operation. The unique key applies the selected operation to the data object instance identified by the key value supplied by the Map File transformation.

5 The BAM Connection Factory JNDI value, such as eis/bam/soap, which defines the run-time server connection pool used to send sensor data to the appropriate BAM server.

6. The Map File, should be created last by clicking the Create icon, which:- Opens the XSLT Mapper to define the XSL transformation to map BPEL data values

to their respective BAM data object fields- Saves values entered in other Create Sensor Action fields

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 260: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 32

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

Introduction to Complex Event Processing

Complex Event Processing (CEP):

• Combines Simple and Event Stream processing

• Correlates stream to relational data

• Monitors streams of events, correlates seemingly unrelated events into patterns and into relational data

• Optimized to handle very large volumes of events

• Implements Continuous Query Language (CQL) to process temporal event data

Introduction to Complex Event Processing

Generally speaking, an Event-Driven Architecture (EDA) embodies three basic approaches to event processing: simple event processing, event stream processing, and complex event processing (CEP). These three styles may even appear together in a mature EDA solution.

In simple event processing, events are directly related to specific, measurable changes of condition, generally with a 1-to-1 correlation. Simple event processing commonly applies to most real-time monitoring and processing systems.In event stream processing (ESP), the events from multiple sources are organized into streams for concurrent evaluation and processing of different types of events. A “stream” is a sequence of events of the same type. For example, a temperature sensor and a air quality sensor both generating events, which can be divided into event streams, to enable identifying a “fire” event only when a “overheating” condition on the temperature event stream and a “smoke” condition on the air quality event stream occur.

By combining the simple-event and event-stream processing, CEP makes use of a Continuous Query Language that can analyze continual streams of time-based (temporal) event streams that can be applied to applications in almost every industry, such as risk management, fraud detection, intrusion detection, to mention a few.

Oracle Complex Event Processing (Oracle CEP) is a fast, standards-based, deterministic, real-time lightweight Java application server built specifically for EDA and CEP.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 261: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 33

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

Monitoring CEP with SOA Suite and BAM

SOA composite

Applications

Databases

Event Streams

Messaging

JMS

event

event

event

event

EDN CEP BAM

Publish-Subscribeabstraction

Declarative

Rich subscription

semantics

Correlation windows

Pattern Matching

across timeand

channels

ContextEnrichment

Analytic Views

Exception Alerts

Integrated Actions

Closed loop

Mobile devices

BAM dashboards

ADF applications

Event Sources Event Delivery Event Processors Response Services

Monitoring CEP with SOA Suite and BAM

Oracle CEP can process multiple event streams to detect patterns and trends in real-time. Oracle CEP integrates tightly with Oracle SOA Suite and Oracle BAM, for business user interrogation and visualization into real-time processes, services, and transactions. This provides an enterprise with information and visibility about business events and trends that enable them to capitalize on emerging opportunities or mitigate developing risks.

Event sources provide the capture of event data to be monitored that is sent through the Event Delivery Network (EDN) or messaging systems (using JMS) to an event processor for processing, or directly to Oracle BAM for visualization in a variety of formats. The focus of CEP is an Event-Driven Architecture (EDA) that supports enriched data streams from any source, such as data streams, Web services, Java applications, and databases.

Oracle CEP provides processing that can manage correlation windows of events, perform pattern matching across time-based information using multiple channels with Continuous Query Language (CQL). CEP processing can also perform enrichment of the data in the given context. Processed event data from Oracle CEP, and raw events from the EDN or JMS messaging services can all be sent to Oracle BAM to be visualized in BAM dashboards, through ADF application (with the BAM Data Control) and mobile devices, enabling recipients to respond accordingly. Responses may in turn generate new events, creating a closed loop system.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 262: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 34

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

Basic Oracle CEP Integration with Oracle BAM

• Oracle CEP sends JMS messages to a JMS queue that Oracle BAM monitors

• Oracle BAM displays the event information in a BAM dashboard based on the BAM reports created

JMSEvent Source

CEP BAM

ProcessorAdapter

Input channel Output channel

JMS AdapterCEP application model is

called an Event Processing Network (EPN)

Basic Oracle CEP Integration with Oracle BAM

Oracle Complex Event Processing (Oracle CEP) provides a rich, declarative environment for developing event processing applications that share common architectural needs such as:

• Event sources: an abstraction for event stream handling, and normalizing event data (types)• Query engine: a common mechanism to select a subset of “interesting” events, and detect

the combination that comprises a complex event• Event processing: an abstraction for dispatching a response and chaining events

A CEP application typically includes:• Adapters, which translate external events or data into Java objects for processing• Processors, which is a set of queries applied to the event streams • Channels, which connect CQL Processor sources and destinations (called sinks) to

configure the flow control• Listeners, which are event sinks that handle triggers raised by the processors (not shown)• Events, which can be implemented as a Java Bean or Map

Note: To develop Oracle CEP applications you need Eclipse (Europa 3.3.2) and the Oracle CEP plug-in feature set. For more information visit the Oracle Technology Network Complex Event Processing Web page at http://www.oracle.com/technology/products/event-driven-architecture/complex-event-processing.html. For more training the “Oracle CEP 11g: Develop Real Time Applications” course enables you to learn how to develop Oracle CEP applications.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 263: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 35

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

Quiz

Oracle BAM can only monitor data from BPEL sensors that are published by using the BAM Sensor Action.

a. True

b. False

Answer: b

Sensors are not the only way monitored data can feed into Oracle BAM. Oracle BAM provides Web service interfaces that can be invoked by any Web service client and through the BAM Adapter, such as a Mediator component sending a message to the BAM Adapter. In addition, Oracle Complex Event Process can feed information into a BAM server for monitoring temporal changes to systems based on events and other sources of information.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 264: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 36

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

Summary

In this lesson, you should have learned how to:

• Create and configure BPEL sensors

• Create and configure Composite sensors

• Publish sensors with a Database Sensor Action and an BAM Sensor Action

• View BPEL sensor information in a BAM Dashboard

• Explain the role of Complex Event Processing

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 265: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications 17 - 37

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

Practice 17 Overview: Creating Sensors and Monitoring in Oracle BAM

This practice covers the following topics:

• Starting the Oracle BAM Server instance

• Importing a Data Object and a Report into Oracle BAM

• Modifying POProcessing to send initial order information from EnrichPO to BAM through the BAM Adapter

• Creating BPEL variable sensors with BAM Sensor Actions to monitor changes to the order status

• Creating a composite sensor and a BPEL activity sensorPOProcessing Composite

Fulfillment BPEL

BAM Adapter

BAM Server

ApproveCCOrder BPEL

EnrichPO

RoutePO

outputVariableReceivePO inputVariable

BAM Sensor Action

DB Sensor Action

Web service

Practice 17 Overview: Creating Sensors and Monitoring in Oracle BAM

The goal of this practice is to create sensors in a composite application and BPEL process for business activity monitoring by using Oracle Enterprise Manager and Oracle BAM. To monitor Oracle BAM, your tasks include:

• Starting the Oracle BAM Server instance and importing a BAM data object and a BAM Report from supplied XML definition files into the Oracle BAM Server by using the a supplied script that executes the ICommand command line utility to import the objects.

• Modifying POProcessing composite application in the following ways:- Create a BAM Adapter in the composite assembly model that is wired to the

EnrichPO Mediator component that sends the initial order received to the Oracle BAM Server through its Web Service interface.

- Modifying the ApproveCCOrder BPEL process with an outputVariable variable sensor that uses a BAM Sensor Action to update order data in the BAM Server

- Modifying the Fulfillment process with an inputVariable variable sensor that uses a BAM Sensor Action to send order status changes to the BAM Server

- Creating a composite sensor and BPEL activity sensor with a Database Sensor action.

Note: You may need to configure the run-time Oracle BAM Adapter by using the WebLogicAdministration Server, if the environment has not already been configured.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 266: D53946GC20_sg2

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 267: D53946GC20_sg2

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

Performing Common Tasks in JDeveloper

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 268: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 2

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

Objectives

After completing this lesson, you should be able to:

• Create a Database Connection

• Create an Application Server Connection

• Create an Application

• Create an Empty Project

• Create an SOA Project

• Create a Project from existing sources

• Deploy an SOA Composite Application

• Create an ADF-BC application

• Configure an ADF-BC application service interface

• Deploy an ADF-BC application

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 269: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 3

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

Creating a Database Connection

Type

Create

View

12

3

4

5

Creating a Database Connection

To access your Oracle XE Database from Oracle JDeveloper, you must first create a connection by performing the following steps:

1. Click the File menu and select New. 2. On the New Gallery window, click the General tab and select Connections.3. Under the Items displayed, select Database Connection.4. In the Create Database Connection dialog, enter the following details:

- Connection Name: soademoDatabase- Connection Type: Oracle (JDBC)- Username: system- Password: oracle- Save Password: Checked- Enter Custom JDBC URL: Unchecked- Driver: thin- Host Name: localhost- JDBC Port: 1521 (or the port number of your database)- SID: XE (or the SID of your database)

5. Once you have entered the configuration details as mentioned above, you need to test the connection. To test the database connection, click Test Connection.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 270: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 4

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

Creating an Application Server Connection

Type

Authentication

12 3

4

5

Creating an Application Server Connection

You need to create a connection from JDeveloper to the Oracle WebLogic Server configured for Oracle SOA Suite in order to deploy from JDeveloper. Create the Application Server connection by performing the following steps:

1. Select New from the File menu. 2. In the New Gallery, in the Categories tree, select General, and then Connections.3. Select Application Server Connection. Click OK. 4. The Create Application Server Connection Type page is displayed. Enter

WLS_AppserverConnection in the Connection Name field and select WebLogic 10.3 from the Connection Type list. Click Next.

5. The Connection Authentication page is displayed. Enter the WebLogic Server username and password. Click Next.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 271: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 5

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

Creating an Application Server Connection

Configuration Test

Completion

View

6

7

89

Creating an Application Server Connection (continued)

6. The Configuration Page is displayed. Enter the following values:- WebLogic Hostname (Administration Server): localhost- Port: 7001- WLS Domain: soabam_domain (or the appropriate domain name for the

environment)Click Next.

7. The test page is displayed. Click Test Connection.8. If the status is successful, click on Finish.9. Optionally, view the final result.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 272: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 6

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

Creating an Application

12

34

Creating an Application

To create an application, complete the following steps:1. Select New from the File menu. 2. In the New Gallery, in the Categories tree, select General, and then Select Generic

Application under Items. 3. In the Create Application Wizard, specify the application name and the directory under

which it needs to be created. Click Next.4. The Project Name page is displayed. Specify the Project name and select the type of

project you want to create. In the slide displayed, the project type selected is SOA. Click Next.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 273: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 7

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

Creating an Application

65

Creating an Application (continued)

5. The Project setting page is displayed (in the slide, the project setting displayed is specific to SOA). Once you are done, click Finish.

6. The Summary page is displayed. Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 274: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 8

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

Creating an Empty Project

1

2

3

4

6

5

Creating an Empty Project

To create a project, complete the following steps:1. Select New from the File menu. 2. In the New Gallery select Projects under the General category and Generic Project from

the Items tab. This invokes the Create Generic Project wizard.3. Specify the Project name and the directory under which you want to create the same.4. Specify the type of Project you want to create. Click Next.5. Based on the type of project you chose, you will be prompted to specify the Java settings.6. Click Finish.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 275: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 9

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

Creating an SOA Project

1

2

3

5

4

Creating an SOA Project

To create a SOA project, complete the following steps:1. Select New from the File menu. 2. In the New Gallery, select Projects under the General category and then SOA Project from

the Items tab. This invokes the Create SOA Project wizard.3. Specify the Project name and the directory under which you want to create the same.4. Select SOA from the Project Technologies tab. Click Next.5. Specify the Composite Template. Click Finish.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 276: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 10

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

Creating a Project from Existing Sources

1

2

3

Creating a Project from Existing Sources

To create a project from Existing Sources, complete the following steps:1. Select New from the File menu. 2. In the New Gallery, select Projects from Existing Sources under the General category and

then click OK. This invokes the Create Project From Existing Sources wizard.3. Specify the Project name and the directory under which you want to create the same.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 277: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 11

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

Creating a Project from Existing Sources

4

5

6

Creating a Project from Existing Sources (continued)

4. Specify the source path and the output directory. Click Next. 5. Specify the Libraries that need to be added. Click Next.6. Click Finish. O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 278: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 12

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

Creating a Project from Existing Sources:Finish

7

Creating a Project from Existing Sources: Finish

7. Click Finish. The wizard creates the project and the selected files.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 279: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 13

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

Deploying an SOA Composite Application

1

2

Deploying an SOA Composite Application

1. In the Application Navigator, Select the project from the Project Menu.

2. Right-click the Project and select Deploy. Specify the Application Server on which you want your project to be deployed. O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 280: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 14

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

Deploying an SOA Composite Application

6

3

4

5

Deploying an SOA Composite Application (continued)

3. Choose the Target Server.

4. Specify a new revision ID or select the “Overwrite any composite with the same revision ID”check box. Click OK.

5. For the first time deployment or if the connection is timed out you are prompted for the Admin username and password.

6. On successful compilation, you will see “Build successful” being displayed on the SOA log.O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 281: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 15

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

Creating an ADF Business Component Project

2Create a Generic Project.

1

3

Move the “ADF Business Components”entry from the Available list to the Selected list.

Creating an ADF Business Component Project

The screen shots in the slide show the initial steps needed to create a JDeveloper project for an ADF Business Components project, where the business component definition is based on one or more existing database tables. The steps are:

1. On the JDeveloper window, select File > New.2. On the New Gallery window, with the General category selected, double-click the Generic

project item.3. On the Generic Project Step 1 of 2 “Name your project” page, enter a project name (such

as CustomerSDO) and project directory, and click Finish.Note: Optionally, instead of clicking Finish you can click Next to set the default Java package name, the source and output directories for the project, on the “Generic Project Step 1 of 2 Configure Java Settings” page, and click Finish.

On completion, a new project folder is added to the current application in the JDeveloper Application Navigator window. This creates the folder and project libraries for ADF Business Component files. Starting on the next page you learn how to create the business components based on existing database tables.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 282: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 16

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

Creating Business Components from Tables

Right-click the project name and select New.

Double-click to start a wizard that creates business components in the project.

2

1

Creating Business Components from Tables

To create ADF Business Components based on existing database tables into the project, perform the following steps:

1. On the JDeveloper Application Navigator window, right-click the generic project folder name and select New.

2. On the New Gallery window, expand the Business Tier category and select ADF Business Components, and double-click the “Business Components from Tables” item. This action starts a wizard that enables you to configure the ADF-BC project connection and select the database table as the structure for the business component structure and functional definition.

Note: The next several pages walk you through the basic steps to “Create Business Components from Tables.”

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 283: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 17

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

Selecting the Table for an ADF-BC Application

1

Select or create the database connection.

2

Copy the desired base table from the Available to the Selected list.

Selecting the Table for an ADF-BC Application

Since you started with a generic project the “Initialize Business Components Project” window is displayed followed by the “Create Business Components from Tables” wizard pages. The steps shown in the slide are:

1. On the “Initialize Business Components Project” window, select a database connection configured in the JDeveloper environment, and click OK. The database connection selected should reference a database schema that contains the same table (or table structure) as the run-time database.

2. On the “Create Business Components from Tables – Step 1 of 6” Entity Objects page, optionally change the Java package name, select the Schema, click Query to populate the Available list of tables (as required), and copy the desired table, such as CUSTOMERS, from the Available list of tables to the Selected list. Optionally, rename the Entity Name, and click Next.

Note: The ADF-BC Entity Name represents the name of the Java class created for the ADF-BC Entity Object component, which defines the database row structure. Each Entity Object instance represents a row of data.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 284: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 18

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

Creating the ADF-BC View Objects

1

2

The View Object selected provides the XML structure for the BPEL Entity Variable.

Creating the ADF-BC View Objects

Continuing with the “Create Business Components from Tables” wizard pages, the steps shown in the slide are:

1. On the “Create Business Components from Tables – Step 2 of 6” Updatable View Objects page, optionally change the Java package name, and copy the desired View Object, such as CustomersView, from the Available list to the Selected list. Optionally, rename the Object Name for the View Object, and click Next.

2. On the “Create Business Components from Tables – Step 3 of 6” Read-OnlyView Objects page, optionally change the Java package name, and copy the desired View Object, such as CustomersView, query database tables and copy the Available list to the Selected list the desired tables. This creates read-only View Objects, which cannot be updated at run-time. Optionally, rename the Object Name for the Read-Only View Object, and click Next. Note: In the example, there are no read-only View Objects selected.

ADF-BC View Objects provide ADF-BC application clients with a component that can query the data in the underlying table. The View Object enables update and delete operations to be executed through standard methods provided by the component.

Note: The ADF-BC View Objects provide the XML element structure on which the BPEL Entity Variable is based.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 285: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 19

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

Creating the ADF-BC Application Module

2

1 Enter the Application Module name.

ADF-BC components created in the

Application Navigator.

Entity Object

Application Module Object

View Object

Creating the ADF-BC Application Module

In the final step of the “Create Business Components from Tables” wizard page, you choose the ADF-BC Application Module name. The steps shown in the slide are:

1. On the “Create Business Components from Tables – Step 4 of 6” Application Module page, optionally change the Java package name, and choose the Application Module Name, such as CustomerSDOAppModule, click Finish.

2. On the Application Navigator, the ADF-BC components for the ADF-BC application should be created. The slide shows the components created include:

- An Entity Object, for this example it is named Customers- A View Object, named CustomersView- An Application Module, named CustomerSDOAppModule- Addition configuration files required for ADF-BC applications

Note: Each component in an ADF-BC application includes Java classes and a corresponding XML file that represents Metadata for the component. The Application Module represents the main application class, which acts as a container object for one or more View Objects, including the read-only View Objects and their associated Entity Objects. If you have more than one Entity Object additional components are created for the relationships between Entity Components and View Objects (in the latter case called View Link objects). The View Objects represent the core application functionality for querying and modifying the database data.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 286: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 20

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

Creating the ADF-BC Service Interface

21

3

Select Service Interface

Define Web Service Name.

Creating the ADF-BC Service Interface

To implement an ADF-BC Application Module as a Web Service you must create its service interface, that is, generate the WSDL for the application module. This is done by configuring the Application Module component settings. To configure the ADF-BC Application Module with a service interface, perform the initial steps (as shown in the slide):

1. On the JDeveloper Application Navigator window, right-click the ADF-BC Application Module and select Open ApplicationModuleName, where the ApplicationModuleName in the example is CustomerSDOAppModule.

2. On the ApplicationModuleName tabbed page, click the Service Interface menu option to display the Service Interface page. On the Service Interface page, click the “Enable support for service interface” (green plus) icon.

3. On the “Create Service Interface – Step 1 of 4” Service Interface window, enter the Web Service Name and Target Namespace for the ADF-BC application. Click Next.Note: The Web Service Name determines the Java interface, Java class, and WSDL file names generated for the service interface.

Note: Remaining steps of the Create Service Interface wizard are shown over the next few pages.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 287: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 21

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

Configuring the ADF-BC Service Interface

12

3Select the operations you wish to expose in the service interface, for each selected

View Object.Ensure you select

ProcessChangeSummary to support update operations.

Configuring the ADF-BC Service Interface

Continuing with the Create Service Interface wizard, the next steps are to select the methods to be exposed as operations in the service interface WSDL. The steps in the slide are:

1. On the “Create Service Interface – Step 2 of 4” Service Custom Methods window, select custom methods (if any exist) that you wish to expose as methods in the service interface, and click Next. In this case, there are no custom methods to be selected.

2. On the “Create Service Interface – Step 3 of 4” Service View Instances window, copy all the View Objects (whose methods are exposed as operations in the service interface) from the Available list to the Selected list.

3. On the “Create Service Interface – Step 3 of 4” Service View Instances window, for each View Object in the Selected list choose the Operation options in the Basic Operation tab for all operations you wish to expose through the service interface. Click Next.Note: If the View Object needs to provide update or merge capabilities, then you must also select the ProcessChangeSummary operation.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 288: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 22

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

Verifying the ADF-BC Service Interface

1

2

Verify service interface classes, WSDL, and operation definitions.

Click the Edit icon to make changes.

Verifying the ADF-BC Service Interface

In the final steps of creating the service interface, perform the following steps:1. On the “Create Service Interface – Finish” Summary window, confirm your selections and

click Finish.2. On the Application Module Service Interface tabbed page, verify the service interface

configuration by clicking the View Instances and checking the Basic Operations and other properties selected. Look at the files generated for the service interface. Clicking the service interface file name links opens those files in the JDeveloper window. These service interface files are added to the project in a folder called serviceinterface, which is a subfolder of the Application Module folder in the Application Navigator window.

Note: If you need to make changes to the Service Interface, click the Edit icon. Make sure you save the changes to your ADF-BC project when the service interface definition is complete.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 289: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 23

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

Setting the ADF-BC Deployment Configuration

1

2

3

Select the SI configuration type as the Default

Configuration.

Edit the selected Default Configuration settings.

Set the run-time data source type and JNDI name.

Setting the ADF-BC Deployment Configuration

Before you deploy the ADF-BC application as a service you need to define configuration options for the Application Module, as listed in the following steps:

1. On the Application Module page, click the Configurations tab. On the Configurations tab, and in the Default Configuration drop-down box select the service interface configuration to be applied for deployment of the service. In the example, the CustomerSDOService is selected because it has the SI type of configuration, which is required for deployment to a remote run-time environment.

2. On the Application Module page Configurations tab, right-click the configuration name selected as the Default Configuration, and select Edit (alternatively, double-click the entry) to open the edit Business Components Configuration window.

3. On the Business Components Configuration window, in the Application Module tab select the Connection Type settings. In the example, JDBC DataSource is selected and the Datasource Name is populated with a JNDI name of a data source configured in the run-time environment. The JNDI name for the run-time data source must point to a database containing a table structure identical to the requirements of the ADF-BC application module. Click OK.

Finally save the changes to the Application Module configuration files.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 290: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 24

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

Creating the ADF-BC Service Deployment Profile

Note: Deploy theprofile from the projector application menu.

1

2Create a Business Components Service Interface Archive type. This creates an

EAR file for deployment.

Creating the ADF-BC Service Deployment Profile

An ADF-BC application can be executed as a local application within a Java UI client. It can also be executed as a remote application in the context of a Web application. However, for an ADF-BC application to be used as a Web Service and SDO, you must deploy it along with the service interface files and configuration. To deploy an ADF-BC application as a Web Service and SDO, you create a deployment profile in the project that generates a Business Components Service Interface archive. The steps to create the deployment profile are shown in the slide:

1. On the Application Navigator, double-click the ADF-BC project to display the Project Properties. On the Project Properties window, select the Deployment node and click New.

2. On the Create Deployment Profile window, select the Business Components Service Interface option in the Archive Type field, enter a Name for the profile and click OK.

Note: When you deploy the project, right-click the Project name in the Application Navigator and select the Deploy option, in a similar way to deploying other applications. However, you might have to use the Application Menu to deploy the ADF-BC deployment profile, which is created and deployed in a standard JavaEE Enterprise Archive (EAR) file.

Additional Note: ADF-BC components enable you to write custom methods that can be exposed as operations in the service interface. For more information about creating custom methods in ADF-BC components refer to the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework 11g Release 1 (11.1.1) documentation.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 291: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications A - 25

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

Summary

In this lesson, you should have learned how to:

• Create a Database Connection

• Create an Application Server Connection

• Create an Application

• Create an Empty Project

• Create an SOA Project

• Create a Project from existing sources

• Deploy an SOA Composite Application

• Create an ADF-BC application

• Configure an ADF-BC application service interface

• Deploy an ADF-BC application

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 292: D53946GC20_sg2

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 293: D53946GC20_sg2

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

Overview of the Oracle Applications Adapter

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 294: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 2

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

Objectives

After completing this lesson, you should be able to:

• Describe Oracle Applications Adapter concepts

• Configure run-time connections for Adapters

• Configure design-time connections for Adapters

• Create and configure Oracle Applications Adapter service

• Invoke an Oracle Applications Adapter operation

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 295: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 3

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

Integrating with Oracle E-Business Suite

Oracle Applications:

• Provides a set of integrated business applications

• Executes on a unified information architecture

• Consolidates data from Oracle and non-Oracle applications

• Enables consistent definition of customers, suppliers, partners, and employees across the entire enterprise

Integrating with Oracle E-Business Suite

Oracle Applications is a set of integrated business applications that runs entirely on the Internet. Oracle Applications offers you the following:

• Reduced costs• Increased revenue across front-office and back-office functions• Access to current, accurate, and consistent data

The applications in Oracle Applications are built on a unified information architecture that consolidates data from Oracle and non-Oracle applications and enables a consistent definition of customers, suppliers, partners, and employees across the entire enterprise. This results in a suite of applications that can give you information, such as current performance metrics, financial ratios, profit and loss summaries. To connect Oracle Applications to non-Oracle applications, you use Oracle Applications Adapter.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 296: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 4

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

Adapter for Oracle Applications

Oracle Applications Adapter:

• Provides comprehensive, bidirectional, synchronous, and asynchronous connectivity to Oracle Applications

• Supports all modules of Oracle Applications in Release 12 and Release 11.5.1 to 11.5.10, as well as some custom integration interfaces

• Supports open standards (JCA, XML, WSIF, WSIL and WSDL)

• Configures and generates adapter metadata as WSDL with J2EE Connector Architecture (JCA) extensions using a JDeveloper design-time tool

Adapter for Oracle Applications

Oracle Applications Adapter provides comprehensive, bidirectional, synchronous, and asynchronous connectivity to Oracle Applications. Adapter supports all modules of Oracle Applications in Release 12 and Release 11.5.1 to 11.5.10, as well as supports custom integration interfaces with reference to various versions of Oracle E-Business Suite including Release 12, Release 11i10, and pre-Release 11i10. For more information, refer to the Oracle Application Server Adapter for Oracle Applications User's Guide. Features of Oracle Applications Adapter includes support for:

• Open standards, such as J2EE Connector Architecture (J2CA), Extensible Markup Language (XML), Web Service Invocation Framework (WSIF), Web Service Inspection Language (WSIL), and Web Services Description Language(WSDL)

• A JDeveloper design-time tool for dynamically browsing the Oracle Applications interface and configuring and generating adapter metadata as WSDL files with J2CA extensions

• Applications integration based on open standards, such as IFX, OAG, RosettaNet, and UCCnet by interfacing with XML Gateway

• Custom integration interfaces for various versions of Oracle e-Business Suite including Release 12, Release 11i10, and pre-Release 11i10

• Multiple language and organization configuration based on “applications context”concepts, discussed in the “Applications Context Concepts” section.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 297: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 5

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

Composite Application

Adapter for Oracle Applications Architecture

Oracle Applications

Adapter

JDeveloper Adapter Wizard

Types of interfaces

Oracle XML Gateway

Concurrent programs

Interface tables and views

PL/SQL APIs

Oracle e-Commerce (EDI) Gateway

JCA Adapter

Oracle WebLogic Server

J2CA

Mediator

BPEL

Adapter for Oracle Applications Architecture

The Oracle Applications Adapter can be used in an SOA composite application from Mediator and BPEL components. The highly flexible interface of Adapter for Oracle Applications supports the following business interface types through the Oracle Applications Browser:

• XML Gateway message maps: Exposes OAGIS-formatted XML documents for commonly used Oracle Application business objects and business interfacesNote: OAGIS is an “Open Applications Group Integration Specification” that provides a canonical business language for information integration.

• PL/SQL APIs: Enables manipulation of Oracle Applications data by using PL/SQL• Concurrent programs: Moves data from interface tables to base tables• Open Interface tables: Enables inserting or updating data into Oracle Applications• Interface views: Enables retrieving data from Oracle Applications tables• e-Commerce Gateway EDI messages: Provides an approach for Electronic Data

Interchange (EDI) integration with third-party applications

Note: XML Gateway integrates with interface tables, Oracle Workflow Business Event System (BES), and interface views to insert and retrieve data from Oracle Applications. A business event occurs in applications whenever something significant occurs; for example, creation of a new purchase order. BES is an application service that uses Oracle Advanced Queuing (AQ) to communicate business events between systems.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 298: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 6

Adapter for Oracle Applications Architecture (continued)

Oracle Integration Repository is:• An integral part of Oracle E-Business Suite• A supplied catalog of information about many public integration interfaces delivered with

Oracle applications, known as business interfaces• A tool that provides a comprehensive view of mechanisms available for Oracle e-Business

Suite’s business interfaces

Note: The business interfaces are exposed because definitions have been annotated at design time, because of Oracle Integration Repository requirement specifications. Oracle Integration Repository can only provide information interfaces specifically annotated to make it public.

Oracle Applications Adapter takes advantage of the annotations that have already been created to make the business interface types (listed on the previous page) visible in the Oracle Applications Module Browser. These business interfaces are exposed as Web services.

For more information, see Oracle Integration Repository User's Guide.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 299: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 7

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

Applications Context Concepts

• Applications context is:– A combination of Organization ID, Username and

Responsibility

– Required for secured transaction processing into and out of Oracle Applications

• An organization:– Is an organizational entity (such as a business group name)

in Oracle Applications configuration data uniquely identified by the Organization ID

– Can represent multilevel hierarchies whose root is a business group

– Is automatically assigned to the business group associated with your current session

Applications Context Concepts

Applications context is required for secured transaction processing into and out of Oracle Applications. Applications context is a combination of Organization ID, Username and Responsibility. To establish applications context, the Organization ID is implicitly derived from the Oracle Applications setup data.

The applications context depends on understanding how Organization ID and multiple organizations are related. An Organization ID is a unique identifier for an organization.

In a single Oracle Applications installation, you can define multiple organizations along with their relationships. Examples of organizations are:

• Sets of books• Business groups• Legal entities• Operating units• Inventory organizations

Each organization is part of a business group, which is associated with a session (connection). A business group identifies the top of an enterprise organization chart. You can define multilevel organization hierarchies, with a business group as the root for each hierarchy. When defining new organizations, they are automatically assigned to the business group associated with your current session.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 300: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 8

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

Establishing Applications Context

To establish applications context, the Organization ID is implicitly derived from Oracle Applications setup data.

12

3

45

APIApps.Initialize

Username,Responsibility

ProfileOption

Operating Unitmodeled as Org_Id

Responsibility,Operating Unit

Establishing Applications Context

The steps that establish applications context include:1. When the system integrator runs, the process achieves the integration with Oracle

Applications using PL/SQL APIs.2. The Apps.Initialize process takes the parameters of Username and Responsibility.3. With these parameters, a lookup on the System Profile Values is done to determine the

Operating Unit.4. The Operating Unit is modeled as Organization ID in the System Profile Values.5. The data is read and written into the Oracle Applications with the parameters of Username,

Responsibility, and Organization ID.

Adapter for Oracle Applications uses the header properties in the Invoke activity to include Username, Responsibility, and Organization ID, the three essential elements for applications context.

Note: Integration interface types that require applications context to be set are PL/SQL APIs, concurrent programs, and EDI programs.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 301: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 9

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

Setting Applications Context in BPEL

Setting applications context in a BPEL process can be done:

• Statically in the WSDL generated by the Oracle Applications Adapter Configuration Wizard

• Dynamically with a header variables configured in the Properties tab ofthe Invoke activitythat executes theOracle Applicationsservice operation

Setting Applications Context in BPEL

The JDeveloper Adapter Configuration Wizard generates the WSDL code containing applications context information, including the username and responsibility of an Oracle Applications user with sufficient privileges (based on the applications context of Organization ID, Username, and Responsibility) to run the program. By default, the Username value is set to SYSADMIN and the Responsibility value is set to SYSTEM ADMINISTRATOR. This is rarely appropriate.

Therefore, for a BPEL process, the applications context can be set:• Statically, by manually editing the generated WSDL replacing the Username and

Responsibility values with their appropriate values. Therefore, these values apply to all invocations of the deployed business process.

• Dynamically, by populating a header variable, created in the Properties tab of the Invoke activity, with values for the Username and Responsibility. To provide header support and simplify design time tasks, Adapter for Oracle Applications normalizes the header values by setting each individual message property through the Properties tab of the Invoke activity without using an Assign activity.

Note: The dynamic approach is recommended, as it provides the advantage of populating the header variable mechanism with different values in the same BPEL process and, therefore, supports working with multiple organization configurations that are possible for structuring application contexts.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 302: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 10

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

Invoking an Oracle Applications Operation

OrderManagement

BPEL Process

Assign request data

Invoke Apps Service

Partner link per Oracle Application function

Set Username and Responsibility and other values in the header properties

Use a different Invoke for different operations

Invoking an Oracle Applications Operation

The BPEL process design model illustrated provides the foundations for invoking an Oracle Applications function or procedure exposed, by the Oracle Applications Adapter, as a service. The key parts of the BPEL process design are:

• Adding the partner link for the Oracle Applications function to be invoked. This is created by dragging the Oracle Applications Adapter icon from the Component Palette into the BPEL Diagram window Services column, and configured by the Adapter Configuration Wizard. You can configure only one function for each partner link.

• Adding and configuring an Invoke activity with header properties includes:- Creating the header variable, whose structure is derived from import elements in the

WSDL generated by the Adapter Configuration Wizard used to configure the Oracle Applications Adapter partner link. The header variable contains values for header properties you set in the Invoke activity Property tab.

- Linking the invoke activity to the partner link with the required input (request) and output (response) variables

- Adding and populating header properties in the Properties tab of the Invoke activity from the header variable. The header properties provides the applications context for the invoked Oracle Application service, so that the session can establish the application user and their associated organization information.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 303: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 11

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

Adapter Design-time and Run-time Connections

Like other adapters the Adapter for Oracle Applications requires:

• Configuration of run-time connections, similar to the DbAdapter connection pools and JDBC data sources

• Creation of a corresponding database connection in JDeveloper that maps to JNDI Name specified in the run-time connection pool configuration

eis/Apps/appsSample eis/Apps/appsSample

Design Time (JDeveloper) Run Time (WebLogic Server)

jdbc/appsSampleappsSample

Oracle Applications Database Instance

JNDI Name

Adapter Design-time and Run-time Connections

When configuring the Adapter for Oracle Applications, much like other adapters, the requirements are that the design-time database connection configuration details must match those in the run-time server. As illustrated in the diagram, the JNDI name used in the Adapter Configuration Wizard must be the same as the JNDI name configured in the OracleAppsAdapter run-time environment in the WebLogic Server.

In the design-time environment when using the Adapter Configuration Wizard you need to select a database connection from those configured in the JDeveloper environment. By default, the JDeveloper connection name used is appended to the JNDI prefix of eis/Apps. For example, the connection name appsSample is mapped to a JNDI Name of eis/Apps/appsSample, which forms the connection pool factory resource name.

In the run-time server, the JNDI name for the connection pool factory resource must be configured with the same JNDI name specified in the JDeveloper Adapter Configuration wizard so that a deployed composite will work correctly. The diagram shows that the run-time JNDI name, eis/Apps/appsSample, is associated with a property that defines the JDBC JNDI name for the actual database connection to the Oracle Applications Database instance.

Therefore, the JDeveloper database connection properties, for the appsSample connection, must point to the same Oracle Applications Database instance as the jdbc/appsSample JNDI name data source references.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 304: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 12

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

Configuring the Adapter Run-Time Connections

Create a run-time connection pool factory.

2

3

4

1

5

Configuring the Adapter Run-Time Connections

In addition to the connection pool and data source, you need to configure an OracleAppsAdapter connection factory to use the managed data source, by referencing its JNDI name. After logging in to the WebLogic Administration Server Console, configure the OracleAppsAdapter connection factory by performing the following steps:

1. On the Domain Structure panel, click Deployments.2. On the Deployments page, click the OracleAppsAdapter link.3. On the “Settings for OracleAppsAdapter” page, click the Configuration tab and then click

the Outbound Connection Pools tab. On the Outbound Connection Pools page click New.4. On the “Create a New Outbound Connection” page, for the Outbound Connection Groups

ensure the javax.resources.cci.ConnectionFactory option is selected, and click Next.

5. On the “Create a New Outbound Connection” page, for the “JNDI name for Outbound Connection Instance” enter the JNDI Name, such as eis/Apps/appsSample, and click Finish.Note: The JNDI Name provides the value that must used for the JNDI name settings in the design-time adapter.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 305: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 13

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

Completing Adapter Configuration

• Save configurationdeployment plan.This requires youredeploy theOracleAppsAdapter

• Associate connection factory to the JDBC resource of the Oracle Applications instance

1

2 3

Completing Adapter Configuration

After creating the OracleAppsAdapter connection factory, for the first time you configure an adapter, a page titled “Save Deployment Plan Assisted” is displayed. In this page, you specify an XML file name and directory for a deployment plan that stores configuration changes. These configuration changes do not become active in the run-time environment until you redeploy the OracleAppsAdapter. Refer to the page titled “Redeploying the Run-Time DbAdapter” earlier in this lesson, for an example of the steps to redeploy the OracleAppsAdapter.

Before you redeploy the OracleAppsAdapter, the steps to associate the connection pool factory JNDI name to the actual JDBC JNDI name representing the Oracle Applications Database instance is required. After clicking the Deployments link in the Domain Structure navigation bar, the steps are:

1. On the “Settings for OracleAppsAdapter” page, click the Configuration tab.2. In the Outbound Connection Pool configuration table on the page, expand the

javax.resource.cci.ConnectionFactory node (if required), and click the eis/Apps/appsSample JNDI name link you previously configured.

3. In the Outbound Connection Properties table, set the xADataSourceName property value to the JNDI name for the JDBC resource that points to the Oracle Applications Database instance. Don’t forget to click Save.Note: The JNDI name for the JDBC resource should have been defined prior to this step.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 306: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 14

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

Configuring an Adapter Design-time Connection

1. Create a database connection for the Oracle Applications database instance with the end part of the JNDI Location name specified for the AppsAdapter run-time connection.

2. Select the connection in the Adapter Configuration Wizard.

Same as the JNDI name configured for the AppsAdapter run-time connection factory

Configuring an Adapter Design-time Connection

At design-time, in JDeveloper BPEL Designer, you need to perform the following tasks to correctly configure the BPEL process to invoke an Oracle Applications service, exposed by a partner link generated by the Adapter Configuration Wizard:

1. On the JDeveloper Connections Navigator tab, create a database connection with connection information that references the database schema for the Oracle Applications installation.Note: The name of this connection is case-sensitive and must be exactly the same string used at the end of the JNDI Location name specified for the AppsAdapter connection factory. Refer to the slide for the appsSample example.

2. On the Adapter Configuration Wizard – Step 2 of 2: Service Connection page, when prompted for a Connection, select the database connection you created in the Connections Navigator tab.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 307: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 15

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

Creating an Oracle Applications Adapter Service

Dragging and dropping the Oracle Applications component into the Services column starts the Adapter Configuration Wizard

1

2

3

4

5

Creating an Oracle Applications Adapter Service

To create the Oracle Applications Adapter as a service:1. Drag the Oracle Applications entry from the Services list on the Component Palette into

the Services column of your BPEL Process Diagram window. The Adapter Configuration Wizard opens and you can configure the partner link for the Oracle Application functionality you want to invoke.

2. On the Adapter Configuration Wizard - Welcome page, click Next.3. On the “Adapter Configuration Wizard – Step 1 of 4: Service Name” page, enter the

service name for your partner link, an optional description, and click Next.4. On the “Adapter Configuration Wizard – Step 2 of 2: Service Connection” page, select the

database connection you created for the Oracle Applications installation, ensuring that the JNDI Location name matches the one specified for the OracleAppsAdapter connection factory in the run-time environment, and click Next.

5. On the “Adapter Configuration Wizard – Step 3 of 4: Operation” page, select the Oracle Application interface method you want to interact with. The example uses the PL/SQL API interface.

Some of the subsequent steps, which have to be configured in the Adapter Configuration Wizard, are covered on the next page.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 308: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 16

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

Oracle Applications Module Browser

7

6

Oracle Applications Module Browser

6. On the “Adapter Configuration Wizard – Step 4 of 4: Database Objects” page, click Add to launch the Oracle Integration Repository lookup screens, which allow the Oracle Applications Module Browser to search for and locate an Oracle Applications function that you want to expose as a service in your BPEL process.

7. On the Oracle Applications Module Browser window, select the PL/SQL APIs function and click OK.

Note: In addition to the interfaces that are made available through Oracle Integration Repository, Oracle Applications Adapter enables you to use business events, customized PL/SQL APIs, customized XML Gateway maps, and selected concurrent programs, all of which you can explore using the Oracle Applications Module Browser.

The Oracle Applications Module Browser is a key component of Oracle Applications Adapter, which is used to select the interface needed to define a partner link. The Module Browser combines interface data from Oracle Integration Repository with information about the additional interfaces supported by Oracle Applications Adapter. The interface data is organized in a tree hierarchy.

For more information about the structure of the tree hierarchy, refer to the Oracle Application Server Adapter for Oracle Applications User's Guide.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 309: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications B - 17

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

Summary

In this lesson, you should have learned how to:

• Describe Oracle Applications Adapter concepts

• Configure run-time connections for Adapters

• Configure design-time connections for Adapters

• Create and configure Oracle Applications Adapter service

• Invoke an Oracle Applications Adapter operation

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 310: D53946GC20_sg2

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 311: D53946GC20_sg2

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

Working with Domain-Value Maps and Cross References

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 312: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 2

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

Objectives

After completing this lesson, you should be able to:

• Describe the Domain-Value Map

• Create a Domain-Value Map

• Populate a Domain-Value Map at design-time

• Look up a Domain-Value Map at run-time

• Describe cross references

• Define a cross reference table

• Populate a cross reference table at run-time

• Look up a cross reference table at run-time

• Delete cross reference entries

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 313: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 3

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

Introducing Domain-Value Maps (DVM)

A Domain-Value Map enables you to associate different values from one application with the values of another application.

With JDeveloper, you can:

• Create a Domain-Value Map

• Populate it with values that need to be mapped

Note: A DVM is a collection of static data that is created at design-time and referenced at run-time.

CityCode in Application A CityName in Application B

BELG_MN_STLouis Belgrade St Louis

BELG_NC Belgrade North Carolina

BO Boston

NP Northport

Introducing Domain-Value Maps (DVM)

Domain-Value Maps enable mapping of vocabulary in one domain to another, which is useful when different domains represent the same data in different ways. Applications that you want to integrate often use different vocabulary to represent the same information. For example, one domain might represent a city with a long name (Boston), whereas another domain may represent a city with a short name (BO). In such cases, you can use a Domain-Value Map to directly map values between multiple domains. A direct mapping of values between two or more domains is also known as Point-to-Point mapping.

Each Domain-Value Map typically holds a specific category of mappings among multiple applications. For example, one Domain-Value Map might hold mappings for city codes and another might hold mappings for state codes.

Note: A DVM is a design-time construct where its structure and row data are static.

Features of Domain-Value Maps include:• Qualifier Support: Allows you to validate a mapping using additional information• Qualifier Order Support: Is used to find the best match during lookup at run time• One-to-Many Mapping Support: Allows you to map one value to multiple values in a

Domain-Value Map

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 314: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 4

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

Creating a Domain-Value Map

Right-click the Project and select New1

Select the Transformations category and the Domain-Value Map (DVM) item

Select the Transformations category and the Domain-Value Map (DVM) item

2

Creating a Domain-Value Map

You can use JDeveloper to create a new Domain-Value Map file that is stored in the project with a .dvm extension. The steps, as illustrated in the slide, to create a DVM file are:

1. On the Application Navigator window, right-click the project name and click New.2. On the New Gallery window, select the Transformation category under the SOA Tier node,

and double-click the Domain-Value Map (DVM) item entry. Alternatively, click the DVM entry and click OK. This action opens the Create Domain-Value Map (DVM) File window, where you can provide a name for your DVM file and specify the initial two domains and values. Refer to the next slide titled “Populating a Domain-Value Map.”

Note: A Domain-Value Map is a transformational tool that can be referenced in an XSL transformation by using DMV lookup functions.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 315: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 5

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

Populating a Domain-Value Map

Click OK, to create the DVM file

In the Map Table section:Columns represent domains

Rows represent domain values

Specify DVM file name, its directory, and initial entries.

1

2

Populating a Domain-Value Map

The slide shows the steps and screen shots for constructing a DVM with its domains and values. After selecting the Domain-Value Map (DVM) item from the New Gallery window, the Create Domain-Value Map (DVM) window is displayed. The steps are:

1. On the Create Domain-Value Map (DVM) window, enter the name of the DVM file and its directory location. Optionally, supply a description, and enter the initial two domain (column) names and their associated values for the DVM, and click OK.Note: This action creates the DVM file in the project, populates it with its initial values, and opens the DVM file in the Domain-Value Map editor window.

2. On the Domain-Value Map Editor window, you can add additional domain values (rows) to the Map Table by clicking the “Add Domain/Value” (green plus) icon and selecting the Add Domain Value option. Additionally, you can also add new domains (columns) by selecting the Add Domain option.Note: If you selected to create a new domain, the Create Domain window is displayed where you can enter the domain name, set the Qualifier property to true if you want to create a qualified domain and then specify its Qualifier Order. Refer to the next page for more information about qualifiers.

When you have completed structuring and populating the DVM Map Table, make sure you click File > Save, in the JDeveloper window menu, to save your the changes to DVM file.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 316: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 6

Populating a Domain-Value Map (continued)

The following XML elements show the source file format for the state codes Domain-Value Map (.dvm) file used in the example:<?xml version="1.0" encoding="UTF-8" ?>

<!-- Generated by Oracle DVM Editor version 1.0 at [11/05/09 4:48 PM]. -->

<dvm name="StateCodes" xmlns="http://xmlns.oracle.com/dvm">

<description>Mapping abbreviated state codes to full state names.

</description>

<columns>

<column name="short"/>

<column name="long"/>

<column name="combined"/>

</columns>

<rows>

<row>

<cell>CA</cell>

<cell>California</cell>

<cell>California (CA)</cell>

</row>

<row>

<cell>NY</cell>

<cell>New York</cell>

<cell>New York (NY)</cell>

</row>

</rows>

</dvm>

Note: You could manually or programmatically construct a file with the above format and include it in your project.

Qualifiers are used to select a specific mapping identified by a specified qualification value. This enables a mapping to be possible when an unqualified value results in multiple possible results producing an invalid condition. However, if a qualified mapping is done the result can be narrowed to a single meaningful result. For example, a Domain-Value Map containing city code to city name mapping may have multiple mappings from KN to Kensington, because Kensington is a city in Canada as well as in USA. So, this mapping requires a qualifier value (such as USA or Canada) to set a context (qualifying) value to enable the result for the mapping to become valid. You can also specify multiple qualifiers for a Domain-Value Map. For example, KN to Kensington mapping can also be qualified with an additional state name qualifier.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 317: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 7

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

Using a Domain-Value Map in Transformations

Drag the lookupValue function onto

the line connecting the

source and target

1

Define the DVM file, source and target domains, applied to the source value

2

Using a Domain-Value Map in Transformations

After creating a DVM, you can use the DVM file in XSLT Mapper by including one of the DVM functions found in the Advanced > DVM Functions menu of the Component Palette. To use the lookupValue DVM function drag lookupValue from the Component Palette onto the line that connects the source element to the target element. The yellow warning triangles indicate that the function definition is not complete. To configure the DVM mapping rules:

1. On the XSLT Mapper window, double-click the lookup-dvm function icon.2. On the “Edit Function – lookupValue” window, enter the following parameters:

- dvmLocation: path and name of the Domain-Value Map file. Use the magnifying glass icon to browse for the file.

- sourceColumnName: the name of domain that is used to lookup and compare against the sourceValue. Click the magnifying glass icon to select the source domain name.

- sourceValue: is an XPath expression identifying a source element, in the source document of the XSLT transformation, whose value is compared to the DVM sourceColumnName for a matching value.

- targetColumnName: the domain name for the target value copied to the target element in the XSLT Mapper file. Click the magnifying glass icon to pick the domain name.

- defaultValue: an optional default value, if no match is found in the DVM.- Click OK to accept the values and apply your selection.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 318: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 8

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

Introducing Cross References

Cross referencing is a run-time activity that provides a way to:• Associate identifiers for equivalent entities created

in different applications• Propagate changes to an application, when updating

equivalent objects in another applicationExample:

Note: A cross reference table is created and referenced at run-time, and the data once created survives beyond the application life-time.

SAP EBS Siebel

SAP_001 EBS_1001 SBL001

SAP_002 EBS_1002 SBL002

Introducing Cross References

Using cross references, you can dynamically populate, maintain, and map values for equivalent entities created by different applications. When creating, updating, and deleting objects in one application, there may be a need to propagate the changes to other applications. For example, when a new customer is created in a SAP application, you may need to create a new entry for the same customer in your Oracle E-Business Suite application (EBS). However, since the applications being integrated are using different entities and IDs to represent the same information you need to cross reference these entities. The example in the slide shows a new SAP customer is inserted with a unique identifier such as SAP_001. When propagating the same information to an Oracle E-Business Suite application and a Siebel application, the new rowneeds to be inserted with different identifiers such as EBS_1001 and SBL001, respectively. In such cases, cross references provide the kind of functionality needed to map these identifiers with each other so that they could be interpreted by their respective applications when referring to the to the same entity.

Note: Cross Referencing enables you to dynamically integrate values between applications, whereas the Domain-Value Maps specify values at design time.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 319: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 9

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

Composite application

Working with Cross References

To implement a cross reference scenario:

• Create the XREF_DATA table in a database and set the jdbc/xref data source to reference that database– By default it is present in the SOAINFRA schema

– This is done once for a SOA Suite instance

• Create a XREF file by using JDeveloper to define the End Systems being related by the cross reference

• Create composite application components to populate, maintain, and reference the cross reference data

XREF_DATA table

Database

.xref file

Defines XREF table structure

Transformation with XREF functions

XSL

Working with Cross References

Cross references are stored in table structures defined by an .xref file that you can create by using JDeveloper. To use the cross reference table defined by an .xref file you need XSD structures that defined the data to be cross referenced, the data itself, and a composite application with either a Mediator or BPEL component containing an XSL transformation that executes the appropriate XREF functions to populate, update, or look up cross references.

When you execute a function to populate a cross reference table, the data is stored in the XREF_DATA table in a database referenced by the jdbc/xref JNDI name. By default, the XREF_DATA table is created in the SOAINFRA schema created by the Repository Creation Utility (RCU), which is used to create the Oracle SOA Suite 11g database schemas required before installing Oracle SOA Suite 11g. Because the cross reference data is persisted in a database it remains available for applications until explicitly deleted, preferably by using the appropriate XREF functions.

Cross reference data is usually built up and maintained over time. Therefore, the components managing the cross reference data need to respond to events that modify the associated data and execute appropriate functions to synchronize the cross referenced data and entities in respective systems involved. However, it is likely that initialization of cross reference data would be required as well.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 320: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 10

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

Creating a Cross Reference Table

In JDeveloper, to create a cross reference table:Create a new project item1 Select the Cross Reference (XREF) item in

the SOA Tier > Transformation category2

Creating a Cross Reference Table

JDeveloper provides a Cross Reference (XREF) item in the Transformations category of the New Gallery window. Perform the following steps to create a cross reference table:

1. In the Projects list, right-click a project and select New. 2. When you select the Cross Reference (XREF) item the Create Cross Reference (XREF)

File window is displayed, enabling you to create the structure of the cross reference table, as discussed in the next slide titled “Defining the Cross Reference Table Structure.”

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 321: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 11

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

Defining the Cross Reference Table Structure

To define the cross reference table structure:

<xref xmlns="..."><table name="product"><description>...</description><columns><column name="Internal"/><column name="External"/>

</columns></table>

</xref>

Enter file name, directory name, and two initial XREF “end systems” columns.

2

Click the Add icon to create more End

Systems3

XREF source

1

Defining the Cross Reference Table Structure

As shown in the slide, the Create Cross Reference (XREF) File window is displayed after selecting the Cross Reference (XREF) item in the New Gallery window. To define the initial configuration of the cross reference table in the Create Cross Reference (XREF) File window, perform the following steps:

1. Specify the following:- File Name, which has a .xref extension- Directory Name where the file is stored, by default it is the project folder- Description (optional) of the cross reference table- The initial two End System entries, which appear as a <column> of XML elements in a

XREF source file. Each End System represents a collection of unique reference values for a given system. The actual cross reference values are created dynamically at run-time.

2. Click OK to accept the name and initial structure specified in the Created Cross Reference (XREF) File window. The specified file name is opened in the Cross Reference editor.

3. In the Cross Reference Editor you can:- Rename existing End System entries by double-clicking their rows and replacing the

names with a new one- Add additional End System entries, as shown in the slide example, by clicking the Add

(green plus) icon and entering a name.- Delete existing entries by selecting their row and clicking the Delete (red X) icon.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 322: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 12

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

Populating Cross Reference Tables

To populate a cross reference table row:

• Create a component with a transformation• Execute the populateXRefRow XREF function

1

2

3

Choice of mode values are: ADD, UPDATE, LINK

Populating Cross Reference TablesPopulating a cross reference table is performed at run-time in the context of a XSL transformation, as shown in the slide. Populated values are persistent until marked for deletion. The steps required to populate the table are:

1. Create the XSL transformation, in a Mediator Routing Rule or a BPEL Transform activity, ensuring that the source elements structure contains a value for each XREF column.

2. With the XSLT Editor open, on the Component Palette select Advanced and click the XREF Functions to expose the list. Drag the populateXRefRow (or populateXRefRow1M) function into the middle column of the XSLT editor.

3. On the XSLT Editor middle column, double-click the populateXRefRow function to set:- The xrefLocation, specifies the directory and name of the .xref file defining the

cross reference structure. Click the Browse (magnifying glass) icon to locate the file.- The referenceColumnName, which is the primary End System name- The referenceValue, which is the unique ID value in the primary End System- The columnName, which is the End System name being cross referenced- The value, which is the unique ID value in the End System being cross referenced - The mode, which can be the value ADD, UPDATE, or LINK (in uppercase). ADD

creates a new row, UPDATE modifies an existing row, LINK appends (associates) additional End System values to an existing reference.

Note: The example populates a table once. Normally the table needs to be maintained over time.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 323: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 13

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

Looking Up Cross Reference Tables

To perform a cross reference lookup:

• The cross reference table must be populated• Include a lookupXRef XREF function in a transformation

1

2

3

Lookup key

Returned XREF value

Looking Up Cross Reference Tables

Once the cross reference data has been populated, composite applications can reference the values by using the lookupXRef function to obtain a value of interest. The slide illustrates the following steps:

1. With an XSL transformation file open in the XSLT Mapper, in the Advanced options of the Component Palette drag the lookupXRef function from the XREF Functions list into the middle column.

2. On the XSLT Mapper window, double-click the lookupXRef function icon. This opens the “Edit Function – lookupXRef” window.

3. In the “Edit Function – lookupXRef” window, set the following five parameter values:- The xrefLocation, specifies the directory and name of the .xref file for the cross

reference structure.- The referenceColumnName, defines the End System name used to look up a value.- The referenceValue, defines the unique ID value used to lookup a value in End

System specified in the referenceColumnName field.- The columnName, defines is the End System name whose cross reference value is

returned by the function.- The needException, defines if an exception is raised when a reference value is not

found. Use the true() function to cause exceptions to be raised.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 324: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 14

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

Deleting Cross Reference Entries

To mark a cross reference entry for deletion execute a markForDelete XREF function in a transformation.

1

2

3

Value to be deleted

True or false returnedValue to be deleted

Deleting Cross Reference Entries

By executing a markforDelete XREF function in a transformation the specified value is marked for deleting in the XREF_DATA database table. This is a logical deletion with the effect of logically removing the marked cross reference value. The row in which the deleted value resides is still needed for maintaining cross references for other systems The slide steps are:

1. On the Component Palette, under the Advanced options drag a markForDelete function from the XREF Functions list into the middle XSLT Mapper column.

2. In the XSLT Mapper window, double-click the markForDelete icon to open the “Edit Function – markForDelete” window.

3. In the “Edit Function – markForDelete” window, enter the following parameter values:- The xrefLocation, specifies the directory and name of the .xref file.- The columnName, defines the End System from which to delete the cross reference.- The value, defines the unique ID of the value being deleted.

Note: Deleting a value in any End System marks its related values for deletion.Note: The markForDelete XREF function returns a true value if the function call was successful, otherwise it returns a false value.The example in the slide marks for deletion all of the values contained in the collection of cross references supplied in the source XML message structure. In this example, the target input element is updated for each element processed from the source and finally holds the true or false result for the markForDelete call for the last element in the source.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 325: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications C - 15

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

Summary

In this lesson, you should have learned how to:

• Describe the Domain-Value Map

• Create a Domain-Value Map

• Populate a Domain-Value Map at design-time

• Look up a Domain-Value Map at run-time

• Describe cross references

• Define a cross reference table

• Populate a cross reference table at run-time

• Look up a cross reference table at run-time

• Delete cross reference entries

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 326: D53946GC20_sg2

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 327: D53946GC20_sg2

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

Coordinating Master-Detail BPEL Processes

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 328: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications D - 2

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

Objectives

After completing this lesson, you should be able to:

• Introduce master-detail process concepts

• Examine coordination of a master-detail process example

• Create a master process

• Create a detail process

• Coordinate the master-detail with an Invoke activity

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 329: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications D - 3

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

Introducing Master-Detail Processes

Signal activitylabel="StartDetailProcess"

to="details"

Receive Signal activitylabel="StartDetailProcess"

from="master"

Invoke activitypartnerlink="DetailProcess"

……

bpelx:invokeAsDetail=“true”

Receive Signal activitylabel="CompleteDetailProcess"

from="details"

Signal activitylabel="CompleteDetailProcess"

to="master"

Master Process Detail Process

Introducing Master-Detail Processes

BPEL process activities that coordinate actions between the master and detail processes are:• Signal: Notifies the other processes (master or detail) to continue processing• Receive Signal: Waits until it receives the proper notification signal from the other process

(master or detail) before continuing its processing

Both activities are coordinated with label attributes defined in the BPEL process files. Labels are declared per master process definition. Each master and detail process includes a Signal and Receive Signal activity. If a Signal activity executes before the Receive Signal activity, the state set by the Signal activity is persisted and effective for a later Receive Signal activity to read. The activity responsibilities based on the type of process in which they are defined are:

• If a Master process contains a Signal activity then the Master process signals all its detail processes at run-time.

• If a Detail process contains a Receive Signal activity then the Detail process waits until it receives the signal executed by its master process.

• If a Detail process contains a Signal activity then the Detail process signals its master process at run time that processing is complete.

• If a Master process contains a Receive Signal activity the Master process waits until it receives the signal executed by all its detail processes.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 330: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications D - 4

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

Coordinating a Master-Detail Process Example

Header

–Customer Info

–Ship-To Address

Line Items

–Item Names

–Item Number

–Price

–Quantity

Header

–Customer Info

–Ship-To Address

Line Items

–Item Names

–Item Number

–Price

–Quantity

Sales Order 1 Sales Order 2

Detail BPELProcess 1

Detail BPELProcess 2

CompletesHeader

Validationand signals

DetailProcess to

continue

CompletesHeader

Validationand signals

DetailProcess to

continue

Completes LineValidation and signals MasterProcess

Validates Line Items

Validates Header Validates Header

Completes LineValidation and signals MasterProcess

Master BPELProcess

Coordinating Master-Detail Process Example

Master and detail coordination consist of a one-to-many relationship between a single master process and multiple detail processes. For example, a business process imports sales orders into an application. Each sales order consists of a header (customer information, ship-to address, and so on) and multiple lines (item name, item number, item quantity, price, and so on). The following tasks are performed to execute the order:

1. Validate the header. If the header is invalid, processing stops.2. Validate each line. If any lines are invalid, they are marked as invalid and processing stops.3. Do inventory checks for each item. If an item is not available, create an assembly order.4. Stage items at the shipping dock after each line item is available. Ship to the customer.

To perform these tasks, create a master process to check and validate each header and multiple BPEL processes to check and validate each line item. Potential coordination points are:

• The master process signals the detail processes that header validation is successful and to continue processing.

• Each detail process signals the master process after line item validation is complete.• Each detail process signals the master process after the line item is available in inventory.• After all lines have been moved, the master process executes logic to ship the order.• After all line items are available, the master signals each detail process to move its line

item to the shipping dock (the dock may become too crowded if items are simply moved as soon as they are available).

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 331: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications D - 5

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

Creating a Master Process

Creating a Master Process

To create an example master process, perform the following steps:1. Create a BPEL process service component in the SOA Composite Editor. For this example,

the process is named MasterProcess. Double-click the MasterProcess BPEL process.2. Drag a Signal activity and drop it into your BPEL process service component.3. Double-click the Signal activity. This activity signals the detail process to perform

processing at run time. Enter the following details:Name: Enter a name (for this example, contactDetailProcess).Label: Enter a label name (for this example, beginDetailProcess). This label must match

the Receive Signal activity label you set in the detail process.To: Select details as the type of process to receive this signal. Click OK.

4. Drag a Receive Signal activity and drop it into your BPEL process service component.5. Double-click the Receive Signal activity. This activity enables the master process to wait

until it receives the signal executed by all its detail processes. Enter the following details:Name: Enter a name (for this example, waitForDetailProcess).Label: Enter a label name (for this example, completeDetailProcess). This label must

match the Receive Signal activity label you set in the detail process.To: Select details as the type of process to receive this signal. Click OK.

The master process has now been designed to Signal the detail process to perform processing at run time and wait until it receives the signal executed by the detail process.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 332: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications D - 6

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

Creating a Detail Process

Creating a Detail Process

To create an example detail process, perform the following steps:1. Create a second BPEL process service component in the SOA Composite Editor, such as

the DetailProcess. Deselect the Expose as Composite Service check box for this BPEL process. Link DetailProcess to the MasterProcess. Double-click the DetailProcess.

2. Drag a Receive Signal activity and drop it into your BPEL process service component.3. Double-click the Receive Signal activity. This activity enables the detail process to wait

until it receives the signal executed by its master process. Enter the following details:- Name: Enter a name (for this example, WaitForContactFromMasterProcess).- Label: Enter a label name (for this example, beginDetailProcess). This label must

match the Receive Signal activity label you set in the master process.- To: Select master as the type of process to receive this signal. Click OK.

4. Drag a Signal activity and drop it into your BPEL process service component.5. Double-click the Signal activity. This activity enables the detail process to signal its

associated master process at run time that processing is complete. Enter details, such as:- Name: Enter a name (for this example, contactMasterProcess).- Label: Enter a label name (for this example, completeDetailProcess). This label must

match the Receive Signal activity label you set in the detail process.- To: Select master as the type of process to receive this signal. Click OK.

The detail process has now been designed to wait until it receives the signal executed by its master process, and signal the master process at run time that processing is complete.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 333: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications D - 7

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

Coordinating the Master-Detail with an Invoke Activity

Coordinating the Master-Detail with an Invoke Activity

Perform the following steps:1. Return to the MasterProcess master process.2. Drag an Invoke activity and drop it into your BPEL process service component.3. Double-click the Invoke activity.4. Select the DetailProcess BPEL process you created earlier as the partner link.5. Complete all remaining fields in the Invoke window, and click OK.6. Click Source in the BPEL process diagram window.7. Add bpelx:invokeasdetail to the Invoke activity and set it to true:

<invoke name="MyInvoke" partnerLink="DetailProcess"portType="dp:DetailProcess"operation="initiate"inputVariable="detail_input"/><bpelx:invokeasdetail name="true"/>

This attribute creates the partner process (DetailProcess) as a detail instance.8. If this is an environment in which one master process is interacting with multiple detail

processes, perform the following tasks:Specify the bpelx:detailLabel attribute for correlating with the Receive Signal activity.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 334: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications D - 8

Coordinating the Master-Detail with an Invoke Activity (continued)

<invoke name="MyInvoke" partnerLink="DetailProcess"portType="dp:DetailProcess"operation="initiate"inputVariable="detail_input"/>bpelx:detailLabel="detailProcessComplete0"<bpelx:invokeasdetail name="true"/>

- Specify the same label value of detailProcessComplete0 in the Receive Signal activity of the master process.<bpelx:receiveSignal name="waitForNotifyFromDetailProcess0-1"label="detailProcessComplete0" from="details"/>

- Repeat these steps as necessary for additional detail processes, ensuring that you specify a different label value.

9. Select Save All from the File main menu.

Master and detail coordination design is now complete.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 335: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications D - 9

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

Summary

In this lesson, you should have learned how to:

• Introduce master-detail process concepts

• Examine coordination of a master-detail process example

• Create a master process

• Create a detail process

• Coordinate the master-detail with an Invoke activity

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 336: D53946GC20_sg2

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 337: D53946GC20_sg2

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

Integrating Services with Oracle Service Bus

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 338: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 2

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

Objectives

After completing this appendix, you should be able to:

• Explain the Oracle Service Bus

• Describe the Oracle Service Bus Architecture

• Define Oracle Service Bus projects and resources

• Describe Proxy Services

• Explain Business Services

• Compare OSB and Mediator Components

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 339: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 3

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

Introduction to Oracle Service Bus

The Oracle Service Bus provides stand-alone service bus capabilities and enables agility the service oriented way by:

• Providing scalability

• Insulating the integration logic

• Service use and tracking

• Service management

Oracle Service Bus

Service Service Service

Application Application Application

Introduction to Oracle Service Bus

Oracle Service Bus (OSB) is a configuration-based, policy-driven Enterprise Service Bus (ESB). It provides a feature-rich console for dynamic service and policy configuration, as well as for system monitoring and operations tasks. OSB facilitates a loosely coupled architecture, facilitates enterprise-wide reuse of services, and centralizes management. OSB provides:

• Scalability - Applications and services connect once to the bus and are then consumable by any service consumer with access to the bus. This results in unlimited scalability because it eliminates the problem of every service trying to connect to every other service.

• Insulation of integration logic - Application developers need not worry about integration logic, because it is completely separate and delegated to the OSB. Integration designers configure integration rules in the OSB which are invoked at run-time to determine what data and security transformations to use, which route or sequence of services to invoke.

• Service use and tracking - The OSB provides a local cache of services and their policies. In this way, services can be discovered and reused.

• Service management - Services connected to the bus can be managed. For example, by settings Service Level Agreement (SLA) thresholds for availability, performance and other measures. Alerts can be generated for SLA variances and issues requiring attention.

Note: The graphic depicts multiple services connected to multiple applications through the Oracle Service Bus, which acts as bridge between services and applications.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 340: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 4

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

Role of Oracle Service Bus

The Oracle Service Bus:

• Supports dynamic routing of messages

• Acts as a message broker

• Provides location transparency

• Facilitates message enrichment

• Supports message transformation and orchestration

Role of Oracle Service Bus

Oracle Service Bus configurations can mix-and-match transports with end-to-end guaranteed delivery if the transport protocol supports it. It supports multi-protocol messaging using:

• HTTP(S)• SOAP• JMS for store-and-forward and third-party messaging products • File, FTP, or email (SMTP, POP, or IMAP)• Tuxedo• Enterprise JavaBeans (EJBs)• Oracle Data Service Integrator (ODSI)• Native Message Queue (MQ)

It can insert additional information into an incoming message providing message enrichment. For example, obtaining customer history from the Get Customer History Service and adding the customer history to the message going to the Rate Quote Service.

OSB can combine existing services to make new services in turn enabling service orchestration. Service orchestration requires writing code. OSB provides location transparency by isolating service location changes. For example, rerouting a message which, originally was routed to the wrong host, instead of the correct host. OSB can inspect the message to determine the destination service. It also transforms messages to match the format of a service.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 341: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 5

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

Oracle Service Bus Core Features

Oracle Service Bus allows management and integration of messages and services across a services network. Its core functional features are separated into the following categories:

• Service integration

• Service security

• Service composition

• Service management

Oracle Service Bus Core Features

The Oracle Service Bus core features can be categorized as:• Service integration: Includes features used for integrating disparate service end-points,

message brokering, and mediating and exposing services for reuse• Service security: Includes features used for service authentication and authorization,

message security enforcement, and user identity validation• Service composition: Includes features used for configuring message routing logic,

message transformation, service configuration, validation and registry• Service management: Includes features used for monitoring and managing service

activity and availability

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 342: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 6

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

Oracle Service Bus Functional Layers

The functional features of the Oracle Service Bus can be categorized into the functional layers.

Oracle Service Bus

Management Monitoring SLAs Reporting Dashboards Open interfaces

Composition Discovery Transformation Message Flow Modeling Test browser

Security Transport security WS-Security Console security Policy

Messaging Service transport layer Transport SDK

Oracle Service Bus Functional Layers

The responsibility of each of the functional layers can be described as :• Management Layer: Provides a service management environment that includes dynamic

service and policy configuration, centralized usage and performance monitoring, and management of services - not just Web services, but also Java, .Net, messaging services,and legacy end points

• Composition Layer: Provides a meta-data driven feature-rich configuration interface for service discovery and validation capabilities for automatic import and synchronization of services with UDDI registries, allows message flow modeling, transformations, third-party service callouts and a test console

• Security Layer: Provides a rapid service configuration and integration environment that abstracts policies associated with routing rules, security, and service end-point access

• Messaging Layer: Reliably connects any service by leveraging standards Web service transports, traditional messaging protocols and configuration of enterprise-specific custom transports

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 343: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 7

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

Oracle Service Bus Architecture

Service Management

Message Brokering Configuration

Framework

Service Bus Security

Messaging Protocols

Monitoring SLA Reporting

Content Based Routing Dynamic Transformation

Error HandlingService Switching

Authentication Authorization Identity Message Security

Service Discovery

Change Center

Validation

Resource Cache

HTTP/S SOAP JMS JMS/XA SMTP MQ FTP

Service Providers

Service Consumers

Oracle Service Bus Architecture

Oracle Service Bus architecture is centered around an Enterprise Service Bus. The bus provides message delivery services, based on standards including SOAP, HTTP and Java Messaging Service (JMS). It is typically designed for high-throughput, guaranteed message delivery to a variety of service producers and consumers. It supports XML as a native data type, while also offering alternatives for handling other data types.

Oracle Service Bus is policy driven and enables you to establish loose coupling between service clients and business services, while maintaining a centralized point of security control and monitoring. It stores persistent policy, proxy service, and related resource configurations in metadata, that can be customized and propagated from development through staging to production environments required. The message-brokering engine accesses this configuration information from its metadata cache.

Oracle Service Bus is an intermediary that processes incoming service request messages, determines routing logic, and transforms these messages for compatibility with other service consumers. It receives messages through a transport protocol such as HTTP(S), JMS, File, and FTP, and sends messages through the same or a different transport protocol. Service response messages follow the inverse path. The message processing by Oracle Service Bus is driven by metadata, specified in the message flow definition of a proxy service.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 344: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 8

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

Projects and Resources

An OSB project is a container for this subset of resources:

• Proxy services

• Business services

• Transformations

• Web Services Description Language(WSDL)

• XML schemas

• WS-Policies

• Security Service Providers

• Java Archives (JARs)

• Alert destinations

Projects and Resources

The slide defines the OSB project as a container for a subset resources that may be created in the project. The image shows a more comprehensive list of resources that can be created in an OSB project categorized by types. O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 345: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 9

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

Introduction to Proxy Services

ServiceConsumer

ServiceProducer

Oracle Service Bus

ServiceProducer

ServiceProducer

BusinessService

BusinessService

BusinessService

Proxy Service

Inbound

Outbound

Message Flow

OSB Console

Introduction to Proxy Services

Oracle Service Bus mediates service request and response messages between disparate heterogeneous service endpoints and intelligently routes messages between them. Content-based routing is a mediation capability supported by Oracle Service Bus based on conditional message processing and transformation capabilities. This routing capability allows loose coupling of SOA endpoints and is particularly useful. It allows service enrichment and reuse by combining transformation and routing functions.

Proxy services are definitions of generic intermediary Web services that are hosted locally on Oracle Service Bus. A proxy service communicates with other services in the IT infrastructure through interfaces, which may or may not be identical to that of a service provider or service consumer business service. Proxy services can route messages to multiple business services, using their configured independent interfaces. Proxy services can be defined and configured using the Oracle Service Bus Console. They are configured by specifying their interface, type of transport it uses, and their associated message processing logic.

A proxy service is the gateway for applications and services to access OSB.

Each proxy service contains a message flow that allows actions to be performed on a message.

Every proxy service must route to some service.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 346: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 10

Introduction to Proxy Services (continued)

Business services are Oracle Service Bus definitions of the enterprise services that exchange messages during business processes. A business service and its interface can be defined and configured using the Oracle Service Bus Console. A business service is configured by specifying its interface, type of transport it uses, its security requirements, and other characteristics.

The inbound transport layer is the communication layer between client services (or service consumers) and Oracle Service Bus. The outbound transport layer is responsible for the communication between business services (or service producers) and Oracle Service Bus.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 347: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 11

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

Introduction to Business Service

Enterprise Service

Oracle Service Bus ProjectService Clients

Application

Client

Transportprotocol

ServiceProxy

Service

Business

Service

Service Brokering

Inbound interface Outbound interface

Transportprotocol

Introduction to Business Service

Business services are Oracle Service Bus definitions of the enterprise services with which you want to exchange messages. You define business services using Web Services Definition Language (WSDL) just as you would define a proxy service. However, the configuration of business services differs from that of proxy services in that a business service does not have a pipeline. Therefore, a business service is any service not implemented by the Oracle Service Bus pipelines.

A business service:• Is contained within an OSB Project• Defines a transport protocol used with the service• Defines a URL that is called when the service is invoked

The properties of a business service depend on which protocol is selected.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 348: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 12

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

Check Status Operation Pipeline PairSubmit Operation Pipeline Pair

Service Level Pipeline Pair

Request Response

Message Flow Definitions

The implementation of a proxy service is specified by a message flow definition.

Start

Condition

Request Response Request Response

Route to

Destination

Route to

Destination

Service A/

Operation A

Service B/

Operation A

Service A/

Operation B

Service B/

Operation B

Start node

Pipeline pair

Branch node

Route node

Message Flow Definitions

To construct a message flow, the four elements that are used are:• A Start Node• A Pipeline Pair, one for the request and one for the response. The pipelines consist of a

sequence of stages that specify actions to perform during request or response processing.• A Branch Node to branch based on the values in designated parts of the message or

message context or to branch based on the operation invoked• A Route Node used to define the message destination. The default route node is an echo

node that reflects the request as the response. O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 349: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 13

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

Oracle Service Bus Console

The OSB Console supports creation, management, and configuration of your OSB environment. Using the OSB Console, you can:

• Create and manage projects and project folders

• Create and manage businessand proxy services

• Test proxy and businessservices

• Modify the securityconfiguration

• Import and exportresources

Oracle Service Bus Console

Oracle Service Bus Console enables you to control the service and policy configurations, and monitor system and operations tasks. Oracle Service Bus relies on WebLogic Server run-time facilities. To start the OSB:

1. Click Start > All Programs > Oracle WebLogic > User Projects > domain_name > Start Server for the Oracle Service Bus Domain , where domain_name represents the name you assigned to your Oracle Service Bus domain when you created it. User Projects is the default location in which your domain is created. User Projects is the default location in which your domain is created by default.

2. When the server starts, enter the following URL in your browser:http://hostname:port/sbconsole where host represents the name of the machine on which WebLogic Server is running and port represents the port number.

The Oracle Service Bus Console login page is displayed. 3. Enter the user name and the password you specified during the installation process. Click

Login.

This graphic shows the Oracle Service Bus (OSB) Console with the Project Explorer open.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 350: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 14

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

Quiz

Business services are Oracle Service Bus definitions of the enterprise services that exchange messages during business processes. a. Trueb. False

Answer: a

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 351: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 15

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

Comparing Oracle Service Bus and Mediator Components

Oracle Service Bus Mediator

It provides stand-alone service bus capabilities, enabling separation between application developers and target systems and services.

It is an intra-composite mediation component that is deployed within a composite on a canonical model.

It does not support events publishing and subscription.

It supports events publishing and subscription.

It provides service virtualization, protocol transformation for an Oracle SOA Suite Application containing multiple composites.

It enables transformation, routing, event delivery, and payload validation inside the composite.

Comparing Oracle Service Bus and Mediator Components

Oracle Service Bus connects, mediates and manages interactions between heterogeneous services and not just Web services. It uniquely delivers the integration capabilities of an Enterprise Service Bus (ESB) with operational service management in a single product with an seamless user experience.

Oracle Mediator alternatively is responsible for brokering communications between components that make up a composite enabling transformation, routing and filtering inside the composite.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 352: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 16

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

Quiz

Oracle Service Bus supports event publishing and subscription. a. Trueb. False

Answer: b

Because Oracle Service Bus does not support event publication and subscription this highlights a scenario where a composite application with Mediator components can be employed to manage event-driven scenarios that can be integrated with other services managed by Oracle Service Bus.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 353: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications E - 17

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

Summary

In this appendix, you should have learned how to:

• Explain the Oracle Service Bus

• Describe the Oracle Service Bus Architecture

• Define Oracle Service Bus projects and resources

• Describe Proxy Services

• Explain Business Services

• Compare OSB and Mediator Components

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 354: D53946GC20_sg2

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 355: D53946GC20_sg2

Glossary

ACID Atomicity, consistency, isolation, durability (for DB transactions).

ADF-BC Application Development Framework Business Components. ADF is a Java EE development framework, from Oracle Corporation, that minimizes the need to write code that implements the application’s infrastructure and makes it easy to develop agile applications that expose data as services. Oracle ADF is based on the Model-View-Controller (MVC) design pattern. An MVC application provides a model layer for interaction with data-sources, a view layer for user interface implementation, and a controller to manage application flow and mediates exchange between the Model and the View layers. ADF Business Components are Model layer components.

API Application programming interface.

APS Application Platform Suite. A comprehensive and integrated enterprise application

B2B

infrastructure.

Business-to-business (B2B) integration is the integration of a company’s applications and business processes with external business systems operated by customers, suppliers, trading partners, exchanges, and marketplaces. B2B integration extends A2A integration to the Internet.

BPEL Business Process Execution Language (BPEL). BPEL is a language for composing multiple services into an end-to-end business process. BPEL is an XML-based language designed to enable task sharing for a Service-Oriented Architecture environment, even across multiple organizations, by orchestrating and choreographing individual Web services. BPEL is the generic term used to refer to all BPEL versions of the specification.

BPEL4WS Business Process Execution Language for Web Services. BPEL4WS refers to the BPEL version 1.0 and 1.1 specifications of business processes and business interaction protocols (Refer BPEL and WS-BPEL)

CEP Complex Event Processing. CEP is primarily an event processing concept that deals with the task of processing multiple events with the goal of identifying the meaningful events within the event cloud. CEP employs techniques such as detection of complex patterns of many events, event correlation and abstraction, event hierarchies, and relationships between events such as causality, membership, and timing, and event-driven processes.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 356: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications Glossary - 2

CICS Customer Information Control System. CICS is a transaction server that runs primarily on IBM mainframe systems under z/OS and z/VSE. CICS is a transaction manager designed for rapid, high-volume online processing. This processing is mostly interactive (screen-oriented), but background transactions are possible.

Component A modular unit of functionality accessed through one or more interfaces.

CORBA Common Object Request Broker Architecture. A set of industry standards published by Object Management Group (OMG) that defines a distributed model for object application systems.

CRM Customer Relationship Management. A broad term that covers concepts used by companies to manage their relationships with customers, including the capture, storage, and analysis of customer information.

DAS Data Access Service. A Java class that provides methods to load a data graph from a data store and to save a data graph back into that data store.

DCOM Distributed Component Object Model. A proprietary Microsoft technology for communication among software components distributed across networked computers.

Dehydration Dehydration is a process that saves application state in a database or persistent store. Dehydration is used by the BPEL Engine in Oracle SOA Suite to save the state of long running processes. (For the converse of Dehydration refer to the term Hydration)

EAI Enterprise Application Integration. Refers to the plans, methods, and tools aimed at modernizing, consolidating, and coordinating the computer applications in an enterprise. EAI may involve developing a total new view of an enterprise's business and its applications, seeing how existing applications fit into the new model, and then devising ways to efficiently reuse what already exists while adding new applications and data.

EAR Enterprise Archive.

EDA Event-Driven Architecture. EDA is a software architecture pattern promoting the production, detection, consumption of, and reaction to events.

EDL Event Definition Language. EDL is an XML language designed to describe events and their structure.

EDN Event Delivery Network. EDN is an computing infrastructure designed for delivery of business or system events between applications that publish and subscribe to those event.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 357: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications Glossary - 3

EDSOA Event Driven Service Oriented Architecture. An architecture that combines an SOA request-response and Event-Driven Architecture’s (EDA) event publish-subscribe paradigms.

EAI

Enterprise Application Integration (EAI) refers to the procedures and tools used to modernize, consolidate, and coordinate the computer applications in an enterprise.

EIS Enterprise Information System. EIS are systems that provide the information infrastructure for an enterprise. Enterprises run their businesses by using the information stored in these systems. Examples of EIS include enterprise resource planning systems, mainframe transaction processing systems, relational database management systems, and other legacy information systems. Enterprise applications require access to applications running on EIS.

EJB Enterprise Java Bean. Defines a Java API for server-side enterprise components that execute within a J2EE-compliant applicant server. The specification also details remote communication protocols, persistence, transactions, concurrency control, naming services, and deployment descriptors.

ETL Extract Transform Load. The processes that enable companies to move data from multiple sources, reformat and cleanse it, and load it into another database, a data mart, or a data warehouse for analysis, or onto another database, a data mart, or a data warehouse for analysis, or onto another operational system to support a business process.

Hydration Hydration is the process of restoring application state from a database or a persistent store. Hydration is used by the BPEL Engine in Oracle SOA Suite to restore the state of long running processes.

IaaS Infrastructure (Information) as a Service. IaaS is the delivery of computer infrastructure (r information) as a service.

IIOP Internet Inter-ORB Protocol. An open-standard protocol published by Object Management Group (OMG) to be used for communication in CORBA-based systems.

IMS-TM Information Management System. IMS-TM is a joint hierarchical database and information management system with extensive transaction processing capabilities created by IBM.

IMS-DB Information Management System. IMS-DB is a joint hierarchical database and information management system with extensive transaction processing capabilities created by IBM.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 358: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications Glossary - 4

JAM Java Applications Manager. Enables launching Java Applications.

JAR Java Archive.

JAAS Java Authentication and Authorization Service.

JAX-RPC Java API for XML-based RPC. JAX-RPC allows a Java application to invoke a Java-based Web Service with a known description while still being consistent with its WSDL description.

JAX-WS Java API for XML-Based Web Services.

J2EE Java 2 Platform, Enterprise Edition. J2EE is a set of coordinated specifications and practices that together enable solutions for developing, deploying, and managing multi-tier server-centric applications. J2EE is build on top of the Java 2 Platform, Standard Edition (J2SE).

Java EE Java Platform, Enterprise Edition. Java EE builds on the solid foundation of Java Platform, Standard Edition (Java SE) and is the industry standard for implementing enterprise-class service-oriented architecture (SOA) and next-generation web applications and provides support for Java EE 5 specifications.

J2CA J2EE Connector Architecture (J2CA) is a J2EE-based technology standard for connecting application servers and enterprise information systems (EIS). J2CA is an earlier version of JCA (see JCA).

JCA Java Connector Architecture. A Java EE-based technology standard for connecting application servers and enterprise information systems (EIS). JCA (or J2CA) specifications provide mechanisms for developing adapters that can be plugged into a Java EE (or J2EE) servers to connect to existing business resources.

JDBC Java Database Connectivity. JDBC is a Java API that enables Java programs to execute SQL statements, and allows Java programs to interact with any SQL-compliant database.

JMS Java Message Service. A Java API for interacting with messaging-based systems. The API supports both the point-to-point (and queuing) and publish/subscribe interaction models. It is the primary standard to provide a reliable foundation for loosely coupled, asynchronous messaging within a distributed environment.

JMX Java Management Extensions. JMX technology provides the tools for building distributed, Web-based, modular and dynamic solutions for managing and monitoring devices, applications, and service-driven networks.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 359: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications Glossary - 5

JNDI Java Naming and Directory Interface. JNDI is part of the Java platform, providing applications based on Java technology with a unified interface to multiple naming and directory services.

JTA Java Transaction API.

JVM Java Virtual Machine.

KPI Key Performance Indicator. KPIs are used to monitor performance of a business or business process and consist of reports, spreadsheets, or charts.

LDAP Lightweight Directory Access Protocol.

LOB Line of Business. LOB is a generic term for a business organization unit.

MAR Metadata Archive.

Mashup Web page or application that combines data or functionality from two or more external sources to create a new service.

MDS Metadata Service. A database repository for storing metadata. It is a critical component of SOA, providing a shared location to manage metadata and govern the asset life cycle.

MOM Message-Oriented Middleware. The term for application communication software that connects systems in a network by carrying and distributing messages between them. The messages may contain data and/or software instructions. MOM infrastructure is typically built around a queuing system that stores messages pending delivery and keeps track of whether and when each message has been delivered.

MQSeries IBM WebSphere MQ is a family of network communication software products launched by IBM in March 1992. It was previously known as MQSeries, a trademark that IBM rebranded in 2002 to join the suite of WebSphere products. WebSphere MQ, which is often referred to simply as "MQ" by users, is IBM's Message Oriented Middleware offering.

MTOM Message Transmission Optimization Mechanism. It is a method of efficiently sending binary data to and from Web services.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 360: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications Glossary - 6

OAGI The Open Applications Group, Inc. OAGI is a nonprofit consortium focusing on the best practices and processes that are based on XML content for e-business and application integration. OAGI was set up to create common standards for the integration of enterprise business applications. Member companies are building specifications to standardize integration between enterprise business applications. The OAGI Business Object Document (BOD) is the architecture that is used to communicate messages or business documents between software applications or components. Each BOD includes supporting details to enable the destination business application to accomplish the action.

OASIS Organization for the Advancement of Structured Information Standards. An international consortium that drives the development, convergence, and adoption of e-business standards. The consortium produces Web services standards and standardization efforts in the public sector and for application-specific markets.

OEM Original Equipment Manufacturers. An OEM manufactures products or components which are purchased by a second company and retailed under the second company's brand name. An OEM model is a form of outsourcing model.

OSOA Open Service Oriented Architecture. OSOA is a collaboration representing an informal group of industry leaders that share a common interest: defining a language-neutral programming model that meets the needs of enterprise developers who are developing software that exploits Service Oriented Architecture characteristics and benefits. The Collaboration is not a Standards Body; it is a set of vendors who wish to innovate rapidly in the development of this programming model and to deliver Specifications to the community for implementation.

PHP PHP: Hypertext Preprocessor. PHP is a widely used as general-purpose scripting language that was originally designed for web development, to produce dynamic web pages.

POJO Plain Old Java Object. POJO is a name used to emphasize that the object in question is an ordinary Java Object, and not a special object, such as an Enterprise JavaBean (see EJB).

POP3 Post Office Protocol Version 3. Post Office Protocol (POP) is an application-layer Internet standard protocol used by local email clients to retrieve email from a remote server over a TCP/IP connection.

Portlet Pluggable user interface software components that are managed and displayed in Web portals.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 361: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications Glossary - 7

QName stands for "qualified name" that is used to uniquely define and reference XML elements and attributes in an XML document. QNames were introduced by the XML Namespaces recommendations, which defines the QName as being composed of a "namespace name" and a "local part." A namespace name is a string formatted as a uniform resource indicator (URI) string or an empty string. The local part is the element name or the attribute name. A namespace name is defined in an XML element with the "xmlns" attribute, which may have a namespace prefix. The namespace prefix is mapped to the URI namespace name. The namespace prefix is used to qualify the XML elements and attributes in the XML document.

QName

RAR Resource Adapter Archive. RAR files are used to package JCA adapters for deployment to a Java EE run-time environment. A Resource Adapter is an archive file format defined in the J2EE Connector Architecture (JCA) specification. Although the file extension of RAR is used (to signify Resource Adapter Archive), it should not be confused with the RAR file extension that indicates use of RAR compression.

REST Representational State Transfer. A collection of network architecture principles that outline how resources are defined and addressed.

RFID Radio Frequency Identification.

RMI Remote Method Invocation. A RPC protocol published for accessing Java object methods remotely within a distributed application system.

ROI Return On Investment. A performance measure used to evaluate the efficiency of an investment or to compare the efficiency of a number of different investments.

RPC Remote Procedure Call. A protocol used in the client-server model that allows one application (the client) to request a service from another application (the server) located on another computer in a network without having to understand network details.

SCA Service Component Architecture. A set of specifications that describe a model for building applications and systems using a Service-Oriented Architecture. SCA extends and complements prior approaches to implementing services, and SCA builds on open standards such as Web services.

Schematron A rules-based XML Schema language that uses XPath expressions to describe validation rules.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 362: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications Glossary - 8

SDO Service Data Objects. A data programming architecture and API for the Java platform that unifies data programming across data source types (relational databases, entity EJB components, XML sources, Web services, JCA, JSP), provides robust support for common application patterns, and enables applications, tools, and frameworks to move easily, query, view, bind, update, and introspect data.

SLA Service-Level Agreement. A contract between a service provider and a service requester that stipulates a specified level of service. An SLA could contain agreements on support options, enforcement or penalty provisions for services not provided, a guaranteed level of system performance, availability, and other quality-of-service (QoS) standards.

SMTP Simple Mail Transfer Protocol. SMTP is an Internet standard for electronic mail (email) transmission across Internet Protocol (IP) networks.

SOA Service-Oriented Architecture. SOA is provides a set of principles of governing concepts used during phases of systems development and integration. An SOA architecture packages functionality as interoperable services. SOA is a design and implementation approach for implementing applications for human and system integration through the use of cooperating services based on a collection of standards. Standards are extensively used to provide a high degree of interoperability and to simply integration.

SOAP Originally defined as Simple Object Access Protocol. An XML-based messaging protocol maintained by W3C that is used to encode the information in Web service request and response messages before sending them over a network. SOAP messages are independent of any operating system or protocol and can be transported using a variety of protocols, including HTTP and JMS.

Stateless Having no information about what occurred previously. Most applications maintain state, which means they remember what users were doing the last time that they ran the application, and they remember all of the configuration settings. In contrast, the Web is intrinsically stateless because each request for a new Web page is processed without any knowledge of the previous pages requested.

Tibco Tibco refers to TIBCO Software Inc. a global company that develops integration software for companies including those in the energy, manufacturing, retail, healthcare, and financial services industries. TIBCO Rendezvous is a software product that provides a message bus for Enterprise Application Integration (EAI).

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 363: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications Glossary - 9

Tuxedo Transactions for Unix, Extended for Distributed Operations. Tuxedo is a middleware platform used to manage distributed transaction processing in distributed computing environments. Tuxedo is a Transaction Processing System or Transaction Oriented Middleware, or Enterprise Application Server for C, C++, and COBOL. Tuxedo is an Oracle product obtain through the acquisition of BEA Systems.

UDDI Universal Description, Discovery, and Integration. An OASIS standard for a platform-independent, XML-based registry to publish and discover network-based software components and services.

VSAM Virtual Storage Access Method. VSAM is an IBM disk file storage access method, first used in the OS/VS2 operating system, later used throughout the Multiple Virtual Storage (MVS) architecture and now in z/OS.

Web Services Web Services are Web applications that are transmitted over the Internet by using the XML, SOAP, WSDL, and UDDI open standards. XML is used to tag the data, SOAP is used to transfer the data, WSDL is used for describing the available services, and UDDI is used for listing the available services.

WLS WebLogic Server.

WLST WebLogic Scripting Tool. A scripting tool used for automating Oracle WebLogic Server management and administration tasks.

WS-* WS-* is a general way of referring to the collection of Web service specifications. There is not a single managed set of specifications referred to by the term WS-*, and nor is there a recognized owning body across all Web Service specifications. The reference term "WS-*" is general way to refer to the many specifications that are named with "WS-" as their prefix.

WS-BPEL Web Services Business Process Execution Language. WS-BPEL is the BPEL version 2.0 specification of the OASIS standard executable language for specifying interactions with Web Services.

WS-Policy WS-Policy is a specification that allows web services to use XML to advertise their policies (on security, Quality of Service, etc.) and for web service consumers to specify their policy requirements.

WS-Security Web Services Security. WS-Security is a communications protocol providing a means for applying security to Web services.

WSDL Web Services Description Language. A standard language for defining a Web service description, which uses XML and XSD to describe the port type and its operations, the message formats, and the protocol bindings.

Ora

cle

Uni

vers

ity a

nd E

gabi

Sol

utio

ns u

se o

nly

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED

Page 364: D53946GC20_sg2

Oracle SOA Suite 11g: Build Composite Applications Glossary - 10

WSFL Web Service Flow Language. It is an XML language for the description of Web services compositions.

WSIF Web Services Invocation Framework. It is a simple Java API for invoking Web Services.

WSIL Web Services Inspection Language. It is an XML document format to facilitate the discovery and aggregation of Web service descriptions in a simple and extensible fashion.

WSPF Web Service Provider Framework.

XML Extensible Markup Language. XML is a set of rules for defining data markup in plain text format.

XPath XML Path Language. XPath is a query language for selecting nodes from an XML document, and may be used to compute values from the content of an XML document. XPath models an XML document as a tree of nodes.

XQuery XML Query Language. XQuery is a query and functional programming language that is designed to query collections of XML data.

XSD XML Schema Definition. Sometimes called XML Schema Document, XSD is a W3C recommendation to formally describe the schema and elements in an XML document. An XSD defines a structure for the custom elements and their corresponding attributes, their relationship to each other, and what types of information/data may be contained in them. This can be used to verify that the content of an XML instance document adheres to a particular schema.

XSL Extensible Stylesheet Language. XSL is a specification (or template) for separating style from content when creating HTML or XML pages.

XSLT Extensible Stylesheet Language Transformations (XSLT) is the language used in XSL style sheets to transform XML documents into other XML documents.

O

racl

e U

nive

rsity

and

Ega

bi S

olut

ions

use

onl

y

THES

E eK

IT M

ATER

IALS

AR

E FO

R Y

OU

R U

SE IN

TH

IS C

LASS

RO

OM

ON

LY.

CO

PYIN

G e

KIT

MAT

ERIA

LS F

RO

M T

HIS

CO

MPU

TER

IS S

TRIC

TLY

PRO

HIB

ITED