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

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 II
D84361GC10
Edition 1.0 | November 2014 | D89148

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

Implementing Human Workflow


and Notifications
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 human task concepts


Explain the human task component
Design a human task
Invoke a human task from a BPEL process
Interact with the Worklist application to act on tasks le
r a b
Add email notification to a BPEL process f e
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
lesson, licehow to:
K J you learn
A
KON Implement a human task component that specifies a simple approver assignment and
routing policy
Include notifications to approvers that they must act on a manual approval task that has
been assigned to them
Send email notification messages to customers to inform them about the status of their
order
This lesson discusses the human workflow concepts and the creation and configuration of the
human task components. You learn how to orchestrate a human task from a BPEL process
component. You also learn how to generate ADF task forms. These forms control the visual
appearance of order information in the notification email message and the Worklist
application. The Worklist application is used by the approvers who are assigned the task of
manually approving the selected orders.

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


Agenda

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

The Worklist Application


Notifications

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 9 - 3


Human Tasks: Introduction

BPEL The
TheBPEL
BPELactivities
activitieswe
weve
have
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

visited
visited
thus
thus
farfar
represent
represent
the
execution of BPEL code or
service invocations.

a ble
f e r
an s
n - t r
a no
h a s
m ) contrast,idaetask in a human
In
c o G
workflow urepresents the work
b t
m enthat needs to be done by a
i
in Stud person (user, role, or group).
@
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
l to as work items. Each task is associated with parameters that
areKalso referred
Tasks R
NA the nature and data related to the task.
describe
O
K

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


Human Tasks: Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Users or participants access


task data and perform tasks
Tasks can be invoked through the Worklist application.
asynchronously by application
clients or from BPEL.

initiate parameters

client receive task


a ble
f e r
an s
n - t r
Task parameters are either
a no
simple data types, or XML
h a s
) ide
formats, described with an XSD.
o m u
User information is typically
m c nt G LDAP
retrieved from an LDAP server. i b d e
@ 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
A human l
Kworkflow supports the declarative assignment and routing of tasks. In the simplest
A
N a task is assigned to a single participant (user or group). Often, more complex task
Ocase,
K assignment and routing are required. For example, tasks that follow an approval pattern may
require the task to be routed up a management chain, or worked and voted on by a group of
people. This requires some form of routing policy definition.
A participant is a user or set of users specified in the assignment and routing policy definition.
For example, a vacation request (task) is assigned to a manager (participant). The manager
must act on the request task before the vacation starts. When the manager formally approves
or rejects the request, the employee is notified of the decision. The notification can be an
email, voice message, instant message, or a short message service (SMS) message.
The Worklist application enables task assignees to view their assignments and act or route
the task as defined by the policies. The Human Task Editor tool enables you to specify task
settings such as task outcome, payload structure, task participants, assignment and routing
policy, expiration and escalation policy, and notification settings.

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


Human Task Service Component

Human Task Service Component


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

BPEL Task Definition


Oracle
Roles BPM
and Worklist
Assignments

Portals
Service Deadlines Client
Interface and Interface Email and
Escalations
RSS
a ble
Clients
f e r
n
Phone
a sand
Presentation r
n-t Notification
Other

a no Channels
h a s
o m )
u ide
m c Directory
Identity
n t G
b
ni (for de LDAP)
example,
i 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 processes require human interactions with the process. For
N AR humans may be needed for approvals, exception management, or performing
Many end-to-end
example,
business

KOactivities that are required to advance the business process. The human task service
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 activity)
Presentation of tasks to end users through a variety of mechanisms, including a Worklist
application (Oracle BPM Worklist)
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 9 - 6


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

Human tasks can be created in a


composite application as stand-alone
components exposed as a service.

a ble
f e r
an s
n - t r
a no
h a s
They can also be added to
a BPEL process as part of o m )
u ide
an orchestrated interaction. 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 a composite application is associated with a BPEL process and is
N AR as part of the business process flow. However, a human task can also be added as
Typically,
integrated
a human task

KOa stand-alone component. A stand-alone human task component is useful when there is no
need for automated activity in the application. In this case, the client application creates the
task itself by interacting with the operations that are exposed from the human task
component.
At run time, the business logic and processing rules of the human task service component are
executed by the human workflow service engine. All human task service components,
regardless of the SOA composite application of which they are a part, are executed in a single
human task service engine on their deployed platform.

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


Adding a Human Task to a Composite Application
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Double-click the
component to display
the task editor.
Select Expose as a
SOAP Service to expose
the task to clients of the
composite application.
The configuration is
stored in a .task file. a ble
f e r
an s
n - t r
Tabs on the left side of
the editor provide access a no
to categories of
h a s
configuration parameters.
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 cecreate a human task component in the composite. During creation, if
A R
In the Composite Editor,
N
you select Create Composite Service with SOAP Bindings, the human task is exposed to the
KOclients of the composite application. These clients interact with the human task service by
using its operations and associated message structures. Whether the component is exposed
or not, it can be associated with a BPEL process component.
Configure the task details (such as outcomes) and data for the parameters. These task detail
settings are saved to an XML file in the project with a .task extension that maintains the task
metadata. The human task metadata (.task) file stores workflow pattern configuration data,
including:
Task details, such as title, payload, and other properties
Routing slip configuration to specify:
- The task flow: Simple, sequential, parallel flow, ad hoc workflow, and For Your
Information (FYI) tasks. An FYI task is a notification scenario that does not require
the task assignee to perform any action on the task information.
- The assignment and routing policy (assignment of a task to a user, group, or role;
static or dynamic assignment; rules based on task outcome or payload content and
title)
- The escalation, renewal, and expiration criteria

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


Configuring the Human Task

The human task configuration is


stored in a .task metadata file
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

that is deployed with the project.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
The configuration options
m c nt G
are organized into
categories. in
i b de
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 cetask component in the SOA composite application or a BPEL process,
N
the AR file is opened in the Human Task Editor, where you can configure task parameters
After creating
.task
a human

KOand properties. The editor enables you to configure settings that are organized into sections,
including:
General: To specify the task title, description, task outcomes, task category, task
priority, and task owner. Many of these can be literal values or dynamically determined.
Data: To define the task parameter structures (types) that are included with the task
payload that is sent to the task management service. Task parameters can be displayed
and modified in the Worklist application.
Assignment: To assign participants to the task and create task routing policies for the
workflow definition
Deadlines: To specify the expiration duration of a task
Notification: To create and send notifications when a user is assigned a task or
informed that the status of the task has changed

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


Configuring the Task Outcomes

Configure possible outcomes


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

from a list, or define your own.


Specify a default outcome.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
m c nt G
Set a priority for the task. 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 title for the task, a priority, a task owner, and a comma-
N AR list of outcome strings. The default outcomes are APPROVE and REJECT, but
General task
separated
details include

KOthese can be modified.


1. Click the magnifying glass icon next to the Outcomes field.
2. In the Outcomes dialog box, select options from the list of seeded values. To create
additional outcomes, click the Create (green plus symbol) icon.
3. In the Add Custom window, enter a string for the custom outcome and click OK. The
new outcome is added to the list.
4. Select the desired values and click OK.

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


Adding Human Task Parameters

Task parameters can be simple


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

data types or XML elements


described with an XSD.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
The Editable via worklist check box
enables users to modify the task m c nt G
parameters in the Worklist application. ini
b de
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 e
cthe
A R
Task parameters form structure of information passed to the Task Service. If you generate
aN
Task Form with the information included, task parameters can be displayed in the Worklist
KOapplication so that a task assignee can view and optionally modify the data.
To add a task parameter, perform the following steps:
1. Click the Add Task Parameter icon (the plus symbol) in the Parameters section.
2. In the Add Task Parameter dialog box, perform either of the following:
- Select the Type option to browse for a desired type, and then enter the parameter
name.
- Select the Element option to browse for an XSD element. In this case, the
Parameter Name field is set based on the chosen element name.
3. Click OK.
To allow the assignee to modify task parameter values in the Worklist application, select
Editable via Worklist. Changes made to the task parameter data are returned to the BPEL
process in the task payload along with the task outcome.
Multiple task parameters can be added to a task definition. Each parameter must be supplied
with values. The preceding two steps define the task parameter data structure that is passed
as the payload to the Task Service.

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


Assigning Task Participants

On the Assignment tab, you configure the


route that the task will follow. You also
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

assign
assignthe
those
participants
participants whowho
will will
review
review
and
andthose
those
whowhowillwill
receive
receive
errors.
errors.

a b le
f e r
an s
n - t r
a no
h a s
o m )
u idaesingle participant
m c nt Gor multiple participants in
Add
b
ni Stude
@ i serial or parallel.

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
On theR K
Assignment l you configure the route that the task will follow. You also assign the
tab,
NA who will review and those who will receive errors. The icons on the Component
Oparticipants
K Palette allow you to add a single participant or multiple participants in serial or parallel.
The choices are:
Single: Specifies that any single person from a list can action the task. The task
completes when any of the assignees actions the task.
Parallel: Specifies when multiple users, who are working in parallel, must act
simultaneously on the task. Completion depends on a voting percentage specified, or
setting a majority or unanimous vote.
Chain: Specifies a list of participants for a workflow to act on the task in sequence
FYI: Specifies that a task is sent to a user for notification purpose. The business process
does not wait for a user action. An FYI task does affect the task outcome.
To add the desired participant type, drag the appropriate icon onto the stage in the central
canvas. The Add Participant Type window is displayed.

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


Configuring Task Participants

Build a list of participants


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

based on different criteria.

a b le
f e r
an s
n - t r
a no
h a s An LDAP application

m ) i d e
typically serves as the

co nt G u source of participant

i b m e information.

@ 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
Click the Add icon inl the Participant list section. Select to add a user, a group, or an
K
O NA role. The Identity Lookup window opens. This window enables you to look up the
application
K user, group, and application role names that are configured in an identity server, such as an
LDAP server.
In addition, you can select to build a list of participants by using different strategies, such as:
A static list of names, or a list that is dynamically populated by using an expression
A management chain that enables definition of the starting assignee and the number of
levels to process up the management chain to a specified top assignee
Rule-based, in which business rules determine the list of assignees based on conditions

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


In the example, the LDAP server connection is associated with the Oracle SOA Suite
Manager Server instance in WebLogic, which provides an embedded LDAP server. The steps
to select a single user include:
1. Selecting (or creating) an application server connection. On successful connection, the
realm is populated. By default, there is only one realm.
2. To add a user, you can select the username (or other LDAP field entries, such as first
name) to which the Search pattern is applied, and click the Lookup icon to populate the
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Search User list.


3. From the Search User list, select one or more entries and click Select to move them to
the Selected User list.
4. Click OK to add the selection to the participant row in the Add Participant Type window.
Note: After selecting a user in the Search User list, you can click Hierarchy to display that
users manager hierarchy. Click Reportees to list those users who report to that user. Double-
click an entry to view additional details about each user.
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 9 - 14


Configuring the Stages of a Task
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 you configure the assignees to whom the task is routed and
N ARhow the task is routed to those assignees. When you first display the Assignments
In the Assignment
specify
section,

KOsection, you are provided with a single stage and no participants. In simple terms, assignment
and routing comprise:
Stages, which organize the approval process for a block of participant types
Participants, who are created by using an editor (a participant list builder). The
sequence in which the assignees are added indicates the execution sequence.
Assignments and routing can be structured in complex ways with multiple stages, with each
stage having its own collection of participants (assignees) to whom the task can be assigned
depending on routing policy settings. As shown in the slide, you can add additional stages
that are processed in serial, in parallel, and by using a combination of both.

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


Configuring Expiration and Escalation Settings

Options provide a fixed duration in days,


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

hours, and minutes, or a period calculated


by using an expression.

Renew after sets the


number of renewals.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
Escalate after sets the number of m c nt G
b
ni Stude
i
levels and the highest approver title.

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 the Deadlines section of the Human Task Editor include:
A R
The options that are available
N
KO Never Expire: The task remains in the system until acted on by a participant.
Expire after: A period can be determined as a fixed number of days, hours, and
minutes, or as a dynamically calculated period based on an expression.
Renew after: The expiration period is extended when a participant does not respond
within the specified time period. You limit the number of renewals before final expiration.
Escalate after: A task is escalated up a management chain by a specified number of
levels if a user does not respond within the time period specified.
Note: An expiration duration set in the Limit allocated duration to field, for a participant type
level, takes precedence over the settings specified in the Deadlines section (routing slip
level).

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


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

Notifications are sent


through channels such as
email, voice message,
instant message, and SMS.

Notifications are sent to different types


a ble
of participants for different actions.
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 R
Notification settings determine when a user is assigned a task or informed that a task status
Nchanged. Notifications are sent through channels such as email, voice message, instant
has
KOmessage, and SMS. Notifications are sent to different types of participants for different actions
based on the settings selected in the Notification Settings section.
Three notification settings are configured, each with a default message:
Assign: When the task has been assigned
Complete: When the task has been completed
Error: When there is a task error
To configure or change notification settings, perform the following steps:
1. Click the Add icon to create additional notification row entries.
2. Select the task status for the notification.
3. Select the recipient for the notification.
4. Configure the notification message based on an expression.
5. Configure the reminder options.
Note: The Make notification actionable check box enables actions to be performed through
email notifications.

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


Adding a Human Task to a BPEL Process

Use the configuration dialog box


to relate BPEL variables to the
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

task input and output values.

a ble
Double-click the human f e r
task activity to open the an s
configuration dialog box. n - t r
a no
When the configuration dialog box h a s
is closed, an <if> activity is
o m )
u ide
created to process each of the
m c nt G
possible outcomes of the task. 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 a BPEL process, add a human task activity to the process flow.
R
To create
Athe a human task
O N
When Create Human Task window opens, select an existing task definition or create a
K new human task. After you click OK, a .task file is created and opened.
Configure the human task properties by selecting an XML element from a BPEL variable
whose type is compatible with the task parameter definition. The source of data can be an
XML fragment, an expression, or a partner link.
The following components are created in the BPEL process:
A partner link for the human task service
A Scope containing the activities that assign task parameters to the variable, invoke the
task service, and wait for the task outcome in the response
An If activity containing an <if> branch for each outcome specified in the .task file.
You can add additional activities to these branches to implement the process activities
that are needed to manage the returned outcome.

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


Expand the taskIf activity and configure the task outcome branches. The number of
branches that exist depends on the number of initial outcome values specified in the Create
Human Task window. For example, the REJECT case, APPROVE case, and ELSE branches
are created by default.
For each outcome branch, you can modify or remove the existing CopyPayloadFromTask
Assign activities, and add any additional activities that are required to perform the processing
that is needed for each outcome.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

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

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 9 - 19


Quiz

A human task can be used only by a BPEL process


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

component.
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
KOA human task can be used as a stand-alone component within a composite application, and
any of its operations can be invoked as a service if its WSDL interface is exposed as a
service. Mediator components can be wired to a human task for sending messages in a For
Your Information (FYI) task scenario. For more complex human workflow patterns, it is more
common to use a human task from the context of a BPEL process.
Note: The FYI task is a form or notification that does not require the task assignee to perform
an action when receiving the task information.

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


Agenda

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

The Worklist Application


Notifications

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 9 - 21


Task Display Forms

Task display forms are:


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

Designed to display and optionally modify task information


supplied as parameters to a human task in a composite
application
Generated as JavaServer Page XML (.jspx) files by
using:
The human task activity in a BPEL process component
r a ble
The ADF Task Flow Based on Human Task item in the n s fe
JSF
a
category of the New Gallery window n-tr 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 Worklist application users with a way to view and optionally modify
R
Task display
Adata. forms provide
N
task The Oracle BPM Worklist application displays all tasks assigned to a user logged in
KOas the task assignee. When a task assignee clicks an assigned task, a task display form
appears to show the task information. However, if the composite application that contains a
human task component is not deployed with a task display form, the task information details
are not displayed.
Oracle Application Development Framework (Oracle ADF), which is integrated with Oracle
JDeveloper, enables you to design task display forms that display task information and the
parameters received from a human task in a SOA composite application.
ADF-based task display forms can be generated from the human task activity in a BPEL
process or created by using the ADF task flow based on a human task item in the JSF
category in the New Gallery window.
Advanced users can design their own task display forms by using ADF data controls to lay out
the content on the page and connect to the workflow service engine at execution time to
retrieve the task content and act on tasks.
Note: Before creating task flow forms, change the encoding preference to UTF-8 in the
JDeveloper Tools > Preferences > Environment settings.

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


Generating a Task Display Form
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
Task parameters obtained
m c nt G
from a task payload definition 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
cincludes
A R
If the SOA composite a human task, you need a way for users to interact with the
N The integrated development environment of Oracle SOA Suite includes Oracle ADF,
task.
KOwhich enables you to design a task display form that depicts the human task in the SOA
composite.
A task form is a Java Server Page XML (.jspx) file that defines how a task payload (from
task parameters) is displayed in the Worklist application. When you create an ADF task flow
based on a human task, you must select a task metadata file to generate the data control.
This data control is used to lay out the content on the page and connect to the workflow
service engine at execution time to retrieve the task content and act on tasks. A task form can
be auto-generated for a simple interface that contains task parameters, or you can generate a
custom task form. The example shows the steps to auto-generate a simple task form:
1. Right-click the human task activity and select Auto Generate Task Form.
2. In the Create Project window, enter a new project name, such as ApprovalTaskForm,
for the ADF task form application files, and click OK.
Note: The Directory field is automatically populated and can be changed by entering or
browsing for a directory name.
3. (Optional) Modify the task form, save any changes, and close the JSP tabbed page.

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


Deploying Task Display Forms
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
Task flows can be deployed
with their related composite m c nt G
b
ni Stude
applications. 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 deploy e
lictask
BeforeRyou the display form files, the composite application that utilizes them
A
N already be deployed.
should
KO After deploying the composite application, you can deploy the task display forms by right-
clicking the Application menu and selecting the Deploy option. When you create a generic
project and add the ADF task form based on human task files, a deployment profile is created
for the project and for the application workspace in which the project resides. Using the
Application Menu Deploy option deploys the EAR file that is identified by the projects
deployment profile in the Application Properties, instead of the Project Properties.
Note: The Oracle SOA Suite 12c server automatically associates the task display form URI
with the human task for which it was generated.

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


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

Access the Worklist application at


http://host:port/integration/worklistapp.

a ble
f e r
an s
n - t r
By default, the Oracle WebLogic Managed server a no
h a s
instances have an embedded LDAP server, which can
m )
be used for authentication and authorization.
o u ide
LDAP
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 application is a web application that is installed with Oracle SOA
R
The Oracle
A12c BPM Worklist
N
Suite components. To access the Worklist application, use the following URL:
KOhttp://host:port/integration/worklistapp.
The Worklist application login page is displayed. Log in to the application with a username
that is authorized to use the Worklist application.

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


Viewing and Acting on Task Information
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Task information is visible


if task display forms are
a ble
deployed with the
f e r
composite application.
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 ceWorklist application, they can view the task assignments, work
N ARand task parameter information by selecting the specific task.
After users
queues,
log in to the

KO The Worklist application provides a default webpage with task information, excluding task
details. By using Oracle JDeveloper to generate task display forms, you can view task details,
which are rendered in the browser. The task display form can also render an Action menu and
buttons. The action for an assigned task can be completed on either of the following:
The Worklist application page that contains the task information
The task form that displays the task parameter details. If the task parameter data is
configured to be modifiable at design time, users can view and save modified values
before they perform a selected action on the page.
Note: If task data is modified, changes must be saved before applying a selected action.
In the pane that contains the list of assigned tasks, you can select a task and perform an
action that is available in the Action menu, such as APPROVE or REJECT. The action items
correspond to the task outcomes configured in the human task component metadata.
Note: If you have not generated task forms, the Worklist application does not display any
information in the bottom-right pane. However, you can still apply an action to the tasks that
appear in the Inbox.

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


Quiz

Task display forms provide Worklist application users with a


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

way to view and (optionally) modify task 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
Answer: a K
J l i ce
N
True AR
KO

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


Agenda

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

The Worklist Application


Notifications

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 9 - 28


Working with Notification Services

Web Services Java


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

interface interface
WebLogic Domain

User Messaging Server

JMS

a ble
f e r
XMPP EMAIL SMPP Extension drivers ans
n - t r
a no
h a s
o m )
u ideservers
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 tasks, notifications are often part of applications that include
N ARtasks. The notification service enables an asynchronous message to be sent to a user
Although
human
not part of human

KOby a specific channel. The message can be sent as an email message, a voice message, a
text message, or an instant message. Actionable notifications enable users to respond.
Oracle SOA Suite 12c is configured with the Oracle User Messaging Service (UMS)
application that enables composite application components (such as a BPEL process and
human task, Web Service clients, and Java applications) to send notifications through email,
voice, IM, or SMS messaging channels.
Message channels are configured with drivers that handle the sending of messages to and
receiving of messages from devices that are associated with that type of channel through an
appropriate server or channel service provider.

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


Oracle User Messaging Service (UMS)

Enables sending notification through email, voice, IM, or


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

SMS channels
Supports two-way messaging (sending and receiving
messages)
Provides user messaging preferences, enabling users to
configure how and when to receive notifications
Integrates with Fusion Middleware components through: a b le
f e r
BPEL notification activities, such as email, IM, and voice
a n s
Human workflow notifications that also provide o n -t r
actionable
messages s an
Oracle BAM alerts for monitored events) ha ide
c om 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
OracleR
UMSK enablesl two-way communication between users and composite applications. It
O NA operations that can be invoked from the BPEL business process or human task to
exposes
K send notifications through the email, voice, IM, or SMS channels. Oracle UMS is integrated
with a human workflow, enabling notification messages to be delivered for different events
and enabling actionable email messages to be implemented.
Oracle UMS supports:
Sending and receiving messages and statuses
Sending notifications to a specific address on a particular channel
Sending notifications to a set of failover addresses
The email channel is configurable out of the box. To configure additional UMS driver
channels, you need to deploy the driver JEE application EAR file and ensure that you have
access to a service provider for the type of channel driver deployed.
Oracle UMS tracks the delivery status information that is provided by messaging gateways, so
that applications can respond to a failed delivery. Applications can specify one or more
failover addresses for a message in case of delivery failure to an initial address. This
capability frees application developers from having to implement complicated retry logic.

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


Configuring UMS Notification Properties

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

a server restart.

1
3

a ble
f e r
ans
n - t r
a no
h a s
2 o m Set)notification
u i demode and email
m c nproperties t G as appropriate.
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 services are communicated through Oracle UMS components.
AR the workflow notification properties, use Enterprise Manager Fusion Middleware
The workflow
ToNconfigure
notification

KOControl and access the SOA Infrastructure page menu by performing the following steps:
1. In the Target Navigation Pane, expand the SOA folder and right-click soa-infra.
2. In the context menu, select SOA Administration > Workflow Properties.
3. On the Workflow Notification Properties page, set the notification mode to All (or Email).
Set other email properties as appropriate to your email server configuration. Click Apply.
Note: After making changes to the workflow notification properties, you must restart the SOA
server.

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


Configuring the User Messaging Email Driver

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

a b le
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 the Workflow notification properties, configure the user messaging
R
In addition
Adriver to configuring
O N
email settings to ensure that the email server and protocol settings are correctly
K specified. To access and configure the user messaging email driver settings, perform the
following steps:
1. On the Workflow Notification Properties page, click the Go to the Messaging Driver
page link. Alternatively, on the Enterprise Manager Control page, in the Target
Navigation pane, expand the User Messaging Service folder and click
usermessagingserver (soa_server1).
2. On the User Messaging Service page, click the Configure Driver icon in the User
Messaging Email Driver row entry.
3. On the User Messaging Email Driver page, enter the email driver properties and other
driver-specific configuration settings. These include mail protocols, such as Post Office
Protocol (POP3), the outgoing Simple Mail Transport Protocol (SMTP) server name, and
the incoming server name, among other settings. Click Apply.
4. After confirming the changes to be made, restart the WebLogic Managed server (SOA
server) instance.

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


Viewing and Testing Email Notifications
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
3
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
cview
A R
You can monitor and the notification activity performed by the human workflow service
N To view and test the human workflow notification activity, perform the following steps:
engine.
KO 1. In Enterprise Manager, in the Target Navigation pane, expand the SOA folder and right-
click soa-infra.
2. In the context menu, select Service Engines > Human Workflow.
3. On the Human Workflow Engine page, click the Notification tab. You can examine any
notification messages in the Outgoing Notifications and Incoming Notifications sections.
If you click Send Test Notification, the Send Test Notification window is displayed.
4. In the Send Test Notification window, you can select the notification channel type to test
(provided that it has been configured) and send a message. In the example, the Email
channel is selected for the test.
Note: The test message mechanism uses BPEL notification activities to send test messages.
The messages that are sent appear in the list in the Outgoing Notifications section. The
example message in the Outgoing Notifications section is actually from the human task of a
composite application that is identified by the WORKFLOW value in the Source column.

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


Sending Email Notification from BPEL

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

Email
notification

User
Messaging
a ble
Email Driver f e r
ans
SMTP
n - t r
IMAP/POP
a no
h a s
o m )
u ide
Email
m c ntimplemented G Email activity is
server b
ni Stude
as a scope.
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 process component provides different ways to notify users through email, IM, SMS,
NTwitter activities. The example in the slide implements email notification by:
and
KO Dragging an Email service icon into the BPEL process and configuring the details for
sending the email
Configuring the email settings provided by the email activity
The email activity parameters can be static strings or can be dynamically derived from the
data held in the BPEL process variables. Each field (except From Account) enables you to
build an XPath expression to construct its value by clicking the XPath Expression Builder icon
on its right.
Configuring the incoming and outgoing mail server information is performed on the User
Messaging Service Email Driver page in Enterprise Manager Fusion Middleware Control.
Note: An email notification may contain multipart attachments along with the message.

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


Sending a Notification
to a Users Preferred Channel
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
The user notification activity:
a no
Sends a message to a
h a s

users preferred channel
Enables additional o m )
u ide
properties to be sent
m c nt G
with the message 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 a BPEL process design in which a notification channel is
N
not AR specified during design time, and simply indicates that a notification must be
The user notification
explicitly
activity

KOsent. The notification channel used is resolved at run time based on the user preferences
defined on the Notifications tab of the Worklist application, or in the User Messaging
Preferences user interface of Oracle UMS. Therefore, the responsibility of notification channel
selection is moved from Oracle BPEL Designer to the end user. If the end user has not
selected a preferred channel or rule, email is used by default.
Note: To access the User Messaging Preference user interface as a stand-alone application,
enter the following URL: http://localhost:8001/sdpmessaging/userprefs-ui. Remember to
replace localhost and the port with values that are suitable for Oracle SOA Suite installation.

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


Quiz

Which of the following provide support for notification?


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

(Select all that apply.)


a. User notification activity
b. An OnMessage branch in a Scope or Pick activity
c. Mediator routing rules
d. Human task component
a ble
e. Email activity e r
s f
- 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 c e
ARa, d, e
Answer:
N
KOBy using the notification activity in a BPEL process, a users preferred form of notification is
used. The preferred notification channel is configured by the user on the Worklist application
Preferences Notification tabbed page.
The email activity specifically uses email to notify someone. The human task, as configured in
the .task file, provides notification through the Worklist application users preferred
notification channel or email by default.

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


Summary

In this lesson, you should have learned how to:


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

Describe human task concepts


Explain the human task component
Design a human task
Invoke a human task from a BPEL process
Interact with the Worklist application to act on tasks le
r a b
Add email notification to a BPEL process f e
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 9 - 37


Practice 9 Overview

A composite application is
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

built that includes a BPEL


process component and a
human task component.

a ble
f e r
an s
n - t r
a no
h a s
m ) Database
i d eand notification
c o tG u
external references

i b m en and email capabilities.


provide customer lookup

@ 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 9 - 38


Practice 9 Overview

A sales order file is


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

received by the process


and passed to the human
task activity.

An If activity routes the


a ble
various outcomes of the f e r
Manual Approval an s
process.
n - t r
a no
h a s Worklist
The
application

m ) review i d e
provides a chance to
u
co nt G before approving or and edit the details
m
i nib Stude rejecting the order.

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 9 - 39


Practice 9 Overview

A Database adapter is
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

invoked to query the


customer database for
email information.

a ble
f e r
ans
n - t r
An email task advises
a no
h a
their order.
s
customers of the status of

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 9 - 40


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

Sharing Functionality in Oracle SOA Suite

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

Use the design-time Metadata Services (MDS) Repository


to share files
Create and use component and project templates
Create and use inline and stand-alone BPEL
subprocesses
List the differences between templates and subprocesses rabl
e
sfe
tr a n
o n -
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 10 - 2


Agenda

Design-Time Metadata Services (MDS) Repository


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

Templates
BPEL Subprocesses

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 10 - 3


Design-Time Metadata
Services (MDS) Repository
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Share WSDL, XSD,


WADL, & XQuery Transfer to/from
other repositories.
a ble
f e r
Export and import
ans
to/from JAR files. 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 Metadata Services Repository, Oracle SOA Suite includes a file-
R
In addition
ASOA to the run-time
O N
based design-time MDS Repository for use during design time. The repository is
K automatically created when you create a SOA composite application. The default directory
location is $JDEV_USER_DIR/soamds, but the repository location can be modified to point to
another folder or version control location.
The SOA-MDS Transfer wizard enables you to share WSDL, XSD, WADL, and XQuery files
with the SOA design-time MDS Repository. This eliminates the need to duplicate these
resources across projects and applications. When artifacts are moved into the repository, all
dependencies are included and references to the transferred artifacts are updated with the
correct MDS URLs on transfer.
WADL refers to Web Application Description Language.

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


These files can then be shared with other SOA composite applications. You can:
Export selected contents of the SOA design-time MDS Repository to a JAR file
Import the contents of a JAR file to a SOA design-time (or a database-based) MDS
Repository
Transfer selected contents of one MDS Repository to another MDS Repository. There
are no limitations on the type of MDS Repository to which to transfer. For example, you
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

can transfer the selected contents of a file-based repository to a database-based MDS


Repository, and vice versa.
Browse for and select files in the SOA design-time MDS Repository. For example, the
WSDL Chooser dialog box that you access from the Create Web Service dialog box
includes a selection for the SOA design-time MDS Repository.

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 10 - 5


Quiz

When artifacts are moved into the repository, it is important to


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

manually include all dependencies and references.


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 NAWhen artifacts are moved into the repository, all dependencies are included and
False.
K references to the transferred artifacts are updated with the correct MDS URLs on transfer.

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


Agenda

Design-Time Metadata Services (MDS) Repository


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

Templates
BPEL Subprocesses

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 10 - 7


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

A complete SOA project packaged and


used to start new projects

A Service component, such as a BPEL


process, packaged for import into other
projects. All dependent components and a ble
f e r
wires are also packaged.
ans
n - t r
a no
A Scope activity of a BPEL
h a s process
that
is packaged as a custom
o m )
u idiseready for
activity in the
Components window
m c nt G and that
b
ni StudBPEL
import into other e projects
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 cepart of an Oracle SOA Suite project that you can use to create new
N ARThere are three types of templates, as described in the slide. Use templates to share
A template
projects.
is a reusable
O
K common code (subpart of a process or a scope) between applications, composites, and
processes. You create the template once, and then share it with others. The template can be
reused multiple times.
Project templates are a way of creating a SOA project instead of starting with an empty
composite. The template can include predefined components, as well as services and
references. For example, frequently used adapters and transformations can be pre-configured
in a template to eliminate the need to re-create the same components every time a new project
is created.
Component templates package one main component, for example a BPEL process, including
all references (adapters and bindings) invoked by the process. You can enforce best practices
by packaging a BPEL process with a predefined fault handler and a number of mandatory
variables as a component template and sharing it across departments. By providing this
template to all developers, you ensure a consistent way of handling faults and naming
variables.

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


Custom activity templates consist of a group of activities in a BPEL process, which can include
partner links and external services. The templates are available within the BPEL palette and
can be dragged and dropped into any BPEL process. You can, for example, package a BPEL
scope, which consists of a complex assign or transformation and the invocation of an external
web service. By sharing this scope, you eliminate the chances of introducing errors and of
course save development time through re-use.
SOA templates work in a drag-and-drop way. After they have been used, they become an
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

integral part of the application and can be customized going forward. When changes are made
to the original template, they are not reflected in the composites and components that are
created through templates.

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 10 - 9


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

Default Location

Custom Location
a b le
f e r
Create Template
an s
Wizard
n - t r
a no
h a s
m ) i d e MDS Repository
co nt G u
m
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 e
cright-click
A R
To create a template, the appropriate object and select Create Template to invoke
NCreate Template wizard. You specify a name and location for the template. The location
the
O
K can be the design-time MDS Repository, the default location in the file system, or a custom
location that you specify. After completing any additional prompts specific to the template type
selected, the template (with any dependencies) is saved to the specified location.

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


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

Select
Start from: SOA Template

Specify the
desired template.

a ble
f e r
an s
n - t r
a no
The project is
h a s
created from
the template. 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
aK
To useR
J lice in the Create SOA Application wizard, select the start type: SOA
project template,
NA Then, specify the desired template.
Template.
O
K

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


Using Service Component Templates

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

Insert a Component Template.

2
Select the specific template.

a ble
f e r
3 ans
n - t r
Review the template
information and click Finish. 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 template, right-click in the Components swimlane of the composite
R
1. To use
Aoverviewa component
N window. Select Insert > Component Template.
KO2. Select the specific template.
3. Click Finish.

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


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

a ble
f e r
ans
n - t r
a no
The component and any
h a s
4 dependencies
to the project.
are added
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
ctemplate
A R
4. When a component is used, the service component and its dependencies are
N to the project.
added
O
K

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


Using BPEL Scope Activity Templates

Add the activity from the


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

Component Palette.
1

Resolve any conflicts (if


the project references any
files that are also named
in the template).
2 a ble
f e r
ans
n - t r
a no
h
Binda s that are
any variables

o m )referenced
u dinethe template
ifound
m c nBPEL to
t G project. in the
those

i nib Stude 3
@
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
1. Scope l
Kactivity templates can be added to a BPEL process from the Component Palette.
A
2. NWhen the scope is added, you are prompted to resolve any naming conflicts (if the project
KO
references files that are also named in the process).
3. You then bind any variables that are referenced in the template to those found in the BPEL
project.

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


Quiz

Which of the following are types of templates?


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

a. SOA Project
b. Partner Link
c. Component
d. External Reference
e. Scope Activity 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
Answer:Ra, Kc,Jand elice
O NA components (such as BPEL processes), and scope activities can be packaged as
Projects,
K templates.

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


Agenda

Design-Time Metadata Services (MDS) Repository


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

Templates
BPEL Subprocesses

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 10 - 16


BPEL Subprocesses: Introduction

Are process fragments that modularize a reusable piece of


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

business logic
Can include partner links and references
Can be invoked from other parent BPEL processes
through a call activity
Do not have an interface (compares to a subroutine in an
object-oriented programming language)
r a ble
Execute completely in the context of the parent process,
n s fe
- trafault
permitting access to process variables and inheriting
n
handling and compensation logic a no
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
Copyright 2014, u
Oracle and/or its affiliates. All rights reserved.
(
J AIN icens
R K limitedl support for modularizing business process logic for reusability. The only
BPEL provides
O NA is to package reusable process logic as completely separate processes, which are
method
K utilized by the parent process (the process utilizing the reusable process logic), in a method
that is identical to using a web service (through the Invoke activity).
To address this challenge, Oracle SOA Suite provides a subprocess extension to BPEL.
A BPEL subprocess is actually not a complete process, but a fragment that modularizes a
reusable piece of business logic. This fragment can include partner links and references, and
can be invoked from other parent BPEL processes through a new call activity.
A subprocess does not have an interface like a standard BPEL process does. You can at best
compare it to a subroutine in an object-oriented programming language. At run time, it executes
completely in the context of the parent process, permitting access to process variables and
inheriting fault handling and compensation logic.

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


The subprocess extension provides the following benefits:
BPEL process code reusability, which reduces the need to create the same activities
multiple times to perform the same tasks
Code modularity
Code maintenance (changes are propagated, which eliminates the need to implement
updates in multiple places every time a change is necessary)
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Less overhead than Invoke activities


Memory footprint reduction, which can be considerable in a complex process
Notes
Subprocesses are supported only with BPEL version 2.0. There is no support with BPEL
version 1.1.
Correlation sets are not supported in subprocesses. If you create a correlation set in an
inline or stand-alone subprocess, it fails at run time.
Subprocesses cannot be shared between multiple composites. 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 10 - 18


Stand-Alone Subprocess

A stand-alone subprocess is a self-contained


snippet of process logic. All references resolve
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

to local definitions or arguments that are defined


in the partner links and variables.

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 cisenot a valid business process, but is a self-contained snippet of
N ARlogic. All references in its process snippet resolve to local definitions or arguments,
A subprocess
process
element
O
K which are defined in the partner links and variables sections of the subprocess.
Note: This contrasts with an inline subprocess, which allows unresolved references to
variables and partner links that are in-scope at the call activity.
A subprocess can converse with partners synchronously (InOut) or asynchronously (InOnly).
The partner link for these interactions can be passed as an argument from a parent process or
configured within the subprocess.
Note: For asynchronous requests, the conversation ID for the WS-Addressing or normalized
messages is set with the parent process instance ID. This enables routing of callback
messages to the correct process instance.

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


Calling a Stand-Alone Subprocess
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a b le
f e r
a n s
A call activity transfers control to the n t r
-subprocess.
There is no service invocation.
o
nArguments in the
call activity map in-scope s avariables and partner
h a
links to subprocess
argumento ism
)
passed eitheru idbyevalue or reference.
element parameters. Each

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
e
K J BPELlicprocess,
Within R
a parent a call activity transfers control to the subprocess. There is no
A
N invocation. Therefore, no inbound message activity is required to consume the
service
KO
message from the call activity, and no Reply or Invoke activity is required to return the value.
This is analogous to executing a member function; control is transferred to the implicit
subprocess scope on call activity activation, and back after scope activity completion.
There may be multiple inputs and outputs through arguments. Arguments in the call activity
map in-scope variables and partner links to subprocess element parameters. Each argument is
passed either by value or by reference, as specified in the call activity. Upon activation, the
subprocess scope is initialized with the input variables, which are set with the call activitys
arguments. Outputs are pass-by-value parameters that are written to by the subprocess.

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


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

An inline subprocess is a
subprocess embedded in
a ble
another (parent) process.
f e r
ans
n - t r
a no
Arguments in the a
variables and)partner hcallsactivity map
linkseto the inline
subprocess omelement id
uparameters. The
c
m in scope t G
i b subprocess
d e n at the time of the call.
can also refer to other

@ in Stu items

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
An inline K
subprocess l is a subprocess that is embedded in another (parent) process.
AN
A
O call activity executes the referenced subprocess code. Arguments in the call activity map in-
K scope variables and partner links to the inlineSubProcess element parameters. Arguments
can be passed by reference or by value.
The call activity transfers control to the subprocess, at which time the subprocess scope is
initialized with the argument variables. In addition to parameter passing, other visible items
(those in scope at the time of the call activity) can be referred to by the inlineSubProcess
element.
Execution is similar to the subprocess element execution model. On completion of the
subprocess, control is returned to the parent process. In the normal case, execution continues
with the next activity after the call activity. In the case of abnormal subprocess completion, the
parent process resolves the process according to the standard life cycle rules of WS-BPEL.

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


Comparing Stand-Alone and Inline Subprocesses

Stand-Alone Subprocess Inline Subprocess


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

They are available in BPEL 2.0 only.


A BPEL call activity invokes the subprocess.
They are visible in the Components window.

Is a fragment of a BPEL process that Is useful for groups of activities that are
includes a number of activities that are reused within one BPEL process
reused across other BPEL processes
r a ble
Can be called from any BPEL process in Is part of the parent BPEL process code
n s fe
the same composite and is not visible in the composite
n - traview
Does not have an interface, and can be Can be called only from a ntheo parent BPEL
called only from another BPEL process. It process. It can use
h a sthe partner
parentlinks and
can include partner links. in-scope variables ) ofid e
the process.
c om t Gu
Defines the parameters to set
i b m edefine
Can either n the parameters to set or

@ in canSuse tudparent process values


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
Stand-alone l subprocesses are both available only in BPEL 2.0. Both are invoked by
K and inline
A (extension) call activity. Both are visible in the components window in JDeveloper.
NBPEL
the
K O
Beyond these similarities, there are only differences. Stand-alone subprocesses can be called
by any number of BPEL processes within the same composite application. Inline subprocesses
are embedded within a single BPEL process, and are visible only from within that process.
Both stand-alone and inline subprocesses can include variables and partner links. The calls to
both types of subprocess can include mapping of process values to subprocess arguments.
However, inline subprocesses can also make use of any partner links and/or variables that are
in scope at the time of the call activity.

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


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

Right-click the scope


1 activity and select Convert
to a Subprocess.

a ble
f e r
ans
n - t r
a no
h a s
) ide
Assign a name, and if
2 desired, add a label and/or o m u
an image.
m Byc default,
n t G
the scope is
b 3
ni Stconverted de to a call activity.
i 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 cecreated from process scope activities. To create an inline subprocess,
N
first AR and configure a scope with the activities that will define the subprocess. To convert
Inline subprocesses
create
are

KO
the scope to a subprocess, perform the following steps:
1. Right-click the scope and select Convert to a Subprocess. The Create Inline Subprocess
dialog box is displayed.
2. Name the subprocess. Typically, you leave the Replace Scope with Subprocess Call
check box selected. This automatically replaces the current scope with a Call activity.
3. Click OK. A call activity replaces the scope in the process.
The subprocess is also displayed in the palette under Subprocesses. You can see and edit the
definition of the subprocess when switching from the Main Process to the subprocess at the top
of the BPEL editor. All partner links that are available in the main process are displayed, in
case you want to add another Invoke. Changes to the subprocess are reflected in every call.

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


Calling an Inline Subprocess

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

available from the


Component Palette.
1
Drag and drop the
subprocess onto the
BPEL process.
2

a ble
f e r
an s
n - t r
a no
h a s
m ) is ide
A call activity
c o
generated. G u
b m en t 3
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
anK
To call R l
inline subprocess, perform the following steps:
A
KO1.N Expand the Subprocesses section of the Component Palette. All available subprocesses
are displayed.
2. Drag the desired subprocess from the Component Palette to the BPEL process. A new
call activity is added to the process.
3. Configure the call activity to map any necessary values from the parent process to the
subprocess.

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


Creating a Stand-Alone Subprocess
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Right-click the Components


1 swimlane and select Insert
> Subprocess.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u i de
Name the subprocess
2 and click OK. 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 ceBPEL subprocess, perform the following steps:
A R
To create a stand-alone
N
O1. Create a SOA composite application that includes a BPEL 2.0 process. Right-click in the
K SOA Composite Editor and select Insert > Subprocess. The Create Subprocess dialog
box is displayed.
2. Enter appropriate values or accept the default values, and click OK to create the stand-
alone subprocess.

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


Creating a Stand-Alone Subprocess
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Right-click the subprocess


3 and select Edit.

a ble
f e r
an s
n - t r
4
Configure the subprocess,
adding the required logic and a n5o
variables. Save your work.
h a s The subprocess is
m ) e
id as an .sbpel
stored in the project
o
c nt G u file.
m
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
A R
3. Right-click the subprocess in the SOA Composite Editor and select Edit.
N Design the desired process logic in the stand-alone subprocess. This can include
4.
KO variables, activities, and partner links.
5. The subprocess is stored in the composite as an .sbpel file.
Notes about subprocess design:
A stand-alone subprocess can include an inline subprocess.
There is no restriction on one BPEL subprocess calling itself recursively. You must
determine if you want to recursively call the same BPEL subprocess and the number of
times the subprocess calls occur.
A stand-alone subprocess cannot be shared in the MDS Repository. However, a BPEL
process with call activities for calling the subprocess can be shared in the MDS
Repository.

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


Calling a Stand-Alone Subprocess from BPEL
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Add the activity from the


1 Component Palette.
a ble
f e r
ans
Map parent process
n - t r
2 values to subprocess
arguments. 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
To call R KJ
a stand-alone
ce
lisubprocess, perform the following steps:
A
KO1.N Expand the Subprocesses section of the Component Palette. All available subprocesses
are displayed. Drag the desired subprocess from the Component Palette to the BPEL
process. A new call activity is added to the process.
2. Configure the call activity to map any necessary values from the calling process to the
stand-alone subprocess.

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


Differences Between
Templates and Subprocesses

A template is a customizable, skeletal composite, process, or scope


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

activity. You can drag and drop a template onto a SOA composite
application or a BPEL process and make additional changes. You
essentially are copying and pasting a template. For example, if there
are 50 lines of code in a template and you copy it twice to use, the
code increases by 100 lines.

a ble
f e r
A subprocess is a BPEL code snippet that is intended for a specific a n s
n -t
purpose. A subprocess can be called and used as it is. An inline
r
o
a nprocess code
subprocess of 50 lines can be called twice and the parent
s
remains at 50 lines, and not 100. Subprocesses h
) a ebetter
perform and
om
have a smaller memory footprint than templates. u i d
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 10 - 28


Quiz

Inline subprocesses can make use of any partner links and/or


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

variables that are in scope at the time of the call activity.


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 NAAn inline subprocess can either define the parameters to set or can use parent process
True.
K values. Stand-alone subprocesses require that you define the parameters to set.

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


Summary

In this lesson, you should have learned how to:


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

Use the design-time Metadata Services (MDS) Repository


to share files
Create and use component and project templates
Create and use inline and stand-alone BPEL
subprocesses
List the differences between templates and subprocesses rabl
e
sfe
tr a n
o n -
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 10 - 30


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

You use a component


2 template in the building
of a project.

a ble
f e r
an s
n - t r
n o 3
1 s a You create and
You first import a ) a
h decall an inline
collection of templates
c o m Gui BPEL subprocess.
from a JAR file. 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
1. InR K practice,l you first import a collection of templates into the SOA Design Time
this
O NARepository.
K 2. You create a project and use a BPEL component template to accelerate the development
of the project.
3. You modify the project. These modifications include the creation and calling of a BPEL
inline subprocess.
You test the finished project.

Oracle SOA Suite 12c: Build Composite Applications 10 - 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

Using the REST 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
Objectives

After completing this lesson, you should be able to:


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

Identify the format of REST queries


List the differences between REST and SOAP
Create and test a REST binding in 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 11 - 2


Agenda

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

Using REST bindings in Oracle SOA Suite

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 11 - 3


REST: Overview

Stands for Representational State Transfer


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

Provides an alternative to using SOAP-


based web services
Incorporates the concept of resources. A
resource is similar to an object instance in
an object-oriented programming language.
Resources have data associated with them.

Resources are
a ble
typically described with
f e r
either XML or JSON.
an s
n - t r
XML
JSON resource a
Each resource has itsno
a s
own address or
h
o m )
Uniform Resource
u ide
m c nt G Identifier (URI).
b
ni Stude
i
http://<host>:<port>/soa-infra/resources/<partition-name>/relative/resource/path

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
cRepresentational
A R
REST stands for State Transfer.
N REST provides an alternative to using SOAP-based web services.
KO It incorporates the concept of resources. A resource is similar to an object instance in an
object-oriented programming language. Resources have data associated with them. The
underlying concept is that when you send a request for a resource, the resource that is
returned shows you the options for the next step. This model is very flexible, and does not
require that the client know in advance what services and service calls are available.
REST services rely on a stateless, client-server, cacheable communications protocol
and in virtually all cases, the HTTP protocol. RESTful applications use the HTTP verbs
GET, PUT, POST, and DELETE to create, update, read, and delete data.
RESTful services do not impose constraints on the data format that is exchanged. Data
can be formatted as XML, HTML, JavaScript Object Notation (JSON), and so on.
REST services themselves are often described with a Web Application Description
Language (WADL) document.

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


REST Queries

Example REST query:


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

http://soa12c.example.com/items/123

Action Method URI

Get all the items. GET /items

Get a single item. GET /items/id

Create a new item. POST /items


a ble
f e r
Edit an item. PUT /items/id ans
n - t r
Delete an item. DELETE /items/id 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
that
J
KREST lice resources (reference to data) in terms of URIs and that REST
describes
O NA nearly always use the HTTP protocol. HTTP messages include a header and a body
services
K (although the body can be empty). HTTP request messages include methods in the header to
specify an action. With this combination, REST queries use HTTP verbs and URIs to specify
actions on resources (or data).
The table in the slide lists some typical actions, and the HTTP methods and URIs that might be
used to accomplish them.

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


Comparing REST and SOAP:
Two Ways to Access Web Services
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

REST SOAP

Is an architectural style that leverages Is a formal standard for message


web standards exchange
Uses HTTP Is protocol independent

Permits many data formats Uses XML a ble


f e r
ans
Uses URI and HTTP verbs to access Uses a WSDL document to access
n - t r
resources (data) operations (business logic)
a no
Is stateless WS* standards provide
h a s support for
) e
om t Guid
stateful transactions.

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
REST is an l style, whereas SOAP is a message exchange standard. Comparing
K architectural
O NAis much like comparing apples and oranges, but in practical terms, they describe ways to
them
K access web services. As such, the table in the slide lists some features of each. These
differences in features mean that in some situations, REST offers advantages, and in others,
SOAP is the better choice.

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


Example Use Cases for REST and SOAP
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

REST SOAP
Operations with limited Operations that require
bandwidth and resources contextual information and
- Mobile conversational state
- Series of short, chatty management
conversations Asynchronous operations
a ble
Stateless operations Operations that require high f e r
levels of security and an s
reliability 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
crequire
A R
For web services that robust security, transactions, and reliability, SOAP can leverage
NWS* standards, and would typically be a better choice. However, because of its use of URIs
the
O
K and lighter-weight message formats such as JSON, REST can offer better performance and
scalability. REST is well-suited for situations such as mobile computing, which are constrained
by limited bandwidth and resources.

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


Agenda

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

Using REST bindings in Oracle SOA Suite

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 11 - 8


Supported Features in Oracle SOA Suite

Oracle SOA Suite provides the following REST support:


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

Enabling REST support in new or existing services


Integration with external REST APIs
Orchestration of a set of RESTful state transitions
Support for XML and JSON
Generation of sample URI for REST service operations
r a ble
Support for WADL services fe
n s
Support for REST security with the Oracle Web Service
n - tra
o
Manager (OWSM) policy 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
e
K JSuite 12clicprovides
Oracle R
SOA the following REST support:
A
N It supports exposing an existing SOA SOAP service as a REST service.
KO REST APIs are web APIs that conform to the REST architectural style. REST APIs are
basically defined by some web requests (the methods) and the data that they return or
need, which is usually JSON or XML.
REST state transitions occur by following hypermedia (hidden fields, headers, and so on)
to reach the next step at which the client is. SOA Suite 12c allows you to model a series
of REST state transitions as a business process with a sequence of RESTful invocations.
For JSON, SOA Suite 12c supports automatic translation to and from XML.
It supports publishing a REST interface either through WADL or WSDL 2.0. WADL files
provide an XML description of HTTP-based web applications.
It supports attaching OWSM policies to REST binding components, both Service and
Reference.

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


REST Adapter

Oracle SOA Suite


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

can consume REST


services.

a ble
f e r
ans
n - t r
Oracle SOA Suite a no
composite applications
h a s
can also be exposed
o m )
u ide
as a REST 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
K J l i cebe used to expose and consume REST services.
N AR
The REST adapter can

KO

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


Creating a REST Binding

Provide a name and a description,


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

and identify the binding as a


service or a reference.

a ble
Provide a relative path
f e r
for the resources.
an s
n - t r
a no
h a s
o m )
u ide
Name the operation, resource
m c nt G
path, and HTTP verb. 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 you provide a name and an optional description, and identify it as
N AaRservice or a reference. You then provide a relative path (URI) for the resources.
To create
either
a REST binding,
O
K Finally, you bind the operation, the resource path, and the HTTP verb.

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


Adding an Operation Binding
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Add an operation binding.

Specify the HTTP verb.

a ble
f e r
ans
n - t r
Describe the request and a no
response messages.
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 the HTTP verb (method) is selected from a drop-down list. You then
N ARthe request and response messages by using the Type Chooser.
When adding
describe
the binding,

KO

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


The Finished Binding Component

server application service resource


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

http://<host>:<port>/soa-infra/resources/<partition-name>/PackAndShipService/packingService/shipping

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 binding component, the resource URI, and a sample HTTP
N AR including both the header (the method or verb can be found here) and the payload
The slide
message,
shows the finished
O
K (in this example, the XML message).

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


Testing the Component
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
ccan
A R
The component WADL be observed from within JDeveloper.

KON

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


Examining the Results
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
ofK
TestingR
J lice can be completed by using the HTTP analyzer in JDeveloper. The
the component
O NA in the slide shows a request message being sent, and the response received. In this
example
K example, the status field of the message was updated by the called operation.

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


Quiz

REST queries use ______________ to describe resources.


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

a. XML
b. URIs
c. SOAP
d. JSON

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 NAqueries use URIs to describe resources.
REST
K

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


Summary

In this lesson, you should have learned how to:


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

Identify the format of REST queries


List the differences between REST and SOAP
Create and test a REST binding in 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 11 - 17


Practice 11 Overview

This practice covers the following topics:


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

Exposing a REST interface


Testing a REST interface
Consuming a REST service

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 11 - 18


Practice 11-1 to 11-4: Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
1
n - t r
a no
h a s
2 o m )
u ide
m c nt G
b
ni Stude
JDeveloper 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
1. InR
J
K practice,
this
cemodify the HelloBPEL composite application by exposing it as a
liyou
O NAREST service.
K 2. You test the service from JDeveloper.
3. You create a second composite that invokes the REST service, passing the required
resource.
4. You deploy the two composites and verify that they interact as expected.

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


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

Developing Business Rules

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 business rule concepts


Describe the Oracle Business Rules architecture
Describe the Rules Engine
Explain the role of the Oracle Business Rules dictionary
Create rules with the JDeveloper Rules Designer
r a ble
Integrate a simple rule with a BPEL process fe
n s
Describe the role of the Rules SDK -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
In this lesson, l basic vocabulary and the concepts for Oracle Business Rules. You
K you learn
O NAhow to configure business rules and Decision Tables. You also learn how to invoke your
learn
K configured business rule service component from a BPEL process.

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


Agenda

Business Rules: Introduction


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

Business Rules in the Oracle SOA Suite

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 12 - 3


Business Rules: Introduction

Business rules are declarative statements that describe


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

business policies or key business decisions. Examples of


business rules include:
Business policies such as spending policies and approval
matrixes
Constraints such as valid configurations and regulatory
requirements
r a ble
Computations such as discounts and premiums n s fe
Reasoning capabilities such as offers based onon -tra
customer
n
value sa 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
Oracle R K Rules
Business l enable dynamic decisions at run time, allowing you to automate
O NA computations, and reasoning while separating rule logic from the underlying
policies,
K application code. This allows more agile rule maintenance and enables business analysts to
modify rule logic without programmer assistance and without interrupting business processes.
Consider implementing rules for the following cases:
Volatility: Rules that are likely to change frequently
Impact: Rules that affect the business the most
Ownership: Rules owned by particular business parties
Compliance: Rules that express regulatory requirements

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


Business Rules Component

A decision component, which is also called a business rule


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

service component, supports the use of Oracle Business Rules


in a SOA composite application. Decision components can be
called within a composite application:
By a BPEL component
By a human task
By the dynamic routing capability of Oracle Mediator
r a ble
Directly by the SOA composite client 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
You can K a SOA
create l composite application that includes the BPEL process, business rule,
A task service components. These components are complementary technologies.
Nhuman
and
O
K BPEL processes focus on the orchestration of systems, services, and people. Business rules
focus on decision-making and policies. Human tasks enable you to model a workflow that
describes tasks for users or groups to perform as part of an end-to-end business process flow.

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


Business Rules Use Cases

Business rules can be used in various ways in composite


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

Dynamic processing
Rules can perform routing within a business process based
on service-level agreements or other guidelines.
Externalization of business rules in a business process
Many conditions must be evaluated in a business process.
The parameters for these conditions can be changed r a ble
independently of the process. n s fe
ra n -t
Data validation and constraint checks n o
s a
Validate input documents or apply constraints
) ha deon requests.
Human task routing c om t Gui
Policy-based task assignments i b m to especific n roles or users
i n Stu d
Load balancing ofintasks @ among is users
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
DynamicR Kprocessing:l Rules can perform intelligent routing within a business process based
onN A
service-level agreements or other guidelines. For example, if a customer requires a
O
K response within one day, send a loan application to the QuickLoan loan agency only. If the
customer can wait longer, route the request to three different loan agencies.
Externalization of business rules in the process: There are typically many conditions that
must be evaluated as part of a business process. However, the parameters for these conditions
can be changed independently of the process. For example, you provide loans to only those
customers with a credit score of at least 650. This value may be changed dynamically based on
new guidelines set by business analysts.

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


Data validation and constraint checks: Rules can validate input documents or apply
additional constraints on requests. For example, a new customer request must always be
accompanied by an employment verification letter and bank account details.
Human task routing: Rules are frequently used for human tasks in a business process:
Policy-based task assignments to specific roles or users: For example, a process
that handles incoming requests from a portal can route loan requests and insurance
quotes to a different set of roles.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Load balancing of tasks among users: When a task is assigned to a set of users or a
role, each user in that role acquires a set of tasks and acts on them within a specified
time. For new incoming tasks, policies may be applied to set priorities on the tasks and to
put them in specific user queues. For example, a specific loan agent is assigned a
maximum of 10 loans.

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 12 - 7


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

IF <condition> THEN <action>

One or more business One or more


terms are tested.
tested actions are taken.

a b le
f e r
a n s
If customer is a Premium customer, THEN apply a 10% discount.
n -t r
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
K form, al business rule can be expressed as an if/then statement. The IF part
In its simplest
R
O NAone or more business terms. If the tests pass, one or more actions are performed in the
tests
K THEN part, such as adding or changing business terms.
The rule IF part is composed of conditional expressions (rule conditions) that refer to facts.
Example: IF Rental_application.driver age < 21
The conditional expression compares a business term (Rental_application.driver age) to the
number 21 by using a less-than comparison.
The rule condition activates the rule whenever a combination of facts makes the conditional
expression true. In some respects, the rule condition is like a query over the available facts in
the Rules Engine, and for every row that is returned from the query, the rule is activated.
The rule THEN part contains the actions that are executed when the rule is fired. A rule is fired
after it is activated and it is selected among other rule activations by using conflict resolution
mechanisms such as priority. A rule might perform several kinds of actions. An action can add
facts, modify facts, or remove facts. An action can execute a Java method or perform a function
that may modify the status of facts or create facts.
Rules fire sequentially rather than in parallel. Note that rule actions often change the set of rule
activations and thus change the next rule to fire.

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


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

If customer is a Premium customer, THEN discount=10%.

Working Memory

Facts are discrete


Customer.status
a ble
f e r
pieces of data
an s
that constitute the
n - t r
input and output
values for the
Discount.amount
a no
business rule. h a s
o m )
u de a fact is put
iWhen
m c nt G forth in memory, it is
b
ni Stude said to be asserted.
@ 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
Rules are Kapplied to ldata objects that are known as facts. Facts are discrete pieces of data that
O NA the input and output values for a business rule. Facts must be exposed through XSD
constitute
K definitions. Fact definitions make up part of a data model, and must be defined before you can
create rules.
These facts are asserted and added to the working memory of a rule session. Each data object
instance corresponds to a single fact.

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


Decision Tables

A Decision Table provides a


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

compact representation of all


possible if/then permutations.

Decision Table R1 R2 R3

CONDITION two_day five_day next_day or


If shipChoice international
a ble
f e r
ACTION RedShipper GreenShipper BlueShipper
ans
Assert carrier
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 in a spreadsheet-like format called a Decision Table. A Decision
N AisRmore compact and intuitive when many rules are needed to analyze many
Rules can
Table
also be expressed

KO
combinations of property values. You can use a Decision Table to create a set of rules that
covers all combinations, or a set of rules in which no two combinations conflict.
You write rules and Decision Tables in terms of fact types and properties. Fact types are often
imported from the Java classes, XML schema, or Oracle ADF Business Components View
Objects. They can also be created in the Rules Designer.

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


Value Sets

Value sets define a list of values, a


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

range of values, or an enumeration of


values for a specified type.

Value sets are defined as types in an


XSD file. They define the possible
values for shipChoice and carrier.
a b le
f e r
ans
n - t r
Decision Table R1 R2
n o R3
s a next_day or
CONDITION two_day five_day
) a
h deinternational
If shipChoice
om t Gu i
c
m GreenShipper
ACTION
i b
RedShipper
e n BlueShipper
Assert carrier
@ 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 havela name, value, data type, and an optional value set. Value sets define a
Fact properties
listNofAvalues, a range of values, or an enumeration of values for a specified type. A value set
O
K splits the value space of a fact property data type into buckets that can be used to specify
constraints on the values associated with Decision Tables, choice lists, variable initial values,
and function return values or function argument values.
There are three forms of value sets:
List of values (LOV): Defines a list of values
List of ranges: Defines a list of value ranges, defined by range endpoints
Enumeration: Defines a list of fixed types. Enumerated types can be imported from XML
or Java facts.
You can define a value set as a global construct that allows reuse, or as a local construct that
applies to only one condition expression.

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


Globals

IF orderTotal > approvalLimit


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

THEN needsApproval=true()

orderTotal

needsApproval
a ble
f e r
an s
approvalLimit
n - t r
A global represents a
Working Memory a no
data value or an
h a s
expression that can
m ) or constant.
Globals
i d ecan be variable
be evaluated in rule
c o tG u They are
conditions and
i b m en similar to public static
expressions.
@ in Stud variables in Java.

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
A global K
represents al data value or an expression that can be evaluated in rule conditions and
O NA
expressions. For example, if a 10% discount is used in several rules, you can create and use a
K defaultDiscount global variable, so that changes to the value need to be carried out in only
one place while the discount is applied to many rules in the dictionary.
Globals are named types that can be based on object, string, or standard primitives, and can be
used in rule definitions and actions.
Globals can be variable or constant. They are visible to all the rulesets in the dictionary. A
global is similar to a public static variable in the Java language.

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


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

A ruleset is a collection of
one or more related rules
and Decision Tables.

Ruleset

IF/THEN a ble
IF/THEN
IF/THEN f e r
ans
n - t r
Rulesets and Decision Tables a no
are seen as a unit of h a s
execution and can be chained o m )
u ide
together. 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 are grouped in an Oracle Business Rules object called a ruleset. A
N AR
Rules and
ruleset
Decision Tables
is a collection of one or more related rules and Decision Tables that are seen as a unit
KO
of execution and that can be chained together to yield an outcome. A ruleset provides a
namespace, similar to a Java package, for rules and Decision Tables.

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


Rules Dictionary

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

3 Java Facts Rules Dictionary 2


Java class
RL Facts

ADF-BC Facts

3 XML Facts Facts Value sets Globals


Rules
Designer
XML
a ble
Schema f e r
Data model ans
n - t r
Ruleset
a n4 o .rules

h a s
o m )
u ide
Rule
5
m c nt G Rule
IF condition
condition1THEN
THENaction
i ib tude Define Business Policies
naction
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 cefacts, functions, globals, value sets, and rulesets in an Oracle Business
R
You group one
Aobject or more
N
Rules called a dictionary. A dictionary is an XML file (in the local file system with a
KO
.rules extension) that stores the applications rulesets and the data model.
Creating an Oracle Business Rules dictionary requires the following:
1. Creating or importing a dictionary into a project by using the JDeveloper Rules Designer
2. Populating the dictionary with the set facts, functions, globals, value sets, and rulesets. A
data model contains the business data definitions for the facts or data objects used in the
rules.
3. Creating one or more facts. Facts can be created as XML facts (derived from XML
schema elements), Java facts (based on a Java class), RL Language (RL functions) facts,
or ADF Business Component facts (based on View Object definitions).
4. Creating rulesets as a container for a set of one or more rules or Decision Tables
5. Defining rules to express the business policies based on the facts in the data model

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


Oracle Business Rules RL Language

The goldCust rule uses a Java class


containing the customer data, cust.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

rule goldCust {
if (fact Customer cust && cust.SpentInLastMonths(3) > 500 ){
assert (new GoldCustomer(cust: cust));
}
}
An instance of the GoldCustomer RL class is
asserted, representing a customer who spends
more than $500 in a three-month period. a ble
f e r
ans
rule goldDiscount {
n - t r
if (fact Order ord & fact GoldCustomer(cust: ord.customer) )
{ a no
ord.discount = 0.1;
The RL fact GoldCustomer is used to
h a s
assert(ord);
infer that if a customer spent $500 in
o m
the past three months, the customer is
)
u ide
}
m c nt G
eligible for a 10% discount.
} 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 more complex business logic, Oracle Business Rules supports a
N AR Java-like language called Oracle Business Rules RL Language (RL Language). RL
For situations
high-level
that require
O
K Language defines the syntax for Oracle Business Rules programs. RL Language includes a
Java-like syntax for defining rules that support the power of Java semantics.
With RL Language, application programs can assert Java objects as facts, and rules can
reference object properties and invoke methods. Likewise, application programs can use XML
documents or portions of XML documents as facts.
Programmers can use RL Language as a full-featured rules programming language, both
directly and as part of the Oracle Business Rules SDK.
RL Language is directly executed by the Rules Engine. It is interpreted rather than compiled, to
enable rules to be changed without rebuilding, redeploying, or even restarting applications.

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


Oracle Business Rules SDK

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

Rules Create, modify,


Designer and maintain rules.

Rules
design time SDK
run time
SOA Rules Dictionary a ble
Composer f e r
ans
n - t r
Custom Java API a no
Java h a s
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 SDK (Rules SDK) is a Java library that provides business rule
N AR features that a developer can use to write a rule-enabled program that accesses
The Oracle
management
Business Rules
O
K a dictionary, or to write customized rules programs that add rules or modify existing rules. The
Rules Designer uses the Rules SDK to create, modify, and access rules and the data model by
using well-defined interfaces. Customer applications can use the Rules SDK to access, display,
create, and modify collections of rules and the data model.
You can use the Rules SDK APIs in a rule-enabled application to access rules or to create and
modify rules. The rules and the associated data model can be initially created in a custom
application or by using the Rules Designer.

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


Oracle Business Rules Components

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

Ruleset Facts Rules Engine

IF/THEN
IF/THEN
IF/THEN
Pattern match
rule to facts? a ble
f e r
tra
Inference
ns
n -
If yes, execute rules. no
Engine
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
Oracle R K Rules
Business l is a data-driven forward chaining system, in which the facts determine
O NArules are evaluated. When a matching rule fires, the rule may add more facts. New facts
which
K are again compared against the rules. The process repeats until a conclusion is reached or the
cycle is stopped or reset. This process is called an inference cycle.
A rule-based system consists of the following:
Rule base: Includes business policies expressed as IF-THEN rules and Decision Tables
Working memory: Includes the fact information added by applications by using assert
calls
Inference Engine (Rules Engine): Processes the rules, and performs pattern-matching
to determine which rules match a given set of facts

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


Editing Business Rules at Run Time

SOA Composer can be used


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

to modify rules dictionaries at


run time, without the need to
redeploy the application.

Rules Dictionary

a ble
f e r
ans
Facts Value sets
n - r
Globals
t
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
ice in a SOA composite application, Oracle Business Rules lets you
K J isldeployed
When aRdictionary
A Composer to view, edit, and commit changes to a dictionary. SOA Composer is a
NSOA
use
O
K browser-based editing tool.

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


Quiz

A __________ is a collection of one or more rules that are seen


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

as a unit of execution.
a. Fact
b. Ruleset
c. Dictionary

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
A
AN
O ruleset is a collection of rules that are considered as a unit of execution, and can be chained
K together to yield an outcome.

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


Agenda

Business Rules: Introduction


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

Business Rules in Oracle SOA Suite

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 12 - 20


Business Rules Component: Overview

The Oracle Business Rules


component can be used in
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

various ways in a SOA


composite application.

a ble
f e r
ans
n - t r
a no
One of the most common ) h
as e
uses is to call the component
c om t Guid
from a BPEL process.
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
A Business l component (also called a Decision component) can be used to
K Rules service
NA dynamic routing with a Mediator component. It can be implemented as advanced
implement
O
K routing rules in human task definitions, where it can perform policy-based task assignments
that dispatch tasks to specific roles or users. It can also provide load balancing of tasks among
users to control the task assignment load.
A Business Rules component can also be called from a BPEL process. When used thus, the
rules can determine intelligent routing paths within a business process based on service-level
agreements or other guidelines. It can also externalize business rules in the process: Rule
conditions that are evaluated as part of a business process where parameters can be changed
are best implemented separately from the process. Rules can also validate input documents or
apply additional constraints on requests.
Oracle Business Rules is a powerful and flexible tool, and can be utilized in many ways to
achieve many objectives. In this course, we focus on its creation, configuration, and invocation
from a BPEL process within a composite application. For more information about Oracle
Business Rules, go to http://www.oracle.com/technetwork/middleware/business-
rules/documentation/index.html.

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


Creating a Business Rules Service Component

Create or import a dictionary.


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
m ) e structures
idfact
Specify the o
c default
initial XML u
G service input
and
b m the n t Decision
i niandSoutputt u demessage structures.
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 component in a composite application, perform the following steps:
A R
To create a Business Rules
N
O1. Drag a Business Rules component into the Components column.
K 2. Select to create or import the dictionary.
3. Select Create > Input or Create > Output to define the initial XML fact structures. These
structures are added to the Business Rules dictionary. They define the default Decision
service input and output message structures.
4. Select an XML schema element to define either the Input or Output fact structures.
5. Click OK to create the component.
When you create a Business Rules component in the Composite Editor, it creates a stand-
alone business rule in the composite application and the Business Rules dictionary. The
dictionary is created with a default Decision function for the Decision service. However, the
dictionary is not opened in the Rules Designer.
Note: The Decision service name is defined on the Advanced tab (not shown in the slide).

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


Adding a Business Rule to a BPEL Process
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

1
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 cein a BPEL process provides you with the option to create a new
N AR Rules component in the composite application, or to select a Business Rules
Creating
Business
a business rule

KO
component that already exists in the composite application. In addition, creating a business rule
in the context of a BPEL process enables you to create the Business Rules dictionary and
specify the rulesets that are invoked.
To create a business rule in your BPEL process:
1. In the BPEL Designer window, drag a Business Rules component into your BPEL flow.
This opens the Business Rule activity window.

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


Configuring a Business Rule in a BPEL Process

Select a dictionary.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Select the operation.

a ble
f e r
ans
n - t r
Map BPEL variable
values to input and a no
(if the business rule h a s
is synchronous)
o m )
u ide
output facts.
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 desired Business Rules component to the composite and
N AR it, select the desired dictionary and, from that dictionary, the operation. Then map
If you have
configured
already added

KO
the input and output facts for the business rule to the appropriate BPEL variables.
Note: If you have not yet created and configured the desired Business Rules component, you
can add a dictionary and specify the input and output facts from the configuration dialog box
shown in the slide.

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


Examining Business Rules Component Files
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The Business Rules dictionary


contains the ruleset definitions, rule,
facts, and globals.

The Decision Service XML Schema


defines the structures for the input
and output facts.

a ble
The Decision Service WSDL
f e r
document defines the basic stateless
ans
t r
and stateful web service operations
n -
that can be invoked.
a no
The Business h a s metadata
Rules e
) i d
defines
c omoperations
the mapping
t G u of the Decision
i b mfunctions.
service
e n to the Decision

@ 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 K l
create the Business Rules component in your composite application or BPEL
A
N the following files are created in the project folder:
process,
KO A Decision service XML Schema that defines the structures for the input and output facts
A Decision service WSDL document that defines the basic stateless and stateful web
service operations that can be invoked
A Business Rules dictionary (.rules file) for containing the ruleset definitions, rule, facts,
and globals that are added to the dictionary
The Business Rules metadata (.orig file) that defines the mapping of the Decision
service operations to the Decision functions that can be executed
Note: When you expand the business rule activity in the BPEL process, you find that it is in fact
a scope that contains the following:
A few Assign activities to prepare the input fact data
An Invoke activity to execute the business rule functions
A few more Assign activities to receive output facts

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


Editing the Rules Dictionary
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
The Rules Designer includes
m c toneach
a series
t Gofof
tabs to provide editing
the elements ofia
b access e
i turule.
nbusiness d
@
in this S
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 Rules ldictionary holds the rules that are executed by an application. The Rules
The Business
NA saves rules and their associated definitions in the dictionary (a .rules file). The
Designer
O
K dictionary is created when you first add a Business Rule component to your composite or BPEL
process flow. By using the Rules Designer, you can define basic building blocks such as facts,
globals (variables and constants), value sets, and rulesets.
Advanced features can also be defined and edited from here, including the following:
Functions: These are parameterized functions based on the RL Language syntax.
Links: These enable linking dictionaries to other dictionaries.
Decision functions: These provide access to rules through a Decision service that is
invoked as a web service or from a Java program through the Rules SDK API.

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


Defining Globals

Assign the global a name,


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

a data type, a value set


(optional), and a value.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u de
iExpression
Specify Constant and/or
m c t GUse Builder
n to define a value.
nib Stude
Final if appropriate.
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
1. InRthe
J
KRules lice click the Globals tab, and then click the Create (+) icon.
Designer,
O NAIn the Edit Global window, enter a name (for example, defaultDiscount), select a
2.
K Type (for example, int), and in the Value field, click the Expression Builder icon.
3. In the Expression Builder window, create an expression or enter a literal value (for
example, 10). Then click OK.
4. In the Edit Global window, select the Constant check box to make it a constant, and the
Final check box to make it a final value.
- Final: Select the Final check box to use the global in a rule test condition. In this
case, the global is initialized once at run time and cannot be altered. A non-final
global is modifiable in assign actions.
- Constant: If the Constant check box is selected, it does not require double
quotation marks around string literal values, and it can be selected from expression
value choice lists. Constant expression values must be constant to be valid.
5. Click OK to create the global.

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


Defining Value Sets

A value set can be a list of values, or it can be a list of ranges


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

that defines a list of value ranges by range endpoints.

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 value set, perform the following steps:
A R
To define a List of Values
N
O1. In the Rules Designer, click the Value Sets tab, and then click the Create (+) icon > List
K of Values to create a row.
2. In the new value set row, select the row and replace the name. Click the Edit icon to open
the Edit Value Set window.
3. In the Edit Value Set window, click the Create (+) icon to add values and aliases.
To define a List of Ranges value set, perform the following steps:
1. In the Rules Designer, click the Value Sets tab. Then click the Create (+) icon > List of
Ranges. This adds a row to the Value Sets table.
2. In the Value Sets table, double-click the Edit icon for the new value set to display the Edit
Value Set window.
3. In the Edit Value Set dialog box, enter the value set name, select the desired data type for
the range values, and click the Add Bucket With Lower Endpoint Included icon repeatedly
to add the number of buckets required. In each bucket row that is added, click the
endpoint cell and set the lower endpoint for each range.
4. Click OK to create the List of Ranges value set.
Note: The Rules Designer always adds the negative Infinity (Infinity) bucket in List of
Ranges value set definitions.

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


Defining a Ruleset

Test Condition and Action


refer to previously defined
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

facts and globals.

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 ceof organizing your rules. Before rules can be created, you need to
N AR
Rulesets
create
provide a way
a ruleset as a container for the rules. After the ruleset is created, rules and Decision
KO
Tables can be defined within it.

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


Defining a Decision Table
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Each condition row


requires a value set from
which to draw the values
values.

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 and a condition operand, perform the following steps:
A R
To create a Decision Table
N
O1. In the Rules Designer, select an existing ruleset. Click the Add icon and select the Create
K Decision Table option from the list.
2. In the Decision Table area, from the list next to the Add icon, select Condition.
3. Each condition row requires a value set from which to draw values for each cell.
4. In the Conditions area, double-click <edit-condition> to display the navigator to select or
enter an expression.

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


Decision Functions
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 cehighlighted thus far have resulted in the definition of a Decision function
R
The configuration
Aexposed steps
O N
that is and invoked by the BPEL process. However, Decision functions do more than
K provide exposure to BPEL. Recall that earlier in this lesson, we saw that Oracle Business
Rules can be invoked by means other than BPEL processes (and even from outside Oracle
SOA Suite).
Decision functions provide access to rules through a Decision service that is invoked as a web
service. Use a Decision function to call rules from a Java application, from a composite, or from
a BPEL process. A Decision function performs the following operations:
Collect rulesets and other Decision functions under a single executable umbrella
Handle the assertion of inputs as rule facts in the Rules Engine working memory
Collect the consequent actions to be executed
Run rulesets
Return results
In a Decision function, the rules that you use can be organized into several rulesets, and these
rulesets can be executed in a prescribed order. Facts may flow to the first ruleset, and this
ruleset may assert additional facts that flow to the second and subsequent rulesets until the
facts finally flow back to the Decision function as the Decision function output.

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


Quiz

Which of the following components can execute business


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

rules? (Select all that apply.)


a. Mediator components
b. Clients of the composite application
c. BPEL components
d. Database adapter components
a ble
e. Human task components e r
s f
- 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
Answer:Ra,Kb,Jc, e lice
O NA Rules is a component that is similar to the BPEL or Mediator component. It provides a
Business
K WSDL interface to expose the Decision service through which rules can be executed.
Therefore, a composite application that exposes a Business Rules component as a service
entry point enables any of its clients to execute the business rule and obtain the results.
Mediator components can use routing rules to execute a Business Rules component. In fact,
when you create a dynamic routing rule, this creates a Business Rules component whose
results determine the target service that is invoked. BPEL components can invoke business
rules and use the results to influence a process flow. The human task participant list builders
can use business rules to generate a list of approvers for a stage in the human task
configuration.

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


Summary

In this lesson, you should have learned how to:


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

Describe business rules concepts


Describe the Oracle Business Rules architecture
Describe the Rules Engine
Explain the role of the Oracle Business Rules dictionary
Create rules with the JDeveloper Rules Designer
r a ble
Integrate a simple rule with a BPEL process fe
n s
Describe the role of the Rules SDK -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 12 - 33


Practice 12-1 to 12-3 Overview

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

1 determines whether or
The incoming
message includes not the order requires
order data. manual approval. 2

If manual approval is If manual approval is


required, the Manual not required, the order
Approval project
from the previous
is automatically
r a ble
approved.
4 fe
s
lesson is
- t r an
invoked. 3 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 and configure a business rule and call it from a BPEL process. This
R
In this practice,
Aprocess you create
N
BPEL also calls the ManualApproval application that you completed in the lesson titled
KO
Implementing a Human Workflow and Notifications.
In the business rule, a pair of rules will use the IF/THEN logic to compare the incoming order
total to a global that defines the threshold for manual approval, and to determine whether or not
the order requires manual approval. This determination is returned to the BPEL process.
If approval is required, the Manual Approval composite is invoked.

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


Practice 12-4 to 12-6 Overview

If the order is
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

A second business
approved rule is added. It
5 employs a Decision
Table to determine the
shipping company for
the order.
6

a ble
f e r
The results of the
ans
business rule are n - t r
incorporated into the
a no
order data, and the
h a s
order is published to
o m )
u ide
a JMS Queue.
m c nt G
7 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 ceyou modify, redeploy, and test the OrderProcessing composite
N AR If the order is approved, either manually or automatically (because the total is
In this optional
application.
practice,

KO
below the approval threshold), a second business rule uses a Decision Table to route the order
to the preferred shipping company based on the shipping option indicated in the order data.
The response from the business rule is incorporated into the data, and the message is
published to a JMS queue.
To accomplish this, you add a second Business Rules component. This component uses a
Decision Table to assign a shipping carrier based on the shipping method specified in the order
detail. You configure the Decision service interface by defining the service name and specifying
the input and output fact structures, which are drawn from an XSD file that you import into the
project.

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


Practice 12-4 to 12-6 Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

The Decision Table in


the second Business
business
Ruleuses
rule will use
a pair
a pair
of value
of
valueinsets
sets its definition
in its of
definition ofand
conditions conditions
actions
and
to route
actions
the order
to route
to the
order toshipping
proper the proper
shipping company.
company. le
r a b
s f e
- t r an
Decision Table R1 R2 n n o R3
s a next_day or
CONDITION two_day five_day
) a
h deinternational
If shipChoice
om t Gu i
c
m GreenShipper
ACTION
i b
RedShipper
e n BlueShipper
Assert carrier
@ 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 Decision l a [provided] XSD document to define the input and output facts and
K Table uses
A sets to constrain the possible shipping choices and carriers.
Nvalue
the
KO

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


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

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
( 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 business events


Describe the Event Delivery Network
Define an event with Event Definition Language
Use a Mediator to publish and consume events
Use a BPEL process to publish and consume events
r a ble
Use a test case to emulate an event message fe
n s
Manage events in Enterprise Manager Fusion Middleware
n - tra
o
Control 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 e
cthe
A R
This lesson describes Oracle SOA Suite 12c Event Delivery Network (EDN) and the use
ofN
the Mediator and BPEL components to publish and consume events. You learn how to
KOcreate event definitions by using the Event Definition Language (EDL) standard.

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


Agenda

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

Creating and Configuring 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
( 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 13 - 3


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

Exposed Services Components External References

DB
Adapter

Stock
Updated

a ble
f e r
ans
n - t r
When a business event occurs:
a no
Is it of interest to any other services?
h a s
How should those services be invoked?
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
cSOA
A R
Decoupled composite applications require complete separation of the service consumer
Nthe service provider, which is typically achieved through the use of asynchronous
and
KOmessaging, where applications can perform in a fire and forget mode.
Advantages
This removes the need for an application to know the details of the application on the
other side.
Resource utilization improves because applications are not holding on to resources until
the interaction is complete
Disadvantages
This introduces the complexities of creating and managing message queues and topics.
This requires that both the publisher of the message and the consumer use the same
messaging technology.
Each messaging system also has its own constraints on the types of programming
languages and environments that can use the service.
What is needed is a level of abstraction that allows applications to generate an event by using
business terms and to associate a business object in an implementation-independent form.
Oracle SOA Suite 12c addresses this need with the Event Delivery Network.

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


Event Delivery Network

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

EDN
With EDN Adapter API

ADF-BC Java
Application Event Delivery Network Application

a ble
f e r
mediator BPEL mediator
ans
describe n - t r
events Service Infrastructure a no
h a s
o m )
u ide
m c nt G
b
ni Stude
MDS
EDL XSD 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 (EDN) is not a messaging infrastructure. It coordinates events
R
The Event
Athe Delivery Network
N
within SOA Suite service infrastructure, and is available to all composites that are running
KOin the SCA container (within the same JVM).
The EDN provides a true publish-subscribe abstraction. It supports a fully declarative
approach, and does not require explicit wiring between components, thus leading to truly
decoupled applications.

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


Aligning SOA and EDA Through EDN
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Services JMS Messaging EDN


Interface WSDL: JMS API EDL: Event
Standard service Definition
interface model Language
Data types XSD: Strong Handful of raw XSD
typing types
Orientation Business Developer Business
a ble
f e r
Tools Wealth of tools Mostly coding Fully declarative
ans
tools
n - t r
Fault Developers Developers Automatic a no
Handling responsibility responsibility 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
ccompares
A R
The table in the slide SOAP (service), JMS (messaging), and EDN (events). When
N are used together, you can create a rich and highly functional combination of Service-
these
KOOriented Architecture (SOA) and event-driven architecture (EDA) approaches to implementing
the varied business requirements.
The EDN provides a way for events to coexist with services. Therefore, the EDN enables the
SOA and EDA worlds to be aligned.

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


Events: Introduction

Events are one-way, fire-and-


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

of a business occurrence.

Events are not targeted to


a specific service provider,
publish but are available to any
and all interested parties.

a ble
Event subscribe f e r
Delivery
ans
Events are messages that Network
n - t r
typically have a header and
a no
a payload.
h a s
o m ) subscribe
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
Kmessages. e
licThey
EventsRare typically have a header and a payload. The header contains
N A
metadata such as the event type and a time stamp. The payload contains details that
KOdescribe the facts of the event instance that the business logic in the consumer will process.
Events are a one-way, fire-and-forget, asynchronous notification of a business occurrence.
They are not targeted to a specific service provider, but are available to any and all interested
parties. The publisher does not:
Rely on any service component receiving the business event to complete
Care if any other service components receive the business event
Need to know where the subscribers (if any) are and what they do with the data
These are important distinctions between business events and direct service invocations that
rely on the Web Services Description Language (WSDL) file contract (for example, a SOAP
service client). If the author of the event depends on the receiver of the event, 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 13 - 7


XSD

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

xmlns:us="http://www.example.org/ns/updtstock"
targetNamespace="http://www.example.org/ns/updtstock"
elementFormDefault="qualified">
<xsd:element name="UpdateStock"
type="us:UpdateStockType"/>
<xsd:complexType name="UpdateStockType">
<xsd:sequence>
<xsd:element name="productId" type="xsd:string"
minOccurs="1"/>
a ble
<xsd:element name="quantity" type="xsd:int"
f e r
minOccurs="1"/>
ans
</xsd:sequence>
n - t r
</xsd:complexType>
a no
</xsd:schema>
h a s
o m )
u ide
Theb m c n
referenced XSD t Gfile describes
i n ipayload
the t u dofethe event.
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
The codeK J inlthe
sample i ceslide describes the payload of an event with two values (productID
A R
N
and quantity). Components that either produce or consume events use this XSD to
KOunderstand the payload of the event.

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


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

XML schema

<definitions xmlns="http://schemas.oracle.com/events/edl"
targetNamespace="http://schemas.oracle.com/events/edl/stock
Update">
<schema-import
namespace="http://www.example.org/ns/updtstock"
location="xsd/updateStock.xsd"/>
QName
QName a ble
<event-definition name="stockUpdated">
f e r
<content
ans
xmlns:ns0="http://www.example.org/ns/updtstock"
n - t r
element="ns0:UpdateStock"/>
a no
</event-definition>
h a s
) ide
</definitions>
o m u
m c nPayload 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 ce
The EDN
A R uses the XML-based Event Definition Language (EDL), which enables you to define
Nevent and its associated strongly typed data. This definition is registered with the SOA
the
KOinfrastructure, and is available to all composites for publication or subscription.
An event definition consists of the following:
A global name or QName, which is qualified by a namespace to uniquely define the
event name
Custom headers, which can be used for faster content-based routing than an XPath
query on the event payload
A payload definition, which is the data associated with the event, and which is provided
by the publisher and is available to the consumer. An XSD is typically used to define the
structure of the payload information.
An EDL file is created and deployed as part of a SOA composite application, even though it
does not really belong to any one applicationit is applicable throughout the SOA Suite
container and is more or less community property. After the EDL file is deployed and
registered with the EDN, subscriptions can be created on the events in the file.

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


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

Event publication information (QName) is


defined in the composite.xml file.

<component name="UpdateStock" version="2.0">


<implementation.bpel src="UpdateStock.bpel"/>
<business-events>
<publishes
xmlns:pub1="http://schemas.oracle.com/events/edl/stockUpda
a ble
te"
f e r
name="pub1:stockUpdated"/>
ans
</business-events>
n - t r
</component>
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 cenot have to be registered beforehand; anyone can publish an event of
aN AR
Publishers
type
of events do
that is defined through EDL. Events of a specific type can be published by many
KOdifferent publishers, both inside the SCA container and outside of it.
Primary publishers of events to the EDN are the Mediator and BPEL service components.
SOA Suite exposes APIs in Java and PL/SQL for publishing events.
ADF business components can be configured to publish events to the EDN when data
manipulations on entity objects occur.
Fusion Middleware Control has a facility for publishing test events.

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


Event Subscription

Event subscription information (QName)


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

is defined in the composite.xml file.

<component name="ReceiveEvent">
<implementation.mediator src="ReceiveEvent.mplan"/>
<business-events>
<subscribe
xmlns:sub1="http://schemas.oracle.com/events/edl/stockUpda
te"
a ble
name="sub1:stockUpdated"
f e r
consistency="oneAndOnlyOne"
ans
runAsRoles="$publisher"/>
n - t r
</business-events>
a no
</component>
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 ceregister their interest in events of a specific type with the EDN through
N
the AR or BPEL components that consume such events.
Composite applications
Mediator
KO An EDN offers the following three levels of subscription granularity:
Namespaces, where the subscriber receives any event with a specific namespace
Event names, where the subscriber receives an event with a specify QName
Content-based XPath filters, where a subscriber can add content-based filters to accept
or reject events
The first step to consume an event is to discover its definition. Event definitions can be stored
locally in a composite or globally on the serverin either case, they can be discovered
through the JDeveloper resource catalog.

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


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

Component Publish Subscribe


Mediator Yes (Routing Rule) Yes

BPEL Yes (Invoke) Yes (Receive; Pick)

Human Task Yes No

ADF-BC Yes (CRUD methods) No


a ble
Java Application Yes No
f e r
ans
PL/SQL Yes No
n - t r
FMW Control Yes (for testing) No a no
h a s
In this course, we focus on event o m )
u ide
publication and subscription m c in thent G
b
ni components. de
Mediator and BPEL i 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 e
cBPEL
A R
Both the Mediator and service components can publish events and subscribe to them.
N applications, including Oracle Application Development Framework (ADF) business
Other
KOcomponent applications and Java EE applications, can raise events. You can also raise
events through PL/SQL APIs.
Note: For more information about creating and publishing Oracle ADF business component
business events, see the Oracle Fusion Middleware Fusion Developers Guide for Oracle
Application Development Framework. The Oracle Fusion Middleware Developers Guide for
Oracle SOA Suite 12c discusses how the human task component can create and generate
business events, and how a Mediator or BPEL component can subscribe to those events.

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


Quiz

Which of the following can publish events? (Choose all that


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

apply.)
a. BPEL component
b. ADF-BC application component
c. Mediator component
d. Human task component
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, b, c, d
Answer:
N
KOAll these components can publish events.

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


Agenda

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

Creating and Configuring 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
( 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 13 - 14


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

2
1

a ble
f e r
ans
n - t r
4 a no
h a s
o m )
u ide
3 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 for a composite application, perform the following steps:
R
To create
AClickevent definitions
O N
1. the Event Definition Creation icon on the composite.xml window toolbar.
K 2. In the Event Definition Creation window, enter:
- The Event Definition file name, which is used for the EDL file that contains the
event definitions that are added to the project
- The directory, to specify where the EDL file is stored
- The namespace, to specify the XML Namespace for event definitions
Click the Add an Event (+) icon to create a new event.
3. In the Add an Event window, select an XML element from an XML schema that defines
the event payload structure. Enter a name for the event. Click OK.
The event is added to the Events table in the Event Definition Creation window and the
EDL file.
4. Add additional events, or click OK to create the EDL file in the project folder.

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


Configuring a Mediator to Publish Events
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
3
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 Mediator component, perform the following steps:
A R
To publish an event from
N
O1. After opening the Mediator Editor, for a selected operation, click the Create (+) icon and
K select Static routing rule.
2. In the Target Type window, click Event.
3. In the Event Chooser window, browse for an existing EDL file or create a new EDL file
with the events to be published. Select the event entry to be published and click OK.
Note: In the Mediator Routing Rule properties, the event icon appears next to the target field.
The event name is formed by concatenating the string Event:: to the event name (for
example Event::Event1). In the Composite Editor window, the Mediator component icon
has a Published Events icon (lightning within a blue circle) on the left edge as a visual
indicator for published events. The name of the published event appears inside the Mediator
component icon. A Mediator component can publish more than one event. Each event is
published in its own Routing Rule definition.

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


Configuring a Mediator to Subscribe to Events
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

2 le
r a b
s f e
- t r an
3 n no
s4 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 event in a Mediator component, drag a Mediator component to the
N AR column in the Composite Editor:
To subscribe
Components
to a business

KO
1. Select Subscribe to Events from the drop-down menu.
2. Click the Subscribe to New Event icon to locate an existing EDL file and select an
event.
3. To further refine a subscription, click the Filter icon to define an XPath-based filter (just
as you do for content-based routing). The filter consists of a Boolean expression that
evaluates the events payload, resulting in true() for events that should be delivered
and false() for events that the component declines.
4. After you click OK, the Mediator is added to the Composite Editor with the following
visual clues:
- The left edge of the Mediator component has a Subscribed Events icon to indicate
that it subscribes to events.
- The body of the Mediator component displays the subscribed event names.
Note: A Mediator component cannot have a service interface and subscribe to events at the
same time. A Mediator component can subscribe to multiple events.

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


Setting Event Delivery Consistency
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
One and only one: Events are delivered in m c ownnglobal
their t G transaction.
b
ni Studewithout a global transaction.
Guaranteed: Events are delivered asynchronously
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 that you want, you can set the level of delivery consistency for the
N AinRaddition to the desired filters. The following delivery consistency levels are available:
After you
event
select the event

KO One and only one: An event is delivered to the subscriber in its own global (JTA)
transaction. Changes made by the subscriber within that transaction are committed after
event processing has completed. If the subscriber fails, the transaction is rolled back.
Failed events are retried a configurable number of times before being delivered to an
error queue.
Guaranteed: Events are delivered to the subscriber asynchronously without a global
transaction. The subscriber can create its own local transaction for processing, which is
committed independently of other event processing. The event is guaranteed to be
handed to the subscriber. However, because there is no global transaction, a system
failure can cause an event to be delivered multiple times. If the subscriber throws an
exception (or fails), the exception is logged and the event is not resent.

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


Publishing Events in BPEL Components
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
In an Invoke activity: h a s
Select Event as the interaction m ) e
idtype.
o
cthe event. G u
Browse to select
b m n t
Create or i i tutodaevariable to store the event.
nbrowse
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 e
cevent
A R
To publish a business from BPEL, perform the following steps:

KON
1. Add an Invoke activity to the BPEL process.
2. Double-click the Invoke activity.
3. From the Interaction Type list, select Event.
4. Click the Browse Events icon to select an event.
5. Create or browse to a variable to store the event.

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


Subscribing to Events in BPEL Components
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
a no
In a Receive or Pick activity: as
Select Event as the interaction ) h type. d e
m Gu
oevent. i
Browse to select the c
Create or n i
browse
nt to store the event.
bm to da evariable
@ i S tu
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
To subscribe l
K to a business event in a BPEL process, perform the following steps:
A
KON
1. Add a Receive or Pick activity.
2. Double-click the new activity.
3. Select Event from the Interaction Type list.
4. Click Browse Events to select an event.
5. Create or browse to a variable to store the event payload.

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


Managing Events from Enterprise Manager
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
a n s
1 2n-t r
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
OracleR K
Enterprise l
Manager Fusion Middleware Control provides a Business Events page that
A
Nbe accessed to manage, track, and test events in the EDN.
can
KO To access the Business Events page after you log in to Oracle Enterprise Manager Fusion
Middleware Control, expand the SOA folder in the Farm navigator and right-click the soa-infra
node. Click Business Events to display the Business Events pane, where you can examine
the configuration information for event definitions as well as individual events.
1. To test an event, select the desired event and click Test. The Test Event window opens.
2. Enter the XML data that is needed to form the event payload that you want to test. This
initiates any application that has subscribed to the event being tested.
3. To view all the events in the SOA Infrastructure EDN, click the Events tab.
4. Select an event entry, and then click Show Event Definition.

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


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

a ble
f e r
ans
n - t r
a no
For a given event, view the as
) h de
subscription configuration
information. 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
Click the K l tab to search for and view the different types of subscriptions.
Subscriptions
O NA
K Subscriptions tabbed page enables you to display and search for information about all
The
subscriptions, and also to create database subscriptions (although the screenshot in the slide
has collapsed the Database Subscriptions section). However, in the example, you can see
the Search section and some of the options that enable you to search for different
subscription types, such as:
Database Subscriptions, to narrow the search result to database subscriptions
Component Subscriptions, to narrow the search result to component subscriptions
Database and Component Subscriptions (the default setting)
In the Component Subscriptions section, a table lists the events and components and their
owning composite application subscribing to the event, the event consistency settings, and
the number of delivery failures (if any). This enables you to quickly monitor the state of events
in the EDN.

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


Quiz

The one and only one consistency setting for event


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

subscription causes events to be delivered to the subscriber in


its own global (JTA) transaction.
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
KO

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


Summary

In this lesson, you should have learned how to:


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

Describe business events


Describe the Event Delivery Network
Define an event with Event Definition Language
Use a Mediator to publish and consume events
Use a BPEL process to publish and consume events
r a ble
Use a test case to emulate an event message fe
n s
Manage events in Enterprise Manager Fusion Middleware
n - tra
o
Control 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
A R
N
KO

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


Practice 13 Overview

This practice covers the following topics:


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

Publishing an event from a BPEL process


Subscribing to an event from a Mediator

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 composite application that updates the inventory quantity of a
K J you lcreate
NAitem in a database table. The application then publishes a stockUpdate event (from a
Ogiven
K BPEL process) that contains the product ID of the stock item that is updated.
A second composite application includes a Mediator that subscribes to the stockUpdate
event. The payload of the event is passed to a BPEL process that extracts the purchase order
data for any order that includes the updated item, and has a status of waiting. When the
purchase order is reconstructed, it is passed to the OrderProcessing application that you
created and deployed in the lesson titled Developing Business Rules. Recall that the
application also calls the Approval application that you created in the lesson titled
Implementing a Human Workflow and Notifications.
After deploying the two new applications, you test them by updating the database. You then
go to the Worklist application to approve any orders where it is required, and observe the
outcome.

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


Practice 13 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 R
N
KO

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


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

Testing and Debugging


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

Create test suites for composite applications


Create test cases to initiate inbound messages, and to
emulate outbound, fault, and callback messages
Create test cases with value-based and XML-based
assertions
Discuss strategies for debugging and troubleshooting r a ble
applications n s fe
n - tra
Use the SOA debugger to step through an application
n o and
observe values during execution a
as ) 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
In this lesson, l the implementation of unit tests and test suites (a collection of unit
K you explore
O NAto test various use cases and conditions that verify the correctness of your application
tests)
K implementation coding paths.
With Oracle SOA Suite 12c, testing the components in a composite application becomes
important when you have an application that depends on other services that may not yet be
implemented. By using test suites and test cases, you learn to use emulations and assertions
to test your application in the absence of dependent services to find out if your application
works.
In addition, you learn that unit tests are useful ways to debug an application even with the
presence of dependent services to ensure that your application interactions are consistent with
the requirements of the services that the application invokes.
The goal is to learn how to create test cases and test suites in JDeveloper, deploy them with
the application so that you execute the test cases and suites in Oracle Enterprise Manager
Fusion Middleware Control, and examine the results.
Test cases and test suites provide you with a useful way to debug composite applications and
their interactions.

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


Agenda

Configuring Test Cases


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

Running Test Cases


Using the SOA Debugger

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 14 - 3


Testing SOA Composite Applications

The goals of testing a SOA composite application are to:


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

Automate testing of interactions between internal


components, as well as with external services
Simulate interactions between a SOA composite
application and its partner web services
Ensure that a composite application interacts with web
service partners as expected before deployment in a
r a ble
e
production environment nsf tra
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
RK l
NA
KO

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


Introducing the Composite Test Framework

The composite test framework:


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

Simulates web service partner interactions


Validates process actions with test data
Creates reports of test results
Supports the creation of tests at the SOA composite
applicationlevel for:
Wires a b le
e r
Service binding components a n sf
n - tr
Service components (such as BPEL processes
a noand Mediator
service components)
h a s
Reference binding components om) e
uid c nt G
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
Oracle R
SOA lice an automated test suite framework for creating and running
K JSuite provides
NA tests on a SOA composite application.
repeatable
O
K Note: The test suite framework calculates the percentage of BPEL process service component
source code executed in terms of the percentage of simple activities executed.

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


Emulations and Assertions

The composite test framework allows you to create emulations


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

and assertions.
Emulations enable you to simulate the message data that
your SOA composite application receives from both the
service components inside the composite and the binding
components outside the composite.
Assertions enable you to validate an entire XML document, ble
a part of a message, a non-leaf element, or a leaf element f e ra
a n s
at a point during SOA composite application execution
n - r
t by
o
a n values.
comparing actual values to expected (asserted)
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
A R
N
KO

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


Test Suites: Overview

For each composite application, the composite test framework


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

supports:
Creating one or more test suites, each comprising a
collection of test cases
Deploying the composite application with its test suites to a
runtime environment
Running a composite application test suite, called a test able
run, by using Oracle Enterprise Manager Fusion s f er
Middleware Control - t r an
n no
s a
h a
Note: Each test run corresponds to
o m a) single
u idecomposite
application instance. 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 supports testing various components at the SOA composite
N AR
The composite test
applicationlevel,
framework
as listed in the slide.
O
K The composite test framework enables creating one or more test suites, each of which consists
of a logical collection of one or more test cases. Each test case contains a set of commands
that are performed when a test case instance is executed. The execution of a test suite is
known as a test run. Each test run corresponds to a single SOA composite application
instance.

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


Test Cases: Overview

A test case:
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Is a component of a test suite


Is a specific test that is included in a test run
Can be thought of as a unit test that comprises the
following components:
Process initiation to initiate your process with an input
payload
r a ble
Emulations to emulate interactions n s fe
n - tra
Assertions to validate message content for the interactions
a no
Message files containing the test message s samples used in
a
) hassertions
the process initiation, emulations, and ide om t Gu
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
Each test Kcase mustlbelong to a test suite, and can be thought of as a unit test for a composite
O NA Each test case is executed when the test suite that contains it is run. Test cases
application.
K comprise the following components:
Process initiation, which enables simulation of input messages that initiate your
composite process to test the behavior of the application service entry points
Emulations, which enable you to simulate the behavior of the internal and external
components with which your SOA composite application interacts
Assertions, which enable you to verify the contents of the different data messages that are
exchanged during service interactions and process flow
Message files, which contain sample XML message structures that are used for execution
of the process initiation, emulation, and assertion components
Note: Message data can be embedded in each component or loaded at run time from the
message files, which must be deployed with the test suite.

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


Contents of a Test Case

A test case can contain one or more:


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

Inbound message initiations or initiating events


Outbound message emulations
Callback message emulations
Fault message emulations
Value-based or XML-based assertions 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
K J l i e
ccollection
A R
Test cases consist of a of process initiations (inbound, outbound, and callback),
N
emulations, and assertions. Each of these test action types can be added to test cases in test
KO
mode of the SOA Composite Editor.
You create process initiations to initiate client inbound messages into your SOA composite
application. You create emulations to simulate the message data or fault data (or both types of
data) that your SOA composite application receives from web service partners. You create
assertions to validate the test data in a variable or an XML document as a process is executed.

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


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

a ble
f e r
ans
n - t r
noCase.
Create a Test
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 Kconsist ofl a logical collection of one or more test cases. Each test case contains a
Test suites
setNofAcommands to be run as the test instance is executed. The execution of a test suite is
O
K known as a test run.
1. To create a test suite, in the Project folder, right-click the testsuites folder and select
Create Test Suite.
2. Enter a name for the test suite, and then click OK.

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


Creating the First Test Case

Load or generate the input


3 message to be used.
1 Name the test case.
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
Specify the service, operation,
2 and possible callback to test. m c Load n t orGgenerate the output
i b 4 e
n Stud output will ornotspecify
message, that
i be tested.
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
ccase,
A R
To create the first test perform the following steps:

KO1.N Enter a name and description for the first test case to be added to the test suite.
2. Specify the operation to be tested.
3. Specify an input message.
4. Specify an output message.

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


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

The dashed wire and


A small blue arrow indicates
wire action icon indicate
that the initiating inbound
that an output message
message is defined.
is defined.

a ble
f e r
ans
n - t r
a no
h a s
The Test
test case
Caseeditor
editorlooks
lookslike
assembly editor (composite.xml),
likethe
o m
the)
u ide
except that the outer m clanesare
swimlanes
swim
naret G
differently colored.
colored..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 the Application Navigator window as a child of the test suite, and
N
the ARfile is opened in the Test Case window. The test case XML file visually resembles the
The test
XML
case file appears
O
K composite.xml file. However, you know that it is the test case file by the name of the tabbed
window and because JDeveloper changes the color of the Exposed Services and External
References columns.
You can now visually edit the test case file by adding process initiations, emulations, and
assertions.

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


Test Case File

compositeTest compositeDN="CCValidate" xmlns="http://xmlns.oracle.com/sca/2006/test">


<initiate serviceName="ValidateCreditCard_ep" operation="validateCC" isAsync="false" delay="PT0S">
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

<message>
***
<CreditCheckRequest xmlns="http://www.example.org/ns/ccauthorize">
<CCNumber>9000-1234-1234-1234</CCNumber> The file includes
<amount>200</amount> the input message.
</CreditCheckRequest>
***
</message>
</initiate>
If specified in the wizard, It
<wireActions wireSource="ValidateCreditCard_ep" operation="validateCC">
also includes a wire assertion
<assert comparisonMethod="xml-similar">
<description/> and the description of the
a ble
<expected> output message.
f e r
<location key="output"/>
an s
***
<message>

n - t r
<CreditCheckResponse xmlns="http://www.example.org/ns/ccauthorize">
<status>VALID</status>
a no
</CreditCheckResponse>
h a s
) ide
***
</message>
o m u
</expected>
</assert>
m c nt G
</wireActions> b
ni Stude
</compositeTest> 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 cecase, several folders are created in the project. The tests folder
N ARall the test case XML files. In the slide is an example of a test case file. It is built from
When you
contains
create a test

KO
the information that is provided to the wizard, including the initiating input message, and a wire
assertion that provides an output message. The input file simulates a message provided by a
client, and the output message mimics data returned to that client by the composite.
Note: The messages folder is used to save the message files that provide messages for
emulations and assertions. Message files are XML files that contain XML message fragments,
and can be reused by copying them between test cases and test suites. The other subfolders
(componenttests and includes) are not used in Oracle SOA Suite 12c.

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


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

You can emulate output, callback,


and fault messages, depending on
the context of the selected wire.

a ble
f e r
an
Generate sample messages
s
n - t r
automatically, or load them
from a file or manual input.
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 cecase file opened in JDeveloper, double-click the wire of the SOA
N AR application area to test. This displays the Wire Actions dialog box, from which you
With the
composite
appropriate test

KO
can design emulations and assertions for the selected part of the SOA composite application.
With emulations, you can simulate a message returned from a synchronous web service
partner, a callback message returned from an asynchronous web service partner, or a fault
message returned from a web service partner.

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


Emulating Events in a Test Case

Event messages can be


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

emulated within a test case.

a ble
f e r
an s
n - t r
Specify the event to Sample data can be a no
emulate and the
a
generated and edited.
h s
target subscribers.
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 ceenables you to create a test case in a test suite that publishes an event
to N AR
The unit test framework
a subscriber component such as a Mediator.
O
K To emulate an event, perform the following steps:
1. In a test case XML editor window, click the Emulate Event Messages icon in the test case
XML file window.
2. In the Event Messages window, select the event to be emulated from the Events section
(to the left of the window), and select the target subscriber component from the Publish
Event To drop-down list.
3. Generate, manually enter, or load an XML value for the event payload, and then click OK.
The test case can be executed in the same way as other test cases, by using Enterprise
Manager Fusion Middleware Control.

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


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

2
1

4 le
r a b
s f e
- t r an
n no
5 a
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 verify variable data or process flow. Assertions enable you to
N ARtest data in a variable or an entire XML document as a process is executed. This is
You perform
validate
assertions

KO
done by extracting a value from a variable or an XML document and comparing it to an
expected value.
1. As with emulations, right-click a wire and select Create Asserts and Emulates.
2. In the Asserts and Emulates window, click the Asserts tab, and then click the Add Assert
(+) icon.
3. In the Create Assert window, you can select one of the following assertion options
(depending on the type of interaction underlying the wire):
- Assert Input: Creates an assertion for the inbound direction
- Assert Output: Creates an assertion for the outbound direction
- Assert Callback: Creates an assertion on a callback
- Assert Fault: Creates an assertion for an application fault

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


4. Select Compare by: XML Similar or XML Identical.
- xml-identical: Performs an exact comparison between the elements and
attributes of the XML message and the assertion value. If there is any difference
between the two XML structures, the comparison fails. For example, a failure occurs
if one document uses an element name of purchaseOrder, whereas the other
uses an element name of invoice. A failure occurs if the child attributes of two
elements are the same but appear in a different order in each XML structure. xml-
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

identical is a strict match comparison.


- xml-similar: Performs a comparison based on similar XML content, but not an
exact match. For example, comparison succeeds if both XML structures use the
same XML Namespace string, but different namespace prefixes. Comparison
succeeds if the same elements with the same child attributes exist, but the attributes
appear in different orders in each element. Both these examples are considered
similar and therefore recoverable.
5. In this example, an XML assertion is done for the entire message.
a ble
f e r
Note: You can create multiple assertions on the same wire.
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 14 - 17


Quiz

Which of the following must be present for a test case definition


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

to be run as a unit test?


a. Inbound message initiation or an initiating event
b. Outbound message emulation
c. Callback message emulation
d. Fault message emulation
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
A
AnN
O inbound message initiation or an initiating event is required to run a test case. The absence
K of an inbound message initiation or an initiating event prevents execution of the test case.

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


Agenda

Configuring Test Cases


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

Running Test Cases


Using the SOA Debugger

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 14 - 19


Selecting the Test Cases to Run

After deploying the application with the


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

test suites, open Enterprise Manager.


On the composite application home
page, click the Unit Tests tab.

Select a specific
test case and
click Execute.

a ble
f e r
an s
n - t r
a no
h a s
Enter a name for the
test run and click OK. 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
Before R
you
J
Kcan licetest cases within a test suite, you must deploy the composite
run any
O NA project along with all the test suites it contains to an Oracle SOA Suite 12c runtime
application
K environment, such as a development or test system. Test suites must be deployed with the
composite application, because a composite application instance is created to execute the
selected test cases that form the test run. A test run is an instance of a test.
After deploying the composite application, log in to Oracle Enterprise Manager Fusion
Middleware Control and perform the following steps to select the test cases to be run:
In the Farm navigator, expand the SOA tree and click the composite application name
[version] deployed with the test cases.
On the composite application home page, click the Unit Tests tab (do not click the Test
drop-down menu). The Unit Tests tab opens the Test Cases tabbed page.
On the composite application Unit Tests > Test Cases tabbed page, if needed, expand
Test Suites and select the specific test case to be run, or click the check box next to a test
suite name to select all the test cases in that test suite. The collection of test cases
selected forms a test run. A test run is a collection of test cases that are executed
simultaneously.

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


After selecting the test cases to be run, click Execute, which opens a Details of test run
window.
In the Details of test run window, enter a name string for the test run. Choose a naming
convention for the names to make it easier to search for the test run results on the Test Runs
tabbed page. You can change the timeout for each test; a test is terminated if it exceeds the
timeout. Set the Number of Concurrent Test Instances to create the specified number of test
instances (for simulating load tests). Click OK to start the test run.
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 14 - 21


Running the Test Cases
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Click Test Runs


to monitor and
A composite application
instance is created for a ble
view results. each test case. 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 cthee Details of test run window, an instance of the composite application
is N AR for each test case that is executed in the test run. The test cases are initiated by
When you
created
click OK in

KO
using the initiations, emulations, and assertions defined in each test case. The composite
application instances run without user intervention (unless your code involves a human task,
which still needs to be managed via the normal Worklist application).
Note: After you click Execute to initiate the test run, the web browser page is refreshed with the
Test Runs page being displayed. This enables you to monitor the test run progress and view
the test run results. The following slide, titled Examining Results of a Test Run, provides an
example of the Test Runs tabbed page.

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


Examining Results of a Test Run
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

In the Assertion details for


section, you can see the list of
instance IDs for failed test case
composite applications.

a ble
f e r
an s
n - t r
a no
h a s
o m )
u ide the cause
Composite application
m c nt Gof assertion failure.
Examine
instance ID link to access b
ni Stude
the Flow Trace page 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
cpage
A R
The Test Runs tabbed is displayed after you initiate a test run. Initially, the Test Runs
N may not contain any information. To update the contents of the page and view the
page
O
K progress or results for the test cases in a test run, perform the following steps:
1. Either click Refresh Test Status, or enter search criteria (such as the test run name), and
click Search.
2. In the table immediately under the Search section (or just above the Result of Test Run
section), the name of the test run should appear. Click the test run row entry that appears
to populate the Result of Test Run section with a table of the test suites and test cases
either in progress or completed and the status of each test.
In the Assertion details for section, you can see the list of failed test case composite
application instance IDs. You can also click the [XML] links in each instance row to examine the
test assertion information, such as assertion failures. An example is shown in the next slide,
titled Viewing Assertion Information.

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


In the Assertion details for section of the Test Runs tabbed page, you can view the details of
the test run assertions. The example shows some assertion failures. When you click any of the
[XML] links in one of the Assertion details for table rows, you can view the data that is
compared by the specific assertion and view the reason for any failures.
In the slide, the actual and expected values are displayed and they do not match. However, the
reason may not be obvious at first. The creditLimit and status nodes do not match, but
the reason for the failure is the difference in the tags themselvesthe tags in the actual value
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

include an inp1: namespace reference, whereas those in the expected value do not. Recall
that the xml-identical option requires an exact match between the XML message (or
fragment) structure and the assertion value. The reason for the failure is the XML structure
rather than the data itself.
Note: The instance link in each row is the instance ID of the composite application that is used
to perform the test case. If you click the instance ID link, you can access the Flow Trace page
for that instance to examine and drill down into the composite application and the component
details, as you would for any other 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
( kon e to u
J AIN icens
RK l
N A
KO

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


Quiz

You start a test suite or test case by clicking the Test button
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

on the composite application home page in Oracle Enterprise


Manager.
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
A
AN
O test suite or test case is executed by clicking the Execute button on the Unit Tests > Test
K Cases tabbed page of the composite application page, after you select the test suites and test
cases that are to be run. A test run creates a new composite application instance to run the test
by using the inbound message initiation as initial input.

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


Agenda

Configuring Test Cases


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

Running Test Cases


Using the SOA Debugger

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 14 - 26


Troubleshooting Guidelines

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

1
XML WSDL 2 3 Server Enterprise
Schema Logs Manager
Defines

Service Testing

Request
Composite
Application
a b le
e r
Client
Response?

a n sf
Web
SOA Debugger
tr Service
n -
5 o
s an
) ha de
o m GWeb u i Service Test Tool
4
Examines
SOAP/HTTP
m ent c
i b d
HTTP Analyzer
@ in StuJDeveloper
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 SOAl applications, one approach is to follow the life cycle of a client request
To troubleshoot
and A
Nresponse (if any) through all the components involved in the interaction. Using this
O
K approach, you track the flow of a message through the system and examine possible sources
of an error in a systematic way. First look at error messages, if available, and take action or
make an educated guess as to where to start looking next. Usually, an error message points
to the probable cause and source of the error, and/or the log files to be consulted for more
information. The graphic in the slide depicts a simple request-response life cycle, highlighting
the key service artifacts that may be a source of errors. It shows the tools to help test and
debug an application, and highlights the importance of log files as sources of information.

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


The numbers in the graphic in the slide represent common sources of problems and the tools to
address them:
1. The XML schema validity, and whether it is accessible to the WSDL that is importing it
2. The WSDL document types, the message, the port type and operation definitions, the
URL defining the endpoint, and the service binding definitions
3. The service logic and its runtime environment; the application-level (service-level) and
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

server log files. Enterprise Manager Fusion Middleware Control provides access to all log
files.
4. The actual contents of the request-and-response messages. If SOAP/HTTP bindings are
used, these exchanges can be monitored by using an HTTP Analyzer tool.
5. The SOA debugger, which provides a troubleshooting environment within Oracle
JDeveloper. You can set breakpoints in Oracle JDeveloper for troubleshooting the binding
components and service components in SOA composite applications, and on
synchronous and asynchronous BPEL processes.
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 14 - 28


Debugging SOA Composite Applications
with the SOA Debugger
The SOA debugger provides a
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

troubleshooting environment
within Oracle JDeveloper.

a ble
f e r
ans
n - t r
a no
h a s
o m )
u ide
service components, and m c nt and
Set breakpoints on binding components,
synchronous
G
b
niprocesses. de
asynchronous BPEL i 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 troubleshooting environment within Oracle JDeveloper. You can
AR
The SOA debugger
setNbreakpoints
provides
for troubleshooting on binding components, service components, and
O
K synchronous and asynchronous BPEL processes.
The features include:
Local or remote debugging
Setting break points and tracing message flow
Viewing raw messages (SOAP and Non-XML) entering or leaving
Changing variables while debugging
Viewing transaction boundaries

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


Starting the Debugger

By default, the name of the


local host is displayed. You can
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

also enter a remote server.

a ble
f e r
Specify in minutes how
ans
Enter the port on
long the client should
n - t
wait while attempting to
r
which the debugging establish a debugging
a no
agent listens.
a s
session before stopping.
h
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
capplications
A R
Both local and remote can be debugged. When the debugger is started, the
N
Connection Settings window prompts for the server to use for debugging, the debug port, and
KO
the timeout for the debugger when it is inactive. The debugger properties are stored per project.
If you have imported a project from a different machine, the host will probably have to be
changed. These values can be stored in JDeveloper properties, which enables you to skip the
Connection Settings window if you always want to use the same options.

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


Setting Breakpoints in Services

Choose whether the request,


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

the reply, or both the request


and reply are important.

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 pausing locations in a SOA composite application that you set
forN AR purposes. You can set breakpoints on a request, on a reply, or on both.
Breakpoints
debugging
are the intentional

KO Create Breakpoints Pair: Set for a request-reply (outbound-inbound) interaction. This is


useful for scenarios in which both the request and reply are important.
Create Request Breakpoint: Set for a request (outbound) interaction. This is useful for
scenarios in which only the request is important.
Create Reply Breakpoint: Set for a reply (inbound) interaction. This is useful for
scenarios in which only the reply is important.
Components on which breakpoints are set are designated with red request (outbound) icons,
reply (inbound) icons, or request-reply (outbound-inbound) icons.

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


Setting Breakpoints in BPEL

To set a breakpoint on
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a service component,
select Edit.

Right-click the BPEL activity


on which to set a breakpoint,
and select Toggle Breakpoint. 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
To set R K J on
a breakpoint licaeBPEL process, select Edit. This opens the BPEL process in Oracle
NADesigner. Right-click the BPEL activity on which to set a breakpoint and select Toggle
BPEL
O
K Breakpoint.
An icon is added to the activity. These breakpoint icons are only red dots because the flow is
always in one direction. It is recommended that you always set a breakpoint on the first activity
within an asynchronous BPEL process.
To disable the breakpoint, right-click and select Toggle Breakpoint again. The red dot is
removed. To display a list of all breakpoints set in the BPEL process, right-click the activity and
select Breakpoints. A dialog box appears. You can also enable and disable breakpoints from
this dialog box.

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


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

Right-click the right handle.of the


service binding component and
select Initiate WS Debugging.
This invokes the HTTP Analyzer. le
r a b
s f e
- t r an
no
Enter the request message n
data to sendsoraclick HTTP
hacopydand
Content) to e paste the
om tfrom
contents i
uan XML file.
c G
ibmClickeSend
i n Stud
n Request.
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
To begin debugging of SOA composite application, right-click the right handle of the service
N component and select Initiate WS Debugging from the shortcut menu. This invokes the
binding
O
K HTTP Analyzer. Enter the request message data to send and click Send Request, or click
HTTP Content to copy and paste the contents from an XML file. You can either enter data field-
by-field or copy and paste an XML document.

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


Examining Values

The first breakpoint turns


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

blue and begins pulsing.

a ble
f e r
ans
n - t r
a no
In the Log window at the bottomhof a s
Oracle JDeveloper, click Data. o m )
u ide
Expand the message m c ntYou
contents. G
can double-click
b
nai value e
dchange
to it.
@ i S t u
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 stops lat the first breakpoint that you set (for example, on the service binding
The debugger
O NA
component). In the Log window at the bottom of Oracle JDeveloper, click Data. Expand the
K message contents. You can double-click a value to change it. For non-XML variables, right-
click and select View value (for example, the return message from a Database adapter).

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


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

When you create a breakpoint,


a corresponding frame is
A stack of frames is a breadcrumb
a ble
trail of the locations that lead you
f e r
created in the Structure window.
to your current location.
ans
A frame is a location.
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
When you create a breakpoint, a corresponding frame is created in the Structure window. A
N is a location. A stack of frames is a breadcrumb trail of the locations that lead you to your
frame
KO
current location. This is equivalent to a stack trace. It shows you where you are and how you
got there. Frames are created independent of breakpoints. When you stop at a breakpoint, all
frames that have been created in the Structure window are displayed. A stack frame also
contains the data that existed at that point of time. Clicking a different stack frame in the
Structure window also updates the Data tab.
You can step over or skip the frame and begin debugging at a different location, such as a
different breakpoint. As you proceed with debugging, additional frames are created.

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


Stepping Through the Application

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

Shift-F7 Step Out Of


Shift-F8 Step Over
F9 Resume Step

a ble
f e r
ans
The debugger steps
n - t r
through the copy
a no
rules in an Assign
h a s
activity one at a 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
To stepRthrough lice
K J an application, use the following function keys or the corresponding toolbar
N A
icons:
KO F8 steps over a frame. This places you at the next breakpoint. If there are no
breakpoints, it steps over all the frames and goes back to the first frame.
F7 steps into the next valid location. This can be a new frame or the same frame, but in
a different location.
Shift-F7 steps out of a frame. This option is used only to process a BPEL scope or
sequence activity. After completion of scope processing, it pauses at the next scope or
activity in the process.
F9 resumes a step operation.
Note: The debugger steps through the copy rules in a BPEL Assign activity one at a time.

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


Ending a Debug Session

Click the Terminate icon to


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

end a debug session. As long


as the debugger is running,
the project cannot be edited.

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
orK
To endR
J licaedebugging session, perform the following:
detach from
O NAthe Terminate icon in the tools menu to end a debugging session. The Terminate
Click
K Debugger Process dialog box is displayed. Select an option:
Detach removes the debugger without ending the debugging process.
Terminate ends the debugging process.
Notes
If you selected Detach, click the Debugger icon above the SOA Composite Editor to
resume debugging.
If you selected Terminate, right-click and select Initiate WS Debugging to reinitiate the
debugger and start a new debugging session.

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


Summary

In this lesson, you should have learned how to:


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

Create test suites for composite applications


Create test cases to initiate inbound messages, and to
emulate outbound, fault, and callback messages
Create test cases with value-based and XML-based
assertions
Discuss strategies for debugging and troubleshooting r a ble
applications n s fe
n - tra
Use the SOA debugger to step through an application
n o and
observe values during execution a
as ) 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 14 - 38


Practice 14-1 to 14-3 Overview
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Add assertions. Emulate a reply message.

a ble
f e
CREDITCARDS r
tablens
a
Initiate an inbound n-tr no
message.
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 to create a test suite that contains three test cases and to deploy the
N AR application with its test suite. After the composite application is deployed, you use
The goal
composite
of this practice
O
K Oracle Enterprise Manager to run the test suite and one test case.
The slide illustrates the concept of a composite application test case, which comprises:
An initiating inbound message that provides the input data for the composite application
when the test case is initiated. This initiating inbound message is created on the
composite entry point that is used to initiate the test.
An emulation for the reply from the CreditCardDB service. The reply emulates the
response to the ValidateCreditCard Mediator component from the CreditCardDB service.
An assertion to verify that all or a part of the response data contains data and values that
we expect to be returned from the Mediator component to the client that is initiating the
request
Emulations and assertions are wire actions and can be created on any wire in a composite
application. When an emulation for a reply is created, the actual service for which the emulation
is created does not have to exist. In this case, the CreditCardDB service does exist. However,
we are emulating a scenario that does not return useful data because of information that is
lacking in the database.

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


Practice 14-4 Overview

In this practice, you use the


SOA debugger to step
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

through a running application.

You observe the values in the


HTTP Analyzer.

a ble
f e r
ans
You step through a running n - t r
BPEL process, one line at a a no
time, before terminating the h a s
debug session. 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 14 - 40


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

Securing Composite Applications


and Invoking Secured Services
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 Web Service Security


Describe Oracle Web Services Manager and its use in
securing SOA composites
Discuss security and identity propagation in SOA
composites
Attach security policies to endpoints at design time and runrabl
e
time 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
Consider l scenario:
Kthe following
O NA
K composite application that you are building interacts with a credit card validation service.
The
The business owner of the credit card information requests that you secure the interaction
with credit card validation processing. Your goal is to learn how to apply security:
At design time by using JDeveloper to attach policies to service endpoints
After deployment by using the Oracle Web Services Manager (OWSM) web interface,
which is accessed through Oracle Enterprise Manager Fusion Middleware Control, to
attach policies to appropriate service endpoints
As a result, you will be better informed on the choices you can make about when to apply
security policies to your application. This can be a developer or an administrative task.

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


Agenda

Web Service Security


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

Oracle Web Services Manager


Securing 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 15 - 3


Web Service Security: Introduction

Securing web services by using WS-Security standards:


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

Supported by WS-Security policy standards, among others


Applied to service endpoints to provide:
Authentication and authorization
Signing and encrypting the whole message or parts thereof
Integrity (reliable messaging), confidentiality, and
propagation of credentials a ble
Allow (Y/N)? f e r
WS-Security
an
Authenticate and authorize
s
Authentication UsernameTokenProfile
n - t
WS-Security policy
r
Who? (sign, encrypt, propagate)
a no
Policy has
Request )
enforcement i d e
c om t Gu
point
Response
i b m en
Client @ in Stud Endpoint Service
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
Securing l (or any services) involves protection of:
Kweb services
N A
The service endpoint, which is the entry point to the service functionality
K O
The message contents, through digital signing, encryption, and ensuring message
integrity
Securing web services is addressed by many standards, such as WS-Security and WS-
Security Policy, which define various elements for securing web service endpoints and the
messages that flow between the service consumer and the service provider. WS-Security
standards cover:
Authentication: The process of obtaining a username and password that is validated
by using some kind of identity store
Authorization: The process of allowing or disallowing access to some functionality or
data, usually implemented through privileges that are assigned to roles, or attaching
policies to the environment
Signing and encryption of the message that flows from the client to a service endpoint
Using the WS-* security standards, much of the configuration is declarative, which removes
most requirements for adding security logic to code. The key benefit of a declarative approach
is the ability to change things post-deploymentthat is, no code changes.

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


Web Service Security: Introduction

WS-Security (WSS) 1.0 and 1.1 standards enable:


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

Authenticating in multiple ways with security tokens


Associating different identities with service requests
Signing or encrypting the whole message body, or a single
XML element of the body payload
Adding credentials in the SOAP header, as in this
example: le
r a b
<soap:Envelope xmlns:soap="..." xmlns:wsse="...">
s f e
<soap:Header> ...
<wsse:Security> - t r an
<wsse:UsernameToken> n no Security
<wsse:Username>jcooper</wsse:Username> a
s token
h a
) ide
<wsse:Password>welcome1</wsse:Password>
</wsse:UsernameToken> o m u
</wsse:Security> ...
m c nt G
</soap:Header> ... b
ni Stude
i
in@ this
</soap:Envelope>

r j a
k se
a
on t2014, uOracle and/or its affiliates. All rights reserved.
( kCopyright o
A I N nse
OracleR
supports ice standard for Web Service Security (WS-Security) to provide
K J the lOASIS
O NA
message-level and transport-level security for web services. WS-Security defines a
K mechanism for adding transport independence and different levels of security to SOAP
messages.
If there is a need to apply integrity and confidentiality at a fine-grained level, XML signature
and encryption can be used to protect the SOAP body, header block, or portions of either.
If the SOAP message needs to be protected beyond the transport session, message-level
security can be used. If there is a need to use different forms of authentication, message-level
security authentication tokens can be used, such as username token, X.509 token, or a
Security Assertion Markup Language (SAML) token.
In the Oracle implementation, all WS-Security features (including digital signatures,
encryption, and authentication) are implemented by using a prebuilt JAX-WS handler called
an interceptor. The interceptor adds the authentication, signature, and encryption WS-
Security elements to the SOAP message, and then forwards the message to the receiving
web service. A receiving web service also has interceptors to decrypt, verify signatures, and
authenticate incoming messages.
The Oracle implementation of WS-Security integrates with Java Authentication and
Authorization Service (JAAS) and a variety of authentication providers.

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


Many web service standards are involved with Web Services Security implementations.
Remember that authentication for web services is done by using Oracle Platform Security
Services (OPSS) Login Modules. For SOA composites and components, security is
implemented through the WS-PolicySecurity standard, where policies are stored in the WS-
Policy 1.2 format, and the policies that are used are advertised through WSDL in the WS-
Policy 1.2 format as well.
OPSS and Oracle Web Services Manager enable the same policy to be reused and applied to
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

more than one service, which provides the capability to do bulk attachment.
Policies can be versioned so that older policies are re-established by using a policy rollback
operation. Oracle Platform Security for Java provides automatic identity propagation. Other
supported web service standards include:
WS-Security 1.0
WS-Security 1.1
WS-SecurityPolicy 1.1
a ble
WS-Security-SwA f e r
ans
UsernameTokenProfile 1.1
n - t r
X509TokenProfile 1.1
a no
Security-Policy Use cases Working Draft 2
h a s
Note: OPSS makes use of the Oracle Fusion Middleware
o m u ideServer Java Platform
)Application
Security (JPS) implementation.
m c nt G
b
ni Stude
i
j a in@ this
a r k se
( kon e to u
J AIN icens
R K l
A
KON

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


Securing Endpoints: Examples

Policy name is used


to enforce assertions.
<service name="receiveOrder" ui:wsdlLocation="receiveOrder.wsdl">
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

<interface.wsdl interface=".../receiveOrder#wsdl.interface(execute)"/>
<binding.ws
port=".../receiveOrder#wsdl.endpoint(receiveOrder/execute)">
<wsp:PolicyReference URI="oracle/wss_username_token_service_policy"
orawsp:category="security" orawsp:status="enabled"/>
</binding.ws> </service

In composite.xml, security Security policies are also


policies are attached in the attached in the bindings of
a ble
bindings of service endpoints. external reference endpoints.
f e r
an s
<reference name="getCreditCardStatus" ... >
n - t r
<interface.wsdl interface=".../getStatusByCC#wsdl.interface(execute)"/>
a no
<binding.ws
h a s
) ide
port=" ... /getStatusByCC#wsdl.endpoint(getStatusByCC/execute_pt)"
location=" ... /validationForCC/getStatusByCC?WSDL">
o m u
c nt G
<wsp:PolicyReference URI="oracle/wss11_saml_token_client_policy"
m
b
ni Stude
orawsp:category="security" orawsp:status="enabled"/>
</binding.ws> </reference> 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 briefly show how security policies can be attached to service
N AR bindings in the composite.xml file.
The examples
endpoint
in the slide

KO Thus, security policies can be declaratively attached to the inbound requests (the service
endpoints) to a SOA composite, and the outbound requests (the external reference endpoints)
from the SOA composite.
The URI attributes in each example identify the policy names, which define one or more
security assertions that are applied at run time to enforce the policy rules during the request-
response message life cycle.
Note: The various URL references in the examples were shortened to make it easier to read
the examples. Details about security policies (including those used in the examples) are
discussed in subsequent slides in this lesson.

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


Quiz

Authentication can be incorporated by using _____________ .


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

a. Signature
b. Security tokens
c. Encryption

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
KO

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


Agenda

Web Service Security


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

Oracle Web Services Manager


Securing 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 15 - 9


Oracle Web Services Manager

Oracle Web Services Manger (OWSM) is a security and


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

management system that provides a common security


infrastructure for web services applications.
OWSM is based on three main operations:
Define
Enforce
Monitor
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
J e
icdefine
OWSMR designed lto
isK and implement web services security in heterogeneous
N A
environments. Instead of coding security logic in the application, you can use OWSM to
KOimplement declarative security and management through predefined policies. The three main
operations on which OWSM is based are:
Define: Attaching security and management policies to the web services to be protected
Enforce: The ability provided by OWSM to distribute policies from a central policy
manager to policy enforcement points that execute the security and management
policies at run time
Monitor: Tracking of runtime security and management events captured by OWSM

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


OWSM Policy Framework

Provides a policy framework to manage and secure web


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

services consistently
Is built by using the WS-Policy standard and leverages the
OPSS Login Module and the Oracle WebLogic Server
authenticator for authentication and authorization

Oracle Web Services Manager a ble


f e r
Policy Enforcement Point
ans
n - t r
Oracle Platform Security a no
Login Module h a s
o m )
u ide
m c nt G
Oracle WebLogic b
ni Stude
Server
Authenticatori
j a in@ this
a r k se
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
OWSMR can
J
K be lice from Oracle Enterprise Manager Fusion Middleware Control to:
leveraged
N A
Centrally define policies by using the OWSM Policy Manager
K O
Enforce OWSM security and management policies locally at run time
Tasks that can be performed from OWSM include:
Handling WS-Security (for example, encryption, decryption, signing, signature
validation, and so on)
Defining authentication and authorization policies against an LDAP directory
Generating standard security tokens, such as SAML tokens, to propagate identities
across multiple web services that are used in a single transaction
Segmenting policies into different namespaces by creating policies within different
folders
Examining log files

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


Components of Oracle
Web Services Manager Architecture
Reliable
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

MTOM Security Addressing Management


Messaging

Oracle Enterprise Manager


OWSM
Fusion Middleware Control
Policy
Manager
Oracle JDeveloper

a ble
Metadata
f e r
Store
ans
(MDS)
n - t r
a no
h a s
Oraclec o m) Guide
Fusion
m
Middleware
n t
i b e
@ in DatabaseS 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
Components l
K of the OWSM Architecture include the following:
N A
KO Oracle Enterprise Manager Fusion Middleware Control: Enables administrators to
access Oracle Web Services Managers functionality to manage, secure, and monitor
web services
Oracle Web Services Manager Policy Manager: Reads and writes policies, including
the predefined and custom policies from the Meta Data Store
Oracle WSM Agent: Manages the enforcement of policies via the Policy Interceptor
Pipeline
Policy Interceptors: Enforce policies, including reliable messaging, management,
addressing, security, and Message Transmission Optimization Mechanism (MTOM)
Metadata Store (MDS): Is used for storing policies. Policies can be stored as files in the
file system (supported for development) or in the Oracle Fusion Middleware database
(supported for production).
Oracle Fusion Middleware Database: Provides database support for the MDS

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


Policies: Introduction

Policies describe the capabilities and requirements of a web


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

service. The different types of policies that are supported in


Oracle Fusion Middleware 12c are:
WS-ReliableMessaging
Management
WS-Addressing
Security r a ble
n s fe
Message Transmission Optimization Mechanism (MTOM) ra
o n -t
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 types ofl policies that are available are the following:
The different
N A
WS-ReliableMessaging: The reliable messaging policies that implement the WS-
K O
ReliableMessaging standard describe a wire-level protocol that allows guaranteed
delivery of SOAP messages, and can maintain the sequential order in which a set of
messages are delivered.
Management: Management policies log request, response, and fault messages to a
message log. Management policies may include custom policies.
WS-Addressing: WS-Addressing policies verify that SOAP messages include WS-
Addressing headers in conformance with the WS-Addressing specification. Transport-
level data is included in the XML message rather than relying on the network-level
transport to convey this information.
Security: Security policies implement the WS-Security 1.0 and 1.1 standards. They
enforce message protection (message integrity and message confidentiality), and
authentication and authorization of web service requesters and providers. The following
token profiles are supported: username token, X.509 certificate, Kerberos ticket, and
Security Assertion Markup Language (SAML) assertion.
Message Transmission Optimization Mechanism (MTOM): Binary content, such as
an image in JPEG format, can be passed between the client and the web service. To be
passed, the binary content is typically inserted into an XML document.

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


Policy Assertions

OWSM policies contain one or more assertions that exhibit


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

a particular behavior.
Assertions are executed in the order in which they are
listed in the policy.

Policy a ble
Request f e r
ans
Assertion 1 Assertion 2 Assertion n
n - t r
Response
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
OWSMR K J consist
policies liceof one or more assertions that exhibit a particular capability or
O NA For example, a security policy could be made up of two assertions: a Log assertion
behavior.
K and a WS-Security assertion. If this particular security policy is attached to a service endpoint,
for the request message, the Log assertion is executed, first logging the request message to a
log file, followed by the WS-Security assertion that authenticates the requestor based on the
token sent in the message and decrypts the message if the message is encrypted.
OWSM policy assertions are instances of policy assertion templates that are added to a policy
at policy creation time. OWSM:
Provides a set of predefined policy assertion templates
Enables users to define custom policy assertions that can be combined with predefined
policy assertions
Note: Custom policy assertions are used when specific functionality is not provided.

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


Types of Security Tokens

Security tokens are used to convey credential information to


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

services. The security tokens that are supported are:


UsernameToken: With plain type and digest password
BinarySecurityToken: For embedding certificates
EncryptedData: For representing a SOAP node or
attachment, which is encrypted
Note: SAML is used to exchange authentication and r a ble
authorization data, such as sending security tokens between n s fe
security domains. n - tra
a no
Example: UsernameToken in plain text (in aaSOAP
s header):
) h de
<wsse:UsernameToken>
<wsse:Username>jcooper</wsse:Username> c om t Gui
i b m en
</wsse:UsernameToken> @ in Stud
<wsse:Password>welcome1</wsse:Password>

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
Specific K l (WSS) 1.0 tokens include:
WS-Security
N A
WSSUsernameToken: This token uses a plain username and password either in plain
K O
text or digest form
WSS10UsernameWithCerts: Along with UsernameToken, this token sends sensitive
data that can be signed or encrypted. Certificate information is also passed in
BinarySecurityToken, IssuerSerial, or KeyIdentifier.
WSS10AnonymousWithCerts: No username or password is sent. Client does not
identify itself to the server. The message exchange must be secure by using signatures
or encryption.
WSS10UsernameTokenOverSSL: This token is similar to the plain username token.
The transport security part is different.
WSS10MutualAuthWithCerts: The client goes for strong authentication by identifying
itself with X509 credentials. The client X509Token is embedded in the message
signature.

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


Additional tokens that are defined for WS-Security 1.1 include:
WSS11AnonymousWithCerts: This token is similar to WSS10. The requestor is not
identified to the service. The request may be signed or encrypted by using ephemeral
keys, or keys derived from ephemeral keys. The response is signed with the same
ephemeral key or derived key.
WSS11MutualAuthWithCerts: The request message data is signed by using
symmetric key mechanisms. (The signature is computed with an ephemeral key or
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

derived key by using asymmetric key mechanisms.)

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 15 - 16


Security Assertion Markup Language (SAML)

Exchanges security information between different parties


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

Conveys information about subjects, human users, or any


entities with the following types of assertions:
An authentication assertion
An authorization assertion
An attribute assertion
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
SAML R is K
J lice
meant for exchanging security information between different security domains
A
N especially authentication details such as user login information, user attributes, and
(parties),
KOauthorization information in the form of policies.
SAML contains one or more assertions, each of which conveys information about subjects
(human users or any entities). Each assertion may contain multiple statements about
authentication, authorization, and additional attributes.
SAML supports the following types of assertions:
Authentication assertion: Conveys information that a certain subject was
authenticated at a certain instant
Authorization assertion: Conveys information about the access privileges for a user to
certain resources
Attribute: Conveys information about subject attributes
SAML assertions are typically used for achieving single sign-on (SSO). When a user is
authenticated in one domain, the user is not required to authenticate again in other domains.
This is possible because authentication information is conveyed to all relevant parties, which
then use the information to testify that the user or entity was indeed authenticated at the
instant claimed. Note that the user could be a program.

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


Security Policies: Introduction

Policies contain one or more assertions (called


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

a security pipeline), such as log, extract token,


Authenticate: Sets and decrypt. Both SOAP and REST services
UsernameToken are secured with OWSM policies.
values

WS-Security: Carries
UsernameToken

Request
Policy
a ble
enforcement
f e r
point
a n s
Response
n -t r
Service
Client o
s an
WS-SecurityPolicy: ) ha de
c om t Gui
The oracle/wss_username_token_service_policy
policy can be used to m extract token n data, apply
authentication and i b e
n Stud set the subject.
authorization, and
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
OracleRFusion lice uses a policy-based model to manage web services. Policies apply
K J Middleware
O NA to the delivery of messages. Policies are part of an enterprise policy framework.
standards
K This enables policies to be centrally created and managed.
Policies contain one or more assertions. A policy assertion is the smallest unit of a policy that
performs a specific action. Policy assertions are executed on the request message and the
response message, and the same set of assertions is executed on both types of messages.
The assertions are executed in the order in which they appear in the pipeline.
Policies are configured by using Oracle JDeveloper at design time and Oracle Enterprise
Manager Fusion Middleware Control console at run time. The predefined OWSM
authentication policies are:
oracle/wss_username_token_service_policy
oracle/wss11_saml_token_client_policy
oracle/wss11_saml_token_service_policy

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


Quiz

Policies are made up of one or more _____________ .


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

a. Tokens
b. Protocols
c. Assertions

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
KO

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


Agenda

Web Service Security


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

Oracle Web Services Manager


Securing 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 15 - 20


Securing SOA and Identity Propagation

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

user. Composite
ProcessOrder
Username (BPEL) oracle/wss11_saml_token_service_policy
Token
Verify SAML token.
receive Authenticate.
Set subject.
Web Client
Verify security. Binds
a b le
Authenticate.
SAML
f e r
Set subject.
an s
CCAuth
n - t r
no Authorization
oracle/wss_username_token_service_policy
Credit
s a
Fulfillment ) h a e Service
om t GRead i d
u subject.
m en c Insert SAML token.
i b
@ inFinalizeStud oracle/wss11_saml_token_client_policy

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 in the lslide illustrates the use of three different policies to authenticate,
The example
O NA and propagate username credentials. Following the request flow, web service
authorize,
K policies are used for authentication and identity propagation:
The Web client obtains the username and password from the user, authenticates the
information, and populates the Username token by using WS-Security headers.
The ProcessOrder BPEL service entry point applies the
oracle/wss_username_token_service_policy attachment to verify security,
authenticate the user, and set the subject with the identity details.
The authorization part may then be applied by using a specified policy.
The ProcessOrder BPEL component is configured with
oracle/wss10_saml_token_client_policy attached to the external reference for
the Credit Authorization Service, causing the process to read the subject and insert the
identity information into the SAML token that is sent in the request to the external
services.
The Credit Authorization Service has oracle/wss11_saml_token_client_policy
attached so that it can verify the SAML token, authenticate, and set the subject to
complete the identity propagation between services.

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


Attaching a Policy to an Inbound Request

Scenario: UsernameToken-based identity authentication


Policy: oracle/wss_username_token_service_policy
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

<service name="Enroll" ui:wsdlLocation="Enroll.wsdl">


<interface.wsdl
interface=/Enroll#wsdl.interface(execute_ptt)"/>
<binding.ws
port=/Enroll#wsdl.endpoint(Enroll/execute_pt)">
<wsp:PolicyReference
URI="oracle/wss_username_token_service_policy"
a ble
orawsp:category="security"
f e r
orawsp:status="enabled"/>
an s
</binding.ws>
n - t r
</service>
a no
h a s
The attachment is added to the service
point) in composite.xml. o m ) (entry
u ide
Result: The user is authenticated,m c andnttheG
subject is associated with b
ni theScurrent de thread.
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 attachment fragment for the following scenario:
A R
The slide shows the policy
N
KO The scenario: UsernameTokenbased identity authentication. In this case:
- The policy enforces the authentication of credentials that are provided via the
UsernameToken WS-Security SOAP header (both plain text and digest
mechanisms are supported)
- The credentials obtained are authenticated against the currently configured JPS
identity store
The result: The user is authenticated, and the subject is associated with the current
request thread.
The policy: oracle/wss_username_token_service_policy
Note: This policy can be applied to any SOAP-based endpoint.

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


Attaching a Policy to an Inbound Request
by Using Oracle JDeveloper 12c
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
2 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 12c to attach policies for testing security in a design-time
N AR When your application is ready for deployment to a production environment, you
You use Oracle
environment.
JDeveloper

KOcan attach runtime policies in the Oracle Enterprise Manager Fusion Middleware Control
console.
To attach a policy to an exposed service, perform the following steps:
1. Right-click the exposed service and select Configure WS-Policies.
2. Click the Add icon for the type of policy, and then select the respective policy to attach.
The slide shows an example to attach an
oracle/wss_username_token_service_policy security policy to the
receiveOrder service.

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


Attaching a Policy to an Outbound Request
Scenario: SAML-based identity assertion
Policy:
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

oracle/wss10_saml_token_client_policy

<reference name="BookingService"
ui:wsdlLocation=".../Booking.wsdl">
<interface.wsdl interface=".../Booking#wsdl.interface(Booking)"/>
<binding.ws
port=".../Booking#wsdl.endpoint(booking_client_ep/Booking_pt)"
location=".../BookingSystem/booking_client_ep?WSDL"
soapVersion="1.1">
<wsp:PolicyReference URI="oracle/wss10_saml_token_client_policy"
a ble
orawsp:category="security" f e r
orawsp:status="enabled"/>
ans
</binding.ws>
n - t r
</reference>
a no
h a s
The attachment is added to an m
o
)
external
u i de
reference in composite.xml.
m c andnttheG
b
ni Stude
Result: Identity is propagated,
i
payload is encrypted.

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 policy attachment fragment for the following scenario:
A R
The example in the slide
N
KO The scenario: SAML-based identity assertion. In this case:
- The policy enables SAML token population for outbound SOAP requests by using
the mechanisms described in WS-Security 1.0
- A SAML token is included in the SOAP message for use in SAML-based
authentication with the sender vouching confirmation
The result: Identity is propagated and the payload is encrypted.
The policy: oracle/wss10_saml_token_client_policy
Note: This policy can be applied to any SOAP-based reference.

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


Attaching a Policy to an Outbound Request
by Using Oracle JDeveloper 12c
1
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

a ble
f e r
ans
n - t r
2
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 ceexternal reference, perform the following steps:
A R
To attach a policy to an
N
O 1. Right-click the external reference and select Configure WS-Policies.
K 2. Click the Add icon for the type of policy.
3. Select the relevant policy to attach.

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


Managing SOA Composite Application Policies
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Policies
page

a ble
f e r
ans
n - t r
a no
Specify the component
to which the policy is to h a s
be attached.
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 ctoe the delivery of messages. You can attach security policies to and
N ARsecurity policies from the currently deployed SOA composite applications.
Policies
detach
apply security

KO To manage SOA composite application policies, perform the following steps:


1. On the Oracle Enterprise Manager home page, expand the soa-infra > SOA folders, and
click a SOA composite application link.
2. On the SOA composite home page, click the Policies tab.
Note: The Policies page enables you to attach policies to and detach policies from the
web service binding components and the service components of the SOA composite
application. The policies table displays the attached policy name, the component to
which the policy is attached, the policy reference status (enabled or disabled) that you
can toggle, the category (Management, Reliable Messaging, MTOM Attachment,
Security, or WS Addressing), any violations, and all authentication, authorization,
confidentiality, and integrity failures since the SOA Infrastructure was last restarted.
3. On the Policies page, click Attach To/Detach From.
4. Select the component to which to attach or from which to detach a policy. This invokes a
dialog box for attaching or detaching policies.

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


Managing SOA Composite Application Policies
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Attach the policy.


Execute the
a ble
validation test.
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 ceare appropriate to your environment, and then click Attach.
R
5. Select policies that
NANote: Attach additional policies as required.
KO6. When you have finished attaching policies, click Validate.
Note: If an error message appears, make the necessary corrections until you no longer
have any validation errors.
7. Click OK.

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


Summary

In this lesson, you should have learned how to:


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

Describe Web Service Security


Describe Oracle Web Services Manager and its use in
securing SOA composites
Discuss security and identity propagation in SOA
composites
Attach security policies to endpoints at design time and runrabl
e
time 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
RK l
NA
KO

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


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

wss_username_token_service_policy

wss11_saml_token_client_policy

Enrollment BookingSystem

Enrollment
BPEL
a ble
Enroll BookingService booking_client_ep
f e r
ans
n - t r
a no
Propagate security identity. as
) h de
c om t Gui
i b m wss11_saml_token_service_policy
e n
Receive security identity.
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
The goal K l is to implement security on the endpoints of composite applications,
of this practice
NAas the Enrollment and BookingService interactions.
such
O
K In this practice, you perform the following tasks:
Apply the UsernameToken security to the Enrollment composite application, which
requires an authenticated username and password to be provided in the WS-Security
headers from its client. After receiving valid credentials, the policy sets the security
identity.
Attach a SAML client policy to the BookingService external reference, which propagates
the security identity to the BookingSystem composite application entry point.
Enforce a SAML service policy on Booking_client_ep, which is the entry point to the
BookingSystem composite application and which requires valid security credentials to
be provided to allow the invocation to proceed.
You first attach the security policies to the deployed applications by using Oracle Enterprise
Manager. After detaching the policies, you repeat the process at design time by attaching the
policies to the endpoints, in JDeveloper, and deploy the applications. You then deploy the
applications with the security policies disabled.

Oracle SOA Suite 12c: Build Composite Applications 15 - 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

Request-Response Patterns

a ble
f e r
ans
n - t r
Appendix A 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
N
KO
Request-Response Patterns

The following request-response patterns are covered in this


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

appendix:
One-Way Message
Synchronous Interaction
Asynchronous Interaction
Asynchronous Interaction with Timeout
Asynchronous Interaction with a Notification Timer r a ble
n s fe
One Request, Multiple Responses
n - tra
One Request, One of Two Possible Responses a no
h a s
One Request, a Mandatory Response, ) and dan
e Optional
m u i
Response co t G m en
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
Request-response l
patterns are used to facilitate communication between the components of
aN A
Business Process Execution Language (BPEL) process. The request-response operation
KOincludes one input element (the request) followed by one output element (the response).
Note: The request-response patterns listed in the slide are discussed on the remaining pages
of this appendix.

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


One-Way Message Interaction

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

No response
Service client Service

Some SOA implementations:


Routing rule
Mediator Service

BPEL
Invoke
Service a ble
f e r
ans
n - t r
BPEL
Invoke Receive
BPEL
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
A one-way message interaction pattern is a special type of request-response pattern, where
OtheNclient sends a message to the service, and the service does not need to reply. This could
K be used for business updates if the requester trusts the message service and the transaction
not to fail.
The communication pattern for the one-way message interaction involves:
A service consumer: The client that invokes the service and supplies the input
message
A service provider: The service that accepts an input message from the service client,
and does not provide a response (output message)
The diagrams show various implementations of a one-way message interaction pattern, such
as:
A Mediator component with a routing rule to a service
A BPEL component to a service

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


The service that consumes the message can also be another SOA component, as shown in
the BPEL to BPEL example, which contains the following implementation:
The BPEL client executes an Invoke activity to execute a one-way operation that is
exposed by the partner link.
The BPEL service accepts the input message by using a Receive activity, and does not
use a Reply activity because there is no response provided or expected.
Note: The Web Services Description Language (WSDL) for a one-way service does not
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

define an output message for the operation.

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 A - 4


Synchronous Interaction

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

Immediate response
Service client Service

Some SOA implementations:

BPEL BPEL le
Mediator request request
r a b
BPEL
s f e
Receive - t r an
Receive
response response
n no
Route Invoke
s a
fault h a fault
Reply
o m )
u ide Reply

Client Service m c nt G
Client Service
i b d e
@ 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 K
In a synchronous l
interaction, a client sends a request to a service, and receives an immediate
A
N or fault.
reply
KO The service can be at either end of this interaction, and is implemented based on its role as
the client or the service. The image in the slide shows two diagrams of a synchronous
interaction between two SOA components.
A BPEL process component client with a BPEL process component service
- The BPEL client contains an Invoke to manage the request-response cycle.
- The BPEL service contains a Receive to obtain the request message, and then
after some processing, return a response by using a Reply, or throw a fault
condition.
A Mediator component client with a BPEL process service
- The client contains a synchronous route to send the request to a BPEL service,
and receive the response or fault.
- The BPEL service contains a Receive to obtain the request message, and then
after some processing, return a response by using a Reply, or throw a fault
condition.

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


Note: A synchronous service may optionally generate an error message (or fault) as a
response.
Whether the BPEL and Mediator clients are in the same SOA Composite or different ones, the
integration pattern remains the same.
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 A - 6


Asynchronous Interaction

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

Delayed response
Service client Service

Some SOA implementations:


Client Service Client Service
BPEL BPEL BPEL le
Mediator request request
r a b
s f e
Receive Invoke - t r an
Receive
Route
n no
response
s a
response
h a
Invoke Receive
o m )
u ide Invoke
m ent c G
i bProcessOrder CheckInventory

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 K
In an asynchronouslinteraction, a client sends a request to a service and waits until the
NA replies.
service
O
K The image in the slide shows two diagrams of an asynchronous interaction between two SOA
components.
A BPEL process component client with a BPEL process component service
- The BPEL client contains an Invoke to initiate the request and do some
processing, and a Receive to obtain the response.
- The BPEL service contains a Receive to obtain the request message, and then
after some processing, return a response by using an Invoke to the client callback
port.
A Mediator component client with a BPEL process service
- The client contains an asynchronous route to send the request to a BPEL service,
and wait for a response.
- The BPEL service contains a Receive to obtain the request message, and then
after some processing, return a response by using an Invoke to the client callback
port.
Note: An asynchronous service would return errors as another response message.

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


One Request, Multiple Responses

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

Service client Multiple responses Service

SOA implementation:
BPEL BPEL
request

Invoke Receive
a b le
response1
f e r
an s
Receive Invoke n - t r
response2
a no
Sequence
a s
Sequence
Receive
m ) h ide
Invoke
response3 co G u
b m en t
i
in Stud Invoke Service
Receive Client
@
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
In this R K
interaction l the client sends a single request to a service, and receives multiple
type,
NA in return. For example, the request can be to order a product online, and the first
Oresponses
K response can be the estimated delivery time, the second response can be payment
confirmation, and the third response can be a notification that the product has been shipped.
In this example, the number and types of responses are expected.
The BPEL Process client: When the BPEL process is on the client side of this
transaction, it needs an Invoke activity to send the request, and a sequence activity with
three Receive activities, one for each reply.
The BPEL Process service: The BPEL service needs a Receive activity to accept the
message from the client, and a sequence attribute with three Invoke activities, one for
each reply.
Note: As with all partner activities, the WSDL file defines the interaction.

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


One Request, a Mandatory Response,
and an Optional Response
Request
Pattern:
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Delayed response
Service client and optional response Service

SOA implementation: Service BPEL


BPEL Client
Receive
request Delay? Otherwise
a b le
Invoke f e r
Optional
ans
response Switch
n - t r
Scope onMessage A Notify user Invoke A
a no
of delay
h a s When
responseom
)
u ide product
m c nt G ships
i b e
Receive B
@ in Stud Invoke B

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
type l the client sends a single request to a service, and receives one or
K of interaction,
A
OtwoNresponses. Here, the request is to order a product online. If the product is delayed, the
K service sends a message to inform the customer. In any case, the service always sends a
notification when the item ships.
The BPEL Process client: When the BPEL process is on the client side of this
transaction, it needs a Scope activity containing the Invoke activity to send the request,
and a Receive activity to accept the mandatory reply. The onMessage handler of the
Scope activity is set to accept the optional message and instructions on what to do if the
optional message is received (for example, notify you that the product is delayed). The
client BPEL process waits to receive the mandatory reply. If the mandatory reply is
received first, the BPEL process continues without waiting for the optional reply. As with
all partner activities, the WSDL file defines the interaction.
The BPEL Process service: The BPEL service needs a Scope activity containing the
Receive activity and an Invoke activity to send the mandatory shipping message, and
the Scope activitys onAlarm handler to send the optional delayed message if a timer
expires (for example, send the delayed message if the item is not shipped in 24 hours).

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


The image in the slide shows a diagram of what happens when one request results in a
mandatory response and an optional response. The following actions take place:
1. The client BPEL process has a Scope activity and an onMessage A attribute. The Scope
activity has a call service Invoke activity to send the request to the service BPEL process,
and wait for a callback Receive activity for the callback.
2. The client call service Invoke activity sends a request to the service BPEL process by way
of a WSDL partner link.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

3. The service BPEL process has the following activities:


- A Receive activity to receive the clients response
- A Switch activity containing logic to either delay a response or not
- An Invoke activity to send the mandatory response back to the client
4. If the product is delayed, the Switch activity in the service selects Message A and sends it
to the wait for a callback Receive activity in the client BPEL process.
5. When the product ships, the Invoke activity sends Message B to the wait for a callback a ble
f e r
Receive activity in the client BPEL process.
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 A - 10


Asynchronous Interaction with Timeout Pattern

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

Delayed response
Service client or timeout Service

SOA implementation:
BPEL BPEL
request

a ble
Invoke Receive
f e r
ans
n - t r
a no
Pick response
h a s
m ) e
idInvoke
o
c nt G u
b m
onAlarm onMessage
Timeout logic logic ni Stude
Client
i Service
@
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
In an asynchronous linteraction with a timeout, a client sends a request to a service and waits
NAit receives a reply, or until a certain time limit is reached, whichever comes first.
until
O
K The sample implementation in the slide shows:
A BPEL process client, which uses an Invoke to send an asynchronous request to the
service, and a Pick activity with:
- An onMessage branch to receive the response (callback)
- An onAlarm branch to manage the timeout condition if it occurs before the
response is received
Note: If the response comes after the time limit has expired, the message goes to
the dead letter queue.
A BPEL Process service that contains a Receive to obtain the request message, and
then after some processing, return a response by using an Invoke to the client callback
port
Note: As with all partner activities, the WSDL file defines the interaction.

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


Asynchronous Interaction
with a Notification Timer Pattern
Pattern: Request
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Delayed response
Service client with timeout Service

SOA implementation:
BPEL BPEL
request
a ble
f e r
Invoke Notify someone Receive ans
when a timeout
n - t r
onAlarm
occurs.
a no
Scope response as
) h de
Receive c om t Gui Invoke
i b m en
Client
@ in Stud Service
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
In an asynchronous linteraction with a notification timer, a client sends a request to a service
O NA
and waits for a reply, although a notification is sent after a timer expires. The client continues
K to wait for a reply from the service even after the timer has expired.
The BPEL Process client: When the BPEL process is on the client side of this
transaction, it needs a Scope activity containing an Invoke activity to send the request,
and a Receive activity to accept the reply. The onAlarm handler of the Scope activity
has a time limit and instructions on what to do when the timer expires. For example, wait
30 minutes, and then send a warning indicating that the process is taking longer than
expected. As with all partner activities, the WSDL file defines the interaction.
The BPEL Process service: As with a synchronous transaction, when the BPEL
process is on the service side of an asynchronous transaction, it needs a Receive
activity to accept the incoming request, and an Invoke activity to return either the
requested information or a fault.
Note: This pattern makes use of the onAlarm branch in a Scope.

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


One Request, One of Two Possible Responses

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

Delayed response A
Service client or response B Service

SOA implementation:
BPEL Client Service BPEL
request

Invoke Receive
a b le
e r
Item in sf
Otherwise
a n
n-tr
stock?

Pick a no
Switch
h a s
o m )
u ide
onMessage onMessage response
m
A c ntInvoke G Invoke
B A
n S i b d e A B
i t u
in@ this
response B

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 e
cone
A R
In an interaction using request and one of two possible responses, the client sends a
N request to a service and receives one of two possible responses. For example, the
single
KOrequest can be to order a product online, and the first response can be either an in-stock
message or an out-of-stock message. The diagram in the slide provides an overview.
The BPEL Process client: When the BPEL process is on the client side of this
transaction, it needs the following:
- An Invoke activity to send the request
- A Pick activity with two branches: one onMessage for the in-stock response and
instructions on what to do if an in-stock message is received, and a second
onMessage for the out-of-stock response and instructions on what to do if an out-
of-stock message is received
The BPEL Process service: The BPEL service needs a Receive activity to accept the
message from the client. It also needs a Switch activity with two branches: one with an
Invoke activity that sends the in-stock message if the item is available, and a second
branch with an Invoke activity that sends the out-of-stock message if the item is not
available.
Note: As with all partner activities, the WSDL file defines the interaction.

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


The image in the slide shows a diagram of what happens when a request results in one of two
possible responses. The following actions take place:
1. The client BPEL process has a call service Invoke activity to send a request to the service
BPEL process, and a Pick activity to select from the responses.
2. The client BPEL processs call service Invoke activity sends a request to the service BPEL
process by using a WSDL partner link.
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

3. The service BPEL process has a Receive activity and a Switch activity. The Receive
activity receives the clients request (from the call service Invoke activity) and sends its
data to the Switch activity.
4. The Switch activity performs either of the following actions:
- If the item is in stock, it invokes Message A.
- If the item is not in stock, it invokes Message B.
5. Then the Switch activity sends either Message A or Message B back to the client.
6. The Pick activity in the client BPEL process receives either Message A or Message B, and a ble
f e r
depending on the message, its branches do the following:
ans
- If Message A is sent, the onMessage A branch handles the response.
n - t r
no
- If Message B is sent, the onMessage B branch handles the response.
a
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 A - 14


Multiple Requests, Multiple Responses

Multiple Requests
Pattern:
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Multiple responses Service 1


Service client

SOA implementation:
Service BPEL
Client Service 2

Flow
a b le
BPEL BPEL f e r
an s
request request
n - t r
Receive Invoke Invoke a noReceive
h a s
response m ) responseide
c o G u
Invoke Receive ib Receive
m en t Invoke
i n t u d
Service 1
i n @ is S Service 2

a r kja se th
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
In this R K J type,
interaction licethe client sends multiple requests to multiple services and receives
NA responses in return. As shown in the slide, the service client (which is a BPEL
Omultiple
K process) uses a parallel flow to coordinate the request and response interactions from two
different services. In this case, two asynchronous callbacks execute in parallel context, so that
each callback does not have to wait for the other to complete. However, the flow does not
complete until all responses are received.
An example of such request-response pattern is implemented in the purchase order course
application where the fulfillment process sends a request to determine stock availability in two
different stores, an internal and an online store. The process waits for both responses before
it chooses the store that is used to acquire the stock to fulfill the order for shipment purposes.
Another example is a loan broker process that requests and retrieves loan offers from multiple
loan service providers.
Note: If the invoked service interface definitions are identical, the pattern could be modified
into a dynamic invocation pattern.

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


Multiple Requests, First Response

Multiple Requests
Pattern:
Unauthorized reproduction or distribution prohibited Copyright 2016, Oracle and/or its affiliates

Pick first response? Service 1


Service client

SOA implementation:
Service BPEL
Client Service 2

Flow
BPEL BPEL
a ble
request request f e r
a n s
Receive Invoke Invoke n -t r
Receive
o
s an
) h a e
First
Pick co
m response G uid
Invoke
response
onMessage A ib
m Bent Invoke
i n onMessage
t u d
Service 1
i n @ is S Service 2

a r kja se th
( on t2014,
kCopyright o uOracle and/or its affiliates. All rights reserved.
A I N nse
In this R K J type,
interaction licethe client sends multiple requests to different services and expects to
NA multiple responses. However, to implement the first message response pattern, a Pick
Oreceive
K activity is used to receive the first of many possible responses, because a Pick processes
only the first message to be received for any of its onMessage branches.
As shown in the slide, the service client (which is a BPEL process) uses a parallel flow to
initiate asynchronous requests for two different services. Instead of using two asynchronous
callbacks in parallel flow, when the flow is completed, a Pick activity is used to wait for all
possible responses, in this case, one of two responses. The first response to arrive is
processed, from service 1 (as shown in the diagram), and the other response message is not
processed because Pick has completed and the service client process continues without
waiting for additional responses.

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


BPEL Deployment Descriptor Properties

Deployment properties are BPEL process component settings


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

that are used at run time. The two types of properties are:
Configuration properties Updates properties
Partner link binding properties at run time

Note: Properties are defined in the composite.xml file.

Defines Packaged Deployed a ble


properties f e r
a n s
JDeveloper
composite.xml SOA -t r
nFusion
Archive
a no Middleware
h a s Control
) ideBPEL
<component name="MyBPELComponent"> ...
o m u
c nt G
<property name="bpel.config.inMemoryOptimization">
true</property>
b m
</component>
i ni Stude Engine

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
cBPEL
A R
There are two types of deployment descriptor properties:
N
KO Configuration properties, which are specific properties used by the BPEL Engine,
Enterprise Manager, or both. The server provides some predefined configuration
properties. Refer to the Oracle Fusion Middleware Developers Guide for SOA Suite 12c
for more information about configuration properties.
Partner link binding properties, which are used by BPEL process designers to
externalize literal values from a process. For example, you may define a minimum credit
rating that a customer must have before processing the order. You define partner link
binding properties on the Properties tab of the Edit Partner Link window.
The illustration shows a configuration property called inMemoryOptimization being
defined at design time by using the JDeveloper BPEL Editor. Properties are saved as name-
value pairs in <property> elements in the deployment descriptor, which is stored in the
composite.xml file that is packaged in the SOA archive.

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


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

Вам также может понравиться