Вы находитесь на странице: 1из 324

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

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
NA
KO
Oracle SOA Suite 12c: Build
Composite Applications
Student Guide Volume I
D84361GC10
Edition 1.0 | November 2014 | D89147

Learn more from Oracle University at oracle.com/education/


Author Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Ron Pinkerton Disclaimer

This document contains proprietary information and is protected by copyright and


Technical Contributors other intellectual property laws. You may copy and print this document solely for your
and Reviewers own use in an Oracle training course. The document may not be modified or altered
in any way. Except where your use constitutes "fair use" under copyright law, you
Simone Geib may not use, share, download, upload, copy, print, display, perform, reproduce,
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Jay Kasi publish, license, post, transmit, or distribute this document in whole or in part without
the express authorization of Oracle.
David Mills
The information contained in this document is subject to change without notice. If you
Ted Witiuk find any problems in the document, please report them in writing to: Oracle University,
Pete Laseau 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.
Tom Barrett
Restricted Rights Notice
Editors If this documentation is delivered to the United States Government or anyone using
Vijayalakshmi Narasimhan the documentation on behalf of the United States Government, the following notice is
applicable:
a ble
Smita Kommini
f e r
U.S. GOVERNMENT RIGHTS
an s
Publishers
n - t r
The U.S. Governments rights to use, modify, reproduce, release, perform, display, or
disclose these training materials are restricted by the terms of the applicable Oracle
Michael Sebastian
a no
license agreement and/or the applicable U.S. Government contract.

Pavithran Adka Trademark Notice


h a s
Giri Venugopal
o m )
u ide
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names
c nt G
may be trademarks of their respective owners.
m
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
R K l
A
KON
Contents
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

1 Introduction to Service-Oriented Architecture


Agenda 1-2
Target Audience 1-3
Prerequisites 1-4
Course Objectives 1-5
Course Scope 1-6
Course Map 1-7
a ble
f e r
Where Can I Learn More? 1-8
ans
Objectives 1-9
n - t r
Agenda 1-10
a no
Problem Statement 1-11
h a s
Definition of SOA 1-12
o m )
u ide
Building a Service Portfolio 1-13
m c nt G
b
ni Stude
Assembling Services as Composite Applications 1-14
i
in@ this
Service Component Architecture 1-15
j a
k se
Elements of a Service Component Architecture 1-16
r
a
kon e to u
Why Standards Are Important in SOA 1-17
(
AIN icens
Benefits of SOA 1-18
J
Quiz 1-19
l
A RK
Agenda 1-20
N
KO Oracle SOA Suite 12c: Introduction 1-21
Elements of a SOA Composite Application 1-22
Oracle Mediator 1-24
Oracle BPEL Process Manager 1-25
Oracle Business Rules 1-26
Oracle Human Workflow 1-27
Oracle Adapters 1-28
JDeveloper 1-29
SOA Composer 1-31
Quiz 1-32
Agenda 1-33
WebLogic Application Server 1-34
Oracle Metadata Repository 1-35
Business Events and the Event Delivery Network 1-36
Oracle Web Service Manager Policy Manager 1-38

iii
SOA Run Time 1-39
Quiz 1-40
Agenda 1-41
Production Environment: Example 1-42
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

SOA Quick Start Installation 1-43


Creating a Domain 1-45
Summary 1-46
Agenda 1-47
Practice 1 Overview 1-48
Course Environment 1-49
Launching the Quick Start Installer 1-50
First Look: JDeveloper 1-51
a ble
Starting the Integrated Server 1-52 f e r
ans
Configuring a Domain 1-53
n - t r
2 Getting Started with Composite Applications a no
h a s
) ide
Objectives 2-2
o m u
Agenda 2-3
m c nt G
How Services Communicate 2-4 b
ni Stude
i
Synchronous and Asynchronous Interactions 2-5
j a in@ this
Describing a Message with XSD 2-6
a r k se
kon e to u
Web Services Description Language 2-7
(
Abstract WSDL 2-8
AIN icens
Concrete WSDL 2-9
J
RK l
Quiz 2-10
NA Agenda 2-11
KO Mediator Components: Introduction 2-12
Routing Data 2-13
Transforming Data 2-14
Filtering Data 2-15
Validating Data 2-16
Mediator as a Callable Service 2-17
Dynamic and Static Routing Rules 2-18
Additional Features of Mediators 2-19
Agenda 2-20
Adapters: Introduction 2-21
File Adapter 2-23
Quiz 2-24
Agenda 2-26
Examining the composite.xml Source 2-27
Creating a Mediator 2-28

iv
Creating an Adapter 2-29
Summary 2-30
Practice 2 Overview 2-31
Application Navigator 2-32
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Creating a SOA Application 2-33


Component Palette 2-35
Creating a WSDL 2-36
Creating a File Adapter 2-37
Configuring Mediator Routing Rules 2-38
Project Files 2-39

3 Managing and Monitoring a Composite Application


a ble
Objectives 3-2 f e r
ans
Agenda 3-3
n - t r
Managing SOA Applications: Overview 3-4
Deploying a Composite Application 3-5 a no
h a s
) ide
Building the Service Archive 3-6
o m u
Deploying Multiple SOA Projects 3-7
m c nt G
Versioning Applications 3-8 b
ni Stude
i
Redeploying an Application 3-9
j a
Deployment Options 3-10in@ this
a r k se
kon e to u
Examining the Deployment Log 3-12
(
Application State 3-13
AIN icens
Configuration Plans: Overview 3-14
J
RK l
Modifying a Configuration Plan 3-15
NA Managing the Life Cycle of a Composite Application 3-16
KO Quiz 3-17
Agenda 3-18
Testing a Composite Application 3-19
Initiating a Test in JDeveloper 3-20
Viewing Responses in JDeveloper 3-21
Managing SOA Applications with JDeveloper 3-22
Enterprise Manager 3-23
Oracle Enterprise Manager: Overview 3-25
Testing a Composite Application 3-26
Response Tab 3-27
Flow Trace 3-28
Quiz 3-29

v
Summary 3-30
Practice 3-1 Overview 3-31
Practice 3-2 Overview 3-32
Practice 3-3 and 3-4 Overview 3-33
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

4 Working with Data


Objectives 4-2
Agenda 4-3
Data Standards 4-4
Role of XSD Attributes 4-5
XSL Transformations 4-6
Using XPath Functions 4-7
a ble
Using the Mapper in JDeveloper 4-8 f e r
ans
Auto Map 4-9
n - t r
XPath Functions 4-10
Optional and Repeating Data 4-11 a no
h a s
) ide
Testing Transformations 4-12
o m u
Quiz 4-13
m c nt G
Agenda 4-14 b
ni Stude
XQuery: Introduction 4-15 i
XQuery 4-16 j a in@ this
a r k se
kon e to u
XSLT Versus XQuery 4-17
(
Using XQuery Transformations 4-18
AIN icens
Agenda 4-19
J
RK l
Working with Native Format Data 4-20
NA Native Data Transformation 4-21
KO Invoking the Native Format Builder 4-22
Specifying File Name and Native Data Format 4-23
Specifying a Sample File 4-24
Defining a Schema for a Native Format 4-25
Summary 4-26
Practice 4 Overview 4-27
Practice 4 Overview: 4-28

5 Using JMS and JDBC Adapters


Objectives 5-2
Agenda 5-3
Binding Components 5-4
JCA Adapters 5-5
Oracle JCA Adapters 5-6
Monitoring Adapters 5-7

vi
Quiz 5-8
Agenda 5-9
JMS Specification: Definition 5-10
JMS Message 5-11
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

JMS Messaging 5-12


JMS Resources 5-13
Adapters and the WebLogic Application Server 5-14
Connection Management 5-15
Oracle JMS Adapter 5-16
Configuring JMS Resources with WebLogic Administration Console 5-18
Defining a Message Destination 5-19
Defining a Connection Factory 5-20
a ble
Defining a Connection Pool 5-21 f e r
ans
Associating the JMS Connection Pool to a Connection Factory 5-22
n - t r
JMS Adapter as Producer 5-23
JMS Adapter as Consumer 5-25 a no
h a s
) ide
Quiz 5-26
o m u
Agenda 5-27
m c nt G
b
ni Stude
Database Adapter: Introduction 5-28
i
Configuring a Database Adapter 5-29
j a in@ this
Configuring a Database Adapter Service Connection 5-30
a r k se
kon e to u
Configuring a Select Statement: Operation Type 5-31
(
Configuring a Select Statement: Importing Tables 5-32
AIN icens
Configuring a Select Statement: Filtering Attributes 5-33
J
RK l
Configuring a Select Statement: Defining Selection Criteria 5-34
NA Configuring a Select Statement: Editing the Expression 5-35
KO Configuring a Select Statement: Advanced Options 5-36
Database Adapter Runtime Connections 5-38
Transactionality 5-39
Quiz 5-40
Summary 5-41
Practice 5-1 to 5-4 Overview 5-42
Practice 5-5 to 5-7 Overview 5-43
Optional Challenge Practice 5-8 Overview 5-44
Optional Challenge Practice 5-9 Overview 5-45

6 Introduction to BPEL
Objectives 6-2
Agenda 6-3
Business Processes and BPEL 6-4
Parts of a BPEL Process 6-5

vii
BPEL, WSDL, and XSD 6-6
Partners, Partner Links, and Roles 6-7
Variables in BPEL 6-8
Interacting with Partners 6-9
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Synchronous Process Concepts 6-11


Asynchronous Process Concepts 6-12
Assigning Values to Variables 6-13
Ordering Execution with a Sequence Activity 6-14
Structuring a Process with a Scope Activity 6-15
Global and Local Variables 6-16
Manipulating Data in Variables 6-17
Transformation 6-18
a ble
Quiz 6-19 f e r
ans
Agenda 6-20
n - t r
BPEL Design Editor 6-21
Creating a BPEL Process 6-23 a no
h a s
) ide
Mapping Values to Variables 6-24
o m u
Using Expression Builder 6-25
m c nt G
b
ni Stude
Testing a BPEL Process 6-26
i
Examining the BPEL Process Audit Trail 6-27
j a in@ this
Examining the BPEL Process Visual Flow 6-28
a r k se
kon e to u
Quiz 6-29
(
Summary 6-30
AIN icens
Practice 6 Overview 6-31
J
RK l
O NA7 More BPEL Activities
K Objectives 7-2
Agenda 7-3
Conditional Branching with the If Activity 7-4
Processing with the Flow Activity 7-5
Using the nonBlockingInvoke Property 7-6
Parallel and Sequential Looping with the forEach Activity 7-7
Suspending a Process with the Wait Activity 7-9
Waiting for a Message with the Pick Activity 7-10
Looping with the While Activity 7-11
Indexing XML Arrays Dynamically 7-12
Quiz 7-13
Basic BPEL 2.0 Activities 7-14

viii
Structured and Extension BPEL 2.0 Activities 7-16
Summary 7-18
Practice 7 Overview 7-19
Before You Begin 7-22
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

8 Handling Faults in Composite Applications


Objectives 8-2
Agenda 8-3
Faults: Overview 8-4
Fault-Handling Challenges 8-5
Fault-Handling Options 8-6
Agenda 8-7
a ble
Managing Faults in a Mediator 8-8 f e r
ans
Quiz 8-9
n - t r
Agenda 8-10
Faults in BPEL Processes 8-11 a no
h a s
) ide
Faults in Synchronous BPEL 8-12
o m u
Synchronous Service Faults 8-13
m c nt G
Review: Scope Activity 8-14 b
ni Stude
Fault Handlers 8-15 i
j a in@ this
Returning Faults from a Synchronous Process 8-17
a r k se
kon e to u
Returning Faults from an Asynchronous Process 8-18
(
Catching BPEL Runtime Faults 8-20
AIN icens
Faults That Cannot Be Handled 8-21
J
RK l
Throwing Faults 8-22
NA Quiz 8-24
KO Agenda 8-26
Review: Transactionality 8-27
Compensation 8-28
Compensation Handlers 8-29
Invoking Compensation 8-30
Quiz 8-31
Agenda 8-32
Fault Management Framework: Overview 8-33
Fault Management Framework and BPEL 8-34
Fault Management Framework and Mediator 8-35
Defining a Fault Policy Document 8-36
Specifying a Default Action 8-37
Defining Fault Bindings 8-38
Quiz 8-39
Agenda 8-40

ix
Recovering Faults with Enterprise Manager Fusion Middleware Control 8-41
Accessing a Recoverable Fault 8-42
Recovering a Fault Condition 8-43
Summary 8-45
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Practice 8-1 to 8-4 Overview 8-46


Practice 8-5 Overview 8-49

9 Implementing Human Workflow and Notifications


Objectives 9-2
Agenda 9-3
Human Tasks: Introduction 9-4
Human Tasks: Overview 9-5
a ble
Human Task Service Component 9-6 f e r
ans
Human Tasks in a Composite Application 9-7
n - t r
Adding a Human Task to a Composite Application 9-8
Configuring the Human Task 9-9 a no
h a s
) ide
Configuring the Task Outcomes 9-10
o m u
Adding Human Task Parameters 9-11
m c nt G
b
ni Stude
Assigning Task Participants 9-12
i
Configuring Task Participants 9-13
j a in@ this
Configuring the Stages of a Task 9-15
a r k se
kon e to u
Configuring Expiration and Escalation Settings 9-16
(
Configuring Notification Settings 9-17
AIN icens
Adding a Human Task to a BPEL Process 9-18
J
RK l
Quiz 9-20
NA Agenda 9-21
KO Task Display Forms 9-22
Generating a Task Display Form 9-23
Deploying Task Display Forms 9-24
Accessing the Worklist Application 9-25
Viewing and Acting on Task Information 9-26
Quiz 9-27
Agenda 9-28
Working with Notification Services 9-29
Oracle User Messaging Service (UMS) 9-30
Configuring UMS Notification Properties 9-31
Configuring the User Messaging Email Driver 9-32
Viewing and Testing Email Notifications 9-33
Sending Email Notification from BPEL 9-34
Sending a Notification to a Users Preferred Channel 9-35
Quiz 9-36

x
Summary 9-37
Practice 9 Overview 9-38

10 Sharing Functionality in Oracle SOA Suite


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

Objectives 10-2
Agenda 10-3
Design-Time Metadata Services (MDS) Repository 10-4
Quiz 10-6
Agenda 10-7
Templates: Overview 10-8
Creating and Using Templates 10-10
Using Project Templates 10-11
a ble
Using Service Component Templates 10-12 f e r
ans
Using BPEL Scope Activity Templates 10-14
n - t r
Quiz 10-15
Agenda 10-16 a no
h a s
) ide
BPEL Subprocesses: Introduction 10-17
o m u
Stand-Alone Subprocess 10-19
m c nt G
b
ni Stude
Calling a Stand-Alone Subprocess 10-20
Inline Subprocess 10-21 i
j a in@ this
Comparing Stand-Alone and Inline Subprocesses 10-22
a r k se
kon e to u
Creating an Inline Subprocess 10-23
(
Calling an Inline Subprocess 10-24
AIN icens
Creating a Stand-Alone Subprocess 10-25
J
RK l
Calling a Stand-Alone Subprocess from BPEL 10-27
NA Differences Between Templates and Subprocesses 10-28
KO Quiz 10-29
Summary 10-30
Practice 10 Overview 10-31

11 Using the REST Adapter


Objectives 11-2
Agenda 11-3
REST: Overview 11-4
REST Queries 11-5
Comparing REST and SOAP: Two Ways to Access Web Services 11-6
Example Use Cases for REST and SOAP 11-7
Agenda 11-8
Supported Features in Oracle SOA Suite 11-9
REST Adapter 11-10
Creating a REST Binding 11-11

xi
Adding an Operation Binding 11-12
The Finished Binding Component 11-13
Testing the Component 11-14
Examining the Results 11-15
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Quiz 11-16
Summary 11-17
Practice 11 Overview 11-18
Practice 11-1 to 11-4: Overview 11-19

12 Developing Business Rules


Objectives 12-2
Agenda 12-3
a ble
Business Rules: Introduction 12-4 f e r
ans
Business Rules Component 12-5
n - t r
Business Rules Use Cases 12-6
Declarative Rules 12-8 a no
h a s
) ide
Facts 12-9
o m u
Decision Tables 12-10
m c nt G
Value Sets 12-11 b
ni Stude
Globals 12-12 i
Rulesets 12-13 j a in@ this
a r k se
kon e to u
Rules Dictionary 12-14
(
Oracle Business Rules RL Language 12-15
AIN icens
Oracle Business Rules SDK 12-16
J
RK l
Oracle Business Rules Components 12-17
NA Editing Business Rules at Run Time 12-18
KO Quiz 12-19
Agenda 12-20
Business Rules Component: Overview 12-21
Creating a Business Rules Service Component 12-22
Adding a Business Rule to a BPEL Process 12-23
Configuring a Business Rule in a BPEL Process 12-24
Examining Business Rules Component Files 12-25
Editing the Rules Dictionary 12-26
Defining Globals 12-27
Defining Value Sets 12-28
Defining a Ruleset 12-29
Defining a Decision Table 12-30
Decision Functions 12-31
Quiz 12-32
Summary 12-33

xii
Practice 12-1 to 12-3 Overview 12-34
Practice 12-4 to 12-6 Overview 12-35

13 Designing and Managing Business Events


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

Objectives 13-2
Agenda 13-3
Problem Statement 13-4
Event Delivery Network 13-5
Aligning SOA and EDA Through EDN 13-6
Events: Introduction 13-7
XSD 13-8
Event Definition Language 13-9
a ble
Event Publication 13-10 f e r
ans
Event Subscription 13-11
n - t r
Event Publication and Subscription 13-12
Quiz 13-13 a no
h a s
) ide
Agenda 13-14
o m u
Creating an Event Definition 13-15
m c nt G
b
ni Stude
Configuring a Mediator to Publish Events 13-16
i
Configuring a Mediator to Subscribe to Events 13-17
j a in@ this
Setting Event Delivery Consistency 13-18
a r k se
kon e to u
Publishing Events in BPEL Components 13-19
(
Subscribing to Events in BPEL Components 13-20
AIN icens
Managing Events from Enterprise Manager 13-21
J
RK l
Viewing Event Subscriptions 13-22
NA Quiz 13-23
KO Summary 13-24
Practice 13 Overview 13-25

14 Testing and Debugging Composite Applications


Objectives 14-2
Agenda 14-3
Testing SOA Composite Applications 14-4
Introducing the Composite Test Framework 14-5
Emulations and Assertions 14-6
Test Suites: Overview 14-7
Test Cases: Overview 14-8
Contents of a Test Case 14-9
Creating a Test Suite 14-10
Creating the First Test Case 14-11
Test Case Editor 14-12

xiii
Test Case File 14-13
Creating Emulations 14-14
Emulating Events in a Test Case 14-15
Creating Assertions 14-16
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Quiz 14-18
Agenda 14-19
Selecting the Test Cases to Run 14-20
Running the Test Cases 14-22
Examining Results of a Test Run 14-23
Quiz 14-25
Agenda 14-26
Troubleshooting Guidelines 14-27
a ble
Debugging SOA Composite Applications with the SOA Debugger 14-29 f e r
ans
Starting the Debugger 14-30
n - t r
Setting Breakpoints in Services 14-31
Setting Breakpoints in BPEL 14-32 a no
h a s
) ide
Initiating Debugging 14-33
o m u
Examining Values 14-34
m c nt G
Frames 14-35 b
ni Stude
i
Stepping Through the Application 14-36
j a in@ this
Ending a Debug Session 14-37
a r k se
kon e to u
Summary 14-38
(
Practice 14-1 to 14-3 Overview 14-39
AIN icens
Practice 14-4 Overview 14-40
J
RK l
O NA15 Securing Composite Applications and Invoking Secured Services
K Objectives 15-2
Agenda 15-3
Web Service Security: Introduction 15-4
Securing Endpoints: Examples 15-7
Quiz 15-8
Agenda 15-9
Oracle Web Services Manager 15-10
OWSM Policy Framework 15-11
Components of Oracle Web Services Manager Architecture 15-12
Policies: Introduction 15-13
Policy Assertions 15-14
Types of Security Tokens 15-15
Security Assertion Markup Language (SAML) 15-17
Security Policies: Introduction 15-18
Quiz 15-19

xiv
Agenda 15-20
Securing SOA and Identity Propagation 15-21
Attaching a Policy to an Inbound Request 15-22
Attaching a Policy to an Inbound Request by Using Oracle JDeveloper 12c 15-23
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Attaching a Policy to an Outbound Request 15-24


Attaching a Policy to an Outbound Request by Using Oracle JDeveloper 12c 15-25
Managing SOA Composite Application Policies 15-26
Summary 15-28
Practice 15 Overview 15-29

A Request-Response Patterns
Request-Response Patterns A-2
a ble
One-Way Message Interaction A-3 f e r
ans
Synchronous Interaction A-5
n - t r
Asynchronous Interaction A-7
One Request, Multiple Responses A-8 a no
h a s
) ide
One Request, a Mandatory Response, and an Optional Response A-9
o m u
c nt G
Asynchronous Interaction with Timeout Pattern A-11
m
b
ni Stude
Asynchronous Interaction with a Notification Timer Pattern A-12
i
One Request, One of Two Possible Responses A-13
j a in@ this
Multiple Requests, Multiple Responses A-15
a r k se
kon e to u
Multiple Requests, First Response A-16
(
BPEL Deployment Descriptor Properties A-17

J AIN icens
RK l
NA
KO

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

KO
N
ARK
J l
(
AIN icens
a r j a
kon e to u
k se
i
in@ this
b m
o
ni Stude
m ) h a
c nt G u
a
ide
s
n no
- t r an
s
f e r a b
le
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Introduction to Service-Oriented Architecture

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO
Agenda

Course Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Introduction to Service-Oriented Architecture


Oracle SOA Suite 12c Design Time: Overview
Oracle SOA Suite 12c Run Time: Overview
Installing Oracle SOA Suite 12c
Practice Overview le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 2


Target Audience
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

This course places strong emphasis on hands-on practices.


It is written for a developer who has technical background, but does not
have any experience with Oracle SOA Suite.
The course provides an overview of SOA features and functionality.
The goal of the course is to provide you with an understanding of Oracle
SOA Suite, and help you to arrive at a level of comfort by using it to r a ble
e
create and configure composite applications.
trnsf
a
n -
no a
a
h de s
)
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
This course l targeted at application architects, business analysts, IT managers,
K is primarily
O NA
and SOA project managers. In addition, technical personnel who are interested in using the
K SOA platform, SOA administrators, and developers will find this course useful for explaining
basic concepts and introducing the Oracle SOA product suite. However, it does not teach how
to develop production-level composite applications or how to administer SOA deployments.

Oracle SOA Suite 12c: Build Composite Applications 1 - 3


Prerequisites

This course assumes that:


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

You have completed the Oracle University course titled


XML Fundamentals or have equivalent knowledge of XML.
This helps in understanding principles related to XML
documents, XPath, XML Schema, and XML Namespace.
Your technical background includes an understanding of
web service concepts such as Web Services Description
r a ble
Language (WSDL), SOAP, and Universal Description, sfe
n
Discovery and Integration (UDDI) -tra on
a n
a
h de s
)
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
StudentsKwho have lsome knowledge of the concepts listed in the slide will benefit from most
ofN Acourses content.
the
K O

Oracle SOA Suite 12c: Build Composite Applications 1 - 4


Course Objectives
After completing this course, you should be able to:
Orchestrate business process flows by using BPEL
Work with Mediator components with routing rules, filters,
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

and transformations
Implement a Business Rule component with IF/THEN rules
and Decision Tables
Test, debug, and troubleshoot a SOA composite
application
Initiate SOA composite applications by using the Event
r a ble
Delivery Network n s fe
Apply security policies to service endpoints to secure n - tra
interactions a no
h a s
Implement Human Workflow with Human Task
components o m )
u ide
m c nt G
Describe SOA conceptsin b
i related
and de technology
t u
Create a SOA composite is S
in@ application by using JDeveloper
a r kja se th
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 5


Course Scope

SOA Suite Installation


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

Oracle JDeveloper Spring Context


Oracle Enterprise Manager Oracle Business Activity
Service Infrastructure Monitoring
Oracle Mediator Oracle B2B
Oracle Adapters Oracle Service Bus
Oracle Business Rules Oracle Enterprise Scheduler
Oracle BPEL Process Manager Managed File Transfer
Human Workflow Oracle Event Processing a ble
f e r
Business Events and Events
ans
Delivery Network
n - t r


Oracle Metadata Repository
Oracle WSM Policy Manager a no
Oracle User Messaging Service h a s
o m ) Thisicourse
u de
m c ntexplores G these
b
ni Stude topics.
@ i
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 6


Course Map

Introduction to Managing and


Getting Started
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

SOA Monitoring

Working with JMS and JDBC


The Basics
Data Adapters

Introduction to More BPEL Fault Handling in


Focus on BPEL
BPEL Activities BPEL

a ble
Tools and Sharing The REST f e r
Techniques
Human Tasks
Functionality Adapter ans
n - t r
concepts a no
Business Rules
h a s
Events
features o m )
u ide
m c nt G
work smarter, Testing b
ni Stude Security
and
i
Debugging
in@ this
not harder

r j a
k se
a
on t2014, uOracle and/or its affiliates. All rights reserved.
( kCopyright o
A I N nse
K J l i ce
R
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 7


Where Can I Learn More?

Topic Website
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Education and Training http://education.oracle.com


Product Documentation http://docs.oracle.com
Product Downloads http://www.oracle.com/technology/software
Product Articles http://www.oracle.com/technetwork/articles
Product Support http://www.oracle.com/support
Product Forums http://forums.oracle.com
a ble
Product Tutorials http://www.oracle.com/oll f e r
ans
Sample Code http://www.samplecode.oracle.com/
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 8


Objectives

After completing this lesson, you should be able to:


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

Describe Service-Oriented Architecture (SOA)


Explain services and key standards
Describe Service Component Architecture (SCA)
Describe the functionality of Oracle SOA Suite 12c service
components and adapters
le
Describe how WebLogic Application Server is used by erab
Oracle SOA Suite a n sf
r n -t
o
s an
) ha de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R K
This introductory l is intended to present some important vocabulary and concepts
lesson
O NA to Service-Oriented Architecture. It is also intended to present a high-level overview of
related
K the components and features of Oracle SOA Suite 12c, and to relate those components and
features to SOA.

Oracle SOA Suite 12c: Build Composite Applications 1 - 9


Agenda

Course Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Introduction to Service-Oriented Architecture


Oracle SOA Suite 12c Design Time: Overview
Oracle SOA Suite 12c Run Time: Overview
Installing Oracle SOA Suite 12c
Practice Overview le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 10


Problem Statement
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Field Service Scheduling Order Processing Account Management

Customer Status Customer Status Shipping Charges

Product Availability Product Availability Order Status

Verify Customer Credit Verify Customer Credit

Order Status
a b le
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
Marketing CRM b
Financeni Warehouse de Other Biz Trading
System System System
i
@ is S t u
Mgmt Unit Partner
i n
a r kja se th
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i cein many ways, some of which are proprietary approaches that have
N ARsilo (stand-alone) systems to be integrated, typically in a point-to-point manner.
Integration
enabled
can be done

KOHowever, the point-to-point approach tends to be brittle, and difficult to maintain over time.
Functionality is often duplicated across applications. Changes to a single application interface
have the potential to impact large numbers of systems, each of which may need
modificationa time-consuming and expensive proposition.
Vendor-specific integration technologies such as Tuxedo have enabled systems to
standardize the way integration is done within their own implementation, but because Tuxedo
does not provide native support for web services, it keeps the technology confined to the
organization that embraced it.
The computing industry worked to create a standardized protocol and software integration
method called Common Object Request Broker Architecture (CORBA) that enabled systems
to integrate by using a standard (non-XML-based) interface definition language for generating
code templates that could be distributed. Although it is possible to apply a SOA approach with
CORBA, its lack of widespread adoption and accessibility, in addition to its remote procedure
call mechanisms, make it costly to implement and less friendly to use across an intranet or the
Internet.

Oracle SOA Suite 12c: Build Composite Applications 1 - 11


Definition of SOA
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

An IT strategy that organizes the discrete functions


contained in enterprise applications into interoperable,
standards-based services to be combined and reused
quickly to meet business requirements

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce attempts to overcome many of the shortcomings of earlier
N AR technologies by embracing the concept of a service. A service is a discrete,
Service-oriented
integration
architecture

KOdecoupled unit of business functionality that is exposed and available to (ideally) all
applications in the enterprise.
Services are the building blocks for a SOA-enabled application. They have functionality-
described standard interface and message structure definitions. Multiple services are
assembled and reused to more quickly create applications that can better support changing
business processes.
The SOA approach to software systems enables a consumer of a service to be decoupled
from the service provider. With SOA, services are accessed by using standard protocols (the
glue), which enable interoperability from decoupled functions.

Oracle SOA Suite 12c: Build Composite Applications 1 - 12


Building a Service Portfolio
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Field Service Scheduling Order Processing Account Management


Service
Portfolio

Verify
a ble
Customer
Customer
Product
Order Status
Shipping
f e r
Status
Credit
Availability Charges
ans
n - t r
a no
h a s
o m )
u ide
m c
Warehousent Other Biz
G
Marketing CRM Finance
i b d e Trading
System System System
@ in Stu Mgmt Unit Partner

j a in this
a r k s e
n
ko e to
Copyright 2014, uOracle and/or its affiliates. All rights reserved.
(
J AIN icens
R K
When embarking onl a SOA approach to systems integration, integrators begin by examining
O NA process requirements to identify functionality to be used as a service unit to help
business
K complete a business process. A service portfolio is identified from a set of services that are
required for implementing one or more business processes within a business domain.
A service portfolio can be realized by a combination of new and reused functionality. Existing
functionality can be wrapped as services by using the adapter technology. New services can
be created with SOA-enabled technologies, including web services, SCA composite
applications, BPEL, and a service bus.
When a collection of services has been identified to serve a business process, it is
recommended to store information about these services, their interfaces, and their message
structures in a common location such as an enterprise repository. This facilitates sharing and
reusability from design through production. Coupled with a service registry, an enterprise
repository can migrate runtime service information into the development, test, and production
operational environments. Coupling an enterprise repository and a service registry enables an
organization to implement strong SOA governance strategies for services throughout a
services life cycle, from the design-time environment to the runtime environment.

Oracle SOA Suite 12c: Build Composite Applications 1 - 13


Assembling Services as Composite Applications
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Field Service Scheduling Order Processing Account Management

Verify
a ble
Customer
Customer
Product
Order Status
Shipping
f e r
Status
Credit
Availability Charges
ans
n - t r
a no
h a s
o m )
u ide
m c
Warehousent Other Biz
G
Marketing CRM Finance
i b d e Trading
System System System
@ in Stu Mgmt Unit Partner

j a in this
a r k s e
n
ko e to
Copyright 2014, uOracle and/or its affiliates. All rights reserved.
(
J AIN icens
When aR K
satisfactorylservice portfolio is created, the necessary services are assembled to
O NAa composite application to address a specific business requirement. Services are reused
form
K as appropriate in multiple composite applications. As a result, development time and
redundant functionality are dramatically reduced.

Oracle SOA Suite 12c: Build Composite Applications 1 - 14


Service Component Architecture

Service Component Architecture (SCA) is a set of


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

specifications that describe a model for building applications by


using a Service-Oriented Architecture.
Services are assembled to form a composite application
that creates a solution that addresses a specific business
requirement.
Composite applications may contain new services
r a ble
(specifically for the application) and business functionssfe
from existing systems and applications (reused in-the t r an
composite application). n on
s a
SCA provides a model for both the composition
) a
h de of services
and the creation of service components,
c ui
om t Gincluding reuse of
b m n
ini
existing application functions.
@ ude S t
n
jai e thi s
r k
a 2014,uOracle
s and/or its affiliates. All rights reserved.
o n
k e to
Copyright
(
J AIN icens
R K Component
The Service l Architecture (SCA) specification provides a programming model for
O NA applications and systems based on a SOA approach. SCA is based on the concept
building
K that a business function is provided as a series of services. These composite applications
may contain new services (specifically for the application) and business functions from
existing systems and applications (reused in the composite application). SCA provides a
model for both the composition of services and the creation of service components, including
reuse of existing application functions.
When assembled together into a composite application, they are managed, maintained, and
deployed together. This streamlines and simplifies management of cooperating service
components compared to earlier technologies that managed SOA applications as a set of
individual services. Because its functionality can be exposed as a service through service
entry points, the SOA composite application is itself a coarse-grained service.
For more information about the SCA initiative, visit: http://www.oasis-opencsa.org/sca.

Oracle SOA Suite 12c: Build Composite Applications 1 - 15


Elements of a Service Component Architecture
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Composite
Application
BPEL Java Others
Client and Implementation
Assembly Model Specifications
Assembly Specifications Implementation Language
Specifications
a ble
f e r
an s
n - t r
o
nJDBC
Security Transactions
Reliable
SOAP JMS s a Others
messaging a
) h ide
Policy Framework c m
o t GuBindings

m Access n Method Specifications
Infrastructure Service i b d e
Specifications @ in Stu
j a i n t h is
a r k s e
n
ko e to
Copyright 2014, uOracle and/or its affiliates. All rights reserved.
(
J AIN icens
SCA isRaK l specifications.
collection of
O NA model specifications define a standard set of XML elements that are used to
Assembly
K define the structure and configuration of an SCA composite application.
Client & implementation (C&I) specifications define an implementation language, such as:
BPEL: The WS-BPEL Client and Implementation (BPEL C&I) model specifies how WS-
BPEL processes can be used as SCA components.
Java, C++, PHP: This specifies language-specific APIs and annotations, which enable
the creation of service components and service clients that are built in these languages.
Note: Oracle SOA Suite 12c implements BPEL and other components such as
Mediator. At this time, it does not implement C++ or PHP. The spring framework can be
used to integrate components that use Java interfaces into SOA composite applications.
Policy framework specifications capture and express nonfunctional requirements, such as
security of a service definition. The policy framework impacts the life cycle of components and
compositions. It supports specification of constraints, capabilities, and quality of service (QoS)
from component design through concrete deployment.
Binding specifications define how services and references are accessed by using different
transport types. There is a binding specification available for each different access method.

Oracle SOA Suite 12c: Build Composite Applications 1 - 16


Why Standards Are Important in SOA

Specifications Service Component Assembly


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

forming a Architecture (SCA) Model


collection of
standards Service Data Objects (SDO) Data Access

Orchestration: Business Process Execution Business


Language (WS-BPEL) processes

Management WS-Reliable Messaging WS-Security Quality of


WS-Policy service
a ble
WS-Security Universal Description, Discovery, and Integration
f e r
(UDDI)
ans
Discovery
n - t r
Web Services Description Language (WSDL)
a no Description
SOAP, REST h a s
o m )
u ide Message
XML, XSD, XQUERY, XSLT,
m c JSON t G
b
i tuSMTP de n
HTTP(S),in IIOP, JMS, Transport
i n @ is S
a r kja se th
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cfunctions
A R
Services are business that form the foundation for using a SOA approach to building
N
applications. SOA applications aggregate functionality of related services to automate a
KObusiness process. In order to reuse services (a fundamental goal of SOA), service
functionality must be described by using standard interface and message structures.
SOA-based approaches have, naturally, embraced many of the message standards illustrated
in the graphic in the slide, including XML, XSD, and SOAP. These document structures are
easily exchanged by using standard Internet protocols such as HTTP. This results in easier
interoperability across intranet and Internet networks. Discovery and description standards
such as WSDL and UDDI contribute to the reusability of services and help achieve
independence of hardware, operating systems, and implementation languages.
As their names suggest, the WS-Security and WS-Reliable Messaging standards describe
standards for secure and reliable message delivery among service-based applications.
BPEL provides XML grammar for describing a business process as a series of activities.
The Service Component Architecture (SCA) and Service Data Objects (SDO) specifications
are works in progress, guided by the OASIS organization. This work may lead to a new
collection of standards with a SOA-enabled approach in mind.

Oracle SOA Suite 12c: Build Composite Applications 1 - 17


Benefits of SOA

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

Existing functionality within an application is reused across


business organizations and processes.
Interoperability
Communication between services is not dependent on the
platform. Services are loosely coupled to the application.
Scalability
a ble
e r
Applications are flexible to changing business requirements.
a n sf
Cost efficiency n - tr
Costs are reduced and delivery of new functionality a no is
h a s
accelerated because existing resources
m ) are
i d e
reused and
integration of business resources co is nstandards G u based.
b m t
i ni Stude
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
R
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 18


Quiz

Service Component Architecture (SCA) is a competing


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

standard to Service-Oriented Architecture (SOA).


a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARb
Answer:
N
KOFalse. The Service Component Architecture (SCA) specification is complementary to SOA. It
provides a programming model for building applications and systems based on a SOA
approach.

Oracle SOA Suite 12c: Build Composite Applications 1 - 19


Agenda

Course Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Introduction to Service-Oriented Architecture


Oracle SOA Suite 12c Design Time: Overview
Oracle SOA Suite 12c Run Time: Overview
Installing Oracle SOA Suite 12c
Practice Overview le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 20


Oracle SOA Suite 12c: Introduction

Oracle SOA Suite 12c provides a comprehensive suite of


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

components for developing, securing, and monitoring SOA,


including:
Service components, which are the building blocks that
are used to construct a SOA composite application
Service engines, which implement service components at
run time
r a ble
Adapters, which provide connectivity to functionality nsfe
outside the composite application n - tra
Service infrastructure, which provides the a no
internal
h a s
o m )
u idefor
message transport infrastructure capabilities
mcandnenabling
connecting service components tG data flow
i nib Stude
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
e
K JSuite isliaccomplete
OracleRSOA set of service infrastructure components that enable services
toN A
be created, managed, and orchestrated into SOA composites by using Business Process
KOExecution Language (BPEL) and SCA. Together, these components provide task services,
decision (rule-based) services, and adapter services. The unified architecture provides a
comprehensive, standards-based platform for deploying and managing composite business
applications with content and human workflow steps.

Oracle SOA Suite 12c: Build Composite Applications 1 - 21


Elements of a SOA Composite Application
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

1 2 3

4 le
r a b
s f e
- t r an
n no
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
A SOAR K J islianceassembly of services, service components, and references that are
composite
NA and deployed together in a single application. Wiring between the service, service
Odesigned
K component, and reference enables message communication. The composite processes the
information described in the messages. The graphic in the slide provides an example of a
composite that includes an (inbound) exposed service, a variety of service components
interacting, and several external references.
1. Services provide the composite client with an entry point to the SOA composite
application. The service advertises its capabilities (also known as operations) to external
applications with a Web Services Description Language (WSDL) file. The binding of the
service describes the protocols that can communicate with the application. Examples
include SOAP/HTTP or a JCA adapter.
2. Service components are the building blocks of a SOA composite application. Oracle
SOA Suite 12c includes the following components:
- The BPEL Process component enables design and execution of a business process
that integrates a series of business activities and services into an end-to-end
process flow.
- The Business Rules component provides the means of making business decisions
based on defined rules.

Oracle SOA Suite 12c: Build Composite Applications 1 - 22


- The Human Task component allows you to model a workflow that describes tasks
for users or groups to perform as part of an end-to-end business process flow.
- The Mediator component is used for validation, transformation, and routing of
message data between components.
3. References enable messages to be sent from the SOA composite application to
services that are external to the composite.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

4. Wires enable you to graphically define the flow of messages within a single SOA
composite application among services, service components, and references.
Note: The wire is not an actual call, but an ability to call. (For example, the routing rules in
Mediator or the invoke/receive activities in BPEL are actual calls, but they can only go
alongside previously defined wires.)

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 23


Oracle Mediator

Oracle Mediator routes data from


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

client applications to and from


Validate
other service components, and
from service components to
external partners.

Filter

a ble
f e r
Transform
ans
n - t r
a no
It provides validation, filtering,
h a s
routing, and transformation
capabilities. o m
Route
)
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
OracleR K J routes
Mediator licedata from client applications to and from other service components,
O NA
and from service components to external partners. Using Oracle Mediator, you create routing
K services and rules for them. A routing service is the key component for moving a message
through the composite applicationfrom its entry point to its exit point. The rules determine
how a message instance processed by the routing service gets to its next destination. Using
the rules, Oracle Mediator can perform the following actions:
Route: Determines the service component (BPEL process, business rule, human task,
or Mediator) to which to send the messages
Validate: Provides support for validating the incoming message payload by using a
schematron or an XSD file
Filter: If specified in the rules, applies a filter expression that specifies that the contents
(payload) of a message be analyzed before any service is invoked
Transform: If specified in the rules, transforms document data from one XML schema to
another, thus enabling data interchange among applications by using different schemas
At run time, Oracle Mediator evaluates routing rules, performs transformations, applies
optional time delays, and invokes another service. In addition, it can subscribe to and publish
business events. A routing service can handle returned responses, callbacks, faults, and time-
outs.

Oracle SOA Suite 12c: Build Composite Applications 1 - 24


Oracle BPEL Process Manager
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Business
Process

Client
a b le
f e r
ans
n - t r
a noExternal
h a s Service
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K JProcess e
licManager
OracleRBPEL provides the standard for assembling a set of discrete
A
N into an end-to-end process flow, thus radically reducing the cost and complexity of
services
KOprocess integration initiatives. Oracle BPEL Process Manager enables you to orchestrate
synchronous and asynchronous services into end-to-end BPEL process flows. You integrate
BPEL processes with external services (known as partner links). You also integrate
technology adapters and services, such as human tasks, transformations, notifications, and
business rules within the process.
Note: Business processes that are based on Business Process Modeling Notation (BPMN)
can be built by using Oracle BPM (OBPM) Suite. The OBPM Suite is layered on top of the
SOA Suite, and shares a unified run time.

Oracle SOA Suite 12c: Build Composite Applications 1 - 25


Oracle Business Rules

Oracle Business Rules enable dynamic


decisions at run time. Policies,
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

computations, and reasoning are


automated. Business logic is separated from
underlying application code.

Oracle
Business Rules
implements
conditions as a ble
f e r
IF-THEN
ans
n - t r
structures or as
Rules
Rules
Decision tables.
decision Tables
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
OracleR K J Rules
Business liceenable dynamic decisions at run time, allowing you to automate
O NA constraints, computations, and reasoning while separating rule logic from underlying
policies,
K application code. Oracle Business Rules implements conditions as IF-THEN structures or as
decision tables. These conditions can be edited by a business analyst to update policies and
computational values with little or no assistance from a programmer.
Examples for using business rules include:
Dynamic processing: Rules can determine intelligent routing paths within a business
process based on service-level agreements or other guidelines.
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 to
dispatch tasks to specific roles or users, or for balancing tasks among users to control
the task assignment load.

Oracle SOA Suite 12c: Build Composite Applications 1 - 26


Oracle Human Workflow

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

Application

create assign act

a b le
complete complete
f e r
a n s
Task Service Assignee n-t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce processes require human interactions for approvals, exception
N AR or other activities that are required to advance the business process. The
Many end-to-end
management,
business

KOhuman workflow component provides 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 that are required for ensuring
timely performance of a task (human task activity)
Presentation of tasks to end users through a variety of mechanisms, including a worklist
application
Organization, filtering, prioritization, and other features that are required for end users to
productively perform their tasks
Reports, reassignments, load balancing, and other features that are required by
supervisors and business owners to manage the performance of tasks

Oracle SOA Suite 12c: Build Composite Applications 1 - 27


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

Adapters can be
inbound or outbound.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce interface that exposes external application functionality in a form
A R
Adapters provide a service
N
that can be used by the SOA composite application components. An adapter converts
KOrequests and responses into a form that is suitable for other (external) systems.
Oracle SOA Suite 12c is shipped with a variety of adapters that are commonly used to access
functionality that is not normally available in a service-oriented context, such as:
File and FTP adapters for reading, writing, and transferring files
Database Adapter for interacting with relational database data
JMS Adapter for communicating asynchronously with other applications through
message-oriented middleware (MOM) services, including Oracle Advanced Queuing
and IBM MQ
Because JCA adapters implement interfaces by using the Java Connector Architecture (JCA)
API standards, custom adapters can be developed to expose existing functionality that is not
usually available in a SOA application context. Adapters are an integration technology that
extends the reach of the SOA composite application.

Oracle SOA Suite 12c: Build Composite Applications 1 - 28


JDeveloper

In addition to many other


editing capabilities, Composite Editor
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

JDeveloper supports a
number of tools for SOA
applications.
BPEL Editor

Mediator Editor
a ble
f e r
ans
n - t r
noTask Editor
Human
a
a
h de s
)
c om t Gui
i b m eBusiness n Rule Editor
in Stu d
i n @ is
r k j a t h
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
OracleR K
JDeveloper l the development component of Oracle SOA Suite. It forms a
is
O NA
comprehensive integrated service environment (ISE) for creating and deploying composite
K applications and managing the composite. Oracle JDeveloper enables developers to model,
create, discover, assemble, orchestrate, test, deploy, and maintain composite applications
based on services.
The SOA Composite Editor enables you to create, edit, and deploy services, and also to
assemble them in a composite application, all from a single location. These components are
integrated into one application, and they communicate with the outside world through binding
components such as web services and JCA adapters.
The SOA Composite Editor enables you to use either of two approaches for designing SOA
composite applications:
The top-down approach of building a composite application puts interfaces first and
implementation next. For example, you first add BPEL processes, human tasks,
business rules, and the Oracle Mediator routing services components to an application,
and later define the specific content of these service components.

Oracle SOA Suite 12c: Build Composite Applications 1 - 29


The bottom-up approach takes existing implementations of service components and
wraps them with web service interfaces for assembly into a composite application. For
example, you first create and define the specific content of BPEL processes, human
tasks, business rules, and the Oracle Mediator routing services components, and later
create a SOA composite application to which you add these service components.
Oracle JDeveloper provides the following additional editors to design service components:
Oracle BPEL Designer: You use Oracle JDeveloper to create a BPEL process service
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

component, and then you use BPEL Designer to design the component. BPEL Designer
is displayed when you double-click a BPEL process in the SOA Composite Editor.
Oracle Mediator Editor: You use Oracle JDeveloper to create a Mediator service
component, and then you use Mediator Editor to design the component. Mediator Editor
is displayed when you double-click a Mediator component in the SOA Composite Editor.
Human Task Editor: You use Oracle JDeveloper to create a human task service
component, and then you use Human Task Editor to design the component. Human
Task Editor is displayed when you double-click a human task in the SOA Composite a ble
f e r
Editor.
ans
- t r
Business Rules Designer: You use Oracle JDeveloper to create a business rules
n
no
service component, and then you use Business Rules Designer to design the
a
h a s
component. Business Rules Designer is displayed when you double-click a business
rule in the SOA Composite Editor.
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 30


SOA Composer
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
SOA Composer provides web-based
n - t r
access to various parameters at run time,
a no
allowing them to be edited without
h a s
ide
redeploying the project that uses them.
)
o m u
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
OracleR SOA liceis an EAR file that is installed as part of the Oracle SOA Suite
K JComposer
O NA It provides access to various configuration options at run time, allowing those
installation.
K options to be updated without needing to redeploy the project that uses them. Options
typically accessed include domain value maps and business rules.

Oracle SOA Suite 12c: Build Composite Applications 1 - 31


Quiz

One capability of Oracle Mediator is to route data within a


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

composite application.
a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARa
Answer:
N
KOTrue. Oracle Mediator routes data from client applications to and from other service
components, and from service components to external partners.

Oracle SOA Suite 12c: Build Composite Applications 1 - 32


Agenda

Course Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Introduction to Service-Oriented Architecture


Oracle SOA Suite 12c Design Time: Overview
Oracle SOA Suite 12c Run Time: Overview
Installing Oracle SOA Suite 12c
Practice Overview le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 33


WebLogic Application Server
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Domain Administration
Server

a ble
f e r
Managed Servers ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce applications are Java Enterprise applications, they must run in a
R
Because SOA composite
Acontainer.
N
Java WebLogic Server (WLS) provides the Java EE environment for these
KOcomponents to run. WLS is written in Java and executes on the standard JVM.
The Oracle SOA Suite 12c platform comprises one Oracle WebLogic Administration server
and one or more Oracle WebLogic Managed servers. Managed servers host application
components and resources. The Administration server provides a central point for managing
logical groups of resources that are organized into domains. Domains consist of one or more
Managed server instances that are managed through a single Administration server.
Note: There are no WLS programming interfaces that refer to domains. All domain-related
information is stored in configuration files. Only an administrator is aware of domains. WLS
domains can separate development, test, and production applications; administration and
operational responsibilities; or organizational and business divisions.

Oracle SOA Suite 12c: Build Composite Applications 1 - 34


Oracle Metadata Repository
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Domain Administration
Server

Managed Servers
a ble
f e r
ans
n - t r
a no
XSD, WSDL
h a s
Metadata
o m )
Servicesu ide
m c nRepository t G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ceSuite 12c platform comprises one Oracle WebLogic Administration
N AR
The typical
server
Oracle SOA
and one or more Oracle WebLogic Managed servers. The example in the slide shows
KOa typical installation. It includes a domain named soa_domain, which includes an
Administration server and two Managed servers.
The Oracle SOA Suite 12c runtime environment requires an Oracle database to maintain the
SOA application configuration and runtime information. This database is known as the Oracle
Metadata Services Repository, or MDS (for MetaData Services). MDS is used to manage
deployed services and composite applications and this management happens transparently
for the application developers and Oracle SOA Suite 12c administrators.
MDS can also be used as a central location for storing and referencing shared service
artifacts, such as business events, rule sets for Oracle Business Rules, XSLT files for Oracle
Mediator, XSD and WSDL documents for Oracle BPEL Process Manager, and other service
documents, which can be deployed in a sharable archive format known as the Metadata
archive (.mar files).

Oracle SOA Suite 12c: Build Composite Applications 1 - 35


Business Events and the Event Delivery Network

Publish Subscribe
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Event Delivery Network

a ble
describes f e r
ans
n - t r
a no
EDL
Metadata h a s
o m
Service
)
u ide
m cRepositoryn t G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cway
A R
A business event is a for one application to notify another application of a significant
N
Ooccurrence to the business. When a business event is published, another application (or
K service component) can subscribe to it and initiate whatever processing is implied by that
event. For example, when product stock levels are updated in an inventory database, an
event can serve as a trigger or signal for another process to fulfill orders that have been on
hold until products become available.
A business event definition includes a unique name and a structure to contain information
about the event. Developers declaratively define business events and specify 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. The Mediator component can publish or
subscribe to events.
Business events are typically asynchronous fire-and-forget (one-way) notifications of a
business occurrence. The publisher does not rely on any service component receiving the
business event to complete. It does not need to know where subscribers are and what they do
with the data.
Note: If the author of the event depends on the receiver of the event, 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.

Oracle SOA Suite 12c: Build Composite Applications 1 - 36


Events are defined by using the Event Definition Language (EDL) to specify the name and
structure of an event. Definitions for business events are stored in the Oracle Metadata
Services Repository (MDS), and published in the Event Delivery Network (EDN).
The Event Delivery Network is designed to handle asynchronous messaging arising from a
business or system event. EDN is not messaging infrastructure. It provides declarative
publish-subscribe implementations. Subscribers can listen for events by XML namespace, by
event name, or by applying content-based XPath filters.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The Event Delivery Network (EDN) provides an application with a way to publish events so
that a composite application with a Mediator component can subscribe to events that trigger
execution of the composite application. The enforcement points are implemented in such a
way that all request and response messages flow through a security pipeline (or filters) that
can apply security policies to internal and external message exchanges.
Note: Events will be covered in more detail in the lesson titled Designing and Managing
Business Events.
a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 37


Oracle Web Service Manager Policy Manager
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Security Interceptor Framework


Request
Web Service
Manage- Reliable or SOA
MTOM Security Addressing
ment Messaging
Response
Component
a ble
f e r
ans
Oracle WSM Policy Manager
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
OracleRWeb
ce (WSM) Policy Manager provides the infrastructure for enforcing
K JServiceliManager
O NA security and auditing policies in the service infrastructure. By securing various
global
K endpoints and setting and propagating identity, it secures applications. Oracle WSM Policy
Manager provides a standard mechanism for signing messages, performing encryption,
performing authentication, and providing role-based access control. You can also change a
policy without having to change the endpoints or clients for these endpoints, thus providing
greater flexibility and security monitoring for your enterprise. In addition, Oracle WSM Policy
Manager collects monitoring statistics with information about the quality, uptime, and security
threats and displays them in a web dashboard. As a result, Oracle WSM Policy Manager
provides better control and visibility over web services.

Oracle SOA Suite 12c: Build Composite Applications 1 - 38


SOA Run Time

SOA Infrastructure
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Business Human Service


BPEL Mediator Engines
Rules Workflow

Event Delivery Network


Enforcement Web Service
Points Policy Manager
Normalized
Message

a ble
Binding Components
f e r
ans
n - t r
File Other
HTTP
JMS o
nJDBC
SOAP
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ceis a Java EEcompliant application running in Oracle WebLogic
N ARThe application manages composites and their life cycles, service engines, and
The SOA
Server.
infrastructure

KObinding components. Service engines execute the business logic for service components.
Binding components execute the logic for adapters.
The SOA infrastructure uses a normalized message structure while it provides the internal
message routing infrastructure capabilities for connecting components and enabling data
flow.
Note: A normalized message is a Java Map object where the key(s) is the part name of the
message and the value is a Document object representing the XML content.
The SOA infrastructure:
Receives messages from the service providers or external partners through SOAP
binding components, adapters, or the delivery API in the form of XML
Routes messages based on composite definition to the appropriate service engine
If response messages are returned from the service engine, they are sent to their targets.

Oracle SOA Suite 12c: Build Composite Applications 1 - 39


Quiz

Business events are a means for service components to


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

exchange data synchronously.


a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARb
Answer:
N
KOFalse. Business events are typically asynchronous fire-and-forget (one-way) notifications of a
business occurrence. The publisher does not rely on any service component receiving the
business event to complete. It does not need to know where subscribers are and what they do
with the data.

Oracle SOA Suite 12c: Build Composite Applications 1 - 40


Agenda

Course Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Introduction to Service-Oriented Architecture


Oracle SOA Suite 12c Design Time: Overview
Oracle SOA Suite 12c Run Time: Overview
Installing Oracle SOA Suite 12c
Practice Overview le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 41


Production Environment: Example
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Load Balancer Load Balancer

SOA Suite SOA Suite

WebLogic Server WebLogic Server


WLS Node Manager WLS Node Manager
Domain (soadomain) Domain (soadomain)
Admin Server
Managed Server Managed Server a ble
Cluster
f e r
(soa_server1) (soa_server2)
ans
n - t r
Enterprise DB 11.2.X.X
a no
JDK 1.7.0_xx
h a
JDKs 1.7.0_xx

) i d e
OL6U3 x86_64
c om tOL6U3 G u x86_64
i b m host:ensoahost2.example.com
host: soahost1.example.com
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
The slideKshows an lexample of a multi-host production topology. It includes two hosts.
N A
Each is running a version of Linux that is certified to work with 12c.
K O
Each has a JDK that is certified to work with 12c.
Each has a WebLogic Server, SOA Suite, WebLogic Server Node managers, and a
domain named soadomain.
One host has an Oracle database whose version is certified to work with 12c.
The other host has the Admin Server running in its domain.
Both have Managed servers, and those Managed servers are clustered.
Each has a stand-alone instance of Oracle HTTP Server as a load balancer.

Oracle SOA Suite 12c: Build Composite Applications 1 - 42


SOA Quick Start Installation

Integrated WebLogic Server


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

Domain (DefaultDomain)

SOA Suite 12c

JavaDB
soa_quickstart_generic.jar
JDK 1.7.0_40

OL6U3 x86_64
About 30 minutes
to HelloWorld! host: soa12c.example.com

a ble
Load Balancer Load Balancer
f e r
SOA Suite SOA Suite
an s
WebLogic Server
- t
WebLogic Server
n r
no
WLS Node Manager WLS Node Manager
Domain (soadomain)
s a Domain (soadomain)
Admin Server

h a
) ide
Cluster Managed Server (soa_server1) Managed Server (soa_server1)

Enterprise DB 11.2.X.X
o m u
m
JDK 1.7.0_xx c nt G JDK 1.7.0_xx
b
ni Stude
OL6U3 x86_64
i OL6U3 x86_64

in@ this
host: soahost1.example.com host: soahost2.example.com

r j a
k se
a
on t2014, uOracle and/or its affiliates. All rights reserved.
( kCopyright o
A I N nse
K J l i ce differs from a full installation in setup speed and limited uses.
A R
A Quick Start installation
N
OThe Quick Start installer creates a new Oracle home that contains all the software required for
K a development or an evaluation environment on a single host.
After spending about 30 minutes running the installation wizard and completing related tasks,
you can start developing and testing your SOA applications by running Oracle JDeveloper
from the Oracle home.
However, Quick Start installations are limited to one Administration server with no option to
add Managed servers.
You also cannot upgrade your Quick Start distribution to a production environment.
Note: If you know that you want a production environment with additional Managed servers or
clusters, you should not use Quick Start. Instead, see Planning the Oracle SOA Suite and
Business Process Management Installation in Installing and Configuring Oracle SOA Suite
and Business Process Management to install a full-scale development environment that can
be scaled to a production environment.

Oracle SOA Suite 12c: Build Composite Applications 1 - 43


By default, the Oracle SOA Suite Quick Start installation contains Oracle JDeveloper and an
Integrated WebLogic Server.
JDeveloper is pre-configured with some JDeveloper IDE extensions so that you can create
various kinds of applications immediately. These pre-installed IDE extensions include the
following:
Oracle BPEL Process Manager
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Oracle Human Workflow


Oracle Business Rules
Oracle Mediator
Oracle Service Bus
Oracle Enterprise Scheduler
SOA Spring Component Design Time
Oracle Event Processing Design Time
r a ble
The Integrated WebLogic Server is pre-configured with Java DB and the runtime software
n s fe for
Oracle Event Processing. This means that you can run any JDevelopero n -traScheduler
all the components listed in the preceding paragraph except Oracle Enterprise
application
and
that does
not use Oracle Enterprise Scheduler or Oracle Event Processing on n Integrated WebLogic
a the
Server without any additional configuration. s
ha de
)
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to u
(
J AIN icens
R K l
A
KON

Oracle SOA Suite 12c: Build Composite Applications 1 - 44


Creating a Domain
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Default Stand-Alone Compact

Includes SOA Suite Includes SOA Suite Is configured by the user


runtime components runtime components Works with an Oracle
Works with a pre- Works with a pre- database that you must
configured Java DB configured Java DB install, and then configure
Launches Integrated WLS with RCU
from JDeveloper.
Integrated WLS is shut
a ble
down every time you end a
f e r
JDeveloper session.
a n s
n r
-iftyou want to
Is best for demos or Is best for developers, o
Can be used
n components that
evaluation especially those who want
s
addaincompatible
SOA
to use the OSB Design
Time Console instead of ) h JavaDB,
a e such as with
are

JDeveloper om t GuEnterprise id Scheduler, MFT,


c
m en B2B, Healthcare, or BAM
i b
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
After you l a Quick Start distribution, you need to configure a domain to test
Khave installed
O NA
applications during development. JDeveloper is bundled with an integrated application server
K called the Integrated WebLogic Server. The integrated application server is a Java EE runtime
for services that are optimized for the iterative code development cycle.
Launching the Integrated WebLogic Server from JDeveloper generates a domain, which is
designated as the default domain. However, you also have the option of launching a
JDeveloper-independent version of the WebLogic server to configure a stand-alone domain.
The three possible domain types are described and compared in the table in the slide.

Oracle SOA Suite 12c: Build Composite Applications 1 - 45


Summary

In this lesson, you should have learned how to:


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

Describe Service-Oriented Architecture (SOA)


Explain services and key standards
Describe Service Component Architecture (SCA)
Describe the functionality of Oracle SOA Suite 12c service
components and adapters
le
Describe how WebLogic Application Server is used by erab
Oracle SOA Suite a n sf
r n -t
o
s an
) ha de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 46


Agenda

Course Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Introduction to Service-Oriented Architecture


Oracle SOA Suite 12c Design Time: Overview
Oracle SOA Suite 12c Run Time: Overview
Installing Oracle SOA Suite 12c
Practice Overview le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 1 - 47


Practice 1 Overview

This practice covers the following topics:


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

Performing the SOA Quick Start installation


Configuring memory settings for improved performance
Starting the integrated server and configuring a domain

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
In this R
practice, iceguided through the Developer Quick Start installation process and
K J you lare
NA
Oyou should be able to use Oracle SOA Suite in about 30 minutes. The installer does the
K following:
Installs all the components that are necessary for development with the core of Oracle
SOA Suite (BPEL, Business Rules, Mediator, and Human Work Flow)
Launches JDeveloper after the installation, automatically registering the IDE plug-ins for
Oracle SOA Suite
The SOA Suite 12c Developer installation contains:
JDeveloper
WebLogic Server
SOA Suite runtime components
BPEL, Human Workflow, Rules, Mediator
Service Bus (not used in this course)
JDeveloper IDE plug-ins for the preceding components
All software is installed in a single middleware home directory that you specify.

Oracle SOA Suite 12c: Build Composite Applications 1 - 48


Course Environment
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Integrated WebLogic Server


Enterprise
Domain (DefaultDomain) Manager

SOA Suite 12c

JavaDB
a ble
f e r
JDK 1.7.0_40
ans
n - t r
OL6U3 x86_64
n o FMW
s a Console
host: soa12c.example.com
) ha de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R K
Your environment l
consists of a server configured with Linux and Java already installed. In this
A
Nsubsequent practices, you first install Oracle SOA Suite. You then use JDeveloper,
and
KOOracle Enterprise Manager, and Fusion Middleware Console to develop, deploy, monitor, and
manage a number of example applications.

Oracle SOA Suite 12c: Build Composite Applications 1 - 49


Launching the Quick Start Installer

Set the environment variable


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

JAVA_HOME to point to the


location of your JDK.

Optionally, set
# startInstall.sh ORACLE_HOME.

export JAVA_HOME=/usr/bin
export ORACLE_HOME=/u01/app/fmw12c/Oracle_Home
cd /home/oracle/labs/software
a ble
$JAVA_HOME/java -jar soa_quickstart_generic.jar
f e r
an s
n - t r
Run the appropriate .jar file. a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
BeforeR K J theliQuick
launching
ce Start installer, set the environment variable JAVA_HOME to point
toN Alocation of your JDK. You can also set ORACLE_HOME. Although this step is not
the
O
K necessary, it will simplify the process of navigating to the various directories when you are
running the installation and configuration commands.
Navigate to the directory that includes the installation files. These files may include several
.jar files, but you will only need to run the one named soa_quickstart_generic.jar.

Oracle SOA Suite 12c: Build Composite Applications 1 - 50


First Look: JDeveloper
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Application
Navigator
Component
and Resource
Palettes a ble
f e r
Design Canvas (various editors) ans
n - t r
a no
Structure Messages and Output ) h
as e
c om t Guid Property
Inspector
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R K amountl of work in this course is completed by using JDeveloper. Some important
A significant
NA of the interface are highlighted in the slide.
Oelements
K In the upper-left region of the editor is the Application Navigator, which provides access
to your applications and projects, as well as the individual files that comprise those
projects.
The large pane in the center is the Design Canvas. It displays different editors,
depending on the kind of files that are currently open for editing. Tabs across the top
provide access to the individual files that are currently open for editing.
To the right of the Design Canvas is the Component palette, which provides collections
of icons to support the editing functions of whatever editor is currently active in the
Design Canvas.
The Structure pane can be found in the lower-left region of the interface. It provides a
hierarchical view of the component or file that is currently being edited in the Design
Canvas.
Properties for the actively edited file can be viewed and edited in the Property Inspector
pane, which is found in the lower-right region of the window.
The lower-center section of the window is reserved for messages and output resulting
from various actions, such as deploying an application. You use each of these panes in
this course.
Oracle SOA Suite 12c: Build Composite Applications 1 - 51
Starting the Integrated Server
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cwith
A R
JDeveloper is bundled an integrated application server called the Integrated WebLogic
N The integrated application server is a Java EE runtime for services that are optimized
Server.
KOfor the iterative code development cycle.
Launch the Integrated WebLogic Server by selecting Run from top menu bar. Select Start
Server Instance from the drop-down menu, as shown in the slide.

Oracle SOA Suite 12c: Build Composite Applications 1 - 52


Configuring a Domain
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a b le
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
claunch
A R
The first time that you the server instance, you are prompted to enter a password for
N default domain, as seen in the screenshot in the slide. The Administrator ID, Listen
your
KOAddress, Listen Port, and SSL Listen Port fields should already have values. Review them
and make any appropriate changes.
Launching the integrated server will take several minutes. You can track the servers launch in
the Messages window pane at the bottom of the JDeveloper screen. When the following
messages appear in the log, the Integrated WebLogic Server has launched successfully.
<Notice> <WebLogicServer> <BEA-000360> <The server started in
RUNNING mode.>
<Notice> <WebLogicServer> <BEA-000365> <Server state changed to
RUNNING.>
SOA Platform is running and accepting requests

Oracle SOA Suite 12c: Build Composite Applications 1 - 53


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

KO
N
ARK
J l
(
AIN icens
a r j a
kon e to u
k se
i
in@ this
b m
o
ni Stude
m ) h a
c nt G u
a
ide
s
n no
- t r an
s
f e r a b
le
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Getting Started with Composite Applications

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO
Objectives

After completing this lesson, you should be able to:


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

Describe how services use WSDL files to communicate


Use Mediator components and File adapters to perform
basic receiving, routing, and writing of messages
Name and describe the contents of some of the files that
are created as part of a composite application
a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 2 - 2


Agenda

How Services Use WSDL Files to Communicate


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

Mediator Components
File Adapters
Composite Application Files

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 2 - 3


How Services Communicate

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

Operation

a b le
f e r
a n s
Input Output Fault n-t r
a no
h a s
o m )
u ide
m c nt G
b
Calling Application
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
e
K J welicdefine
For ourRpurposes, a service as software, which is available over the Internet or a
A
N and which exposes functionality as one or more operations, or actions, to other
Onetwork
K applications.
The service and calling application exchange messages. Although there are several different
interaction patterns, in a common scenario, the calling application invokes the service and, as
part of that invocation, provides input data. The service then either completes its unit of work
and returns data or if it is unable to complete the requested operation, it may instead return
information about the failure.
In order for the calling application to exchange messages with the service, a means must be
defined for the application to provide the required information in an acceptable format, and for
the application to interpret the output (or fault) message provided by the service. Although not
a strict requirement, XML is commonly used for these input, output, and fault messages, and
XML Schema Definition (XSD) is used to describe the structure of these XML messages.

Oracle SOA Suite 12c: Build Composite Applications 2 - 4


Synchronous and Asynchronous Interactions

Request
Synchronous request/response
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Reply/Fault
Real-time response or error feedback
Client in waiting mode

Request
Asynchronous request/callback
Callback
Client free after request submission le
r a b
Separate service invocation for response f e
ans
n - t r
o
Asynchronous request only
s a n One-Way
Also known as fire and forget m) h ide
a
c o t Gu
Client free after request submission
b m en
i
No response message in S
@(ACK tud
only)
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
The interaction l in the previous slide included input, output, and (possibly) a fault
K described
O NA Mediators support both synchronous (request-reply) and asynchronous (both one-
message.
K way and callback response) interactions.
In a synchronous interaction, the client requests a service, and then waits for a response to
the request. While the client waits, the communication channel between the parties is left
open until the response occurs. This may be undesirable if large numbers of channels are left
open for long periods of time. It may not be needed if the client does not need an immediate
response. In these cases, an asynchronous response may be more appropriate.
In an asynchronous interaction, the client invokes the service but does not wait for a response
before continuing. Asynchronous operations open a communication channel between the
parties, make the request, and close the channel before the response occurs. The response
may come at a later time via a callback operation, or not at all for one-way interactions.

Oracle SOA Suite 12c: Build Composite Applications 2 - 5


Describing a Message with XSD

namespace
<?xml version="1.0"?>
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

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

data type occurrence


<xs:element name=book">
<xs:complexType>
order
<xs:sequence>
<xs:element name=author" type="xs:string minOccurs=1/>
<xs:element name=title" type="xs:string"/>
<xs:element name=pagecount" type="xs:integer"/> r a ble
<xs:element name=price" type="xs:decimal"/> n s fe
</xs:sequence>
n - tra
</xs:complexType>
a no
</xs:element> s
aattributes h de
)
</xs:schema> c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R K for XMLl schema definition and, as its name suggests, an XSD is used to
XSD stands
O NA (or define) the structure (or schema) of an XML message. In fact, an XSD uses an
describe
K XML format to provide that description.
XML documents are described in terms of their component pieces, or elements. An XML
schema definition is used to define those elements. It can be used to define their sequence,
their attributes, their relationship (parent/child), a permissible number of occurrences, data
types, and default or fixed values, if any.
Built-in data types (a list of commonly used examples would include integer, double, Boolean,
date, and string, among others), simplify the description of permissible document content and
data formats in XML schemas. XSD also supports complex types, which describe elements
that are made up of other elements.
Like other XML documents, the example in the slide includes a namespace definition.
Namespace definitions are used in XML to allow programs to disambiguate among document
elements that may have the same name but are drawn from different sources and thus have
different meanings. Subsequent elements in the document begin with their namespace prefix.

Oracle SOA Suite 12c: Build Composite Applications 2 - 6


Web Services Description Language

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

message
portType Abstract WSDL
operation (what the service does)
input
output le
A WSDL file
r a b
typically has
s f e
two parts.
parts
- t r an
binding n no
service Concrete WSDL s a
(how/where h a
) toidaccess) e
port m
o
c nt G u
b m
i ni Stude
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ceof messages to be exchanged between a calling application and a
N ARis important, but is not enough to enable the applications to converse. For this, a Web
Describing
service
the structure

KOService Description Language or WSDL document is used. This (XML) description includes
the format of input, output, and fault messages, and the data types they use. It also includes
the names of operations that the service provides, and how and where to find the service.
The information in a single WSDL document is organized into two parts: the abstract definition
(what a web service does) and the concrete definition (how and where to access the service).
Abstract definitions include types, message, operation, and portType.
Types define the data types used in messages. These types are often drawn from the
XML Schema Language.
Messages describe the parts of the input, output, and fault messages that are
exchanged with the calling program.
Operations provide a name for the action performed on messages.
PortTypes group messages with operations.

Oracle SOA Suite 12c: Build Composite Applications 2 - 7


Abstract WSDL

<?xml version= '1.0' encoding= 'UTF-8' ?>


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

<wsdl:definitions
name="ReceiveData"
targetNamespace="http://oracle.com/sca/soapservice/Basics/HelloWorld/ReceiveData"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:inp1="http://www.example.org/ns/porder"
xmlns:tns="http://oracle.com/sca/soapservice/Basics/HelloWorld/ReceiveData"
>
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" >
<import namespace="http://www.example.org/ns/porder" schemaLocation="xsd/po.xsd" /> 1
</schema>
a ble
</wsdl:types>
f e r
<wsdl:message name="requestMessage">
2 an s
<wsdl:part name=part1" element="inp1:PurchaseOrder"/>
</wsdl:message> n - t r
<wsdl:portType name="execute_ptt">
a no
<wsdl:operation name="execute">
<wsdl:input message="tns:requestMessage"/> 3 h a s
</wsdl:operation>
o m )
u ide
</wsdl:portType>
m c nt G
</wsdl:definitions>
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cWSDL
A R
In the sample abstract file shown in the slide:
N
1. Section 1 includes an import statement and a reference to the po.xsd file. Although
KO the data types could have been included directly in this WSDL file, it is a better practice
(because it promotes reuse) to separate the data type definitions into an XSD file, and
then to import the file.
2. Section 2 describes the requestMessage message. The description includes the
name of the (single, in this example) part, and the name of the element that describes
the message structure of that part. The message element PurchaseOrder is fully
described in the imported po.xsd document.
3. Finally, section 3 describes the port type execute_ptt, which groups a specific
operation (execute) with the message requestMessage.
Note: The number and order of messages in the portType definition of a WSDL is important.
Because you see only a single message listed in this example, you know that operation
execute is a one-way operation. If you saw a second message, you could assume that the
operation returned a response upon completion.

Oracle SOA Suite 12c: Build Composite Applications 2 - 8


Concrete WSDL
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

binding
service Concrete WSDL
port (how/where to access)

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i cegenerated by JDeveloper for local services (those within the WebLogic
N ARmay not include the concrete portion of the WSDL. However, the WSDL documents
The WSDL
Server)
documents

KOfor services deployed outside the WebLogic Server will include the concrete elements of the
WSDL, which provide additional information about how and where to access the service:
The binding describes how a given portType operation is transmitted, such as HTTP or
SOAP (that is, the protocol), and provides information about where the service is
located.
The port specifies a combination of a network address and a binding, which constitute
an endpoint.
A service groups ports together. A service reveals to a calling program where to access
the web service, and through which port. It also describes how the communication
messages are defined.

Oracle SOA Suite 12c: Build Composite Applications 2 - 9


Quiz

Abstract and concrete WSDLs are two separate but related


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

files that describe the conversation between a service and the


calling application.
a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARb
Answer:
N
KOFalse. The information in a single WSDL document is organized into two parts: the abstract
definition (what a web service does) and the concrete definition (how and where to access the
service).

Oracle SOA Suite 12c: Build Composite Applications 2 - 10


Agenda

How Services Use WSDL Files to Communicate


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

Mediator Components
File Adapters
Composite Application Files

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

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


Mediator Components: Introduction
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Validate

Filter

a ble
f e r
Transform
ans
n - t r
a no
h a s
Route o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i cecomposite application may need to be filtered, transformed, validated,
A R
Data flowing through a
N
and routed from a source to one or more target services. Mediator components (or simply
KOMediators) offer these capabilities. A Mediator provides a lightweight mediation framework to
manage data between clients and services.

Oracle SOA Suite 12c: Build Composite Applications 2 - 12


Routing Data

Routing Rule 1
Target
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Service

Routing Rule 1
Target
Service

a b le
Routing Rule 2 f e r
Target
a n s
-t
Service r
n on
s a
a
h de
Routing Rule 1 m)
c o t Gui Target
i b m en Service
i n Stud
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cthe
A R
Routing data, which is primary purpose of a Mediator component, is accomplished by
N one or more routing rules. Each routing rule specifies a target service for the data.
adding
KORouting rules allow you to specify validation, filters, and transformations. Routing rules can
handle returned responses, callbacks, faults, and timeouts.
In the first example in the slide, a routing rule is applied to an incoming XML message. A
transformation is performed and the message is passed to a specified destination.
Transformations are a required part of a routing rule configuration.
In the second example, two routing rules are defined. Each is applied to the incoming
message. In the diagram, each rule has filtering and validation defined. These are
defined in addition to the message transformation. For each routing rule, the message
must pass validation, meet filter criteria, and be transformed before it can be routed to
the specified destination.
The third example shows a routing rule with validation and a transformation defined, but
no filter. Filters and validations are always optional in the configuration of a routing rule.

Oracle SOA Suite 12c: Build Composite Applications 2 - 13


Transforming Data

eXtensible Stylesheet Language


Transformation (XSLT) describes the
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

mapping of data from one XML structure


to another.

XSLT
Processor

a ble
f e r
a n s
Input XML XSL n
Output
r
-t XML
o
Document Mapper
s a n Document
) ha de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
Mediator K l support data transformation from one XML schema to another. This
routing rules
O NA data interchange and enrichment between applications by using different schemas.
enables
K For example, the source XML schema may have last name and first name as separate
values. The target XML schema may have the full name (both first and last) stored as one
value. Through transformations, you can concatenate the first and last names from the source
data before it reaches the target data.
Transformations are defined in XSL files that can be visually designed by using the XSLT
Mapper (a visual editing tool), which is provided by Oracle JDeveloper 12c. The XSL file is
deployed with the composite application so that the Mediator engine can process the mapping
rules in an XSL processor that is available in the runtime environment.

Oracle SOA Suite 12c: Build Composite Applications 2 - 14


Filtering Data

Filter conditions can


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

be applied to
message payload
content.

If a condition evaluates
to true, the message is
a ble
routed to its target.
f e r
an s
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cprovide
A R
Mediator routing rules content (payload)based filtering criteria to ensure that data is
N to a suitable target. If the condition evaluates to true for a given message instance, the
routed
KOdata is routed to the target defined in the routing rule.
For example, a Mediator receives a file from an application or service that contains data about
new customers. Based on the country mentioned in the customers address, data can be
routed to the database that stores data for that particular country.

Oracle SOA Suite 12c: Build Composite Applications 2 - 15


Validating Data

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

Processing continues

Syntactic validations
are applied once to
Fault generated
each incoming
message.

a ble
f e r
Semantic s
ran
Processing continues
n -t
o
s an
) ha de
Semantic validations
c om t GFault ui generated
can be applied in
i b m en
each routing rule.
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
Mediator K
routing rulesl provide support for two levels of validation of incoming message
O NA The first level uses an XSD file to validate the payload structure, ensuring that it
payloads.
K has the correct element hierarchy and relationships based on the XSD definition. The second
level of validation is semantic. It uses a schematron (.sch) file to validate the message
content. You can specify schematron files for each inbound message part and Mediator can
execute schematron validations for those parts. For example, you can check whether a price
element value contains suitably formatted numeric data and is within a range of values. If
either syntactic or semantic validation fails, the routing rule is not processed and a fault is
generated, which is returned to the caller of a synchronous operation.
Note: Enabling validation incurs some overhead because of the execution time required to
perform the validation rules. For more information about Schematron specifications, refer to
http://www.schematron.com.

Oracle SOA Suite 12c: Build Composite Applications 2 - 16


Mediator as a Callable Service
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Input Routing Rule


Calling
Service a ble
f e r
Echo
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
OracleRMediator lice can be exposed as a callable service without having to route it to
K J functionality
O NA
any other service. For example, you can call an Oracle Mediator to perform a transformation,
K a validation, or an assignment, and then echo the Oracle Mediator back to your application
without routing it anywhere else.
Note: An echo can be either a synchronous or an asynchronous interface. The echo option is
available only for inbound service operations and is not available for event subscriptions.

Oracle SOA Suite 12c: Build Composite Applications 2 - 17


Dynamic and Static Routing Rules

Static Routing
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Target
Service

Dynamic routing uses


a Business Rules
component with a
Target
decision table to
determine routing. Service a b le
f e r
a n s
Dynamic Routing -t r
nTarget
a noService
h a s
o m )
u ide Target
m c nt G
b
ni Stude Service
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce enables you to create both static and dynamic routing rules.
A R
The Mediator component
N
KOStatic routing rules can be created for event subscriptions and incoming operations for both
synchronous and asynchronous service interactions. Static routing rules support the following
types of targets:
Service type: To route a message to a target service, either another component within
the same composite application or an external service reference
Event type: To publish an event to the Event Delivery Network
Echo service: To use an internal echo mechanism that enables the request message to
be echoed as a response, which can be transformed before being returned to the caller
A dynamic routing rule configures a Business Rules component that uses a decision table
to determine the target endpoint to which a message is routed through a dynamic external
service interface. Dynamic routing rules can be created only for asynchronous interactions.

Oracle SOA Suite 12c: Build Composite Applications 2 - 18


Additional Features of Mediators

Mediators provide the following additional features, which are


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

covered in later lessons:


Error routing and management
Mediator components support fault policybased error
handling. A fault policy consists of conditions and actions.
Conditions specify the action to be carried out for a particular
error condition. le
r a b
Event Handling f e
Mediator components provide support for subscribing trato or ns
n -
no the Oracle
raising business events that are delivered through
a
SOA Suite 12c Event Delivery Network a s
(EDN).
m ) h ide
c o t Gu
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 2 - 19


Agenda

How Services Use WSDL Files to Communicate


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

Mediator Components
File Adapters
Composite Application Files

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 2 - 20


Adapters: Introduction

Oracle SOA Suite


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

SCA Composite
External Existing
SOAP JCA Adapter
(SOAP) Application
Reference Reference Functionality
Client

Bindings a b le
f e r
ans
n - t r
SOAP JMS Other a no
REST JCA
h a s
o m )
u i de
Service Infrastructure
m c nt G
Web Service b
ni Stude EIS/DBMS
@ i
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R K for JEE lConnector Architecture and is part of the JEE specification. JCA
JCA stands
O NA the concept of resource adapters, or simply adapters. Adapters are deployed in a
describes
K Java EE container. An adapter exposes an API through which a service component can
access an external application as if it were a web service. Adapters are described by a WSDL
document, which is the only view the service component has of the external system. The
adapter itself is transparent to the service component. This enables interoperability with
heterogeneous applications, which are provided by different vendors, based on different
technologies and platforms. By creating a service interface where none existed, an adapter
provides another type of service in your service portfolio.
A number of technology adapters are available for Oracle SOA Suite 12c Mediator and BPEL
components, including:
REST binding: The Representational State Transfer (REST) binding is available for
SOA composites and Service Bus services. It allows the configuration of REST
interactions as exposed interfaces and allows the invocation of externally available
REST services.

Oracle SOA Suite 12c: Build Composite Applications 2 - 21


JMS/AQ adapter: Either inbound or outbound, a JMS/AQ adapter transmits an XML
message to or from an Oracle SOA Suite component through a message-oriented
service such as an Oracle Advanced Queuing queue and other JMS providers.
Database adapter: An inbound Database adapter service sends an XML message to
an Oracle SOA Suite component when a SQL insert, update, or delete operation is
performed against a database. An outbound Database adapter transforms the contents
of an XML message into a SQL insert, update, or delete operation on the target
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

database.
File/FTP adapters: An inbound File or FTP adapter service reads data from a local or
remote file system, transforms the file data into an XML message, and sends it to an
Oracle SOA Suite component when a new text file appears in a local file system. An
outbound File adapter service transforms the contents of an XML message to a text file,
and writes it to a local or remote file system.
Oracle Applications (OA) adapter: An inbound OA adapter sends XML messages to
Oracle SOA Suite on receiving messages from an Oracle E-Business Suite interface. An
a ble
outbound OA adapter sends data from Oracle SOA Suite to Oracle Applications by f e r
using interface tables, APIs, and concurrent programs. ans
n - t r

based protocols. a no
Socket adapters: These communicate either as a client or server by using TCP/IP-

h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 2 - 22


File Adapter
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Exposed Services Components External References

Adapter Mediator

Supports: a ble
f e r
Multiple file formats
File pattern matching Mediator Adapter-tra
ns
n on
s a
) a
h de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
As the R K implies,l a File adapter reads and writes files to the operating system. Pattern
name
NA capabilities enable filter processing for specific sets of files. XML schema
Omatching
K documents are used to support the parsing and formatting of different file formats such as
delimited, positional, XML, binary, and COBOL copy books. Error recovery and checkpoint
capabilities facilitate management of exception conditions. Scalability is obtained through the
multi-threaded execution environment, which supplies connection management, and batching
and debatching capabilities.
When configured to read files, a File adapter is configured as an exposed service, forming the
composite applications entry point. Within the composite application, it is wired to either a
Mediator or a BPEL component. When configured to write files, the File adapter is configured
as an external reference, and serves as the target of a BPEL service invocation (more on this
later) or as the target of a Mediator routing rule.
Reading or writing a file thus is a one-way operationthat is, in the case of a write operation,
the File adapter service writes the payload to a specified file name in a specified directory. It
does not send a response to the composite application. In the case of a read operation, the
File adapter polls a specific directory for new files. When found, the File adapter passes the
file payload to the composite application, but does not wait for a response from the composite.

Oracle SOA Suite 12c: Build Composite Applications 2 - 23


Quiz

Which Mediator component feature enables target services to


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

receive data in their desired format?


a. Filter expression
b. XSL transformation
c. Validation
d. Routing rule
a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARb
Answer:
N
KOAlthough a filter can be used to prevent undesirable data from reaching a target service and
validations can prevent ill-formed XML data from being passed to a target service, it is XSL
transformation that converts data into a format that is desired and required by a target service.

Oracle SOA Suite 12c: Build Composite Applications 2 - 24


Quiz

The File adapter is capable of representing many file formats


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

as XML data.
a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARa
Answer:
N
KOTrue. The File adapter supports multiple file formats. It can convert native format data to XML,
and XML to native formats.

Oracle SOA Suite 12c: Build Composite Applications 2 - 25


Agenda

How Services Use WSDL Files to Communicate


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

Mediator Components
File Adapters
Composite Application Files

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 2 - 26


Examining the composite.xml Source

[header]
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

<composite [attributes]>
<import namespace=[namespace] location="ReceiveData.wsdl" importType="wsdl"/>
<import namespace=[namespace] location="WriteData.wsdl" importType="wsdl"/> 1
<service name="ReceiveData" ui:wsdlLocation="ReceiveData.wsdl">
<interface.wsdl interface=[path]ReceiveData#wsdl.interface(execute_ptt)"/>
<binding.ws port=[path]ReceiveData#wsdl.endpoint(ReceiveData/execute_pt)">
<property [config properties]> 2
</binding.ws>
</service>
<component name="RouteData">
<implementation.mediator src="RouteData.mplan"/> 3 a b le
</component>
f e r
<reference name="WriteData" ui:wsdlLocation="WriteData.wsdl">
a n s
r
n-t 4
<interface.wsdl interface=[path]WriteData#wsdl.interface(Write_ptt)"/>

no
<binding.jca config="WriteData_file.jca"/>
</reference>
<wire>
s a
h a
ide
<source.uri>ReceiveData</source.uri>
<target.uri>RouteData/RouteData</target.uri>
m ) 5
</wire> o
c nt G u
...
b m
</composite>
i ni Stude
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J
A composite.xml l i ceis automatically created when you create a SOA project. This file
file
N AR the entire composite assembly of services, service components, references, and
describes
O
K wires. The example in the slide is formatted to make it easier to read, and shows the following
key elements:
1. The <composite> element encapsulates the entire composite assembly information.
2. The <service> element represents the service that is exposed by the composite.
- The <interface.wsdl> element names the portType of the service. (Note that
interface.wsdl does not refer to a file name in this case.)
- The <binding.ws> element includes port information to expose the service to
external clients.
3. The <component> element represents a Mediator, and includes a link to the source
implementation file. (Additional <component> elements would be included for each
additional component in the application.)
4. The <reference> elements describe connections to the external services that are
referenced by the components in the composite application.
5. The <wire> element defines how data will flow among components. (Additional wires
would be present to connect additional components and external references.)

Oracle SOA Suite 12c: Build Composite Applications 2 - 27


Creating a Mediator
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
composite.xml
a no
<component name="RouteData">
h a s
<implementation.mediator src="RouteData.mplan"/>
o m )
u ide
m c nt G
</component> b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce to a composite application, several project files are created or
N AR
When a Mediator
modified:
is added

KO A .componentType file describes the services and references for each component.
This file tracks the wiring that is created between components, and ensures that the
wires work as designed.
An .mplan file contains the Mediator metadata. This includes implementation details
such as routing rules, links to transformations, filters, validations, and references to
target services.
A .wsdl (Web Services Description Language) file specifies how other services call an
Oracle Mediator. A .wsdl file defines the input and output messages and operations of
an Oracle Mediator. The .wsdl file is not created in every circumstance, but is created
if you specify an interface definition for the component by selecting the Asynchronous
Interface, Synchronous Interface, the One-Way Interface, or the Interface Definition
from WSDL templates.
A <component> element is added to the composite.xml file.
An <import> element is added to the composite.xml file for the component WSDL
interface.

Oracle SOA Suite 12c: Build Composite Applications 2 - 28


Creating an Adapter
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
composite.xml
n - t r
<composite [attributes]>
a no
. . .
h a s
) ide
<reference name="WriteData" ui:wsdlLocation="WriteData.wsdl">
m
<interface.wsdl interface=[path]WriteData#wsdl.interface(Write_ptt)"/>
o u
<binding.jca config="WriteData_file.jca"/>
m c nt G
</reference>
b
ni Stude
. . .
i
in@ this
</composite>

r j a
k se
a
on t2014, uOracle and/or its affiliates. All rights reserved.
( kCopyright o
A I N nse
K J l i ce to a composite application, several project files are created or
N AR
When an
modified:
adapter is added

KO A .componentType file describes the services and references for each component.
This file tracks the wiring that is created between components, and ensures that the
wires work as designed.
A .jca file contains the adapter implementation details. In the case of a File adapter
that is configured to write data, the details would contain a directory name and a file
naming pattern, as well as other information.
A .wsdl file is created that includes the abstract WSDL information about the service
that the adapter provides.
An <import> statement is added to the composite.xml file, which makes the .wsdl
file contents available.
A <reference> element is added to the composite.xml file that aggregates the
references to the adapter .jca and .wsdl files. This also includes the binding
information that substitutes for the concrete information in a WSDL.

Oracle SOA Suite 12c: Build Composite Applications 2 - 29


Summary

In this lesson, you should have learned how to:


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

Describe how services use WSDL files to communicate


Use Mediator components and File adapters to perform
basic receiving, routing, and writing of messages
Name and describe the contents of some of the files that
are created as part of a composite application
a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 2 - 30


Practice 2 Overview

This practice covers the following topics:


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

Creating a Composite Application


Adding a Mediator Component to a Composite Application
Adding a File Adapter to a Composite Application
Examining Composite Application Files

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 2 - 31


Application Navigator
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The Application Menu is


accessed from this icon.

a ble
f e r
an s
Application-level functions,
including:
n - t r
New,
a no


Open,
h a
Close,
s
o m
)Delete, u ide
m c nt G Rename,
b
ni Stude and more are available.
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
J lice tasks is provided by the Application Navigator menu.
AccessRtoKapplication-level
O NA
K

Oracle SOA Suite 12c: Build Composite Applications 2 - 32


Creating a SOA Application
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
Selecting the SOA Application template
causes the wizard to guide you through a no
the creation of a SOA project.
h a s
(Remember that the application is only
o m )
u ide
a container. The real work is defined
in the projects that you add to that m c nt G
container.)
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cProject
A R
When you select New from the Application Navigator menu, the Create Application
N is invoked. The wizard displays a series of windows in which you make choices and
wizard
KOinput values to create the new application. In the example in the slide, the SOA Application
template is selected. This selection drives the content and choices of some of the subsequent
windows in the wizard.

Oracle SOA Suite 12c: Build Composite Applications 2 - 33


Creating a SOA Application

The first steps in building a


new application are to
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

assign it a name and to


specify the directory in
which to save the source
1 files.

Add a project to the


application, assigning it a
name and directory as well.
a ble
2 f e r
an s
n - t r
a no
h a s
Specify the e
)the project. starting point for
m u i d
m co nt G
3 i nib Stude
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce on the upper left, select New Application from the Applications
N AR list.
In the Applications
drop-down
window

KO 1. On the Name your application page, you can optionally change the name and location
for your application.
2. On the Name your project page, you can optionally change the name and location for
your SOA project. By default, Oracle JDeveloper adds the SOA project technology, the
composite.xml file that describes the SOA composite application, and the necessary
libraries to your model project.
3. On the Configure SOA Settings page, click Empty Composite for this example, and click
Finish.

Oracle SOA Suite 12c: Build Composite Applications 2 - 34


Component Palette
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
The Component Palette
a no
allows you to add
service components and h a s
adapters to your
o m )
u ide
application.
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce is created, the Composite Editor is opened. It is on that blank
N ARthat you build the model of your composite application. The service components and
When the
canvas
SOA Application

KOadapters for this model are accessed from the Component Palette, which is displayed on the
right side of JDeveloper.

Oracle SOA Suite 12c: Build Composite Applications 2 - 35


Creating a WSDL
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The Create WSDL wizard


builds the necessary WSDL
files automatically. You
specify XSD files to
a ble
describe the messages and
f e r
s
modify any other values that
an
you desire.
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
Recall R
J
K earlier
from
ce
inlithe lesson that WSDL documents are used to describe the means for
O NA a service. JDeveloper offers a Create WSDL wizard that prompts you for the
accessing
K required information to automatically create WSDL documents.

Oracle SOA Suite 12c: Build Composite Applications 2 - 36


Creating a File Adapter
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The File Adapter wizard


guides you through the
a ble
configuration of an adapter.
f e r
an s
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i cisealso wizard-driven. In the example in the slide, the File Adapter
N AR Wizard is displayed as a result of adding a File adapter to the SOA Application
Adapter configuration
Configuration
KOmodel. The wizard prompts for the inputs that are necessary to configure the File adapter.

Oracle SOA Suite 12c: Build Composite Applications 2 - 37


Configuring Mediator Routing Rules
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Add or delete routing rules as needed.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m
Specify the validation, filtering, and transformation c nt G
details for each Mediator routing rule. i b
n Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
care
A R
Mediator routing rules configured from an input window. From that window, filters,
N
validations, and transformations can be defined and modified. In the practice, you create a
KOminimum transformation. In later practices, you create more complex transformations, and
define filters and validations.

Oracle SOA Suite 12c: Build Composite Applications 2 - 38


Project Files
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

1 2 3 4

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
composite.xml b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
ProjectRfiles lice in the Application Navigator under the <ProjectName>/SOA folder
K Jare organized
NA
structure.
O
K 1. The composite.xml file is displayed as <ProjectName>. This makes it easier to
navigate among the JDeveloper editing tabs when multiple composite.xml files are
open.
2. The WSDL file for the service binding is stored in the SOA/WSDL folder.
3. The Mediator configuration files (.mplan) are stored in the /Mediators subfolder. The
XSLT transformations, including those found in mediators, are stored in the
/Transformations subfolder.
4. The Adapter files are stored in the /Adapters and /WSDLs subdirectories.

Oracle SOA Suite 12c: Build Composite Applications 2 - 39


Project Files

composite.xml
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

WriteData_file.jca

a ble
ReceiveData.wsdl WriteData.wsdl
f e r
ans
n - t r
no
po.xsd

s a
h a
RouteData.mplan
o m )
u ide
m c nt G
b
ni Stude
i
PurchaseOrder_To_PurchaseOrder.xsl

j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce building your first composite application, it looks like the model at
N
the ARof the slide. The bottom portion of the slide lists the files that are created with each
When you
top
have completed

KOcomponent. The red dashed lines indicate the references between files and, from that, the
underlying relationships between the components.

Oracle SOA Suite 12c: Build Composite Applications 2 - 40


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

Managing and Monitoring


a Composite Application
a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO
Objectives

After completing this lesson, you should be able to:


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

Deploy and undeploy a composite application


Test a composite application with Oracle Enterprise
Manager and JDeveloper
Manage SOA composite applications with Oracle
Enterprise Manager
Migrate a composite application to a production r a ble
environment n s fe
a - tr
no n
s a
) a
h de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
Administration l SOA Suite 12c is an extensive topic that merits its own course. In
K of Oracle
A we cover the basic capabilities of the Fusion Middleware Console and Oracle
Ncourse,
this
O
K Enterprise Manager web interfaces to administer and manage SOA composite applications.
In many cases, deployment-related tasks can also be performed in JDeveloper and these are
discussed where relevant. However, it is unlikely that JDeveloper will be used to deploy
directly to a production system.
Therefore, we examine the steps that are needed to create deployment profiles that facilitate
managing the life cycle of a composite application and ease the migration from a development
to a production environment. The aim of this lesson is to explore the Enterprise Manager web
interface, which enables you to initiate a composite application and test it with different data,
and learn how to use Enterprise Manager to examine message flow and any fault conditions.

Oracle SOA Suite 12c: Build Composite Applications 3 - 2


Agenda

Deploying Composite Applications


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

Testing and Managing Composite Applications

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 3 - 3


Managing SOA Applications: Overview

Administration of SOA applications involves using the


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

Enterprise Manager web interface for tasks such as:


Configuring the runtime environment
Deploying and managing the state of composite
applications
Redeploying or undeploying applications
Testing composite applications and viewing the results r a ble
n s fe
Locating composite application instances
n - tra
no in the
Tracking and monitoring message flow and events
a
system has
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
OracleR
SOA lice a variety of administrative tools for monitoring (observing state or
K JSuite provides
O NAvalues in the runtime environment) and managing (changing state or runtime
other
K parameters) service components and deployed applications. These include tools such as
Oracle Enterprise Manager and Fusion Middleware Console. The command-line interface
(CLI) tools include WebLogic Scripting Tool (WLST) and Ant. JDeveloper also provides
access to certain test, management, and monitoring functionality for the developer.

Oracle SOA Suite 12c: Build Composite Applications 3 - 4


Deploying a Composite Application

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

SAR File

deploy

SOA Infrastructure

BPEL Mediator
Business Human
a ble
Rules Workflow
f e r
ans
Event Delivery Network
n - t r
Enforcement
Points
Web Service
Policy Manager a no
Message
h a s
o m )
u ide
m c
HTTP en
tG
File Other i b
n SSOAP d JMS JDBC
i t u
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
When a
A R composite application is assembled and each of its components configured, it is
N for deployment and testing in a runtime environment. Deployment consists of several
ready
KOseparate steps:
1. Building the application
- All service components are included in a file. This file is in the JAR file format, and
is known as a Service Archive (SAR) file. The SAR file is a deployment unit that
describes and packages service components such as BPEL processes, business
rules, human tasks, and mediator routing services into a single application.
2. Deploying the application
- The SAR file is passed to the target server, which unpacks the archive, and
immediately begins executing the application.

Oracle SOA Suite 12c: Build Composite Applications 3 - 5


Building the Service Archive

sca_HelloWorld_rev1.0.jar
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce composite application in Oracle JDeveloper, the composite is
N AR in a SAR file. SAR is a JAR file (for a single composite application) and is named in
When you
packaged
deploy a SOA

KOthe format sca_<ProjectName)_<revision>.jar. The SAR file can include the following
artifacts:
Binding components and service components
References to Oracle Web Service Manager (OWSM) policies and human workflow task
flows
Metadata such as WSDL and XSD files
Note: The SAR file is generated in the deployment folder that is specified in the Project
Properties settings. By default, this is the deploy subfolder of the project.

Oracle SOA Suite 12c: Build Composite Applications 3 - 6


Deploying Multiple SOA Projects
A ZIP file contains deployment
package files for multiple projects.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

deploy
SOA Infrastructure

BPEL Mediator
Business Human
a ble
Rules Workflow
f e r
ans
Event Delivery Network
n - t r
Enforcement
Points
Web Service
Policy Manager a no
Message
h a s
o m )
u ide
m c
HTTP en
tG
File Other i b
n SSOAP d JMS JDBC
i t u
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce Workspace may contain multiple projects. Using the Application
R
A JDeveloper
Aand Application
O N
menu application properties, JDeveloper enables you to create a SOA bundle to deploy
K multiple applications with one deploy operation, instead of deploying each separately. Each
project should have its own deployment profileeither the default profile or a deployment
profile that you create. The SOA Bundler creates a ZIP file that contains one or more SOA
archive files. If you deploy using a SOA bundle, all the SOA archives specified on the SOA
Bundle Deployment Profile Properties Dependencies page are generated (if they do not exist)
and added to the SOA bundle ZIP file. The SOA bundle ZIP file is written to the file name and
location specified in the SOA Bundle Deployment Profile Properties General settings. By
default, this is a deploy subfolder of the Application Workspace directory.

Oracle SOA Suite 12c: Build Composite Applications 3 - 7


Versioning Applications
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

SOA Infrastructure

1.0 1.1
a ble
f e r
an s
Each deployed
n - t r
version has a unique
endpoint URL.
URL a no
h a s
o m )
u ide
m c nt G
b
ni StudC2 e
C1
@ i C3
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
A SOAR K
composite l
application is automatically activated when you deploy it to the SOA
N A
Oinfrastructure. During deployment, you can specify a specific revision number for the
K application. A revision is a specific deployed version of the application. You can deploy
multiple revisions of an application to support different client requirements at the same time.
The benefit of revisions is that an older version can be executed in the same environment as
a new revision. Older client applications are supported until they can be modified to use the
new revision. For example, client C1 is using the composite application CA version 1.0 by
explicitly specifying the revision number. New partnerships with different clients (C2 and C3)
who require the new revision can invoke it either by specifying its revision or excluding the
revision information, causing the default revision (the new version) to be invoked. Later, you
can plan the migration path for the old client to the newer revision of the application.
The revision value is added to the application name in Oracle Enterprise Manager Fusion
Middleware Control Console. Revision 1.0 is the default version for many deployed SOA
composite applications. If a new request comes in for a specific composite application
revision, that composite application revision is invoked. If a new request comes in without
specifying a revision, the default revision is invoked.
Note: An archive selected for deployment can be a SOA composite bundle (containing
multiple SOA composite application revisions). However, there should not be any cross-
references between composites in the same bundle. For example, Composite A revision 1.0
should not reference Composite B revision 1.0.
Oracle SOA Suite 12c: Build Composite Applications 3 - 8
Redeploying an Application

Redeploy a composite application if:


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

Configuration and updates to the application do not modify


the interface definition
You wish to make an older version of the application the
default version

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
ccomposite
A R
When you redeploy a application, you overwrite the specific version with a new
N of the application. If the application is redeployed as the default revision, the active
copy
KOversion is immediately replaced, causing any running instances to be terminated. The
terminated instances have their runtime state changed to stale.
If you wish to apply configuration and updates to a composite application, and those changes
do not modify the interface definition (and therefore, affect clients from a design perspective),
the revision ID need not be changed. In this case, redeploying the application makes sense.
You might also choose to redeploy to make an older version of the composite application the
default revision.
Note: In a production environment, overriding an active version of an application may have
negative consequences. Care should be exercised when deciding whether to deploy a new
version of an application or when overriding an already deployed version.

Oracle SOA Suite 12c: Build Composite Applications 3 - 9


Deployment Options
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
In the SOAK J l i
Deployment
ceConfiguration dialog box, you can manage the following configuration
N AR
settings:
O
K Project: Displays the project name. However, if you are deploying multiple projects by using
a SOA bundle style deployment, the configuration window displays multiple project tabs. The
Project fields value changes when you select a project name tab to enable you to view and
define the following settings for each project:
Current Revision ID: Is a read-only setting that shows an existing project revision (if
previously deployed). By default, this appears as the value 1.0.
New Revision ID: Enables you to change the revision ID of the SOA composite
application
Note: If you do not change the revision ID, you should select the Overwrite any existing
composites with the same revision ID check box.
SOA Configuration Plan section: Enables you to select a configuration plan file (if any
exist) to be applied to the deployed application. When using a SOA bundle to deploy
multiple projects, each project may have its own configuration plan attached.

Oracle SOA Suite 12c: Build Composite Applications 3 - 10


Mark composite revision as default: By default, this check box is selected, making a
newly deployed composite revision as the default version invoked for new requests in
the runtime environment. However, deselect this check box if you do not want it to be
the new default revision.
Overwrite any existing composites with the same revision ID: When this check box
is selected, the deployment overwrites an existing SOA composite application with the
same revision value. This option should be selected when you do not change revision
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

ID; otherwise, a deployment error occurs.


Use the following SOA configuration plan for all composites: Use this option when
you are deploying multiple composite applications with a SOA bundle and when you
wish to apply the same configuration plan for all composite applications. Click Browse to
locate and select the configuration plan to be used.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

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


Examining the Deployment Log

[04:19:27 PM] ---- Deployment started. ----

1
[04:19:27 PM] Target platform is (Weblogic 12.x).
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

[04:19:27 PM] Running dependency analysis...


[04:19:27 PM] Building...
[04:19:33 PM] Deploying profile...
[04:19:33 PM] Wrote Archive Module to
/u01/app/fmw12c/domains/myWork/mywork/Basics/HelloWorld/deploy/sca_HelloWorld_
rev1.0.jar
[04:19:33 PM] Deploying sca_HelloWorld_rev1.0.jar to partition "default" on server
DefaultServer [http://soa12c.example.com:7101]
[04:19:33 PM] Processing
sar=/u01/app/fmw12c/domains/myWork/mywork/Basics/HelloWorld/deploy/sca_HelloWo
rld_rev1.0.jar
[04:19:33 PM] Adding sar file - 2
a ble
/u01/app/fmw12c/domains/myWork/mywork/Basics/HelloWorld/deploy/sca_HelloWorld_
f e r
rev1.0.jar
ans
[04:19:33 PM] Preparing to send HTTP request for deployment
n - t r
no
[04:19:33 PM] Creating HTTP connection to host:soa12c.example.com, port:7101
[04:19:33 PM] Sending internal deployment descriptor
[04:19:33 PM] Sending archive - sca_HelloWorld_rev1.0.jar
s a 3
[04:19:35 PM] Received HTTP response from the server, response code=200
) a
h de
om t Gui
[04:19:35 PM] Successfully deployed archive sca_HelloWorld_rev1.0.jar with 0

c
warning/severe messages to partition "default" on server DefaultServer
m en
[http://soa12c.example.com:7101]
i
n Studb
[04:19:35 PM] Elapsed time for deployment: 8 seconds 4
i
in@ this
[04:19:35 PM] ---- Deployment finished. ----

r j a
k se
a
on t2014, uOracle and/or its affiliates. All rights reserved.
( kCopyright o
A I N nse
K J l i ce each step of the deployment process.
A R
The deployment log records
N
KO1. When deployment is started, the target platform is identified. The application is checked
to see whether it can meet all dependencies for execution on this platform.
2. The project is compiled as a service archive and packaged in a .jar file.
3. A connection is made to the target host, and the deployment descriptor is sent with the
.jar file. The application server deploys the application and returns a response.
4. The response from the application server is displayed in the log file, along with the
elapsed time for the entire deployment process.

Oracle SOA Suite 12c: Build Composite Applications 3 - 12


Application State
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

SOA Infrastructure
state=active
turn off
deploy
turn on
Enterprise
Manager
Removed
retire activate a ble
f e r
ans
undeploy
n - r
state=shutdown
t
a no
JDeveloper
state=stale
state=retired ha
s
o m )
u ide
b
Existing instanceistate mc ent G
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
When an R Kapplicationl is deployed, it is automatically made active. It remains in the active state
O NAsome administrative action is taken. Possible administrative actions include turning off or
until
K retiring the application. When an application is turned off (or shut down in Oracle Enterprise
Manager), that revision of the application is shut down. New requests to the composite are
rejected. An application that has been turned off can also be turned on (or started up in
Oracle Enterprise Manager). When an application is turned on, the application is restarted.
New requests are processed. No recovery of messages occurs.
An active application can also be retired. When an application is retired, no new instances of
that revision of the application are created and any request is rejected. Existing instances are
allowed to complete normally. Only active composites can be retired. An application that has
been retired can also be activated. When an application is activated, new requests are
processed and new instances are created.
Undeploying an application removes the selected application revision. You cannot configure,
monitor process instances, or view previously completed processes of that revision of the
application. The state of any currently running instances is changed to stale, and they are
effectively terminated. The default revision is changed to the next available revision of the
application (if one exists). Applications with running instances should be retired before they
are undeployed. This will give all running instances an opportunity to complete.

Oracle SOA Suite 12c: Build Composite Applications 3 - 13


Configuration Plans: Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

deployed

Target
Environment 1

Configuration
Plans
a ble
f e r
ans
SOA Archive n - t r
deployed
a no
h a s
m )Target ide
c o G u
b m en t
Environment 2
i
in Stud
@
in this
r k j a
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
As youR K projectsl from one environment to another (for example, from testing to
move
NA
Oproduction), you typically must modify several environment-specific values, such as Java
K Database Connectivity (JDBC) connection strings, host names of various servers, and so on.
Configuration plans enable you to modify these values by using a single text (XML) file called
a configuration plan. The configuration plan is created either in Oracle JDeveloper or with
command-line tools such as the ant-sca-text.xml Ant script. During process deployment,
the configuration plan searches the SOA project for values that must be replaced to adapt the
project to the next target environment.
Thus, you can create multiple configuration plans for different target environments without
directly modifying the original source code that was created during development.

Oracle SOA Suite 12c: Build Composite Applications 3 - 14


Modifying a Configuration Plan
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

<SOAConfigPlan ...>
<composite name="EchoMediatorComposite">
<import>
<searchReplace>
<search>soa12c_dev.example.com</search>
<replace>soa12c.example.com</replace>
a ble
f e r
</searchReplace>
ans
</import> ...
n - t r
no
</composite>
</SOAConfigPlan>
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce plan is relatively straightforward, by including the appropriate
N AR
Modifying the configuration
<searchReplace> elements and their <search> and <replace> child elements with
KOappropriate values. The slide example shows how to provide search and replace host name
strings that are found in the schemaLocation attribute of a WSDL import element.
You can modify the configuration plan file to replace the following attributes and properties:
Any composite, service component, reference, service, and binding properties in the
SOA composite application file (composite.xml)
Attribute values for bindings (for example, the location for binding.ws)
The schemaLocation attribute of an import in a WSDL file
The location attribute of an include in a WSDL file
The schemaLocation attribute of an include, import, and redefine in an XSD file
Any properties in JCA adapter files
Modify and add policy references for service and reference binding components
Note: Editing the configuration plan requires that you know the assembly model structure and
all the service artifacts used by the composite application. For more information, refer to the
Fusion Middleware documentation titled Developing SOA Applications with Oracle SOA Suite.

Oracle SOA Suite 12c: Build Composite Applications 3 - 15


Managing the Life Cycle
of a Composite Application
Source Code check in check out check in check out
Control
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Systems

Service
MDS
Registry

Config
Plans

a b le
WSIL
f e r
ans
n - t r
deploy deploy
n o deploy
s a
) a
h de
c om t Gui
i b m en
DEVELOPMENT
@ in Stud
TEST PRODUCTION

j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
The slideKillustrates lone possible scenario for migrating an application from development to
A production environments. Each phase of migration can use any of these tools:
Nand
test
K O
Oracle JDeveloper 12c is typically used during the development phase. With
JDeveloper, you use a source code control system (SCCS) for version control of the
composite application source code and its configuration plan.
Ant is a command-line tool that can be used to deploy a composite application with the
deployment plan modified for the test environment. After successful testing, the
composite application and test deployment plan are checked in to the SCCS.
Oracle Enterprise Manager 12c Fusion Middleware Control can deploy the composite
application with the deployment plan modified for the production environment.
The deployment configuration plan simplifies the process of migrating a composite application
across environments.
Note: Service lifecycle management ideally includes an enterprise repository and a service
registry for central storage, access, and versioning of services, subject to SOA governance
requirements. Without an enterprise repository or a service registry, you can use the Oracle
SOA Suite 12c Metadata Services (MDS) Repository to store reusable artifacts, which can be
accessed through JDeveloper during the development phase.

Oracle SOA Suite 12c: Build Composite Applications 3 - 16


Quiz

After an application is deployed, its state must be set to active


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

before it is executed by the application server.


a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARb
Answer:
N
KOFalse. When an application is deployed, it is automatically made active. It remains in the
active state until some administrative action is taken.

Oracle SOA Suite 12c: Build Composite Applications 3 - 17


Agenda

Deploying Composite Applications


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

Testing and Managing Composite Applications

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 3 - 18


Testing a Composite Application

Composite applications can be tested by using:


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

Oracle Enterprise Manager Fusion Middleware Control,


which enables:
Initiating composite application instances
Viewing responses for synchronous requests
Tracking message flow through a composite application
Viewing faults and log files
r a ble
e
Managing fault conditions nsf t ra
Oracle JDeveloper Web Service Test tool, which n -
o enables:
a n
Initiating composite applications a
h de s
)
Viewing responses for synchronous
c om t Gui requests
Examining the HTTP request
i b mand eresponse n headers
in Stu d
i n @ is
r k j a t h
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
R
Both Oracle l Manager Fusion Middleware Control and Oracle JDeveloper have
K Enterprise
O NA tools that enable you to initiate composite applications and view responses (for
testing
K synchronous services). The slide highlights some of the capabilities of each tool, and
highlights some of the differences. Each has its place in the set of tools that you can use to
test your applications or the services that they reference.

Oracle SOA Suite 12c: Build Composite Applications 3 - 19


Initiating a Test in JDeveloper

Select a web service in the Resource


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

Palette. Right-click an entry point and


select Test Web Service from the menu.

a ble
f e r
an s
n - t r
a no
h a s
o m )
u ide
m c Enterntsample G data and
b
ni Stud e Send Request.
click
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce testing tool is called HTTP Analyzer. It is a proxy server that is
N ARof intercepting HTTP communications as well as creating, copying, and modifying
The JDeveloper
capable
web service

KOSOAP packets to send to services and interpret service responses.


To initiate a test of a web service in JDeveloper, select the desired service in the Resource
Palette. Right-click the service and select Test Web Service. The request and response
panes are displayed. Enter sample data and click Send Request.

Oracle SOA Suite 12c: Build Composite Applications 3 - 20


Viewing Responses in JDeveloper
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Synchronous response message


payloads are displayed here.
a ble
f e r
ans
n - t r
a no
h a s
The HTTP Content o m )
u ide
view of requests and m c nt G
b
ni Stude
responses i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
care
A R
If the service that you testing is a synchronous service, the response or fault message is
N
displayed in the reply window area.
KO If you click the Raw Message tab, you can view the HTTP header lines and the SOAP content
in XML format. The HTTP Analyzer tab in the lower section of the window enables you to view
request messages for all exchanges. Just click a numbered line to view the information
exchanged for that request-response cycle. You can also initiate additional requests.

Oracle SOA Suite 12c: Build Composite Applications 3 - 21


Managing SOA Applications with JDeveloper

The Application Server Navigator in JDeveloper enables you to


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

perform the following actions on SOA applications:


Deploy a SOA archive.
Retire an existing revision.
Turn an application OFF and ON.
Set the default revision.
Undeploy the application. r a ble
e sf
r a n
-t on
a n
a
h de s
)
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
To open the l Server Navigator, select JDeveloper View > Application Server
K Application
NA Expand the Application Servers tree and the target server connection. Perform the
ONavigator.
K desired action from different context menus.
Right-click the SOA folder to view its context menu. Select Deploy SOA Archive to deploy a
SOA archive (SAR) file that has already been created.
Right-click any composite application node and select one of the following operations:
Retire to stop new instances from being created before you undeploy an application
Turn OFF to shut down the application so as to prevent new instances from being
created. This is similar to performing the Shutdown action in the Oracle Enterprise
Manager Fusion Middleware Control. When you turn off an application, the context
menu item is changed to Turn ON so that you can enable the application to start
instances for receiving new requests from clients.
Set Default Revision to alter the version of a composite application that is used to
handle requests. This menu option is not active (disabled) unless you have multiple
revisions deployed.
Undeploy to remove the composite application from the server

Oracle SOA Suite 12c: Build Composite Applications 3 - 22


Enterprise Manager

Enterprise Manager provides tools for many purposes,


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

including:
Deploying and undeploying applications
Managing the state of applications
Testing applications SOA Infrastructure

BPEL Mediator
Business
Rules
Human
Workflow
a ble
f e r
ans
Enterprise
Event Delivery Network
n - t r
Manager
Enforcement
n o Policy
Web Service
Points
s
Message a Manager

) ha de
c om t GHTTP ui
File
i b m Otheren SOAP JMS JDBC
in Stu d
i n @ is
r k j a t h
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
OracleR K
Enterprise l
Manager 12c Fusion Middleware Control is the primary tool for managing,
N A
monitoring, and configuring the SOA runtime environment and components.
KO By using Fusion Middleware Control, you can perform tasks such as:
Deploying and undeploying composite applications
Managing the runtime state of composite applications
Shutting down and restarting the composite applications
Initiating tests of SOA applications by using a web-based service testing tool
Tracking and monitoring composite application instances and message flows through a
composite application
Examining and managing application fault conditions
Monitoring component engines

Oracle SOA Suite 12c: Build Composite Applications 3 - 23


From Fusion Middleware Control, you can navigate to Oracle SOA Suite administration tasks
through the SOA Infrastructure home page and menu. The SOA infrastructure provides you
with access to all deployed SOA composite applications, service engines, service
components, business events, and other elements.
Fusion Middleware Control provides a wide variety of administrative and performance data for
the SOA components, composite applications, and composite instances within the SOA
infrastructure, thus enabling you to administer and pinpoint issues.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 3 - 24


Oracle Enterprise Manager: Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Manage and monitor the application.


Retire, shut down or start up, and
test
Access WSDL URLs.
Examine composite.xml definition
Access log files.

Navigation a ble
f e r
Pane
ans
Drill down into monitoring and
n - t r
performance data for application
instances, components, and services. a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cgiven
A R
The home page for a application includes buttons and tabs that provide access to a
N of application management functions. The buttons allow you to:
variety
KO Manage the state of an application (retire and shutdown or startup)
Test the application
Access WSDL URLs
Examine the composite.xml definition
Access log files
By default, the dashboard tab is displayed. From there, you can drill down into monitoring and
performance data for application instances, components, and services. Other tabs allow you
to search for specific instances and faults and rejected messages. You can also access unit
test cases and security policies from there.

Oracle SOA Suite 12c: Build Composite Applications 3 - 25


Testing a Composite Application
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Modify test
parameters and
a ble
supply sample data.
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
To initiate a test of a composite application, navigate to the home page for the composite
N
Oapplication that you wish to test, and click Test. The Test Web Service page is displayed
K (shown in the slide).
On the Test Web Service page, click Test (if there is one entry point) or click Test and select
one of the entries from the Test drop-down list (if multiple entry points are available) Select an
operation from the Operation drop-down list (which may provide a list if the service has more
than one operation).
On the Test Web Service page, scroll down the page and enter various properties in the
Request tab section. In particular, enter request data values in the fields supplied in the Input
Arguments section, which by default displays input fields (based on the request messages
structure) in Tree View mode. Click Test Web Service to invoke the service.

Oracle SOA Suite 12c: Build Composite Applications 3 - 26


Response Tab

The webpage is refreshed with the Response tab displaying


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

either of the following:


The synchronous response data or fault message
The fact that no response was possible because it was an
asynchronous request (regardless of whether it was a one-
way or two-way operation), because the web client cannot
receive a response as an asynchronous callback message
a ble
e r
Use the Flow Trace
a n sf
n - tr of the
feature to examine

a
test nomore detail.
the execution
in
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ceResponse tab is enabled. If the service is synchronous, the tab
N ARthe response data or fault message. If the request is asynchronous, the window
When the
displays
test is run, the

KOdisplays a message that the test is complete but no response is possible.


From the Response tab, the Launch Flow Trace button provides access to step-by-step status
of the test.

Oracle SOA Suite 12c: Build Composite Applications 3 - 27


Flow Trace
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Execution of the application instance is


logged on a per-component basis.

a ble
f e r
ans
n - t r
a no
has deis available by
Detailed audit) information
clicking a
c m Guiname.
ocomponent
m ent
i b
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
The Flow KTrace logsl the execution of an application instance on a per-component basis. The
O NA
components type, current state, and time stamp of the last update is noted in the trace.
K Further drilldown is possible by clicking a component name.

Oracle SOA Suite 12c: Build Composite Applications 3 - 28


Quiz

The Flow Trace logs the execution of an application instance


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

on a per-component basis.
a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARa
Answer:
N
KOTrue. The Flow Trace logs the execution of an application instance on a per-component
basis. The components type, current state, and time stamp of the last update is noted in the
trace. Further drilldown is possible by clicking a component name.

Oracle SOA Suite 12c: Build Composite Applications 3 - 29


Summary

In this lesson, you should have learned how to:


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

Manage SOA composite applications by using Oracle


Enterprise Manager
Track messages through SOA composite applications by
using Oracle Enterprise Manager
Deploy a composite application
Undeploy a composite application r a ble
n s fe
Migrate a composite application to a production
n - tra
environment no
s a
) a
h de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 3 - 30


Practice 3-1 Overview
sca_HelloWorld_rev1.0.jar
build
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

SAR File

deploy

SOA Infrastructure

Business Human
BPEL Mediator
Rules Workflow
a ble
f e r
Event Delivery Network
a n s
Enterprise r
n-tWeb Service
no Policy Manager
Enforcement
Manager Points
Message
s a
h a
o m )
u ide
File m c ntSOAP
Other
G
HTTP
JMS JDBC
i b e
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
In this R K you lcreate, deploy, and run a simple SOA composite application. You use the
practice,
NA Manager web application to test the service with sample input. The goal of this
OEnterprise
K practice is to become familiar with the development environment, and to begin forming an
understanding of composite application components.

Oracle SOA Suite 12c: Build Composite Applications 3 - 31


Practice 3-2 Overview

In this practice, you modify the HelloWorld File adapter to use a


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

logical name. Your tasks are to:


Modify the File adapter definition of the HelloWorld
application to use a logical name instead of a physical
directory name for the location to write files in
Set a reference property of the File adapter to define the
logical name value
r a ble
Deploy the updated HelloWorld application and test that n s fe
- tra for
the order file is saved in the directory that is specified
n
o
the logical name an s
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce the following:
A R
In Practice 3-2, you perform
N
O Modify the File adapter definition of the HelloWorld application to use the logical name
K orderfiles instead of specifying the physical directory name for the location to write
files in.
Set a reference property of the File adapter to define a value for the orderfiles
logical name.
Deploy the updated HelloWorld application and test that the order file is saved to the
directory specified for the logical name.

Oracle SOA Suite 12c: Build Composite Applications 3 - 32


Practice 3-3 and 3-4 Overview
Configuration SOA Archive
Plan
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

generate
validate
deploy
JDeveloper

SOA Infrastructure

BPEL Mediator
Business
Rules
Human
Workflow
a ble
f e r
an s
Enterprise
Event Delivery Network
n - t r
Manager
Enforcement
n o Policy
Web Service
Points
s a
Message
Manager

) ha de
c om tHTTP G ui
File
i b mOther en SOAP JMS JDBC
in Stu d
i n @ is
r k j a t h
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
R
In the final l for this lesson, you perform the following:
Ktwo practices
A
KON Generate a configuration plan for the HelloWorld project that redefines the value
assigned to the logical name property of the File adapter.
Validate the configuration plan.
Redeploy the HelloWorld composite application with its new configuration plan by using
Enterprise Manager.

Oracle SOA Suite 12c: Build Composite Applications 3 - 33


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

KO
N
ARK
J l
(
AIN icens
a r j a
kon e to u
k se
i
in@ this
b m
o
ni Stude
m ) h a
c nt G u
a
ide
s
n no
- t r an
s
f e r a b
le
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Working with Data

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO
Objectives

After completing this lesson, you should be able to:


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

Describe the role of XML, XSD, XPath, XQuery, and XSLT


in the way Oracle SOA Suite 12c handles data
Use the XSLT Mapper to create XSL transformations in a
Mediator
Describe how the XQuery Mapper can be used to create
XQuery transformations in a Mediator
r a ble
Transform external, native format data to XML data a that
n sfise
useable within Oracle SOA Suite 12c n - tr
o
s an
) ha de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 4 - 2


Agenda

XSLT Transformations in Mediator


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

XQuery Transformations in Mediator


Adapters and Native Format Data

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 4 - 3


Data Standards

XSL transformations describe


the mapping of data from one
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

XML structure to another.

XPath is the expression


language used to reference a ble
f e r
elements and to manipulate
ans
data in XSL transformations.
n - t r
a no
h a s
XML schema
Schema definition
Definition o m
(XSD)
(XSD)
)
u ide
documents describe m c nt G
the
b
ni documents. de
structure of iXML documents
t u
j a in@ this S
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce Oracle SOA Suite 12c processes messages that are formatted
asN ARAn XML schema definition, or an XSD document, is used to describe the structure of
In its interaction
XML.
with services,

KOthese XML messages. As its name suggests, an XSD is used to describe (or define) the
structure (or schema) of an XML message. In fact, an XSD uses the XML format to provide
that description.
eXtensible Stylesheet Language Transformation (XSLT) is used to describe how to map data
from one XML structure to another. XSLT makes use of the expression language defined by
XPath for selecting elements for processing, for conditional processing, and for generating
text.

Oracle SOA Suite 12c: Build Composite Applications 4 - 4


Role of XSD Attributes

<ns0:item>
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

<ns0:productId>SKU301</ns0:productId>
<ns0:name>Music Player 1Gb</ns0:productName>
<ns0:price>45</ns0:price>
<ns0:quantity>3</ns0:quantity>
</ns0:item>

XSD describes XML.

a ble
f e r
<xsd:complexType name="OrderItemType">
ans
<xsd:sequence>
n - t r
<xsd:element name="productId" type="xsd:string" minOccurs="1"/>
a no
<xsd:element name="name" type="xsd:stringminOccurs="1"/>
<xsd:element name="price" type="xsd:decimal" minOccurs="1"/> h a s
m
<xsd:element name="quantity" type="xsd:int" minOccurs="1"/>
o
)
u ide
</xsd:sequence>
m c nt G
</xsd:complexType> b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
XML documents are described in terms of their component pieces, or elements. An XML
N definition is used to define these elements. It can be used to define their order and
schema
KOnumber, their attributes, their relationship (parent/child), their data types, and their default or
fixed values, if any. Built-in data types (a list of commonly used examples would include int,
double, boolean, date, and string, among others), simplify the description of permissible
document content and data formats in XML schemas. XSD also supports complex types,
which describe elements that contain other elements and/or attributes.
Like other XML documents, XSD documents include namespace definitions, which are used
in XML to allow programs to disambiguate among document elements that may have the
same name but are drawn from different sources and thus have different meanings.
Subsequent elements in the document begin with their namespace prefix.
The example in the slide shows a snippet of an XSD, which describes a complex type and its
component elements, each of which is of a built-in data type. Note also the minOccurs
attribute, which indicates that this element is required, and must occur at least one time in any
valid message. The upper code box in the slide shows a piece of an XML document that is
described by the XSD sample.

Oracle SOA Suite 12c: Build Composite Applications 4 - 5


XSL Transformations

Source Target
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

item

productId prodId

productName prodName

price price

qty quantity
a ble
f e r
ans
<ns1:item>
n - t r
<ns1:prodId>
<xsl:value-of select="imp1:productID"/> a no
</ns1:prodId>
h a s
<ns1:prodName>
o m )
u ide
<xsl:value-of select="imp1:productName"/>
m c nt G
</ns1:prodName>
b
ni Stude
</ns1:item>
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce an XSLT transformation references two documentsone describing
N
the AR message, the other describing the outbound message. It then includes a set of
In Oracle SOA
inbound
Suite 12c,
O
K instructions that result in the creation of the outbound document.
In the example in the slide, the <xsl:value-of> element is used to extract the value of an
XML element and add it to the output stream of the transformation. The select attribute
contains an XPath expression that references the path to the desired source node.
This expression instructs the XSLT processor to take the contents found at the productId
location in the source message, and to place those contents in the prodId node in the
outbound message. Similar instructions map the productName node to the prodName node.

Oracle SOA Suite 12c: Build Composite Applications 4 - 6


Using XPath Functions

Source Target
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

item

productId prodId

productName prodName
widget WIDGET

price price
a ble
f e r
ans
<ns1:item>
n - t r
no
<ns1:prodId>
<xsl:value-of select="imp1:productID"/>
s a
</ns1:prodId>
h a
<ns1:prodName>
o m )
u ide
</ns1:prodName> m c nt G
<xsl:value-of select ="xp20:upper-case(imp1:productName)"/>

b
ni Stude
</ns1:item>
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
As youRhave lice is used to reference and navigate through the hierarchical structure
K Jseen, XPath
A
OofNan XML document. XPath also includes a library of functions that enable evaluation and
K manipulation of data found at the referenced location in the document.
In the example in the slide, the value found in the productName node is converted to
uppercase before being assigned to the prodName node in the destination document.
XPath functions can be nested as well. If you want to copy only the first three characters of
the uppercase value to the destination, you could pass the result of the upper-case function
to the substring function in an expression such as <xsl:value-of
select="substring(xp20:upper-case(imp1:prodName),3)"/>.

Oracle SOA Suite 12c: Build Composite Applications 4 - 7


Using the Mapper in JDeveloper
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce enables you to visually create transformation rules that can be
N ARto message structures that are processed in Mediator routing rules. Transformation
The XSLT
applied
Mapper window

KOrules are created by dragging source elements to their respective target elements. A large
number of built-in functions exist that you can use to enrich and alter source values before
they are copied to their target elements. The XSL source editor can be used for XSL
constructs and mappings that cannot be visually represented by the visual designer.

Oracle SOA Suite 12c: Build Composite Applications 4 - 8


Auto Map
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

These control how


Auto Map matches
node names.

a ble
f e r
ans
n - t r
a no
h a s
These control how
o m )
u ide
Auto Map treats
m c nt G
optional data. b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i cestarts the Auto Map tool. With it, the XSLT Mapper automatically tries
Mapping R
Aall non-leaf nodes
toNlink relevant nodes under the selected source and target. The Auto Map tool is
KOinvaluable when there are a large number of elements to be mapped in complex structures.
The behavior of the Auto Map tool can be tuned by altering the settings in Oracle JDeveloper
preferences or by right-clicking the XSLT Mapper and selecting Auto Map Preferences.
The automatic mapping algorithm depends on existing maps between source and target
nodes. When maps exist between source and target nodes before executing automatic
mapping, these existing maps are used to define valid synonyms that are used by the
algorithm.

Oracle SOA Suite 12c: Build Composite Applications 4 - 9


XPath Functions
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
Functions
f e r
appear as icons.
an s
n - t r
a no
h a s Component
The drag-
) i d e
c om t Gand-drop Palette
u offers
access to the
b m n
i ni Stude XPath function library.
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
XPath R K J provide
functions licethe means to evaluate and manipulate data in an XSL transformation.
O NA of functions include type conversion, date, logical, mathematical, string, and
Categories
K others. Text literals can also be added in a similar manner. The functions are accessed from
the Component Palette, and added to mappings by dragging and dropping the appropriate
function onto the center of the canvas, or directly onto an existing mapping.
Functions are displayed as icons. Nested functions are displayed with the innermost function
to the left, and the subsequent outer functions to the right. Execution of the functions is also
performed left to right.

Oracle SOA Suite 12c: Build Composite Applications 4 - 10


Optional and Repeating Data
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
<xsd:element name="item" type="tns:itemType" maxOccurs="unbounded" />
h a s
) ide
<xsd:element name="prodName" type="xsd:string" minOccurs="0"/>
o m u
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l
The <xsl:for-each> i ceelement provides the means to perform looping in XSLT. The for-
R is often used to ensure that all instances of a repeating element
Aelement
N
each
KO(maxOccurs=UNBOUNDED) within a source document are copied to the target document.
The <xsl:if> element can be used to define a conditional test of some content within the
source document, or to test some condition during the execution of the transformation. One
way the if element is often used is to verify that an optional element (minOccurs=0) is
present before attempting to copy content to a destination node.
Both the for-each and if elements can be defined manually and/or created by the Auto
Map tool.

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


Testing Transformations
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
Source and destination panels display sample
a no
data before and after transformation.
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cenables
The XSL
A R Map Tester you to test the transformation mapping logic that you designed
N the XSLT Mapper. As shown in the image in the slide, the Tester generates sample data,
with
KOexecutes the XSLT transformation, and displays the output.
Note: The test settings that you specify are stored and do not need to be entered again the
next time that you test. However, test settings must be entered again if you close and re-open
Oracle JDeveloper.

Oracle SOA Suite 12c: Build Composite Applications 4 - 12


Quiz

The Mediator can apply XSLT mappings to message structures


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

that are processed in routing rules.


a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARa
Answer:
N
KOTrue. The XSLT Mapper window enables you to visually create transformation rules that can
be applied to message structures that are processed in Mediator routing rules.

Oracle SOA Suite 12c: Build Composite Applications 4 - 13


Agenda

XSLT Transformations in Mediator


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

XQuery Transformations in Mediator


Adapters and Native Format Data

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 4 - 14


XQuery: Introduction

According to the W3C standards body that oversees the


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

development of the XQuery standard:

XQuery is a standardized language for combining documents,


databases, web pages, and almost anything else.

XQuery is replacing proprietary middleware languages and


web application development languages. XQuery is simpler to
r a ble
work with and easier to maintain than many other alternatives. sfe
tran
o n -
s an
XQuery is designed to work with the ) a e
hXML
data model and be a comprehensive
c om t Gquery uid
language for data thatbism expressed e n in XML.

in Stui d
i n @ is
r k j a t h
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
XQuery RisKdesignedlto query XML data from both XML files and relational databases. Just as
O NAis the query language for structured data that is expressed as relational tables, XQuery
SQL
K is designed to work with the XML data model and be a comprehensive query language for
data that is expressed in XML. You can use a single XQuery on multiple and heterogeneous
data sources to transform the query result into new XML data.

Oracle SOA Suite 12c: Build Composite Applications 4 - 15


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

XQuery is built on XPath a b le


XQuery provides a f e r
expressions.
a
mechanism for extracting n s
Applications of XQuery
n -t r
information from
o
include querying, n
relationaladatabases,
generation, and s
) haand web
files, e services.
transformation of XML.
c om t Guid
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
XQueryR l expressions. It is used to query, generate, and transform XML
isKbuilt on XPath
NA
content.
O
K XML querying: XML can map a large number of different data models. XQuery thus
provides a mechanism for extracting information from relational databases, files, and
web services simultaneously.
XML generation: XQuery enables you to construct XML data by using the result of a
query.
XML transformation: XQuery can construct XML as a result of evaluating a query
expression, in many cases more expressively and efficiently than XSL Transformations
(XSLT). XQuery enables you to scan a hierarchy of elements. You can use it to apply
transformations at each level of the hierarchy by defining a recursive function.

Oracle SOA Suite 12c: Build Composite Applications 4 - 16


XSLT Versus XQuery

Similarities:
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

XPath
Data model
Functions and operators
Differences:
Syntax
XQuery is similar to SQL. a ble

f e r
XSLT stylesheets use XML syntax.
ans
Performance n - t r
o

s an
XSLT loads the entire input document in memory.
hato bedused
XQuery loads only the objects that need
) e by the

m Gu i
current statement. co m ent
i b
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
Both XSLT l are languages designed to query and manipulate XML documents.
K and XQuery
O NAfeatures and capabilities have lots of overlap. The slide lists the similarities and
Their
K differences between them.

Oracle SOA Suite 12c: Build Composite Applications 4 - 17


Using XQuery Transformations
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce Mediator can be either XSLT or XQuery, as you choose. The
N AReditor uses the same look-and-feel as the XSLT editor.
Transformations
XQuery
in Oracle

KO

Oracle SOA Suite 12c: Build Composite Applications 4 - 18


Agenda

XSLT Transformations in Mediator


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

XQuery Transformations in Mediator


Adapters and Native Format Data

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 4 - 19


Working with Native Format Data

Mediator transformations
can process both XML and
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

native format data within


transformations.

Adapter Mediator Adapter


a ble
f e r
ans
n - t r
Exposed Services Components External References
a no
File, FTP, and JMS adapters can
convert data from native format to) h
as e
XML, and from XML to native
c o m Guid
format.

This allows the data values to be t
m en
b
accessed by XSLitransformations
in Stud
within the application.
@
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
OracleR K
Mediator, l File, FTP, and JMS adapters accept native messages in XML or non-
and
O NAformat and publish them as XML messages. They can also accept XML messages and
XML
K convert them back to native EIS format. This translation from native data format to XML and
back is performed by using a definition file (non-XML schema definition), which itself is
defined in the XML schema format. The Native Format Builder wizard enables you to sample
native data and create the native XSD (NXSD) grammar for translation of native data.

Oracle SOA Suite 12c: Build Composite Applications 4 - 20


Native Data Transformation

2,100,credit,two_day,initial,VISTA,1234-1234-1234-1234
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

SKU301|Music Player 1Gb|45|3


SKU305|Music Player 160Gb|250|20

Header Transformation
Order Detail
Information

<customer>
a ble
<custID>2</custID>
f e r
<ID>100</ID>
ans
***
n - t r
no
<itemlist>
<item>
s a
<prodID>SKU301</prodID>
h a
) ide
<prodName>Music Player 1Gb</prodName>
<price>45</price>
o m u
<quantity>3</quantity>
m c nt G
</item>
b
ni Stude
***
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce shows incoming delimited data passed into the adapter, and that
R
The example
Apassed in the slide
N
data out of the adapter in XML format, which is suitable for processing in Oracle SOA
KOSuite 12c. An outbound adapter can be configured to perform the opposite transformation,
passing XML data out in a delimited (or other) format.

Oracle SOA Suite 12c: Build Composite Applications 4 - 21


Invoking the Native Format Builder
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Invoke the Native Format Builder from either the Adapter


Wizard or via the Mediator Translate to Native option.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce is accessible from the configuration wizard for any adapter that
N AR native format translation, or via the Translate to Native option in the Mediator
The Native
supports
Format Builder

KOconfiguration dialog box.

Oracle SOA Suite 12c: Build Composite Applications 4 - 22


Specifying File Name and Native Data Format
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Specify the name of the file to create,


and the type of native data to process.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
Begin by K J
specifying l i
the
cename of the file (.xsd) that will describe the native format, and by
N AR the type of data it will represent.
selecting
KO The Native Format Builder wizard supports file formats such as delimited, fixed-length,
complex type, data type description (DTD), and COBOL Copybook.
The Delimited option enables you to create native schemas for records, where fields are
separated by a value such as a comma or number sign (#).
The Fixed Length (Positional) option enables you to create native schemas for records
where all fields are of fixed length.
The Complex Type option enables you to create native schema for records where the
fields may themselves be records having multiple delimiter types.
The DTD option enables you to generate native schema from the user-supplied DTD,
which contains information about the structure of an XML document.
The COBOL Copybook option enables you to generate native schema from the user-
supplied COBOL Copybook definition.

Oracle SOA Suite 12c: Build Composite Applications 4 - 23


Specifying a Sample File
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
a n s
n-and
Specify a sample file
r
t specify
how it should n beointerpreted.
s a
) a
h de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
The Native l
K Format Builder reads a sample native file to initiate the definition process. On the
A
N shown in the slide, specify the sample file and provide additional instructions on how
screen
KOto interpret the contents of that file.

Oracle SOA Suite 12c: Build Composite Applications 4 - 24


Defining a Schema for a Native Format
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Icons provide access to tools to define


XML schema elements and complex types.

a ble
f e r
an s
t r
A sample native format
n -
file is displayed.
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce file, the wizard provides features to allow you to fully define the
N AR XML schema file.
After reading
resultant
the sample

KO

Oracle SOA Suite 12c: Build Composite Applications 4 - 25


Summary

In this lesson, you should have learned how to:


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

Describe the role of XML, XSD, XPath, and XSLT in the


way Oracle SOA Suite 12c handles data
Use the XSLT Mapper to create XSL transformations in a
Mediator
Test XSL transformations
Configure adapters and Mediator transformations to r a ble
convert external, native format data to XML data thatanissf
e
useable within Oracle SOA Suite 12c n - tr
o
s an
) ha de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 4 - 26


Practice 4 Overview

This practice covers the following topics:


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

Defining Native Format Data


Using the XSLT Mapper

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 4 - 27


Practice 4 Overview:

The Mediator will


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

perform an XSL
transformation of
data.

The inbound File adapter


will convert the delimited
data to XML format.

a ble
f e r
ans
n - t r
a no
The outbound
h a s
ide
File adapter will
m )
write the data to
o
c nt G
the file system.
u
b m
i ni Stude
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
In this R
practice, ice deploy, and run a composite application that receives delimited
K J you lcreate,
NAfrom a File adapter. This data is transformed to XML format and passed to a Mediator.
Odata
K The Mediator then transforms the data to the XML format that is desired by the receiving
application. In this practice, this application is an outbound File adapter that writes the data
from the composite application to the file system.

Oracle SOA Suite 12c: Build Composite Applications 4 - 28


Optional Challenge:
Creating a Fixed-Length Output File
In this unstructured practice, you add an additional File adapter
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

as an external reference that writes purchase order information


to a fixed-length format file. This section of the practice builds
on the work that you have already done. The new adapter
should write different data to the same format. For example,
running the application three times should produce files with
content similar to the following: le
r a b
s f e
2 100 credit two-day initial MCRD 1234-1234-1234-1234 - t r an
2 100 credit two-day initial VISTA 1234-1234-1234-1234 n no
2 100 credit international initial VISTA 1234-1234-1234-1234 s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
In this R KJ
unstructured lice you add an additional File adapter as an external reference that
practice,
NApurchase order header information to a fixed-length format file. This section of the
Owrites
K practice builds on the work that you have already done.
Note: This data sample has blank spaces added between fields for visual clarity on this page.
The fixed-length data in your implementation is not likely to include spaces between fields
(although spaces within fields may be common). For the purpose of this exercise, you may
configure your adapter to preserve these extra spaces or not, as you see fit.
A sample file to assist in the definition of the native format is available at
d:\labs\files\data\po_header.txt. Some additional basic guidance is available in
the Tasks section of this practice, but the specifics are up to you. After you have modified the
application, redeploy it. Copy the file d:\labs\files\data\purchaseOrder.dat to
d:\labs\input\po_3.txt. Repeat this step three or more times. For at least one
execution of this step, open and modify the file po_3.txt. Replace the word two_day with
the word international. Verify that each iteration of the test provides appropriate output.

Oracle SOA Suite 12c: Build Composite Applications 4 - 29


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

KO
N
ARK
J l
(
AIN icens
a r j a
kon e to u
k se
i
in@ this
b m
o
ni Stude
m ) h a
c nt G u
a
ide
s
n no
- t r an
s
f e r a b
le
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Using JMS and JDBC Adapters

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO
Objectives

After completing this lesson, you should be able to:


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

Discuss the adapter architecture


Identify the types of technology adapters
Configure and use the JMS adapter
Configure and use a Database adapter
Describe the configuration of runtime connections for le
adapters r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 5 - 2


Agenda

Oracle JCA Adapters


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

JMS Specification and JMS Adapter


Database Adapter

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 5 - 3


Binding Components

Services provide the outside References enable messages to


world with an entry point to a be sent from the SOA composite
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

SOA composite application. application to external services in


the outside world.

a ble
f e r
ans
n - t r
a no
h a s
Services and references
o m )
u ide
are two kinds of binding
m c nt G
components. b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
KJ
BindingRcomponents
ce a connection between a SOA composite and the external
liestablish
NAThere are two types of binding components:
world.
O
K Services provide the outside world with an entry point to the SOA composite application.
The WSDL file of the service advertises its capabilities to external applications. These
capabilities are used for contacting the SOA composite application components. The
binding connectivity of the service describes the protocols that can communicate with
the service, for example, SOAP/HTTP or a JCA adapter.
References enable messages to be sent from the SOA composite application to the
external services in the outside world.
Note: Binding components are displayed in the JDeveloper Component Palette as service
adapters.
Several types of binding components are provided by Oracle SOA Suite, including Web
service (SOAP over HTTP), ADF-BC service, HTTP binding, and JCA adapters. The
remainder of this lesson explores JCA adapters in more detail.

Oracle SOA Suite 12c: Build Composite Applications 5 - 4


JCA Adapters
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

WebLogic Application Server

resource resource External


Client adapter adapter System

a ble
f e r
Binding
The components
binding for JCA
components for ans
adapters
JCA provide
adapters a WSDL
provide a WSDL n - t r
interface to a resource adapter
a no
that is deployed
deployed to the runtime
to the runtime
h a s
environment. The adapter itself
o m )
u ide
c nt G
is transparent to the application.
m
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
JCA stands for JEE Connector Architecture. It is part of the JEE specification. JCA describes
Nconcept of resource adapters, or simply adapters. Adapters enable SOA Suite
the
KOcomponents to interact with systems outside the composite application, including those
outside the application server. This simplifies the integration of diverse systems.
An adapter exposes an API through which a service component accesses an external system.
The interface for this API is described by a WSDL document. This WSDL is the only view that
the component has of the external system. The adapter itself is transparent to the service
component.
Oracle JCA adapters enable communication with various back-end systems. This includes
exchange of requests and (possibly) responses with back-end systems. Adapters also
support the real-time event notification service. This service provides notification about the
events associated with successful back-end transactions for creating, deleting, and updating
back-end data. (More on the event notification service later.)
In many cases, adapters can offer advantages over web services. They are for tighter
coupling and they bring value-adds such as connection pooling, for example. Adapters
typically perform better than web services.

Oracle SOA Suite 12c: Build Composite Applications 5 - 5


Oracle JCA Adapters

SOA Infrastructure
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Business Human
BPEL Mediator
Rules Workflow

Event Delivery Network


Enforcement Web Service
Points Policy
Message Manager

a ble
f e r
Technology Packaged Legacy ans
Application n - t r
Files; FTP PeopleSoft Tuxedo a no
JMS; AQ; MQ SAP R/3 CICS
h a s
Database Siebel
o m )VSAM
u ide


Sockets
SOAP; REST

m
Oracle Apps
c nt G
J.D. Edwards

IMS/TM
IMS/DB
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
OracleR K J canlibe
adapters
cecategorized broadly into three groups:
N A
K O Technology adapters can be used to integrate SOA applications with transport
protocols, data stores, and messaging middleware.
Application adapters connect various packaged applications, such as SAP and Siebel,
and databases.
Legacy adapters integrate mainframe and legacy applications. There are CICS and
Tuxedo adapters as well. (CICS and Tuxedo are not applications but command
interfaces to legacy applications.)

Oracle SOA Suite 12c: Build Composite Applications 5 - 6


Monitoring Adapters
SOA Infrastructure

Business Human
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

BPEL Mediator
Rules Workflow

Event Delivery Network

Enforcement Web Service


Points Policy
Message Manager

File Other
SOAP;
JMS JDBC
a ble
REST
f e r
ans
Adapter Preprocessing
n - t r
Preparing Interaction Spec
a no
Enterprise
Adapter Processing
h a s
Manager
o
Invoking Database
)
Setting up Callable Statement
m u ide
m c nt G
Parsing Result
b
ni Stude
i Adapter Post-Processing

j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
J
K adapters e
licsuch
OracleR
JCA as File, JMS, and Database gather and publish statistics for every
A
N they process, either inbound or outbound. The statistics are broken down into
message
KOcategories and individual tasks. The following is an example of how statistics are broken
down in an outbound (reference) process:
Adapter Preprocessing
- Preparing Interaction Spec
Adapter Processing
- Setting up Callable Statement
- Invoking Database
- Parsing Result
Adapter Post-processing
Adapter statistics can be viewed in the Oracle Enterprise Manager console.

Oracle SOA Suite 12c: Build Composite Applications 5 - 7


Quiz

Statistics about message processing are gathered by adapters,


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

and are viewable in the Oracle Enterprise Manager console.


a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARa
Answer:
N
KOTrue. Adapters gather and publish statistics for every message they process, either inbound
or outbound. Adapter statistics can be viewed in the Oracle Enterprise Manager console.

Oracle SOA Suite 12c: Build Composite Applications 5 - 8


Agenda

Oracle JCA Adapters


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

JMS Specification and JMS Adapter


Database Adapter

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 5 - 9


JMS Specification: Definition
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The Java Message Service (JMS) API is a messaging


standard that allows application components based on
the Java Platform, Enterprise Edition (JEE) to create,
send, receive, and read messages. It enables
distributed communication that is loosely coupled,
reliable, and asynchronous. a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce (JMS) describes reliable asynchronous communication between
N
the AR
The Java Message
components
Service
in a distributed computing environment. It uses a client/server model,
KOwhereby a JMS server routes and delivers messages to JMS clients.

Oracle SOA Suite 12c: Build Composite Applications 5 - 10


JMS Message

Standard Message
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Header
Message Header
Fields used to describe
JMSCorrelationID
and deliver messages JMSCorrelationIDAsBytes
JMSDeliveryMode
JMSDestination
JMSExpiration
JMSMessageID
JMSPriority (Optional) Properties
Name-value pairs
JMSRedelivered
defined by an a ble
JMSReplyTo
f e r
JMSTimeStamp application
ans
JMSType
n - t r
a no
h a s
User-Defined Properties)
o m u ide
Payload Message Body m c nt G
Message contents b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cmandates
A R
The JMS specification that messages consist of three sections: a standard
N header, which contains fields that are used to describe and deliver messages; an
message
KOoptional properties element, which contains application-defined properties (as name-value
pairs); and the message body, which holds the contents (payload) of the message. The
payload can be a text message, byte message, map message, stream message, or object
message. The properties element is JMS providerspecific and varies from one JMS provider
to another.

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


JMS Messaging

Point-to-point
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Each message is delivered to only one consumer.


1
consumer

2
N 2 1 consumer

N
queue consumer

a ble
Publish/subscribe
f e r
Each message may be delivered to multiple subscribers.
ans
1 n - t r
n oconsumer
s a
) a
h d1e consumer
N 2 1
c om t Gui
i b m en 1
i n Stud
topic consumer
@
in this
r k j a
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
R K two types
JMS supports l of messaging: point-to-point and publish/subscribe.
N A
In point-to-point messaging, messages are stored in a queue until they are consumed.
K O
One or more producers write to the queue and one or more consumers extract
messages from the queue. A queue may have many receivers, but only one receiver
receives each message. The JMS consumer sends an acknowledgment after
consumption of a message; this results in purging of the message from the queue.
In publish/subscribe messaging, producers publish messages to a topic, and the
consumer subscribes to a particular topic. Many publishers can publish to the same
topic, and many consumers can subscribe to the same topic. All the messages
published to the topic by the producers are received by all the consumers that are
subscribed to the topic. By default, subscribers receive messages only when the
subscribers are active. However, the JMS API supports durable subscriptions that
ensure that consumers receive messages that were published even when the
subscribers are not up and running. These messages are persisted by the JMS provider
and are either sent to the consumer when it becomes active again or purged from
storage if the message expires. The JMS producer can be set either to persistent or
non-persistent mode. The messages are not persisted in the latter case and can be
used only for nondurable subscriptions.

Oracle SOA Suite 12c: Build Composite Applications 5 - 12


JMS Resources
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

WebLogic
Server
Lookup connection factory.
JNDI

JMS Server

JMS Obtain connection


a ble
Client from connection factory. f e r
ans
n - t r
a no
Publish message
h a s
to a JMS destination.
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
J e
liccan
BeforeR anKapplication publish a JMS message, it must have a connection to a message
N A
destination. That connection is provided by a connection factory, which is an administered
KOobject that is configured with predefined parameters, such as a default priority to use for
messages when a priority is not explicitly defined on the message. The JMS client looks up a
connection factory by using the Java Naming and Directory Interface (JNDI), which is a Java
API for a directory service that allows Java software clients to discover and look up data and
objects via a name.
After the JMS client is provided a connection, the message can be created and published to
the appropriate message destination (a topic or queue).
Note: Although the generic image in the slide shows the JMS client outside the WebLogic
Server, this client could be an application deployed within the same application server. In
Oracle SOA Suite 12c, the JMS adapter is such an application.

Oracle SOA Suite 12c: Build Composite Applications 5 - 13


Adapters and the WebLogic Application Server
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

WebLogic Application Server

Managers Adapter External


Transaction System System
Security Contracts
Connection

a ble
f e r
ans
n - t r
The application server provides
a no
management for connections,
h a s
transactions, and security for JCA
o
adapters and other deployed applications.m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cServer
A R
The Oracle WebLogic architecture includes the following set of system-level contracts:
N
KO Connection management: Enables application components to connect to a back-end
application and leverage any connection pooling support of the Oracle WebLogic Server
container. This leads to a scalable and efficient environment that can support a large
number of components that require access to a back-end application.
Transaction management: Enables an application server to use a transaction manager
to manage transactions across multiple resource managers. Most adapters support only
local transactions (single-phase commit) and not XA transactions (two-phase commit).
The Oracle adapters that support XA transactions include MQ Series, JMS, AQ, and
Database.
Security management: Provides a comprehensive, flexible security infrastructure that
is designed to address the security challenges of making applications available on the
web. WebLogic security (via OWSM) can be used stand-alone to secure WebLogic
Server applications or as part of an enterprise-wide security management system that
represents a best-in-breed security management solution.

Oracle SOA Suite 12c: Build Composite Applications 5 - 14


Connection Management

WebLogic Server
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

JMS Server
Application 1

Application 2

Application 3

a ble
f e r
ans
n - t r
a no
Deployed Connection
h a s Message
Applications Pool ) i e
Destination
d
c om t Gu
Note: The diagram shows the JMS i b m running
Server e n within the
WebLogic Server, but that need innot beSthe d
tu case.
n @ s
r k jai e thi
o n a 2014,uOracle
s and/or its affiliates. All rights reserved.
( k e to
Copyright

J AIN icens
WhereasR Kthe subjectl of system contracts is generally outside the scope of this class, it is
O NAnoting that one of the services specified by these contracts is connection management,
worth
K or the creation and management of connections to back-end systems. An important concept
in connection management is connection pooling. Rather than opening connections on an as-
needed basis, connections with data and services are established, configured, cached, and
reused automatically by the application server. Connection pooling enhances application
performance and scalability, particularly when many connections are required simultaneously
to a given database or other back-end system.
Note: Configuration of these connection resources is done within the Oracle adapter by using
Fusion Middleware Control. This configuration must be done before the adapters can be fully
configured within a composite application.

Oracle SOA Suite 12c: Build Composite Applications 5 - 15


Oracle JMS Adapter

WebLogic Server
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Oracle WebLogic
JMS JMS Server
Adapter

a b le
f e r
a n s
Supported features include:
r
n-t include:
Supported JMS servers
JMS topics and queues Active MQ no
Byte, text, and map message types Apaches a
JMS headers and properties
) a
h de
AQ JMS
JMS message selector
Durable JMS subscriber c om tTIBCO
IBM
G uiJMS MQSeries
WebSphere

i b m en
in Stud
Persistent and non-persistent publication
@
in this
r k j a
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
The JMSR Kadapter usesl a messaging model that separates service consumers from service
O NA This messaging model is defined by using Web Services Description Language
providers.
K (WSDL), which describes the operations exposed by the adapter.
In an outbound message flow, the JMS adapter acts as a service provider. The adapter
receives a normalized message from the SOA infrastructure, converts that message to a JMS
message, and then sends the message to a JMS destination. In an inbound message flow,
the JMS adapter acts as a message consumer. The adapter converts the JMS message that it
receives from a topic or queue to a normalized message, and then sends the normalized
message as part of the message exchange to another component as a service request.
The JMS adapter supports JMS topics and queues. It supports byte, text, and map JMS
message types. The Adapter Configuration wizard provides the Native Format Builder wizard
for consuming native data payloads at run time. The adapter supports the JMS message
selector for performing filtering while subscribing to JMS topics and queues. (This parameter
is based on the SQL 92 language for filtering messages based on the fields present in the
JMS header and properties section.)

Oracle SOA Suite 12c: Build Composite Applications 5 - 16


The WebLogic Application Server includes a JMS-compliant message server that provides
interim storage for messages in message destinations, which may take the form of topics
and/or queues. The message server acknowledges the JMS client that produces the message
and ensures successful delivery to the JMS client that consumes the message.
Messages remain live until picked up and committed by all eligible consumers, or until their
expiration time is met. The Time-to-Live configuration parameter of the JMS adapter defines
this window of opportunity for consumers to receive a message. The time-out may be turned
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

off completely (default), or set to a specific number of milliseconds.


Messages are deleted from storage when they have been received by all subscribers, or after
their Time-to-Live has elapsed. After being picked up or expiring, messages are automatically
cleaned up (deleted) by the Message Server and are no longer accessible.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 5 - 17


Configuring JMS Resources
with WebLogic Administration Console
JMS configurations are stored as
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

modules that are defined by an XML file.

JMS modules may contain several


types of objects, including connection
factories and message destinations.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ceconfigured in the runtime environment, before the deployment of a
N AR application, which includes a JMS adapter that references these resources.
JMS resources
composite
must be

KO Using the WebLogic Administration web-based console, log in as the administrator (with
username weblogic, and the password that was specified when WebLogic Server was
installed) and configure the following JMS resources:
A JMS destination, such as a queue or topic
A JMS connection factory
A JMS adapter connection pool that is associated with the JMS connection factory
Note: The JMS adapter connection pool JNDI name is needed to configure the JMS
resources on the design-time JMS Adapter Configuration wizard pages when you add a JMS
adapter to a composite application.

Oracle SOA Suite 12c: Build Composite Applications 5 - 18


Defining a Message Destination

To create a message destination:


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

1. Select the resource type


2. Supply the name and JNDI name
3. Specify the subdeployment

1
3 le
2 r a b
s f e
- t r an
n no
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
To configure a JMS destination, log in to the WebLogic Server Administration console as the
N
Oadministrative user. On the Domain Structure navigation bar, expand Services > Messaging
K and select JMS Modules. On the JMS Modules page, click the SOAJMSModule link. On the
Settings for SOAJMSModule Configuration tab page in the Summary of Resources table,
click New.
1. Select the desired resource option (for example, Topic), and click Next.
2. Enter a configuration name (such as demoTopic) and the JNDI name (such as
jms/demoTopic) and click Next.
3. Select SOASubDeployment for the Subdeployment type. Select the SOAJMSServer
option in the JMS Servers table. (The SOAJMSServer is automatically created during
installation of SOA Suite.) Click Finish.
Note: The response page indicates that the configured resource was created successfully.
The new resource appears as an entry in the Summary of Resources table on the Settings
for SOAJMSModule page.

Oracle SOA Suite 12c: Build Composite Applications 5 - 19


Defining a Connection Factory

To create a connection factory:


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

1. Select the resource type


2. Supply the name, JNDI
name, and other parameters
3. Specify the target server
2
1

a ble
f e r
ans
n - t r
3 a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce factory with a JNDI resource name, perform the following
N AR
To create
steps:
the JMS connection

KO
1. On the Create a New JMS System Module Resource page, select the Connection
Factory resource type option. Click Next.
2. Enter the following Connection Factory Properties:
- Name (such as demoCFactory) as a configuration name
- JNDI (such as jms/demoCFactory) for the JNDI resource name string
Click Next.
3. Under Targets, verify that you have the correct Servers check box selected and click
Finish.
The Summary of Resources table contains the newly created resource.

Oracle SOA Suite 12c: Build Composite Applications 5 - 20


Defining a Connection Pool

Connection pools are defined in


association with both an adapter and a
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

connection factory.

The JNDI name that is assigned is used


in the configuration of the adapter in
composite applications.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
Unlike R
connection lice and message destinations, connection pools are defined in
K J factories
O NA with an adapter. Resource adapters are applications that are deployed to the
association
K WebLogic Server. Their deployment configuration includes runtime connection parameters,
including the back-end application connection information, the JNDI name to be used, and
other configuration information, including connection pooling parameters.
The Resource adapter deployment information can be edited in Fusion Middleware Control by
selecting Deployments. A table of deployments is listed, which provides access to the JMS
adapter. Click the adapter to access its settings.
In the resulting display, click the Configuration > Outbound Connection Pools tab to create or
edit a connection pool.

Oracle SOA Suite 12c: Build Composite Applications 5 - 21


Associating the JMS Connection Pool
to a Connection Factory
Associate the connection factory
with the new JNDI name.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
Redeploy the JMS adapter b
ni Stude
to activate these changes. i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
To associate a JMS connection pool to the appropriate connection factory name, navigate to

KOtheNJmsAdapter > Configuration > Outbound Connection Pools tab, and then do the following:
1. Expand the factory entry oracle.tip.adapter.jms.IJmsConnectionFactory under the
Outbound Connection Pool Configuration table. Locate and click the JNDI name link for
the connection pool that you previously created.
2. On the Settings page, change the ConnectionFactoryLocation property value to the
JNDI name value that you specified for the connection factory.
3. After saving the property value changes, update the deployment for the JMS adapter.
Click Deployments.
4. Select the check box next to JmsAdapter and click Update.
5. Verify that the correct deployment plan is selected, click Next, and click Finish.

Oracle SOA Suite 12c: Build Composite Applications 5 - 22


JMS Adapter as Producer
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Exposed Services Components External References

Entry Mediator JMS


Point Adapter
(producer)

a ble
f e r
Message Destination ans
n - t r
Message Type
Delivery Mode a no
Priority ) has de
Time toco m
Live
G ui
i
b
ni Stud
m ent
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
Message Destination
N
KO The name of the message destination is part of the configuration of a publishing JMS
adapter. This destination must already be configured in the target application server.
Message Type
The message type parameter indicates which JMS Message type is to be produced.
Supported values are bytes, text, and map.
Delivery Mode
When a durable topic subscriber is unavailable, messages are not lost. The Message
Server retains the messages until they are retrieved or they expire. When a topic
subscriber is nondurable, the client sees messages on a topic only when that subscriber
is active. If the subscriber is inactive, and messages are published, the messages are
lost. By default, topic subscribers are durable. If message throughput supersedes
reliability, set the Durability property to nondurable.

Oracle SOA Suite 12c: Build Composite Applications 5 - 23


Message Priority
By default, all messages are published with equal priority, and are delivered to
consumers in the order in which they are received. However, message content or other
business concerns may dictate that a given message or type of message is of greater
(or lesser) relative importance than other messages that are published to the message
server. In this case, the priority of the message can be set to a value greater or less than
that of other messages published. By changing the priority of the message, the order in
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

which it is received by the consumer can be changed. (Default value is 4. The valid
values are 0 through 9, where 0 is the lowest priority and 9 is the highest.)
Time to Live
Time to Live indicates how long the message is retained by the Message Server. If it
has not been received by all eligible consumers by this time, the message is
automatically purged by the message server.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 5 - 24


JMS Adapter as Consumer
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Exposed Services Components External References

JMS
Adapter
(consumer)

a ble
f e r
ans
n - t r
Destination Name
a no
s
Message BodyaType
h
Messagem )
Selector
o t Gu ide
m en c
i b
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R K Name l
Destination
N A
K O The destination name specifies the name of the message destination.
Message Body Type
The Message Body Type parameter indicates which JMS Message type is to be
produced. Supported values are byte, text, and map.
Message Selector
A message selector allows a consumer to receive a subset of available messages by
filtering message property values. The selector is defined as a property of a message
consumer. The syntax and functionality of a message selector are similar to a SQL
WHERE clause. For example, the message selector JMSType LIKE 'invoice*' AND
JMSRedelivered = 'false' ensures that the consumer receives only messages
where the JMSType message property is set to invoice AND the JMSRedelivered
message property is set to false.
Message selectors can be used effectively, but their overuse can impact the
performance of the Message Server. In this case, it may be more desirable to publish
messages to multiple destinations and configure selected subscribers accordingly.

Oracle SOA Suite 12c: Build Composite Applications 5 - 25


Quiz

The JMS adapter can interact only with a JMS Server that
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

resides within WebLogic Server.


a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARb
Answer:
N
KOFalse. Applications that exchange data via JMS do not have to reside within
WebLogic Server.

Oracle SOA Suite 12c: Build Composite Applications 5 - 26


Agenda

Oracle JCA Adapters


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

JMS Specification and JMS Adapter


Database Adapter

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 5 - 27


Database Adapter: Introduction

WSDL documents expose WSDL documents expose


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

database operations. database operations.

Exposed Services Components External References

DB DB
Adapter Adapter

a ble
f e r
ans
n - t r
Select
a no
Insert
poll h a s
call e
)
Update
c o m G uid
Delete
i b m ent
Merge
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
The graphic l illustrates that a Database adapter exposes database operations that
K in the slide
O NA
can be implemented and used by the components in a composite application. The Database
K adapter provides a WSDL interface to define the operations and message structure in an XML
format, enabling it to be used as a service by the composite application components.
The Database adapter configuration is defined in the Adapter Configuration wizard, which
enables you to specify one of the following types of operations:
Data manipulation operations (insert, update, merge, and delete)
Query operations (select)
Custom SQL statements
Calls to stored procedures, in which the adapter honors any logic in the stored
procedure and acts as a call relay interface
Note: Query and DML operations are managed and executed by the TopLink Java framework
that performs the SQL database operations. For all operations (including calling stored
procedures), the conversion of data between XML input to and output from the native format
that is used in the database is performed by the Database adapter.

Oracle SOA Suite 12c: Build Composite Applications 5 - 28


Configuring a Database Adapter

Drag the Database adapter to


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

the composite.xml canvas.

Supply a name
for the service.
a ble
f e r
an s
n - t r
Adapter wizard a no
h a s
opens.
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i cea Database adapter, complete the following steps in JDeveloper:
A R
To create and configure
N
O1. In the Composite Editor, drag a Database adapter into the External References (or the
K Exposed Services) column. The example shows the Database adapter being dragged
into the External References column. The Adapter Configuration wizard is displayed. On
the Welcome page, click Next to proceed with the remaining steps to configure the
adapter.
2. Specify the name of the service.
Note: Recall that the adapter itself is transparent to the composite application. This service
appears as one more web service invocation to the application.
Subsequent slides cover the remaining steps to configure a Database adapter by using a
query operation (SELECT statement).

Oracle SOA Suite 12c: Build Composite Applications 5 - 29


Configuring a Database Adapter
Service Connection
Specify a database connection
or create a new one.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

design
time a ble
f e r
run ans
time n - t r
a no
h a s
m ) This ide
Specify the JNDI name of the connection.
c o G u
name must match the connection
b m Database
pool
e t
n adapter.
factory
name configured for the
in Stui
runtime d
i n @ is
r k j a t h
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
On theR
Service l
K Connection page, click the Browse icon to select an existing database
N A
Oconnection created in the JDeveloper IDE, or click the Add icon to create a new IDE or
K application connection. The details for the connection selected or created are displayed in the
Connection field.
Note: When you select a database connection, the JNDI Name field is populated with the
connection name prefixed with eis/DB/. In the example in the slide, the SOA database
connection creates the JNDI name eis/DB/SOA. The JNDI name must match the JNDI
connection factory resource configured for the Database adapter that is deployed in the
WebLogic Server runtime environment. The JNDI name already exists. In the SOA Quick
Start installation, it is automatically provided. In an enterprise installation, the administrator
will have provided it.

Oracle SOA Suite 12c: Build Composite Applications 5 - 30


Configuring a Select Statement:
Operation Type
Specify what you want the adapter to do.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce wizard then offers a choice of operation types. Subsequent wizard
N AR
The Adapter
pages
Configuration
vary depending on the choice of operation type. The choice of operation types include:
KO Call a Stored Procedure or Function enables you to execute a database stored
procedure or function.
Perform an Operation on a Table enables you to select any or all of the following
options: Insert or Update (Merge), Insert Only, Update Only, Delete, Select, and Query
by Example.
Poll for New or Changed Records in a Table enables reading and publishing new or
changed records, and is useful to an inbound Database adapter that is implemented as
an exposed service in a composite application.
Execute Pure SQL is used for creating a custom SQL string.
Note: The Do Synchronous Post to BPEL (Allows In-Order Delivery) option can be
selected when the Poll for New or Changed Records in a Table operation type is selected.
These changes are delivered in order as asynchronous events to a BPEL process
component.

Oracle SOA Suite 12c: Build Composite Applications 5 - 31


Configuring a Select Statement:
Importing Tables
Because we specified an operation on a table,
we now query the database for a list of tables.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
an s
n - t r
a no
h a s
o m )
u ide
From the list of displayed tables, we specify m c nt G
which tables to use. b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cslide,
A R
In the example in the you explore the configuration for a Select operation.
N
KO1. Click Import Tables to open the Import Tables window.
2. In the Import Tables window, select the schema. Enter Name Filters if desired, and click
Query.
- The Available column is populated with a list of tables.
3. Select a table from the Available list and click the single right arrow icon to move it to the
Selected column. When you have finished selecting the tables, click OK.
4. You are returned to the Select Table page with the selected tables listed.
On the Select Table page, verify the addition of the selected table, and click Next.

Oracle SOA Suite 12c: Build Composite Applications 5 - 32


Configuring a Select Statement:
Filtering Attributes
For each selected table, we specify
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

which attributes (columns) to reference.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
On theR
Attribute licepage, you can deselect the attributes that you do not wish to query.
K J Filtering
NAMake sure that appropriate attributes are chosen for insert operations, unless you are
ONote:
K sure that the database provides default values for the attributes that you omit.

Oracle SOA Suite 12c: Build Composite Applications 5 - 33


Configuring a Select Statement:
Defining Selection Criteria
We create any parameters to be used in the
filter (WHERE clause) of the SELECT statement.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c statement
SELECT t G
The stem of b the
de n
i ni Sgenerated.
is automatically t u
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K e
J querylicparameters
You can R create and conditions for a SELECT operation. The example in the
A
N creates a parameter called ccNum, which is added to the query and used in a condition
slide
KOto retrieve credit card data with a specified ID. The actual value for the ccNum parameter is
supplied at run time. The steps to define and use the parameter are as follows:
1. On the Define Selection Criteria page, next to the Parameters field, click Add.
2. In the Parameter Name window, enter a parameter name and click OK.
3. On the Define Selection Criteria page, with the parameter name defined and populated,
next to the SQL field, click Edit to define the query criteria (conditions).

Oracle SOA Suite 12c: Build Composite Applications 5 - 34


Configuring a Select Statement:
Editing the Expression
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The Expression Builder assists in


the creation of the filter expression.

a ble
f e r
ans
n - t r
a no
The completed expression is
h a s
added to the SELECT statement.
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce window, click Add to form the first expression.
A R
In the Expression Builder
N
OIn this example, with the expression selected, configure the first argument as cardNumber in
K the Query Key column, the Operation (EQUAL by default), the second argument as Parameter,
and select the ccNum parameter. Click OK to add the condition to the query.
Note: The Expression Builder allows you to create multiple conditions separated by logical
operators (AND and OR).

Oracle SOA Suite 12c: Build Composite Applications 5 - 35


Configuring a Select Statement:
Advanced Options
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

These properties
are specific to the
Database adapter.

a ble
f e r
Specify a
an
These properties s
query timeout. - t r
are common to
n
all JCA adapters.
a no
h a s
Configure the
o m )
u ide
number of retries
before flagging m c nt G
b
ni Stude
an error. i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
On theR K J Options
Advanced lice page, you can configure database-specific values in the following
NA
Osections:
K JDBC Options: Sets a query timeout. A value of zero means it waits indefinitely. Max
Rows determines the maximums number of rows fetched per round trip.
Auto-Retries: Attempts the specified number of retries before flagging an error. Interval
is the number of seconds between retries. The Backoff Factor determines a delay to
increase the wait time between retries. A value of 2 doubles the interval after each retry.
The Max Interval is the longest wait time between retries.
Native Sequencing (Oracle only): This is used for INSERT operations, and specifies
that the primary key is assigned from the selected sequence, which can be searched for
or created.
Interaction Options: Get ActiveUnitOfWork forces all operations invoked in the same
global transaction to use the same connection. This guarantees that subsequent
operations can see the changes from earlier operations. Emulated two-phase commits
use the same connection. MERGE and INSERT operations are committed when the
global transaction completes. Therefore, it also alters when WRITE operations occur.
Detect Omissions allows the MERGE and INSERT operations to ignore empty or missing
XML elements. If Detect Omissions is not selected, missing or empty elements are
stored as NULL values.

Oracle SOA Suite 12c: Build Composite Applications 5 - 36


The JCA Endpoint Properties pane provides access to properties that are common to all JCA
adapters. These properties configure the retry behavior of the adapter if its configured
endpoint is not available.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 5 - 37


Database Adapter Runtime Connections
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

WebLogic Server

Application 1

Application 2

Application 3
a ble
f e r
ans
n - t r
a no
Deployed h a s
Applications Connection m ) e
idDatabase
o
c nt G u
(with Database Pool m
adapters)
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cthe
A R
Like the JMS adapter, database connection defined in the Database adapter at design
N specifies a JNDI name in the form of eis/DB/connection-name, which is used to
time
KOlocate a connection for the target database at run time. The runtime server environment must
be configured with the same JNDI resource name and associated with a JDBC connection for
the target database server. After making configuration changes to the Database adapter
resources, the Database adapter configuration must be updated to be available for
applications.
Note: There is no need to restart the WebLogic Server instance after redeployment.
Configuration of the Database adapter should be completed and redeployed when there are
no application instances running in the runtime environment. All adapter runtime configuration
settings that depend on the adapter runtime services should be made and deployed before
deploying applications. This concept applies to any of the adapter configurations available in
the runtime environment that do not conform to the WebLogic Server production
redeployment feature requirements.

Oracle SOA Suite 12c: Build Composite Applications 5 - 38


Transactionality

The Database adapter and JMS adapter are both transactional


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

(as are the AQ adapter and Java web services).


In general, a transaction is started by a service when it is
invoked by a client, and ends when the service operation
completes. If the invoked service completes successfully,
the transaction started is committed; otherwise errors roll
back the transaction.
r a ble
Transactional boundaries depend on the context,
n s fe
configuration, and environment of the services that - a
trare
no n
implemented and invoked. a
h a s
Transaction semantics are different for ) services
d e that are
m u i
o t Gthat are invoked
invoked synchronously than forcservices
asynchronously. i b m e n
in u d t
n @ s S
r k jai e thi
o n a 2014,uOracle
s and/or its affiliates. All rights reserved.
( k e to
Copyright

J AIN icens
R
In general, l is started by a service when it is invoked by a client, and ends when
Ka transaction
A
OtheNservice operation completes. If the invoked service completes successfully, the
K transaction started is committed; otherwise errors roll back the transaction.
With the Oracle SOA Suite 12c platform, a transactional service can be implemented as a
Java web service, a Database adapter, a JMS adapter, and the AQ adaptereach of which
can be invoked from the Mediator and BPEL components.
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).
In each case, 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 as compared with services that are invoked
asynchronously.
Note: In the case of multiple operations with a database (for example, insert, delete, and
update), these multiple operations constitute a single transaction.

Oracle SOA Suite 12c: Build Composite Applications 5 - 39


Quiz

The ____________ exposes the database operations that can


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

be invoked by the components in a composite application.


a. File adapter
b. Socket adapter
c. Database adapter
d. Oracle Application adapter
a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARc
Answer:
N
KOThe Database adapter exposes the database operations that can be invoked by composite
applications. However, using the Oracle Application adapter, you can access and invoke
service operations that ultimately perform database operations through stored procedure
calls. But, this is not the same as directly invoking database SQL operations.

Oracle SOA Suite 12c: Build Composite Applications 5 - 40


Summary

In this lesson, you should have learned how to:


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

Discuss the adapter architecture


Identify the types of technology adapters
Configure and use the JMS adapter
Configure and use a Database adapter
Describe the configuration of runtime connections for le
adapters r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 5 - 41


Practice 5-1 to 5-4 Overview

A Database adapter provides access to a


database table with credit card information.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Exposed Services Components External References

Entry Mediator DB
request
Point Adapter
response

a ble
f e r
an s
A synchronous Mediator provides
n - t r
bidirectional routing and transformation
of request and response messages. a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
In this R
practice, ice a composite application that receives a credit card number and a
K J you lcreate
NA order total. The application uses a Database adapter to query credit card
Opurchase
K information in an Oracle Database. Based on the results of that query, a status of VALID or
INVALID is returned.
To create this application, you:
Create a new SOA project
Add a Database adapter that is configured to perform a select operation on the
database
Add a synchronous Mediator, defining a WSDL interface based on the elements of the
file creditcheck.xsd
Deploy and test the composite application with both valid and invalid credit card
numbers

Oracle SOA Suite 12c: Build Composite Applications 5 - 42


Practice 5-5 to 5-7 Overview

A JMS adapter publishes a


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

message to a JMS queue.

Exposed Services Components External References

Entry Mediator JMS


request
Point Adapter
(producer)
a ble
f e r
ans
n - t r
a no
An asynchronous Mediator provides
h a s
one-way routing and transformation of
the request message. o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
R KJ lice
In these practices, you create a new SOA project. You add a JMS adapter and configure that
A
KON adapter to publish messages to a queue. You then add a Mediator to perform message
routing. Finally, you deploy and test the JMSProducer composite application.

Oracle SOA Suite 12c: Build Composite Applications 5 - 43


Optional Challenge
Practice 5-8 Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Destination Name (Queue): jms/soaDemo/Queue


JNDI Name: eis/soaDemo/Queue File output

Exposed Services Components External References

a ble
f e r
an s
n - t r
a no
In this practice, you recall and apply the skills that you havehlearned a s so far.
You create a project to consume the messages produced
o m u ide practice.
) in the previous
You determine the components to add, and howc to configure t Gthem.
b m n
i ni Stude
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
In this R
optional, lice practice, you create a new SOA project that is configured to
K J unstructured
NA the messages that are sent to the queue in the previous practice. The messages
Oconsume
K pass through the application unchanged and are written to a file.

Oracle SOA Suite 12c: Build Composite Applications 5 - 44


Optional Challenge
Practice 5-9 Overview
Set the message property.
From: $in.request/inpl:Shippingrequest/inpl:custName
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

To: $out.property.jca.jms.JMSProperty.Artist

Entry Point Mediator JMS


request Adapter
(producer)

a ble
f e r
Set the Message Selector: Artist LIKE '%Berry
an s
n - t r
JMS a no
Adapter
h a s
(consumer)
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
In this R
optional liceyou modify your previous SOA project so that JMSProducer sets a
K J practice,
NA
Ouser-defined message property to a specific value. You then modify JMSConsumer to use a
K message selector so that only a subset of the published messages are received and written to
a file.

Oracle SOA Suite 12c: Build Composite Applications 5 - 45


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

KO
N
ARK
J l
(
AIN icens
a r j a
kon e to u
k se
i
in@ this
b m
o
ni Stude
m ) h a
c nt G u
a
ide
s
n no
- t r an
s
f e r a b
le
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Introduction to BPEL

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO
Objectives

After completing this lesson, you should be able to:


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

Describe the role of the XSD, WSDL, and BPEL files in a


business process module
Describe the relationship between WSDL partner link types
and BPEL partner link elements
Describe the role of a business process in a composite
application
r a ble
Create a business process in a BPEL module n s fe
n - tra
Use the BPEL editor in JDeveloper no
Use basic BPEL activities to interact with
a
spartners
) h a e
Use the Assign activity to manipulateom tdata i d
u in BPEL
c G
variables ibm den in Stu
i n @ is
r k j a t h
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 6 - 2


Agenda

Introduction to Business Processes and BPEL


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

BPEL Process in Oracle SOA Suite 12c

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 6 - 3


Business Processes and BPEL
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Service Service Service Service

WSDL WSDL WSDL WSDL

a ble
orchestration
f e r
ans
BPEL Engine
n - t r
a no
h a s
BPEL com Gui
) de
i b m ent
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
K canl be incorporated into a business process through the use of the Business
MultipleRservices
O NA Execution Language, or BPEL. The BPEL specification defines the XML grammar that
Process
K allows you to describe a business process. This process may (among other things) invoke
services, manipulate data, and throw faults.
Multiple services are orchestrated by a BPEL engine (such as the Oracle BPEL Process
Manager) by using the BPEL, WSDL, and XSD files. In the context of BPEL, the term
orchestrating means to coordinate the flow of information to and from clients and between the
services invoked by the BPEL process to implement all or part of a business process. The
engine creates representations of the process (instances of the process) in an application
server (such as WebLogic).
In Oracle SOA Suite 12c, a BPEL process is a component of a SOA composite application,
which receives and returns data through service entry points. The service entry points can be
wired to a BPEL process component, which processes the data and interacts with the external
references (external services) of the composite application. When a message is received, the
BPEL engine creates a new process instance and starts it. The engine is in charge of executing
the business logic specified in the BPEL process.

Oracle SOA Suite 12c: Build Composite Applications 6 - 4


Parts of a BPEL Process
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

BPEL Process
Partner Links Partner Links

Interface Partner
Client Link

External
r a ble
sfe
Service
n
n - tra
o
an
The service interface (WSDL) Activities make up the Partner links represent a
describes the BPEL process
operation and the associated
BPEL process flow or
sequence of instructions ha des
reference to the external
services that are invoked
)
request and (optional)
response message structures.
to be executed.
c om t Gui
by BPEL process activities.

i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
The key K
elements ofla BPEL process are:
A
KON A service interface, which is the WSDL that describes the BPEL process operation and
associated request and optional response message structures. A BPEL process can be
exposed as a service for a composite application. The service interface provides the
BPEL client with a way to interact with the BPEL process component.
Activities, which are the actual XML elements that make up the BPEL process flow or
sequence of instructions to be executed. This usually involves invoking other services to
perform the function required for a business process implementation.
Partner links, which represent a reference to the external services that are invoked by
the BPEL process activities. In the JDeveloper Composite Editor, when you wire a BPEL
process component, an external (service) referencea partner linkis created in the
BPEL process component. A partner link describes the roles played for the interaction
between the BPEL process and the service that it invokes.

Oracle SOA Suite 12c: Build Composite Applications 6 - 5


BPEL, WSDL, and XSD

BPEL includes all


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

information from both the


WSDL and XSD files.
Imported into BPEL

WSDL describes
message types.

a ble
f e r
Imported into WSDL
an s
n - t r
a no
h a s
XSD describes
o m )
u ide
message structures.
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ceprocess interacts with other web services. To connect with those
N AR the BPEL process imports the information stored in the WSDL for each service.
By definition,
services,
a business
O
K Recall from the conversation about WSDL that these documents in turn import information from
the XSD files. Therefore, a BPEL file typically includes a series of <import> statements that
enable the process to leverage the information stored in each services WSDL and XSD files.

Oracle SOA Suite 12c: Build Composite Applications 6 - 6


Partners, Partner Links, and Roles

BPEL partnerLink
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
WSDL partnerLinkType
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce a relationship between the BPEL process and the invoked service
N ARa role that each plays in the interaction. To identify the roles and relationships that are
Each interaction
through
represents

KO
applicable in an interaction, a BPEL process uses a partner link and a partner link type.
A partner link, which is defined in the BPEL source, describes the roles that the BPEL process
and the invoked service play. Each role is associated with a port type (operation defined in the
WSDL), which determines the message data structures the process and the invoked service
can manipulate in their respective roles. A partner link is configured with a name, a partner link
type, and one role for synchronous interactions or two roles for asynchronous interactions.
A partner link type, which is defined in a WSDL document, describes the possible interactions a
service can perform, thereby characterizing the conversational relationship between two
services by specifying roles for each type of interaction offered by the service. A partner link
type defines one or two roles.
One role indicates that the service can complete the conversation without a callback.
Two roles indicate that there is a requirement to receive a callback from the service.
A role is associated with a port type, which is defined in the WSDL of a service, which
determines the operation performed by the role and the message structure received in a
request or returned as a response within the context of the conversation.

Oracle SOA Suite 12c: Build Composite Applications 6 - 7


Variables in BPEL

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

Request

Assign Input Message

Client Invoke Partner

Output Message
a ble
Assign
f e r
ans
Reply n - t r
Reply
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
The BPEL engine is responsible for managing the data values used by the business process.
N values include data passed to the process via the invoking client partner, and the reply
Typical
O
K data to be sent back to that partner. Similarly, input and output messages for invoked services
may need to be created or tracked or both. Finally, the process may have the need to maintain
data internally, such as sequence numbers and so on. All this data can be stored in BPEL
variables. The BPEL process file declares its variables before the sequence of activities is
begun. An example appears in the slide.
Note: Local variables can be utilized within a Scope activity, which we will discuss later in this
lesson.

Oracle SOA Suite 12c: Build Composite Applications 6 - 8


Interacting with Partners

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

Request

Assign Input Message

Information from the


Client Invoke Partner partners WSDL is
referenced here.

Output Message
a ble
Assign
f e r
an s
Reply n - t r
Reply
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
lice into discrete steps, or activities. The BPEL specification identifies
K J is organized
A BPELRprocess
NA of activities with a variety of applications. One group of activities includes primitive, or
a number
O
K basic, activities. These activities may instruct the BPEL engine to invoke an operation on some
service to wait for a message to be received from a client, to generate the response of an
input/output operation, to copy data from a source to a destination, to indicate that something
went wrong, or a number of other tasks.
Three different activities are used for interacting with partners. The first of these is the Receive
activity. Receive represents the input (receipt of a message) of a WSDL operation provided by
the process. An example is shown in the slide.
Attributes of the Receive activity include the partnerLink, as well as the portType and operation
of the process that the partner is targeting. The Receive activity takes the incoming message,
puts it in the specified variable, and ends.
The createInstance attribute is of particular importance here. The BPEL script is a blueprint for
a process, but that process is instantiated by the BPEL Service Engine only when a
createInstance attribute set to yes is encountered.

Oracle SOA Suite 12c: Build Composite Applications 6 - 9


The second activity that interacts with partners is the Invoke activity. The Invoke activity
invokes a one-way or request-response operation between the BPEL process and a partner
web service on a port provided by the partner.
Parameters for the Invoke activity, such as portType, partner, and operation, are specified as
attributes. Also specified are the input and output variables, which contain the input and output
of the operation being invoked.
Finally, if the process needs to send back a synchronous reply to the client partner who sent
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

the message, a Reply activity is also necessary. The partnerLink, operation, and portType
attributes for the Reply activity should match those of the corresponding Receive activity.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 6 - 10


Synchronous Process Concepts

Obtains the request


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

with a Receive activity

1 Receive
Request:
<input>Name</input>
2 Assign
Concatenates
Client "Hello " + Name
a ble
Response: 3 Reply f e r
<result>Hello Name</result>
ans
n - t r
a no
Returns the response
with a Reply activity) h
as e
c om t Guid
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R K BPELl process:
A synchronous
A
KON Contains activities that should not take a long time, because the client waits for the
response
Obtains the request with a Receive activity
Returns the response with a Reply activity
When you create a synchronous BPEL process, Oracle BPEL Process Designer automatically
creates a BPEL process template with a Receive activity and a Reply activity. You create
additional processing tasks between the Receive and Reply activities.
The slide illustrates the simple design of a HelloUser BPEL process. The process is short-
lived, and sends a response (a Reply) to its invoker. It meets the criteria for a synchronous
process. The sequence of activities in the HelloUser process design is as follows:
1. Receive a request XML message that contains a name string and that is input from the
client (invoker).
2. Assign the text "Hello" concatenated to the name string that is received as input to the
result message.
3. Reply with the result XML message (output data) that is sent to the client in response.

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


Asynchronous Process Concepts

Obtains the request


with a Receive activity
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

1 Receive

2 Some number of
long-running
intermediate steps
Client
3 Receive
Invoke a ble
f e r
ans
n - t r
a no
h a s
The final Invoke operation is a callback.
(Omit the final Invoke activity for a one-
way operation.)
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ceprocess:
A R
An asynchronous BPEL
N
O Contains activities that may take some time
K Obtains the request with a Receive activity
Returns an optional response with a callback that is implemented with an Invoke activity
The basic structure of an asynchronous BPEL process flow, as created by the Oracle
JDeveloper Create BPEL Process wizard, comprises the following items:
1. A Receive activity at the start of the flow
2. Some number of long-running intermediate activities
3. An Invoke activity at the end of the flow
Oracle BPEL Process Manager automatically manages the correlation between the clients of
the invoked process by using WS-Addressing techniques. This enables a long-running process
to invoke the client when the process is complete. The final Invoke operation is a callback.
The client should not have to wait for an asynchronous process to complete before it responds
and must provide a way for the invoked process to call it back to obtain the result (response).
Note: The slide shows an asynchronous process structure created by Oracle BPEL Process
Designer when using the Asynchronous BPEL Process template.

Oracle SOA Suite 12c: Build Composite Applications 6 - 12


Assigning Values to Variables
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Receive
Request

Assign Input Message

a ble
Client Invoke Partner f e r
ans
n - t r
Assign Output Message
a no
h a s
Reply
o m )
u i de
Reply
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce a BPEL process and its partners must conform to a particular
N AR structure. These structures are defined by the service WSDL, and usually consist of
Data exchanged
message
between

KO
XML elements described by an XML schema document.
The two most commonly used variables are inputVariable, which receives the client
request, and outputVariable, which contains the client response. Each service invoked by
the business process also has an associated input variable, and if it returns a response, a
variable is defined to store that data.

Oracle SOA Suite 12c: Build Composite Applications 6 - 13


Ordering Execution with a Sequence Activity

A Sequence activity is a container used


to define the execution order of
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

activities. A Sequence can be used to Receive


logically group related steps.

Activity 1
Request

Activity 2

a ble
client Activity 3 f e r
ans
n - t r
(nested)
a no
Sequence
h a s
Reply o m ) Sequences
u ide can be nested.
m c nt G
Reply (not shown: A Sequence
i b
n Stud e must contain at least one
@ isi activity.)
i n
a r kja se th
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ca ecollection of activities to be performed in sequential order. A Sequence
N AR
A Sequence contains

KO used to logically group related steps, thus simplifying larger business processes.
can be

Oracle SOA Suite 12c: Build Composite Applications 6 - 14


Structuring a Process with a Scope Activity
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Receive
Request

The Scope activity provides a


container and a context for other Assign
Input message
activities. A Scope provides
handlers for faults, events, and
compensation, as well as data Invoke Partner
variables and correlation sets.

a b le
Client Assign Output message f e r
an s
n - t r
(nested)
a no
Scope
h a s
Reply o m )
u idecan be nested.
m c nt G
Reply
Scopes

i b d e (not shown: A Scope must

@ in Stu contain at least one activity.)

j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
The Scope Kactivity isl used to manage complexity and provide a container and context for other
NA within a BPEL process. It may contain constructs such as variable definitions, fault-
activities
O
K and event-handling definitions, and others. A Scope is a structured activity that contains one
other (mandatory) activity (which may itself contain other activities). Scopes may be nested.
Note: Scopes are important in BPEL processes in a number of different ways. This lesson
focuses on Scopes as they relate to variables. In the lesson titled Handling Faults in
Composite Applications, we discuss Scopes as they relate to fault handling and compensation.

Oracle SOA Suite 12c: Build Composite Applications 6 - 15


Global and Local Variables
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

BPEL Process

Built-in
Types
XML Schema Scope
Element Variable
Type Type
<types>

WSDL Local
Global
a ble
</types>
Variable
Variable
f e r
Message ans
Type n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce at the process level are called global variables. They are visible to all
N
the AR within the BPEL process and are present for the lifetime of the process. Variables
Variables that
activities
are created

KO
that are created within a scope are called local variables. They are visible to activities only
within their own scope, and they are discarded when the scope ends.
When created, a variable in BPEL is assigned a data type. That type determines its structure
and memory (size) requirements. Variable types can be derived from built-in XML data types,
such as string, boolean, int, and others. They can also be derived from an XML element
type defined in an XML schema document (XSD) file, or can be described by a message type
defined in the imported or inline XML schemas of a WSDL document.
Note: It is a best practice to keep common element type definitions in a centralized XML
schema document to enable sharing across cooperating services.

Oracle SOA Suite 12c: Build Composite Applications 6 - 16


Manipulating Data in Variables
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Source
<from> <to> Target
Variable Variable

Because XPath is used to


copy data values, a rich
library of XPath functions is
available to enable
a ble
XPath Functions evaluation and manipulation
f e r
Type Conversion of data values held in
an s
Database Functions variables.
n - t r
Date Functions
a no
Logical Functions
h a s
) ide
String Functions
and more o m u
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J Assign e
licactivity,
During R
a BPEL data is copied from variable to variable. assign includes a
A
N element and a <to> element. There are multiple forms of the from element. One of
<from>
KO
the most powerful specifies an expression to be evaluated by using XPath. This expression can
be anything that XPath will allow, provided it returns an XPath value type (string, number, or
Boolean). Expressions are often used to do simple math (increment sequence numbers), string
concatenations, or other operations on variables, messages, or other values.

Oracle SOA Suite 12c: Build Composite Applications 6 - 17


Transformation

BPEL Design Time


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

uses XSLT Mapper

Transform
defines

a ble
Source-def.xsd Transform.xsl Target-def.xsd
f e r
ans
n - t r
BPEL Run Time a no
h a s
o m )
u ide
m c nt G
b
ni StudProcessor
XSLT e
Source XML
@ i Target XML
n
jai e thi s
r k
a 2014,uOracle
s and/or its affiliates. All rights reserved.
o n
k e to
Copyright
(
J AIN icens
R
If a given K l involves many copy statements between complex data structures, it
Assign activity
may
O NA be preferable to use the transform activity and the associated design-time visual
K mapping capabilities inherent in the XSLT Mapper.
Transformations are implemented as a BPEL Assign activity with a BPEL extension annotation
that enables the design-time visual representation to be a Transform activity. The <from>
element defines an expression that uses the ora:processXSLT function, which is an Oracle
extension service to BPEL. This extension enables the runtime engine to execute the
transformation in the XSL processor provided by the Oracle Application Server Java EE
container service infrastructure.
The graphic in the slide shows the design-time components, where a BPEL Transform is
created from which the XSLT Mapper is opened to create an XSL file that defines the mapping
rules for converting elements from a Source-def.xsd to a Target-def.xsd. The BPEL run
time shows the Transform.xsl file being used by the XLST processor to convert a source
XML structure to a target XML structure.

Oracle SOA Suite 12c: Build Composite Applications 6 - 18


Quiz

The BPEL engine instantiates a business process when a


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

message is received by an activity (often a Receive activity)


with the createInstance attribute set to yes.
a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
Answer:RaK
J lice
O NAReceive represents the input (receipt of a message) of a WSDL operation provided by the
True.
K process. The process is instantiated by the BPEL Service Engine when a createInstance
attribute set to yes is encountered.

Oracle SOA Suite 12c: Build Composite Applications 6 - 19


Agenda

Introduction to Business Processes and BPEL


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

BPEL Process in Oracle SOA Suite 12c

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 6 - 20


BPEL Design Editor
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The process model is


composed of activities BPEL activities are
in the center canvas. available in the
Component Palette.

a ble
f e r
ans
n - t r
a no
View and edit the
h a s
process as a
model, or as XML. o m )
u ide
are displayed inm
c nt G
Client and service partners
their
b
i lanes.
respectivenswimlanes. de
i swim
t u
j a in@ this S
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
The slide shows the JDeveloper BPEL Editor with a visual representation of the process
N on the Design tab. The Design tab is divided into three swimlanes:
diagram
O
K The left partner link swimlane contains the BPEL process service interface that clients,
applications, or components use to interact with the BPEL process component.
The right partner link swimlane contains external service references.
The middle swimlane contains the BPEL process activities that form the process flow.
The main editor window has a Source tab to view and edit the BPEL XML source that was
created in the Design view, and a History tab to view historical changes. The Component
Palette contains components that can be added to your BPEL process flow.

Oracle SOA Suite 12c: Build Composite Applications 6 - 21


Standard JDeveloper windows (not shown) offer additional editor support.
The Application Navigator panel shows the files within the application and projects.
The Structure panel contains two ways to view the XML structure of the BPEL process.
The Source tab shows the raw XML source element hierarchy. The BPEL tab shows the
BPEL process component structures in a tree format. You can edit the BPEL process in
the Structure panel. Next to the Structure panel is a Thumbnail view that provides a
movable frame to change what is visible on the Design tab page.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The Log windows enable you to view design-time errors and check validation results.
The Property Inspector shows properties for a subset of selected objects.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 6 - 22


Creating a BPEL Process
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

XSD describes the


XSD describes the
request and
request and
response messages
response messages.
the process will use.
a ble
f e r
ans
n - t r
A WSDL file (which may
include XSD references) a no
describes each external
h a s
partner interface.
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce a business process is built as a service component within a
N AR application. When complete, the BPEL component is configured with the necessary
In Oracle
composite
SOA Suite 12c,
O
K XSD files to define the XML data types used in the process, the WSDL files that describe the
interfaces for the partner services, and the BPEL file, which contains the source code for the
business process itself.
A BPEL component can be added to a composite application at any time, but it cannot be
configured until the necessary XSD and WSDL files are created and are available. For this
reason, it is more efficient to ensure that XSD files are created to describe all message types,
and WSDL files are available for all external service partners before undertaking the completion
of a BPEL component.
Note: The Web Services Inspection Language (WSIL) connection can be used to locate the
WSDL path in the Create Partner Link configuration windows in the BPEL Editor. However, for
production runtime environments, it is recommended to consider using an Enterprise
Repository and a Service Registry solution for the additional SOA governance capabilities that
they offer.
You can also access service URLs by using an Application Server connection. However, only
SOA composite application services are exposed through an Application Server connection,
whereas Java EE Web Services and SOA services are exposed through the WSIL connection.

Oracle SOA Suite 12c: Build Composite Applications 6 - 23


Mapping Values to Variables

Simple copy operations in an <assign>


are generated with drag-and-drop.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
ValuesR
can licefrom one variable to another with simple drag-and-drop actions in the
KbeJ assigned
A pane.
NAssign
Edit
K O

Oracle SOA Suite 12c: Build Composite Applications 6 - 24


Using Expression Builder
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

XPath expressions are built


in Expression Builder.

a ble
f e r
ans
t r
The XPath function library
n -
is categorized by type.
a no
h a s
Variables are available
o m )
u ide
in a tree structure.
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cassignments
A R
More complex variable can be created with Expression Builder. With it, XPath
N
expressions and function calls can be invoked to assign values to target variables.
KO

Oracle SOA Suite 12c: Build Composite Applications 6 - 25


Testing a BPEL Process
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Supply input values


and run the test.

The response is displayed. The


Flow Trace is accessed from here.

a ble
The Flow Trace lists each f e r
an s
step of the test and its state.
n - t r
a no
h a s
Click the BPEL o m )
u ide
process to access
m c nt G
the audit trail. b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ceprocess are the same as those for any composite application. If the
N AR application service entry point operation selected for the test is a synchronous
The steps
composite
to test a BPEL
O
K operation, the test page is refreshed with the response or fault information on the Response tab
page.
For synchronous and asynchronous operations, the Launch Message Flow Trace link is always
visible, enabling you to drill down into the details of the composite application execution. To
view the results of an asynchronous operation test, you must click the Launch Message Flow
Trace link.
When you click the Launch Message Flow Trace link, a new web browser window is opened
with the Flow Trace page for the composite application instance. On the Flow Trace page in the
Trace section, to view the audit trail for the BPEL process, click the BPEL component link name
in the Trace tree.

Oracle SOA Suite 12c: Build Composite Applications 6 - 26


Examining the BPEL Process Audit Trail

The Flow tab provides


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

access to the Visual


Flow information for
the process.

The Audit
audit trail
Trailallows
allows
you to examine values
a ble
at each activity.
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
J e
liclink
ClickingRaK component in the Trace section of a Flow Trace page opens the Audit Trail tab
A
N For a BPEL process, the execution sequence of activities in the process is displayed,
page.
KO
either in completion or up to the activity that the process executed (if still active). On the Audit
Trail tab page, you can expand the activity sections and their child nodes to examine the effects
of that activity and the payload (data) changes made.
Next to the Audit Trail tab, you can see the following additional tabs:
The Flow tab displays a visual form of the process flow, similar to the BPEL model in the
JDeveloper BPEL Designer.
The Sensor Values tab enables you to view the BPEL sensor data (if any) produced by
the activity, variable, or fault sensors implemented in the BPEL process.
The Faults tab displays the details of any fault conditions that arise during the BPEL
process execution. (Faults are discussed in the lesson titled Handling Faults in
Composite Applications.)

Oracle SOA Suite 12c: Build Composite Applications 6 - 27


Examining the BPEL Process Visual Flow
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
The Visual Flow o m )
lets u ide
you click an
m c activity t G

andi b d e
view information.
n
@ in Stu
j a i n t h is
a r k s e
n
ko e to
Copyright 2014, uOracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
The Visual l a graphical representation of the activity sequence executed by the
KFlow provides
NAprocess. On the Flow tab page, you can click each activity icon to open and view the
BPEL
O
K details for that activity in its Activity Detail window.
Note: If the BPEL process is still executing, click the refresh icon (on the top-right corner of the
page) to get an updated view of the process over time.

Oracle SOA Suite 12c: Build Composite Applications 6 - 28


Quiz

A business process can be deployed as a stand-alone


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

application separately from a composite application, and can


then interact with the composite at run time.
a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
Answer:RbK
J lice
O NAIn Oracle SOA Suite 12c, a business process is built as a service component within a
False.
K composite application.

Oracle SOA Suite 12c: Build Composite Applications 6 - 29


Summary

In this lesson, you should have learned how to:


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

Describe the role of the XSD, WSDL, and BPEL files in a


business process module
Describe the relationship between WSDL partner link types
and BPEL partner link elements
Describe the role of a business process in a composite
application
r a ble
Create a business process in a BPEL module n s fe
n - tra
Use the BPEL editor in JDeveloper no
Use basic BPEL activities to interact with
a
spartners
) h a e
Use the Assign activity to manipulateom tdata i d
u in BPEL
c G
variables ibm den in Stu
i n @ is
r k j a t h
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 6 - 30


Practice 6 Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce a composite application that includes a simple BPEL process. The
R
In this practice,
Aprocess you create
N
BPEL accepts input, and calls the credit card validation project that you built in the
KO
previous practice.

Oracle SOA Suite 12c: Build Composite Applications 6 - 31


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

KO
N
ARK
J l
(
AIN icens
a r j a
kon e to u
k se
i
in@ this
b m
o
ni Stude
m ) h a
c nt G u
a
ide
s
n no
- t r an
s
f e r a b
le
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

More BPEL Activities

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO
Objectives

After completing this lesson, you should be able to:


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

Perform conditional branching by using an If activity


Implement parallel processing by using a Flow activity
Implement non-blocking invocation with a Flow
Create parallel branches dynamically with a forEach
activity
le
Implement a Pick activity with an alarm and a timeout erab
sf
Execute activities repetitively with a While activity-tran
n on
s a
) a
h de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 7 - 2


Agenda

More Activity Types


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

Interaction Patterns

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 7 - 3


Conditional Branching with the If Activity

Use elseif to test


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

alternative conditions.

a ble
f e r
an s
n - t r
If can be nested.
a no
h a s
Activities are executed if
Use the Empty
o m )
u ideUse Expression
activityto
m cdo nothing. t G the test tocondition
Builder define
condition is true. n
i nib Stude for the If.
@
in this
r k j a
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
R
In BPEL K conditional
2.0, l branching is defined with the If activity. An If element includes:
A
KON A condition to be evaluated
One or more activities to be executed if the condition evaluates to true
An <else> branch, which includes one or more activities to be executed if the condition
evaluates to false
An If activity may also include one or more ordered <elseif> branches, each with a condition
to be evaluated. Only one branch is executed; that is, the first <elseif> branch that returns a
true result is processed, and no other branch is evaluated.
Note: For the XPath expressions and conditions that are created in XPath Expression Builder,
it is recommended that you use explicit type conversion where appropriate to avoid subtle
problems that can arise from implicit type conversion in an XML context. For example, XML
data is usually treated as string data, and comparing two numerical strings performs a string-
based comparison that may not yield the intended result for a numerical value comparison.

Oracle SOA Suite 12c: Build Composite Applications 7 - 4


Processing with the Flow Activity

The Flow activityenables


flowactivity enables
two or more sequences of
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

activities to be processed
concurrently.

a ble
f e r
ans
n - t r
a no
h a s
The Flow completes
o m )
u ide
when all activity
m c nt G
sequences are finished. b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce implements the processing of concurrent sequences of activities. A
R
In BPEL, the
Aactivity Flow activity
O N
Flow may contain one or more branches, each with its own activity sequences that are
K processed simultaneously. Each branch of the flow must contain a Sequence activity, which in
turn may contain additional activities (including a nested Flow activity). Flow branches are
specified at design time. At run time, a Flow terminates when all flow branch sequences have
completed.

Oracle SOA Suite 12c: Build Composite Applications 7 - 5


Using the nonBlockingInvoke Property
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

If a synchronous Invoke the asynchronous


blocks execution until it Invoke waits until the
completes synchronous Invoke
Invoke completes.
Invoke

Receive

a ble
2
Solution: Edit the partner link
f e r
an
Set the nonBlockingInvoke
s
for the synchronous service.

n
property to true.- t r
1 a no
h a s
4
o m )
u ide
m c nt G
b
ni Stude 3
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ceSequence construct are processed sequentially. A synchronous
N AR
The activities in a BPEL
O activity in a Flow branch causes the remaining Flow branches to wait until the
Invoke
K synchronous exchange is completed. This has the effect of serializing the execution of Flow
branches. However, by setting the nonBlockingInvoke partner link binding property to
true, the Invoke activities are executed in separate threads.
The nonBlockingInvoke property has a default value of false, in which case the
invocation is executed in the same thread as the BPEL process instance. When this property
value is set to true, a separate thread is spawned to do the invocation so that the Invoke
activity does not block the instance.
To add the nonBlockingInvoke property to a partner link, perform the following steps:
1. In the BPEL Designer window, right-click a partner link and select Edit.
2. In the Edit Partner Link window, click the Property tab, and then the Create Property icon.
3. Select the nonBlockingInvoke value from the Name drop-down list, and click OK.
4. In the Edit Partner Link window, replace the text Property Value with the value true,
and click OK.
The property value is inserted inside the BPEL component element in the composite.xml
file.

Oracle SOA Suite 12c: Build Composite Applications 7 - 6


Parallel and Sequential Looping
with the forEach Activity
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Both sequential
and parallel looping
a ble
are supported. Declare the starting f e r
Declare start and end
and final values for
ans
the loop counter.
n - t
values for the loop. r
a no
h a s
In BPEL 2.0, the forEach
o m )
u ide
activity performs looping
m c nt G
iterations sequentially N times b
ni Stude
over a given set of activities. i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce both sequential and parallel looping iterations. By default, the
N ARactivity performs looping iterations sequentially N times over a given set of activities
The forEach
forEach
activity supports
O
K that are defined within a Scope activity. For instance, the forEach activity iterates over an
incoming purchase order message where the purchase order message consists of N order
items. The enclosed Scope activity must be executed N+1 times, with each instance starting
only after the previous iteration has completed.
In parallel iteration, all looping iterations are started at the same time and processed in parallel.
Parallel iterations are useful in environments where sets of independent data are processed or
independent interaction with different partners is performed in parallel. In these scenarios,
execution of the N+1 instances of the contained Scope activity occurs. Each copy of the Scope
activity has the same counter variable that you specify. Each instances counter variable must
be uniquely initialized in parallel with one of the integer values beginning with the starting
counter value and proceeding up to and including the final counter value.

Oracle SOA Suite 12c: Build Composite Applications 7 - 7


Unlike a Flow activity, the number of parallel branches is not known at design time with the
forEach activity. The specified counter variable iterates through the number of parallel
branches, controlled by the starting counter value and the final counter value.
You can also specify a completion condition on the Completion tab. This condition enables the
forEach activity to complete without executing or finishing all the branches specified. An
example would be: You send out parallel requests and a sufficient subset of the recipients has
responded.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 7 - 8


Suspending a Process with the Wait Activity

You can suspend a BPEL process


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

by using the Wait activity.

a ble
f e r
ans
n - t r
The Wait activity pauses for a a no
specified amount of elapsed time
h a s
or until a specified date-time.
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce process by using the Wait activity. The Wait activity pauses for a
N AR amount of elapsed time or until a specified date-time.
You can
specified
suspend a BPEL

KO The slide shows the configuration window for a Wait activity. You can use an expression to
calculate the time period for which the process will wait or the time it waits until.
For example, if you set a Wait for 2 minutes, the BPEL Designer creates the following Wait
element:
<wait name="Wait_1" for="'PT2M'"/>
Here, the P designator must always be present and precede the year (Y), month (M), and day
(D) parts, each of which is preceded by a number, if present. The T precedes the time parts for
hour (H), minutes (M), and seconds (S). If you use an expression to set the wait time, the
resulting string must conform to the following format: P1Y1M1DT1H1M1S.
For example, a Wait for 1 year, 1 month, 1 day, 1 hour, 1 minute, and 1 second is:
<wait name="Wait_1" for="'P1Y1M1DT1H1M1S'"/>
An example of a Wait until a specified date and time is:
<wait name="Wait_2" until="'2007-02-28T12:43:59'"/>
Note: The time format conforms with the ISO 8601 international time format standard.

Oracle SOA Suite 12c: Build Composite Applications 7 - 9


Waiting for a Message with the Pick Activity

The Pick activity is An onAlarm branch


used to wait for a
implements a wait
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

message, just as a
time, and provides
Receive activity does.
an optional timeout.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ceto wait for a message (just as a Receive activity does), but with an
N ARtimeout. To achieve this, it includes two branches:
The Pick
optional
activity is used

KO One or more onMessage branches receive a specific message from an operation that is
exposed by a service through a partner link.
Zero or more onAlarm branches implement a wait time.
One branch is selected before the other, based on the occurrence of the associated event.
After the Pick activity has accepted an event for handling, other events are no longer accepted.
The possible events are the arrival of some message in the form of the invocation of an
inbound one-way or request-and-response operation, or an alarm based on a timer (analogous
to an alarm clock).
The Pick activity completes when one of the branches is triggered by the occurrence of its
associated event.

Oracle SOA Suite 12c: Build Composite Applications 7 - 10


Looping with the While Activity
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The While executes


its activity in a loop if a b le
its condition is true. f e r
an s
n - t r
a no
The While contains a h a s
m ) e
idThe
single activity, which
may be a Sequence o
c nt G defined u condition is
or a Scope.
i b m e with
in Stu d Expression Builder.
@
in this
r k j a
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
K continues
A WhileRactivity l to repetitively execute a single activity (or a set of activities in a
NA or Scope) if the specified condition is true. When the condition becomes false, the
Sequence
O
K loop terminates.
To add and configure a While activity, perform the following steps:
1. Drag a While component from the Component Palette to the process diagram.
2. Click the View Condition Expression icon and construct the conditional expression in
Expression Builder.
3. Expand the While activity and drag another activity, Sequence, or Scope, into the body of
the While activity.
Note: When working with a While activity, treat it as a traditional programming loop construct,
such that you:
Perform an initialization before the loop
Evaluate the condition before entering the loop
Execute the body of the loop if the condition is true
Increment or modify the variables that affect the condition, such as the example for using
a counter, as shown in the slide

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


Indexing XML Arrays Dynamically

To access the nth element of an XML


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

array, use the XPath expression


syntax: /parent/array[n]/child

<while name="While1">
<condition>$i &lt;= $numItems and $inStock=true()</condition>
<sequence name="Sequence1">
<assign name="Assign_prodid">
<copy>
<from>$inputVariable.payload/ns2:product[position()=$i]/ns2:prodId</from>
<to>$Invoke_check_getInternalStoreView1_InputVariable.parameters/ns4:prod
Id</to>
</copy>
a ble
</assign>
f e r
ans
n - t r
For dynamic index expression, use
either the XPath syntax a no
[position()=num] or simply
h a s
the value [num].
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce processing, you may need to index XML array structures. Accessing
N
the ARelement of an XML array uses the following XPath expression syntax:
When performing
nth
dynamic

KO
/parent/array[n]/child
Here, the value n is enclosed in square brackets to form the index (starting from 1) for a
specific XML array element. For example: To obtain the price of the second item in a purchase
order, the XPath expression could be /OrderItems/Item[2]/price.
Note: For dynamic index expression, use the XPath syntax [position()=2].

Oracle SOA Suite 12c: Build Composite Applications 7 - 12


Quiz

The Flow and forEach activities are the two looping constructs
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

that are available in BPEL.


a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
Answer:RbK
J lice
O NAThe While and forEach activities are the two looping constructs that are available in
False.
K BPEL. The Flow activity implements processing of concurrent sequences of activities.

Oracle SOA Suite 12c: Build Composite Applications 7 - 13


Basic BPEL 2.0 Activities

Web Services
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Receive Invoke Reply

Updating Variables

Assign Validate Transform XQTransform

Fault and Error Handling


a ble
Throw Rethrow Catch Catch Alls f e r
- t r an
Compensate CompensateScope n on
s a
Miscellaneous ) a
h de
c om t Gui
Wait
iExit
b m en Empty
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
The slide
R l of the BPEL activity icons that appear on the Component Palette or in
Kshows some
A process flow. The activities are classified, similar to the definitions found in the WS-
NDesign
the
O
K subdivided into functional groups.
BPEL V2.0 specifications. Activities are defined as Basic or Structured activities, which are

Basic Activities
Invoking and Providing Web Service Operations
Receive: Waits for an initiating message or an asynchronous callback response message
from a service
Invoke: Enables you to invoke a service (identified by its partner link) and specify an
operation for this service to perform
Reply: Allows the process to send a message in reply to a message that was received
through a Receive activity
Updating Variables and Partner Links
Assign: Manipulates XML data to copy the contents of one variable to another
Validate: Provides the ability to validate variables against schema definitions
Transform and XQTransform: Process XSL and XQuery Transformations that map
source elements to target elements to update variables

Oracle SOA Suite 12c: Build Composite Applications 7 - 14


Fault and Error Handing
Throw: Generates a fault from inside the business process
Rethrow: Allows you to raise a previously handled fault
Compensate: Executes a compensation handler, which contains a sequence of activities
executed, to reverse the results of a fault scenario
CompensateScope: Points to a scope whose compensation handler is to be run
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Catch: Enables you to trap a name (specific) fault or an error condition


Catch All: Enables you to catch unnamed (non-specific) fault or error conditions
Note: The Catch and Catch All activities are branches of a Scope activity.
Miscellaneous
Wait: Allows a process to specify a delay for a certain period of time or until a certain
deadline is reached
Exit: Enables you to end the tasks of an activity (for example, the fault-handling tasks in a
a ble
catch branch)
f e r
ans
Empty: Provides a no-operation activity. This is useful for inserting sensor points for
- t r
monitoring business activity or when a fault needs to be caught and suppressed.
n
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 7 - 15


Structured and Extension BPEL 2.0 Activities

Execution Context Sequential and Parallel Processing


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

Scope Sequence Flow

Looping Execution

While ForEach RepeatUntil

Conditional Branching

onMessage a ble
Pick If f e r
onAlarm
an s
n - t r
SOA Components a no
BPEL Extensions
h a s
o m )
u de others!
iMany
Human Task Business Rules
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
Structured Activities
N
KO
Execution Context
Scope: Consists of a collection of nested activities that can have their own local
variables, fault handlers, compensation handlers, and so on. A Scope activity is
analogous to a coding block in structured programming languages.
Sequential and Parallel Processing
Sequence: Contains a collection of activities to be performed in sequential order
Flow: Executes two or more branches of activities in parallel (concurrently)
Looping Execution
While: Supports repeated performance of a specified iterative activity. The iterative
activity is repeated until the given while condition is no longer true.
ForEach: Processes multiple sets of activities sequentially or in parallel
RepeatUntil: Executes the body of the activity at least once. At that point, a condition is
tested. If the condition is true, the activity ends.

Oracle SOA Suite 12c: Build Composite Applications 7 - 16


Conditional Branching Execution
Pick: Provides a way to wait for the occurrence of a set of events, such as a message
(onMessage branch) arriving or a timeout condition specified by an alarm (onAlarm
branch). Only one of these events is acted upon by a sequence of activities, to handle the
event.
If: Enables you to define conditional behavior for specific activities to decide between two
or more branches. Only one activity is selected for execution from a set of branches.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

SOA Components
Human Task: This Oracle BPEL Extension provides for the invocation of a Human Task
service component.
Business Rule: This Oracle BPEL Extension provides for the invocation of a Business
Rules service component.
Other Extensions
Many other BPEL Extension activities are available on the Component Palette. To learn
a ble
more about them, refer to the Developing SOA Applications with Oracle SOA Suite 12cf e r
documentation. ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 7 - 17


Summary

In this lesson, you should have learned how to:


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

Perform conditional branching by using an If activity


Implement parallel processing by using a Flow activity
Implement non-blocking invocation with a Flow
Create parallel branches dynamically with a forEach
activity
le
Implement a Pick activity with an alarm and a timeout erab
sf
Execute activities repetitively with a While activity-tran
non
Explore various SOA component interactiona patterns
Explore a dynamic service invocation) h as e
pattern
d om t Gui
m en c
i b
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 7 - 18


Practice 7 Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

1 2

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce calling an asynchronous service. To do this, you build a composite
N AR with two BPEL processes.
This practice
application
demonstrates

KO Note: In this practice, you build a synchronous process, which calls an asynchronous process.
This would rarely, if ever, be considered a suitable design pattern in the real world, but it works
well to illustrate many of the activities that were discussed in this lesson.

Oracle SOA Suite 12c: Build Composite Applications 7 - 19


Practice 7 Overview

The While activity will loop as long


The incoming message as $elapsed < $numSecs.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

specifies a numeric value,


which is stored in the
variable $numSecs.
A second variable
$elapsed is initialized to 0. A Wait activity pauses
for 3 seconds.

An Assign activity adds


a ble
3 to $elapsed. At this f e r
ans
point, the While activity
loops. n - t r
a no
h a s of
The value
o m ) $elapsed
u ide is copied
m c nt G to the reply and
i b e
@ in Stud returned to the client.

j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
The first Kthese is anl asynchronous BPEL process. The process uses the While and Wait
of
NA to loop for a specified amount of time. The time is specified by a value passed in the
activities
O
K incoming message.

Oracle SOA Suite 12c: Build Composite Applications 7 - 20


Practice 7 Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The AsyncProcess
The incoming message
waits the specified
specifies a numeric
number of seconds.
value, which is passed
to the AsyncProcess.

The Pick activity includes an


a ble
onMessage branch that
f e r
s
executes if a reply is received.
an
n - t r
a no
h a s
o m The
u ide also includes an
) Pick activity
m c onAlarm n t G branch that executes if
b
ni Studespecifiedisamount
no reply received within a
@ isi of time.
i n
a r kja se th
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce the asynchronous service, and specifies how long that process
N AR
The second process calls
O loop. The calling process then uses a Pick activity with both an onMessage and an
should
K onAlarm branch. The onAlarm branch specifies how long to wait for a response. If the called
process returns a message before onAlarm is activated, the onMessage branch executes. If
not, the onAlarm branch is triggered instead.
During testing, you pass two values to the process: one to trigger the onMessage branch, and
the other to trigger the onAlarm branch.

Oracle SOA Suite 12c: Build Composite Applications 7 - 21


Before You Begin

The instructions for this practice and those that follow include
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

path references that include XML namespace prefixes, for


example:
Use Expression Builder to define the expression
string($inputVariable.payload/ns4:shipMethod).
If you have built each of the components in the order that was
prescribed in the instructions, Expression Builder generates an ble
expression that includes namespaces that match. f e ra
a n s
-t r
If you have built components in a different order, or deleted,
n
o
and then re-created components, your namespace
s a n prefixes
) ha de
may not match what is listed in these instructions.
m i
c o t Ginu your project.
In that case, use the namespace references
i b m en
in
Do NOT change those references ttoudmatch the book.
j a in@ this S
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 7 - 22


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

Handling Faults in Composite Applications

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO
Objectives

After completing this lesson, you should be able to:


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

Describe basic fault handling and propagation


Explain fault management for synchronous and
asynchronous services
Modify a WSDL operation to have a fault message
Manage faults with Mediator components
Throw and catch faults in a BPEL process r a ble
n s fe
Describe the Fault Management Framework -tra on
a n
a
h de s
)
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
In this R
lesson, l to design and use fault management and handling techniques by
K you learn
NAthe following:
Ousing
K A Mediator component
A BPEL component
The SOA Fault Management Framework (by implementing fault policies that can be
associated with applications and components through fault-binding definitions)
You are reminded that fault management and handling depend on interaction types. Different
strategies are needed for synchronous interactions than for asynchronous interactions. You
learn how to design faults for synchronous interactions by specifying fault definitions in WSDL
documents.

Oracle SOA Suite 12c: Build Composite Applications 8 - 2


Agenda

Faults: Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Managing Faults in Mediator


Fault Handling in BPEL
Compensation in BPEL
The Fault Management Framework
Faults in Enterprise Manager le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 3


Faults: Overview

Faults are:
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Errors encountered during the execution of an application


Similar to exceptions in Java
There are different types of faults. We focus on two:
Business faults, which are:
Available in synchronous operations
Defined by a user and are application-specific r a ble
n s fe
Generated when a problem is detected with data tra
o n -
Thrown by the process or received from an invoked
operation s an
a ) h de
Runtime faults, which are:
c om t Gui
Defined by the system ibm den
Thrown by the runtime @ insystem
S tufor incorrect logic or values
n
jai e thi s
r k
a 2014,uOracle
s and/or its affiliates. All rights reserved.
o n
k e to
Copyright
(
J AIN icens
R K l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 4


Fault-Handling Challenges

The handling and propagation (passing on) of faults is a multi-


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

dimensional problem. Strategies for fault handling must


consider the following:
Fault type
Business
Runtime
Component type a ble
f e r
Mediator
ans
BPEL component n - t r
a no
Interaction type a s
h
Synchronous o m )
u ide
Asynchronous m c nt G
n b
i tude
Transactionality of the i
j a in@servicesh i s S involved
a r k se t
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
R
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 5


Fault-Handling Options

Oracle SOA Suite provides multiple tools for responding to


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

faults, including:
Mediator configuration options
BPEL language constructs
The Fault Management Framework
Enterprise Manager
a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 6


Agenda

Faults: Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Managing Faults in Mediator


Fault Handling in BPEL
Compensation in BPEL
The Fault Management Framework
Faults in Enterprise Manager le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 7


Managing Faults in a Mediator
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Mediator

Routing Rule
Faults Section
return Return to the initial fault
to caller caller

1
Route to a service
a ble
Publish an event
f e r
ans
n - t r
a no
route to a service publish )anhevent e
as
c o m Guid
2
m en3 t
i b
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
In a Mediator l when you create a routing rule for a target service that defines one
K component,
orN A faults (in its WSDL), the Faults section becomes visible. In the Faults section of a
more
O
K routing rule, you can add a fault handler to:
1. Return a fault from the target service to the caller of the Mediator component, provided
that the WSDL of the Mediator component supports returning faults to its clients
2. Forward a fault from the target service to another service to deal with the fault message,
such as a logging and notification service. You can forward faults whether or not the
Mediator defines faults in its WSDL interface.
3. Publish an event
When the Fault section appears in the routing rule, an initial fault routing handler is created.
The target service set for the initial fault routing is:
Set to the initial caller of the Mediator component, if the Mediator component defines
faults in its WSDL that can be returned to its caller
Not set to any target, if the Mediator component does not define any faults in its WSDL
interface. In this case, you must forward the fault to a target that you configure.

Oracle SOA Suite 12c: Build Composite Applications 8 - 8


Quiz

A Mediator can return a fault to the original caller, if the fault is


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

defined in its WSDL.


a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARa
Answer:
N
KOTrue. A synchronous Mediator can return a fault to the caller of the Mediator, provided that the
WSDL of the Mediator component supports returning faults to its clients.

Oracle SOA Suite 12c: Build Composite Applications 8 - 9


Agenda

Faults: Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Managing Faults in Mediator


Fault Handling in BPEL
Compensation in BPEL
The Fault Management Framework
Faults in Enterprise Manager le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 10


Faults in BPEL Processes

During execution, a BPEL process can encounter:


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

Both business and runtime faults


A third type of fault known as a standard fault
Standard faults are:
Defined by the WS-BPEL specification
Not associated with a message type or WSDL message
Thrown by the systems a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
Faults R
that
J
Koccur liceBPEL process execution because of errors generated by the invoked
during
O NA or internal or system failure conditions can be handled and gracefully managed.
services
K Faults detected by a BPEL process may need to be returned to the process client by using a
technique that is dependent on the type of interaction.
The types of faults defined for a BPEL process include:
Standard faults, which are defined by the WS-BPEL specification (http://docs.oasis-
open.org/wsbpel/2.0/wsbpel-v2.0.html). Some standard fault name examples are:
bindingFault, conflictingReceive, invalidReply, and remoteFault.
Note: These faults have no message type, and are therefore caught without requiring a
fault variable to store or access an error message.
Business faults are user-defined, application-specific names that are generated by the
BPEL process as a result of errors in business logic or data, such as
CreditLimitExceeded.
Runtime faults are caused by the errors detected in the BPEL process execution
environment, known as system faults, for example: an endless loop, and SOAP faults.

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


Faults in Synchronous BPEL
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

BPEL Process

Operation

request response fault

a ble
f e r
ans
n - t r
a no
h a s
Calling Application o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce in several ways. A fault can be returned by a called service. BPEL
R
BPEL faults
Acan can be raised
N
faults be caused by situations encountered during run time, including mismatched types
KOin an Assign activity, uninitialized variables, out-of-memory conditions, and so on.
Depending on the nature of the fault and the design of the BPEL code, it may be possible to
recover a fault, or to take some sort of mitigating actions before exiting gracefully. In this
section, you learn more about the behavior of BPEL faults and the language constructs that
are available to you to plan for and respond to fault conditions.

Oracle SOA Suite 12c: Build Composite Applications 8 - 12


Synchronous Service Faults
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

<!-- MESSAGE TYPE DEFINITION -->


<wsdl:message name="BookingRequestMsg">
<wsdl:part name="payload" element="ns1:enrollmentRequest" />
</wsdl:message>
<wsdl:message name="BookingResponseMsg">
<wsdl:part name="payload" element="ns1:enrollmentResponse" />
</wsdl:message>
<wsdl:message name="BookingFaultMsg">
<wsdl:part name="payload" element="ns1:enrollmentFault" />
</wsdl:message>
a ble
f e r
<!-- portType implemented by the Booking BPEL process -->
ans
<wsdl:portType name="Booking">
n - t r
<wsdl:operation name="process">
a no
<wsdl:input message="client:BookingRequestMsg" />
h a s
ide
<wsdl:output message="client:BookingResponseMsg"/>
m )
<wsdl:fault message="client:BookingFaultMsg" name="pymtFault"/>
</wsdl:operation> o
c nt G u
b m
ni Stude
</wsdl:portType>
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce Language (WSDL) for a synchronous web service describes the
N ARresponse for a given operation. It may also describe a fault for that operation. WSDL
The Web
regular
Services Definition

KOfaults have a name and a reference to a message definition, as shown in the example in the
slide.
To define a business fault for a synchronous service (WSDL does not support the creation of
fault elements for one-way or asynchronous operations), perform the following:
1. In an XSD, define a fault element containing a structure for error information. The
element can be as basic as a single string to contain an error message.
2. In the WSDL, create a WSDL message whose structure is defined as the XSD type.
3. In the WSDL, create a fault part in the process operation and associate it with the
correct message structure.
Note: Choose meaningful fault names that reflect the business fault condition, because the
fault names are used in the Mediator Faults section of the routing rules and BPEL process
Throw activities.

Oracle SOA Suite 12c: Build Composite Applications 8 - 13


Review: Scope Activity
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Receive
Request

The Scope activity provides a


container and a context for other Assign
Assign
Input Message
activities. A Scope provides
handlers for faults, events, and
compensation, as well as data Invoke
Invoke Partner
variables and correlation sets.

a ble
Client Assign Output Message f e r
an s
n - t r
(nested)
a no
Scope
h a s
Reply o m )
u idecan be nested.
m c nt G
Reply
Scopes

i b d e (not shown: A Scope must

@ in Stu contain at least one activity.)

j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
Recall Rfrom l titled Introduction to BPEL that the Scope activity is used to organize
K the lesson
O NA within a BPEL process into logical units of work. A Scope is a structured activity that
activities
K contains one other (mandatory) activity (which may itself contain other activities). Recall also
that Scopes may be nested. Even if no Scopes are explicitly added to a process, there is an
implied Scope at the process level. Scopes are important in BPEL processes in a number of
different ways, but within this lesson, we focus on Scopes as they relate to error handling and
compensation.

Oracle SOA Suite 12c: Build Composite Applications 8 - 14


Fault Handlers

Fault handling can be attached to


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

catch
the (implied) process-level Scope.

catchAll

Each fault handler must have at


least one Catch or CatchAll
a ble
defined. f e r
an s
n - t r
catch a no
h a
Individual
sScopes can have fault
o m ) defined.
handlers
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
The receipt of a fault message results in a fault condition being raised in the BPEL code.
N this condition occurs, the BPEL engine seeks to execute any fault handlers associated
When
KOwith that particular fault, and within the current scope of execution. The faultHandlers
construct is a BPEL container associated with a given Scope (or the implied process-level
Scope). A faultHandlers container includes the Catch and/or CatchAll elements. These
elements work in very much the same way as their Java counterparts.
The Catch activity is used to intercept and deal with a specific kind of fault. A
faultHandlers container may contain zero or more Catch elements. Properties of the
Catch element include the Fault Name, which may be one of the BPEL-defined faults, or the
faults defined in a WSDL file. You can also specify a fault variable name (name of an existing
BPEL variable) that will contain the fault message.

Oracle SOA Suite 12c: Build Composite Applications 8 - 15


Use the CatchAll element to intercept and deal with all faults that are not caught by an
associated Catch element. There are no properties for the CatchAll element. Its behavior is
predefined and it requires no configuration. A faultHandlers container may contain zero or
one CatchAll element.
Note: Both the Catch and CatchAll constructs are considered optional, but a
faultHandlers container must contain at least one Catch or CatchAll element to be valid.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

If no fault handler is present for an error condition within the current Scope of execution, the
fault is automatically propagated to the parent Scope, until the process-level Scope is
reached. If no suitable fault handler is found at the process level, the default fault-handling
rules of the BPEL Process Manager server are invoked.

a b le
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 16


Returning Faults from a Synchronous Process

BPEL Client Synchronous Process


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

catch

If
condition
a ble
invoke
f e r
ans
n - t r
isError a noelse
h a s
o m )
u ide
m c ntReply G Reply
b
ni Stude
Fault Response
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce a fault to its client, as opposed to handling it internally. This is
N ARas propagating a fault. For synchronous operations, the Reply activity is used to return
A BPEL
known
process can return
O
K the fault. To return a fault to the process client, perform the following:
1. Define the business fault in the process WSDL for the synchronous process operation.
This includes associating the fault with the correct message structure.
2. Terminate the BPEL process with a Reply activity that is configured with the Fault
QName of the business fault that is defined in the WSDL.
The BPEL element syntax of a Reply activity that returns a fault in a synchronous interaction
is:
<reply name="ReplywithBusinessFault
partnerLink="client"
portType="client:CatchRtFaultBPELProcess"
operation="process"
variable="businessFaultVar"
faultName="client:CreditCardInvalid"/>
Note: The fault variable is optional. Ensure that the Reply with fault activity is part of a
conditional branch, as shown in the slide example where a fault handler catches the fault
thrown in the <case> branch. The Reply executes either in the conditional branch or in the
fault handler. The process should still contain a Reply activity for the successful response.
Oracle SOA Suite 12c: Build Composite Applications 8 - 17
Returning Faults from an Asynchronous Process

BPEL Client Asynchronous Process


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

invoke

If
pick
condition
a ble
f e r
ans
n - t r
onError onResult isError a noelse
h a s
o m )
u ide
m c nFault t G Response
b
ni Stude
callback callback
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
KJ e
licservice,
For anR
asynchronous because a fault response cannot be returned as an immediate
N A
Oresponse, the options are to return a fault message through the same callback operation as
K the normal response, or to use a different callback operation.
Remember, clients making asynchronous requests do not wait for a reply. Therefore, to report
faults from an asynchronous process, you can use a callback operation, where the BPEL
process uses an Invoke activity to send a fault response in a callback either on the same port
type as the success response or in a separate callback port type.
The slide illustrates the first strategy: The BPEL client uses a Pick activity with two
onMessage branches: one for the onResult (success) and another for the onError (fault)
callback. The asynchronous BPEL service returns either the success or fault response with an
Invoke activity.

Oracle SOA Suite 12c: Build Composite Applications 8 - 18


Example:
<portType name="BPELAsynchRequest">
<operation name="initiate">
<input message="client:BPELFaultHandlingRequestMessage"/>
</operation>
</portType>
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

<portType name="BPELAsynchCallbackResponse">
<operation name="onResult">
<input message="client:BPELSuccessResponseMessage"/>
</operation>
<operation name="onError">
<input message="client:BPELFaultResponseMessage"/>
</operation>
a ble
f e r
</portType>
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 19


Catching BPEL Runtime Faults
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Import RuntimeFault.wsdl
into your process WSDL.

import
a ble
f e r
ans
n - r
Add a Catch to a
t
Scope and select
the desired system
a no
h a s
fault from the

o m )
browser list.
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i cebe caught by using the following steps:
R
BPEL runtime
AImport faults can
N
1. RuntimeFault.wsdl into your process WSDL. RuntimeFault.wsdl is
KO seeded into MDS from soa.mar inside soa-infra-wls.ear during its deployment.
Note: A copy of soa.mar (a JAR or ZIP file) is deployed to soa-infra in the WebLogic
Server (WLS) domain.
2. In a scope, add a Catch branch and double-click the Catch icon.
3. In the Catch window, click the Browse (flashlight) icon to open the Fault Chooser, in
which you can expand System Faults and select one fault, such as bindingFault.
4. In the Catch window, you can auto-create (or browse for) a variable that has a message
type of bpelx:RuntimeFaultMessage.

<catch faultName="bpelx:bindingFault"
faultName="runtimeFaultVar">
...
</catch>

Oracle SOA Suite 12c: Build Composite Applications 8 - 20


Faults That Cannot Be Handled

Some faults cannot be handled. Examples include:


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

Some internal server errors


Lower-level JVM errors
Transaction timeout conditions and transactions that are
marked for rollback
Note: The BPEL Process Manager (server) manages these
error conditions by writing them to log files and terminating the rabl
e
instance. n s fe
a - tr
no n
s a
) a
h de
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
A faultR
handler l to catch Oracle BPEL Process Manager execution exceptions. The
K is used
NAand CatchAll branches can handle almost all business and runtime exceptions.
OCatch
K However, fault handlers cannot handle the following conditions:
Some Oracle BPEL Server internal errors. Some internal server errors can mean that
the Oracle BPEL Server cannot ensure the execution of a BPEL process instancefor
example, an ORABPEL (BPEL Server schema) database access exception. This type of
exception is sent to the Oracle BPEL Process Manager error handler, thus preventing a
specific process fault handler from catching and handling it.
Lower-level JVM errorsfor example, OutOfMemoryException
When a transaction is marked for rollback only, or when a transaction is rolled back
because of a timeout. In these cases, even if the fault handler catches the fault, any
corrective actions are discarded.

Oracle SOA Suite 12c: Build Composite Applications 8 - 21


Throwing Faults

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

Catch
someFault

If
condition
a ble
f e r
ans
n - t r
throw
someFault
else
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A BPEL
A Rfault can be deliberately raised by using the Throw or Rethrow constructs. The Throw
N declares the name of a fault and optionally provides a variable to associate data with
Oactivity
K the fault.
<throw faultName="tns:pymtFault"/>
Thrown fault conditions can be managed internally by the same BPEL process by using a
Catch or CatchAll branch in an enclosing Scope.
Note: Any unmanaged fault messages are handled by the BPEL Process Manager engine,
and may not be propagated to the invoker of the BPEL process unless you include a Reply
activity that is configured with fault information.
Before you can throw a fault message, consider defining a message structure type for the
fault message data. If you intend to propagate the fault to a client, you must define the
message structure and fault information in the WSDL operation that is used to invoke the
BPEL process.
To throw a fault, perform the following:
1. Create a Throw activity in your process where the business fault occurs.
2. Configure the Fault QName and Fault Variable fields for the Throw activity.

Oracle SOA Suite 12c: Build Composite Applications 8 - 22


The fault variable, if specified, must have the same fault message type as the Fault QName
that is derived from the WSDL file. The fault variable should be populated with fault
information by using an Assign activity before the Throw activity is executed.
Note: The fault variable must be visible to the Scope in which the fault handler (Catch or
CatchAll branch) is located.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 23


Quiz

Faults are notified and handled differently based on the type of


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

interaction (synchronous or asynchronous invocation).


a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARa
Answer:
N
KOFor a synchronous service, a fault can be returned as a response, instead of expected data,
whereas for an asynchronous service, because a fault response cannot be returned as an
immediate response, the options are to return a fault message through the same callback
operation as the normal response, or to use a different callback operation.

Oracle SOA Suite 12c: Build Composite Applications 8 - 24


Quiz

A BPEL fault handler must include a CatchAll element to


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

handle all exceptions that are not caught by name.


a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARb
Answer:
N
KOFalse. The CatchAll element is used to intercept and deal with all faults that are not caught by
an associated Catch element. However, the CatchAll element is always optional. A
faultHandlers container may contain zero or one CatchAll element.

Oracle SOA Suite 12c: Build Composite Applications 8 - 25


Agenda

Faults: Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Managing Faults in Mediator


Fault Handling in BPEL
Compensation in BPEL
The Fault Management Framework
Faults in Enterprise Manager le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 26


Review: Transactionality

The Database adapter and JMS adapter are both transactional


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

(as are the AQ adapter and Java web services).


In general, a transaction is started by a service when it is
invoked by a client, and ends when the service operation
completes. If the invoked service completes successfully,
the transaction that is started is committed; otherwise
errors roll back the transaction.
r a ble
Transactional boundaries depend on the context,
n s fe
configuration, and environment of the services that - a
trare
no n
implemented and invoked. a
h a s
Transaction semantics are different for ) services
d e that are
m u i
o t Gthat are invoked
invoked synchronously than forcservices
asynchronously. i b m e n
in u d t
n @ s S
r k jai e thi
o n a 2014,uOracle
s and/or its affiliates. All rights reserved.
( k e to
Copyright

J AIN icens
R
In general, l is started by a service when it is invoked by a client, and ends when
Ka transaction
A
OtheNservice operation completes. If the invoked service completes successfully, the
K transaction that is started is committed; otherwise errors roll back the transaction.
With the Oracle SOA Suite 12c platform, a transactional service can be implemented as a
Java web service, a Database adapter, a JMS adapter, or the AQ adaptereach of which can
be invoked from the Mediator and BPEL components.
In each case, 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 that are invoked
asynchronously.
Note: SOAP endpoints, File adapter, and the FTP adapter service implementations are non-
transactional; that is, they do not join existing transactions and start new transactions (if any).

Oracle SOA Suite 12c: Build Composite Applications 8 - 27


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

By the time the payment


interaction throws a fault, the
reserve seat interaction is
committed as a separate
transaction. There is a need to
offset or undo that transaction.
Reserve seat (success)

a ble
f e r
an s
n - t r
Process payment (fault)
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i cein BPEL is similar conceptually to exception handling in Java,
N AR processes require a different approach to error handling. A business process may
Although
business
fault handling

KOcontain multiple, discrete transactions. The overall business transaction can fail or be
cancelled after many enclosed transactions have already been processed. It may then be
necessary to explicitly reverse or offset those individual transactions that were completed
before the fault.
The diagram in the slide shows a simple process that handles a request to enroll in a training
course. After receiving the request, the process invokes a web service that requests a seat in
a given course, and decrements the number of available seats. The next activity processes
the customers payment information. If problems are encountered while processing the
payment, a fault message is returned by the web service. In that case, the debit of the
available seat count (which is already completed) must be cancelled, reversed, or otherwise
compensated for.
BPEL includes several activities that provide the capability to define compensation actions.
The first of these constructs is the compensation handler. A compensation handler is a
container for activities that perform compensation actions. Compensation handlers are
attached to the activity to be reversed, which may be either an Invoke element or a Scope.

Oracle SOA Suite 12c: Build Composite Applications 8 - 28


Compensation Handlers
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

<scope name="myScope">
<variables>
...local variables declared here
</variables>
<compensationHandler>
<sequence name="compSequence">
...compensation activities defined here
r a ble
</sequence>
n s fe
</compensationHandler>
n - tra
<sequence name="mainSequence">
...normal activities defined here s a
no
</sequence> ) ha de
m Gui
</scope> co m ent
i b
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
BPEL includes
R l
K the compensationHandler construct to allow the definition of compensation
A
N to undo successfully completed activities in the case of a fault. Compensation handlers
logic
KOare associated with Scope and Invoke activities. A compensationHandler may contain
only a single activity, although that activity can be a Sequence or a Scope, either of which
may contain multiple activities. A compensationHandler specifies how to undo or
compensate the result of the particular activity with which it is associated. A
compensationHandler may run only after its parent activity has completed normally.

Oracle SOA Suite 12c: Build Composite Applications 8 - 29


Invoking Compensation

The CompensateScope activity


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

names a specific Scope whose


compensation handler is to be run. catch

Compensation
compensateScope
Handler

catch

compensateScope
a ble
Compensation
f e r
Handler
ans
n - t r
catchAll
a no
h a scompensate

m Gu ) i d e
The Compensate activity resultsc in o
i b
the execution of all compensation
m ent
in Scopes.
handlers for all completed
@ S tud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R K l
BPEL provides two ways to trigger compensation handlers. The first of these is the
A
KON Compensate activity. This construct is used within a faultHandlers (within a Catch or a
CatchAll) or compensationHandler element. The Compensate activity causes
compensation of all Scopes immediately enclosed within the Scope (or process) that contains
the fault handler or compensation handler with the Compensate activity. This compensation
occurs in the reverse order of completion of the Scopes.
<compensate/>
The Compensate activity requires no property configuration.
The second way to trigger compensation handlers is by using the CompensateScope activity.
The CompensateScope activity enables compensation for one specified Scope or Invoke
element enclosed within the Scope that contains the handler with the CompensateScope
activity. Like the Compensate activity, the CompensateScope activity is used within a
faultHandlers (within a Catch or CatchAll) or compensationHandler element.
<compensateScope name="CompensateScope1" target="myScope"/>
The CompensateScope activity has two properties: the name (which may be arbitrary), and
the target, which specifies the name of the scope whose compensation handler should be
executed.

Oracle SOA Suite 12c: Build Composite Applications 8 - 30


Quiz

A compensationHandler provides a mechanism for undoing


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

or compensating the result of all completed activities in a


business process.
a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
Answer:
A Rb
N
KOFalse. A compensationHandler specifies how to undo or compensate the result of the
particular activity with which it is associated.

Oracle SOA Suite 12c: Build Composite Applications 8 - 31


Agenda

Faults: Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Managing Faults in Mediator


Fault Handling in BPEL
Compensation in BPEL
The Fault Management Framework
Faults in Enterprise Manager le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 32


Fault Management Framework: Overview
The Fault Management Framework
provides error handling that is
external to the SOA composite, and Fault
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

does not impact the Mediator or Management


The fault policies
BPEL design or run time. Framework
file defines faults,
conditions, and
actions.
Actions include:
Composite Application Retry
Possible Fault Human
Faults Policies intervention
Mediator BPEL Terminate
a ble
f e r
an s
n - t r
a no
Fault h a s
) ide
The fault bindings file associates
fault policies with a composite o m
Bindings u
application, component, or
m c nt G
service reference. b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K JSuite 12c e
licprovides
OracleRSOA a generic Fault Management Framework for handling faults in
N A
composite applications that contain Mediator and BPEL components. The purpose of the
KOFault Management Framework is to provide error handling that is external to SOA and does
not impact the SOA or BPEL design or run time.
The framework is implemented by using policies defined in XML. These policies are reusable
across composites and components, and can catch both runtime and business faults. When a
fault is caught, the policy defines actions that can be used for the SOA instance such as retry,
human intervention, replay scope, rethrow fault, abort, and custom Java actions. When
human intervention is used, Enterprise Manager provides a GUI for managing the faulted
instance.
User-defined fault policies are defined in a fault policy file that can be associated with the
component or an activity. The policy file defines faultPolicy entries with conditions and
related actions. The binding file associates a policy with a composite application, a
component, or a reference.
When the policies have been defined and bound to composites and/or components, the
framework intercepts the fault before the standard fault handler comes into play. For example,
if a BPEL process has defined standard BPEL fault handling and a fault policy is defined or
bound to the BPEL process, when a fault occurs, the framework intercepts the fault, allowing
any of the supported actions to be applied to the instance.

Oracle SOA Suite 12c: Build Composite Applications 8 - 33


Fault Management Framework and BPEL
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The Fault Management


Request Framework catches all faults
Receive
(business and runtime) for
invoke activities.

Fault returned
client Invoke partner

a ble
f e r
a n s
The Fault Management n -t r
o
Reply
Reply
Framework eliminates
need to code s a n the
each invoke
)
activity hforaeachdpossible
e
m condition.
ofault u i
m en c t G
i b
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
If a fault K during
occurs l runtime in an Invoke activity in a process, the framework catches the
NAand performs a user-specified action that is defined in a fault policy file that is associated
Ofault
K with the activity. If a fault results in a condition in which human intervention is the prescribed
action, you perform recovery actions from the Oracle Enterprise Manager Fusion Middleware
Control Console. The Fault Management Framework provides an alternative to designing a
BPEL process with excessive error handling for Invoke activities.

Oracle SOA Suite 12c: Build Composite Applications 8 - 34


Fault Management Framework and Mediator
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Mediator

fault
Routing Rule
returned

a ble
f e r
an s
n - t r
The Fault Management
Framework can catch faultsa no
a s
returned by services, and those
h
o m )
u ide
encountered internally, such
duringas

m c nt G
message transformation and
other mediator activities.
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
OracleR K J provides
Mediator lice sophisticated error-handling capabilities that enable you to
O NA an Oracle Mediator service component for error occurrences and corresponding
configure
K corrective actions. Error handling enables an Oracle Mediator to handle errors that occur
during the processing of messages and also the exceptions returned by outside web services.
You can handle both business faults and system faults with Oracle Mediator.
Business faults are application-specific and are explicitly defined in the service WSDL file.
You can handle business faults by defining the fault handlers in Oracle JDeveloper at design
time. System faults occur because of some problem in the underlying system, such as a
network not being available. Oracle Mediator provides fault policybased error handling for
system faults.

Oracle SOA Suite 12c: Build Composite Applications 8 - 35


Defining a Fault Policy Document
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

1
Define a Fault Policy Document.

a ble
f e r
ans
n - t r
a no
Select the name of the fault.
h a s
o m )
u ide
2
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i cedocument, perform the following steps:
A R
To define a fault policy
N
O1. In JDeveloper, select File > New > From Gallery. In the Categories pane of the New
K Gallery dialog box, select SOA Tier > Faults. In the Items pane, select Fault Policy
Document and click OK.
2. In the Fault Policies editor, name the policy and specify the Fault Name from the drop-
down list.

Oracle SOA Suite 12c: Build Composite Applications 8 - 36


Specifying a Default Action

Specify the default action


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

to take in response to the


raised fault.

a b le
f e r
an s
n - t r
2
a no
h a s
Edit the properties of o m )
u ide
the chosen action. m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce a default action, perform the following steps:
A R
To specify and configure
N
O1. Select the desired action from the Default Action drop-down list. This defines what
K action or actions the policy will take when activated. On the Actions tab (not shown),
highlight default-retry. Click the Pencil icon to edit the action.
2. In the Properties pane for the selected action, configure the parameters for that action.
The fault-policies.xml file is created in the project under the SOA folder.

Oracle SOA Suite 12c: Build Composite Applications 8 - 37


Defining Fault Bindings
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
2 f e r
an s
n - t r
a no
Associate the policy with h a s
the desired component,
o m )
u ide
reference, or service.
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
J
K policies
To bindRthe ltoicaecomposite application, or a component within a composite
NA perform the following steps:
Oapplication,
K 1. On the Composite Editor toolbar, click the Edit Composite Fault Policies icon. The
Composite Fault Policies screen is displayed. Here you can associate fault policies with
the composite or the components therein.
2. In the Composite Fault Policies dialog box, select the policy from the drop-down list to
the right of the desired component.

Oracle SOA Suite 12c: Build Composite Applications 8 - 38


Quiz

The Fault Management Framework is external to the SOA


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

composite and does not impact the Mediator or BPEL design or


run time.
a. True
b. False

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i c e
ARa
Answer:
N
KOTrue. The Fault Management Framework provides error handling that is external to the SOA
composite and does not impact the Mediator or BPEL design or run time.

Oracle SOA Suite 12c: Build Composite Applications 8 - 39


Agenda

Faults: Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Managing Faults in Mediator


Fault Handling in BPEL
Compensation in BPEL
The Fault Management Framework
Faults in Enterprise Manager le
r a b
s f e
- t r an
non
s a
h a
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 40


Recovering Faults with Enterprise Manager
Fusion Middleware Control
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Some faults can be recovered


by using Enterprise Manager
Fusion Middleware Control from
the composite application home
page or a Flow Trace page.

a ble
f e r
an s
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
OracleREnterprise lice Fusion Middleware Control provides access to fault information
K J Manager
O NA
and fault-management capabilities during runtime operations. Each composite application
K home page provides ways for you to search for, view, manage, and act on recoverable faults.
A composite application instance Flow Trace page also provides quick access to fault
information for management when using Enterprise Manager Fusion Middleware Control.
In addition, component-specific home pages (not shown in the slide) also provide ways for
you to search for, view, manage, and act on recoverable faults.
Note: Not all faults are recoverable. For example, in Mediator components, fault policies
apply to parallel routing rules, not sequential routing rules. For sequentially processed routing
rules, a fault is returned to the caller who is responsible for handling the fault. If the caller is an
inbound adapter, rejection handlers can be defined to manage the (rejected) error messages.

Oracle SOA Suite 12c: Build Composite Applications 8 - 41


Accessing a Recoverable Fault

Scenario: An asynchronous BPEL process


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

invokes a service that is not available.


Solution: Start up the unavailable service
and retry on the Enterprise Manager
Fusion Middleware Control pages.

a ble
f e r
an s
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce shows the Flow Trace for a composite application that executed a
R
The example
Aprocessin the slide
N
BPEL called SimpleBPEL, which encountered a fault condition. In this case, the
KOSimpleBPEL process attempted to invoke a service that was not available.
After initiating a test of the composite application that contains the SimpleBPEL process, the
fault seen in the screenshot was encountered. Because of the fault policies associated with
the composite application, the human intervention action was applied. This enables the SOA
administrator to recover the fault by using Enterprise Manager Fusion Middleware Control.
The administrator must first locate the composite application instance in which the fault
occurred, and click the instance link to navigate to the Flow Trace page shown in the slide.
If a fault is recoverable, a Recover link is visible in the table containing the list of faults and the
error messages. To proceed with recovery, click the Recover link. This opens the Faults
tabbed page of the component in which the fault occurred (see the next page, titled
Recovering a Fault Condition, for an example) where you begin to examine the details of the
cause and take corrective action.
Note: You can also click the SimpleBPEL instance link under the Trace tree, and click the
Faults tab on the SimpleBPEL component instance page.

Oracle SOA Suite 12c: Build Composite Applications 8 - 42


Recovering a Fault Condition

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

Select a fault with a Recoverable indication.

Recover.

a ble
f e r
ans
n - t r
a no
3 h a s
o m )
u ide
Select recovery action
details.
m c nt G 2
i b d e
@ in Stu Take corrective action.

j a i n t h is
a r k s e
n
ko e to
Copyright 2014, uOracle and/or its affiliates. All rights reserved.
(
J AIN icens
R
After you Khave located l the instance page for a component that has incurred a fault condition,
O NA
you can click the Faults tab to view the fault information. The fault information may or may not
K provide sufficient details to determine the cause of the fault and help you to make a decision
about what action to take. In the example in the slide, the SimpleBPEL process attempted to
invoke a service that was not available. The fault policy definition included an action that
requested human intervention. Human intervention actions are visible in the page section that
is displayed when you click the recoverable fault in the Faults section. As shown in the slide,
to recover from the service unavailable scenario, perform the following steps:
1. On the Instance for the component page, click the fault entry with the Recoverable
status. This causes the instance page to be split into two sections. The top section
contains the fault information, and the bottom section provides a set of recovery options.
2. Take corrective action to fix the source of the problem. In this case, the unavailable
service is started again.
3. Return to the Instance for the component page. Select and enter appropriate values to
implement the human intervention actions. In the example, the invoke operation is
retried by selecting the Retry option from the Recover Action drop-down list, entering a
suitable payload in a selected variable (inputVariable), and clicking Recover.

Oracle SOA Suite 12c: Build Composite Applications 8 - 43


4. After clicking Recover, a Confirmation window is displayed. Click Yes to continue.
5. After clicking Yes in the Confirmation window, wait for the action to be performed and for
an Information window to be displayed indicating whether the recovery action was a
success or not. In this example, it is successful.
6. On the Instance for the component page, the recovered fault is removed from the list of
faults.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Note: If the Retry recovery action is successful and you selected a fault policy action derived
from the fault policy file, such as my-java-handler, from the After Successful Retry drop-
down list, the selected fault policy action is executed.
The slide shows the different recovery action options that you can select on the recovery
page. The self-explanatory recovery actions are:
Retry, to retry the activity
Abort, to terminate the instance
Replay, to throw a replay scope exception. All activities in the scope are executed
a ble
again. f e r
ans
t r
Rethrow, to rethrow the exception. In this case, you delegate exception handling back to
n -
the instance.
a no
h a s
Continue, which continues the instance as if normal processing took place by marking
the activity as a success
o m )
u ide
c nt G
Note: You can also modify the instance variable information that is available (in scope) to the
m
b
ni Stude
faulted activity. This can be useful if data must be corrected subject to operation policies and
i
j a in@ this
constraints. Therefore, you have a wide range of options. The choice of action selected
depends on the fault condition and if appropriate corrective action can be taken.
a r k se
( kon e to u
J AIN icens
RK l
N A
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 44


Summary

In this lesson, you should have learned how to:


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

Describe basic fault handling and propagation


Explain fault management for synchronous and
asynchronous services
Modify a WSDL operation to have a fault message
Manage faults with Mediator components
Throw and catch faults in a BPEL process r a ble
n s fe
Describe the Fault Management Framework -tra on
a n
a
h de s
)
c om t Gui
i b m en
@ in Stud
j a in this
a r k s e
n
ko e to
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
RK l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 45


Practice 8-1 to 8-4 Overview

You first deploy a synchronous BPEL


process (provided) that mimics processing
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

of training course enrollment requests


both seat reservations and payment
information. Under certain circumstances,
the process will return a fault.

a ble
f e r
an s
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce a fault to its client, as opposed to handling it internally. This is
N ARas propagating a fault. For synchronous operations, the Reply activity is used to return
A BPEL
known
process can return
O
K the fault. To return a fault to the process client, perform the following steps:
1. Define the business fault in the process WSDL for the synchronous process operation.
This includes associating the fault with the correct message structure.
2. Terminate the BPEL process with a Reply activity that is configured with the Fault
QName of the business fault that is defined in the WSDL.
The BPEL element syntax of a Reply activity that returns a fault in a synchronous interaction
is:
<reply name="ReplywithBusinessFault
partnerLink="client"
portType="client:CatchRtFaultBPELProcess"
operation="process"
variable="businessFaultVar"
faultName="client:CreditCardInvalid"/>

Oracle SOA Suite 12c: Build Composite Applications 8 - 46


Practice 8-1 to 8-4 Overview

You then build the BPEL client that will call


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

the training booking service. You invoke the


service to reserve a seat in the class, and
then invoke it again to process payment
information.

a ble
f e r
an s
n - t r
a no
In anticipation of building error

h a s
handling, you enclose both

ide
invocations in a scope, and
m ) then enclose the enrollment
o
c nt G u
invocation in a second (nested)
b m scope activity, shown here by

i ni Stude the red dashed line.

j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i ce
A R
N
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 47


Practice 8-1 to 8-4 Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
an s
n - t r
a no
You addh aa
s to the outer
m
Scope, ) which willidbeeinvoked if a specific
Catch element
You add a compensation handler to the
c ofault G u by BookingService.
is returned
nested Scope that will reverse the seat
b m The e t
nCatch element will include a
assignment when invoked.
i d
in Stu compensation handler.
CompensateScope to invoke the

i n @ is
r k j a t h
n a u s e
( ko e to
Copyright 2014, Oracle and/or its affiliates. All rights reserved.

J AIN icens
R K l
NA
KO

Oracle SOA Suite 12c: Build Composite Applications 8 - 48


Practice 8-5 Overview

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

fault-policies.xml

fault-bindings.xml

sayHello
a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
In this R
practice, ice a fault policy with the Fault Policy wizard and associate the fault
K J you ldesign
NAwith the fault policy binding file. You are provided a pair of composite applications that
Opolicy
K interact, but do not (yet) have any fault policies associated with them.
The SayHello project is the classic Hello World project. It concatenates the string Hello and
an input string that is received as part of the project invocation. The CallGreeting
[asynchronous] project accepts an input string that you provide, and then passes that string
when it invokes SayHello.

Oracle SOA Suite 12c: Build Composite Applications 8 - 49


Practice 8-5 Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
K J l i e
cSayHello.
A R
You shut down project When project CallGreeting attempts to invoke the service, a
N fault is raised. To manually recover the fault, in Enterprise Manager, you examine the
remote
KOFlow Instances for project CallGreeting. When the Recovery Required link is displayed, you
are provided the options to Retry or Abort.
After restarting project SayHello, you select Retry, and observe that the Flow Trace is
updated, indicating the completion of the instance.

Oracle SOA Suite 12c: Build Composite Applications 8 - 50

Вам также может понравиться