You are on page 1of 258

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

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
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
a
has
applicable:
Smita Kommini
U.S. GOVERNMENT RIGHTS
)
Publishers
ฺ c om ฺ
The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or

Michael Sebastian t i n ide


disclose these training materials are restricted by the terms of the applicable Oracle
o
license agreement and/or the applicable U.S. Government contract.

Pavithran Adka t e lla t Gu


Trademark Notice

o n s den
Giri Venugopal
c Stu
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names
@
i
arn e this
may be trademarks of their respective owners.

l k
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
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
Where Can I Learn More? 1-8
) has
Objectives 1-9
ฺ c om ฺ
Agenda 1-10
t i o n ide
Problem Statement 1-11
t e lla t Gu
Definition of SOA 1-12 o n s den
@ c Stu
Building a Service Portfolio 1-13 i
k arn e this
Assembling Services as Composite Applications 1-14
l
k ฺ ku o us
Service Component Architecture 1-15
e p a et
Elements of a Service Component Architecture 1-16
i ( de icens
Why Standards Are Important in SOA 1-17
a r n le l
ulk ferab
Benefits of SOA 1-18
K
Quiz 1-19
k ans
p a
e tr
Agenda 1-20
De non- 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
Starting the Integrated Server 1-52
) has
Configuring a Domain 1-53
ฺ c om ฺ
t i o n ide
2 Getting Started with Composite Applications
t e lla t Gu
Objectives 2-2
o n s den
Agenda 2-3
@ c Stu
i
How Services Communicate 2-4
l k arn e this
ฺ ku o us2-5
Synchronous and Asynchronous Interactions
k
a 2-6e t
Describing a Message withpXSD
e
i (
Web Services Description
c ns 2-7
de Language
e
a
Abstract WSDL r n 2-8 le li
k r2-9
ulWSDL
Concrete ab
K
k 2-10 s f e
p a
Quiz
e n-t 2-11r a n
De nAgenda
o
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
Objectives 3-2
) has
Agenda 3-3
ฺ c om ฺ
Managing SOA Applications: Overview 3-4
t i o n ide
Deploying a Composite Application 3-5
t e lla t Gu
Building the Service Archive 3-6
o n s den
Deploying Multiple SOA Projects 3-7
@ c Stu
i
Versioning Applications 3-8
l k arn e this
ฺ ku o us
Redeploying an Application 3-9
k
p a et
Deployment Options 3-10
e
( de icens
Examining the Deployment Log 3-12
i
a r n le l
Application State 3-13
ulk ferab
Configuration Plans: Overview 3-14
K
p a k ans
Modifying a Configuration Plan 3-15
e tr
De non- Managing the Life Cycle of a Composite Application 3-16
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
Using the Mapper in JDeveloper 4-8
) has
Auto Map 4-9
ฺ c om ฺ
XPath Functions 4-10
t i o n ide
Optional and Repeating Data 4-11
t e lla t Gu
Testing Transformations 4-12
o n s den
Quiz 4-13
@ c Stu
i
Agenda 4-14
l k arn e this

XQuery: Introduction 4-15
k ku o us
XQuery 4-16
e p a et
( de icens
XSLT Versus XQuery 4-17
i
a r n le l
Using XQuery Transformations 4-18
ulk ferab
Agenda 4-19
K
p a k ans
Working with Native Format Data 4-20
e tr
De non- Native Data Transformation 4-21
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
Defining a Connection Pool 5-21
) has
ฺ c om ฺ
Associating the JMS Connection Pool to a Connection Factory 5-22
JMS Adapter as Producer 5-23
t i o n ide
JMS Adapter as Consumer 5-25
t e lla t Gu
Quiz 5-26
o n s den
Agenda 5-27
@ c Stu
i
l k arn e this
Database Adapter: Introduction 5-28

ฺ ku o us
Configuring a Database Adapter 5-29
k
p a et
Configuring a Database Adapter Service Connection 5-30
e
( de icens
Configuring a Select Statement: Operation Type 5-31
i
a r n le l
Configuring a Select Statement: Importing Tables 5-32
ulk ferab
Configuring a Select Statement: Filtering Attributes 5-33
K
p a k ans
Configuring a Select Statement: Defining Selection Criteria 5-34
e tr
De non- Configuring a Select Statement: Editing the Expression 5-35
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
Quiz 6-19
) has
Agenda 6-20
ฺ c om ฺ
BPEL Design Editor 6-21
t i o n ide
Creating a BPEL Process 6-23
t e lla t Gu
Mapping Values to Variables 6-24
o n s den
Using Expression Builder 6-25
@ c Stu
i
Testing a BPEL Process 6-26
l k arn e this
ฺ ku o us
Examining the BPEL Process Audit Trail 6-27
k
p a et
Examining the BPEL Process Visual Flow 6-28
e
Quiz 6-29
i ( de icens
a r
Summary 6-30n le l
ulk ferab
Practice 6 Overview 6-31
K
p a k ans
e n-BPEL tr Activities
De 7 nMore
o
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
Managing Faults in a Mediator 8-8
) has
Quiz 8-9
ฺ c om ฺ
Agenda 8-10
t i o n ide
Faults in BPEL Processes 8-11
t e lla t Gu
Faults in Synchronous BPEL 8-12
o n s den
Synchronous Service Faults 8-13
@ c Stu
i
Review: Scope Activity 8-14
l k arn e this
Fault Handlers 8-15
k ฺ ku o us
p a et
Returning Faults from a Synchronous Process 8-17
e
( de icens
Returning Faults from an Asynchronous Process 8-18
i
a r n le l
Catching BPEL Runtime Faults 8-20
ulk ferab
Faults That Cannot Be Handled 8-21
K
p a k ans
Throwing Faults 8-22
e tr
De non- Quiz 8-24
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
Human Task Service Component 9-6
) has
Human Tasks in a Composite Application 9-7
ฺ c om ฺ
Adding a Human Task to a Composite Application 9-8
t i o n ide
Configuring the Human Task 9-9
t e lla t Gu
Configuring the Task Outcomes 9-10
o n s den
Adding Human Task Parameters 9-11
@ c Stu
i
Assigning Task Participants 9-12
l k arn e this
ฺ ku o us
Configuring Task Participants 9-13
k
p a et
Configuring the Stages of a Task 9-15
e
( de icens
Configuring Expiration and Escalation Settings 9-16
i
a r n le l
Configuring Notification Settings 9-17
ulk ferab
Adding a Human Task to a BPEL Process 9-18
K
p a k ans
Quiz 9-20
e tr
De non- Agenda 9-21
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 User’s 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
Using Service Component Templates 10-12
) has
Using BPEL Scope Activity Templates 10-14
ฺ c om ฺ
Quiz 10-15
t i o n ide
Agenda 10-16
t e lla t Gu
BPEL Subprocesses: Introduction 10-17
o n s den
Stand-Alone Subprocess 10-19
@ c Stu
i
l k arn e this
Calling a Stand-Alone Subprocess 10-20
Inline Subprocess 10-21
k ฺ ku o us
p a et
Comparing Stand-Alone and Inline Subprocesses 10-22
e
( de icens
Creating an Inline Subprocess 10-23
i
a r n le l
Calling an Inline Subprocess 10-24
ulk ferab
Creating a Stand-Alone Subprocess 10-25
K
p a k ans
Calling a Stand-Alone Subprocess from BPEL 10-27
e tr
De non-Differences Between Templates and Subprocesses 10-28
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
Business Rules: Introduction 12-4
) has
Business Rules Component 12-5
ฺ c om ฺ
Business Rules Use Cases 12-6
t i o n ide
Declarative Rules 12-8
t e lla t Gu
Facts 12-9
o n s den
Decision Tables 12-10
@ c Stu
i
Value Sets 12-11
l k arn e this
Globals 12-12
k ฺ ku o us
Rulesets 12-13
e p a et
( de icens
Rules Dictionary 12-14
i
a r n le l
Oracle Business Rules RL Language 12-15
ulk ferab
Oracle Business Rules SDK 12-16
K
p a k ans
Oracle Business Rules Components 12-17
e tr
De non-Editing Business Rules at Run Time 12-18
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
Event Publication 13-10
) has
Event Subscription 13-11
ฺ c om ฺ
Event Publication and Subscription 13-12
t i o n ide
Quiz 13-13
t e lla t Gu
Agenda 13-14
o n s den
Creating an Event Definition 13-15
@ c Stu
i
l k arn e this
Configuring a Mediator to Publish Events 13-16

ฺ ku o us
Configuring a Mediator to Subscribe to Events 13-17
k
p a et
Setting Event Delivery Consistency 13-18
e
( de icens
Publishing Events in BPEL Components 13-19
i
a r n le l
Subscribing to Events in BPEL Components 13-20
ulk ferab
Managing Events from Enterprise Manager 13-21
K
p a k ans
Viewing Event Subscriptions 13-22
e tr
De non-Quiz 13-23
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
Debugging SOA Composite Applications with the SOA Debugger 14-29
) has
Starting the Debugger 14-30
ฺ c om ฺ
Setting Breakpoints in Services 14-31
t i o n ide
Setting Breakpoints in BPEL 14-32
t e lla t Gu
Initiating Debugging 14-33
o n s den
Examining Values 14-34
@ c Stu
i
Frames 14-35
l k arn e this
ฺ ku o us
Stepping Through the Application 14-36
k
p a et
Ending a Debug Session 14-37
e
Summary 14-38
i ( de icens
a r n le l
Practice 14-1 to 14-3 Overview 14-39
ulk ferab
Practice 14-4 Overview 14-40
K
p a k ans
e n-tr Composite Applications and Invoking Secured Services
De 15nSecuring
o
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
One-Way Message Interaction A-3
) has
Synchronous Interaction A-5
ฺ c om ฺ
Asynchronous Interaction A-7
t i o n ide
One Request, Multiple Responses A-8
t e lla t Gu
n s den
One Request, a Mandatory Response, and an Optional Response A-9
o
c Stu
Asynchronous Interaction with Timeout Pattern A-11
@
i
l k arn e this
Asynchronous Interaction with a Notification Timer Pattern A-12

ฺ ku o us
One Request, One of Two Possible Responses A-13
k
p a et
Multiple Requests, Multiple Responses A-15
e
( de icens
Multiple Requests, First Response A-16
i
a r n le l
BPEL Deployment Descriptor Properties A-17

K ulk ferab
p a k ans
e tr
De non-

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

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Implementing Human Workflow


and Notifications
a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-
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
s a
• Add email notification to a BPEL process a
m )h
n ฺ co eฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
a k Kyou
In thisplesson, n s fehow to:
learn
e n-traa human task component that specifies a simple approver assignment and
D•e Implement
no policy
routing
• 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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


Human Tasks: Introduction

BPEL The
TheBPEL
BPELactivities
activitieswe
we’ve
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o s aetask
Inncontrast,d
n in a human
@ c workflow S turepresents the work
i sthat needs to be done by a
l k arn e thiperson (user, role, or group).
ฺ k u us
e p ak e to
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
Tasksparekalso referred
a n s to as work items. Each task is associated with parameters that
describe r
ee othen-nature
t and data related to the task.
D n

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 task
receive
s a
)ha
m
co eฺ
n ฺ
Task parameters are either tio
simple data types, or e l
XML l a G uid
formats, described n s
with
tan XSD.ent
@ co Stud
i
arn e this
User information is typically LDAP
retrieved from an LDAP server. l k
k ฺ ku o us
e p a et
i ( de© 2014, c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
A human
p a kworkflow a n s
supports the declarative assignment and routing of tasks. In the simplest
e
e a task
case, t r
-is assigned to a single participant (user or group). Often, more complex task
D nonand routing are required. For example, tasks that follow an approval pattern may
assignment
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
has
Clients

Phone
m ) and
Presentation
ฺ c oOther
t i o n Channels
i d eฺ
Notification

t e lla t Gu
o n s den
@ c Stu
i
l k
n example,
ar(for
Identity
e hisLDAP)
Directory
t
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Many p a k abusiness
end-to-end n s processes require human interactions with the process. For
e
e ohumans
example, t r
n- may be needed for approvals, exception management, or performing
D n that
activities 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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
They can also be added to
a BPEL process as part of c on tude
an orchestrated interaction.
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
Typically,ka human a ntask in a composite application is associated with a BPEL process and is
e
e on t r
as-part of the business process flow. However, a human task can also be added as
Dintegrated
n component. A stand-alone human task component is useful when there is no
a stand-alone
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 The configuration is
composite application. stored in a .task file.
s a
)ha
m
co eฺ
Tabs on the left side of n ฺ
the editor provide access
l a t io uid
to categories of
s t el nt G
configuration parameters.
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
In the p a k K aEditor,
Composite n sfe create a human task component in the composite. During creation, if
you
D -tr Composite Service with SOAP Bindings,” the human task is exposed to the
eeselecton“Create
clients n
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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a
are organized into r ni@ this S
The configuration options

categories.ulk s e
ฺ k u
e p ak e to
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k a ahuman
After creating
p n s task component in the SOA composite application or a BPEL process,
e.task
the r
e nfile-tis opened in the Human Task Editor, where you can configure task parameters
D no The editor enables you to configure settings that are organized into sections,
and properties.
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
Set a priority for the task.
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
General
p a k details
task a n sinclude the title for the task, a priority, a task owner, and a comma-
ee olist
separated n r
-tof outcome strings. The default outcomes are APPROVE and REJECT, but
D n be modified.
these can
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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
ni@ this S
The “Editable via worklist” check box
enables users to modify the task
a r
parameters in the Worklist application.
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
Task parameters
p a n the structure of information passed to the Task Service. If you generate
form
e
e Form
a Task t r
-with the information included, task parameters can be displayed in the Worklist
D nonso that a task assignee can view and optionally modify the data.
application
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.

s a
)h a
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
r n i@ is SorAddmultiple a single participant

l k a e th participants in

ฺ k u us serial or parallel.

e p ak e to
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k anstab, you configure the route that the task will follow. You also assign the
On thepAssignment
ee onwho
participants
D -tr will review and those who will receive errors. The icons on the Component
Palettenallow 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.

s a
)h a
m
co eฺ
n ฺ
l a t io uid
s t el typically
An LDAP
n t Gapplication
c on tudsource e serves as the
of participant

a r ni@ this S information.


k
ul use
ฺ k
e p ak e to
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
Click the
p k icon
Add a ninsthe Participant list section. Select to add a user, a group, or an
ee onrole.
application r
-t The Identity Lookup window opens. This window enables you to look up the
D n and application role names that are configured in an identity server, such as an
user, group,
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
user’s 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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ฺ

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
In the p a k K ansection,
Assignment sfe you configure the assignees to whom the task is routed and
ee how
specify n -
thetr task is routed to those assignees. When you first display the Assignments
D o are provided with a single stage and no participants. In simple terms, assignment
section,nyou
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
“Escalate after” sets the number of
levels and the highest approver title.lk
arn e this
k ฺ ku o us
e p a et
i ( de© 2014,c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k thataare
The options
p n savailable in the Deadlines section of the Human Task Editor include:
e nExpire:
-t r
D•e Never
n o 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


of participants for different actions. s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
Notification
p settings
a n determine when a user is assigned a task or informed that a task status
e
e changed.
has t r
n- Notifications are sent through channels such as email, voice message, instant
D noand
message, 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.

s a
Double-click the human
)ha
task activity to open the m
co eฺ
configuration dialog box.
n ฺ
l a t io uid
When the configuration dialog box s t el nt G
is closed, an <if> activity is c on tude
created to process each of the
possible outcomes of the task. a r ni@ this S
k u lk se
p a kฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
To create k
a human a ntask in a BPEL process, add a human task activity to the process flow.
e t r
- Human Task window opens, select an existing task definition or create a
e theoCreate
When
D n ntask. After you click OK, a .task file is created and opened.
new human
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Answer: a k
p -tran
b
e e
D n n can be used as a stand-alone component within a composite application, and
A humanotask
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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 a
has
– The “ADF Task Flow Based on Human Task” item in the) JSF
m
category of the New Gallery window ฺco ฺ o n ide
t i
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k forms
Task display
p a n s
provide Worklist application users with a way to view and optionally modify
e t r
- Oracle BPM Worklist application displays all tasks assigned to a user logged in
e data.oThe
task
D n nassignee. When a task assignee clicks an assigned task, a task display form
as the task
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ฺ

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
Task parameters obtained
a r ni@ this S
from a task payload definition
k u lk se
p a kฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
If the SOA
p kcomposite
a n includes a human task, you need a way for users to interact with the
task.e - t r
e Theointegrated development environment of Oracle SOA Suite includes Oracle ADF,
D n n you to design a task display form that depicts the human task in the SOA
which enables
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
Task flows can be deployed @ c Stu
i
with their related composite
l k arn e this
applications.
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
Beforepyouk deploy
a n s task display form files, the composite application that utilizes them
the
ee already
should n r
-t be deployed.
D n o
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 project’s
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.

s a
)ha
m
co eฺ
n ฺ
l a t io serveruid
By default, the Oracle WebLogic Managed
instances have an embedded s t el server,
LDAP n t G
which can
be used for authentication c t u de
onand authorization.
LDAP
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
The Oracle k BPM a n
Worklist application is a web application that is installed with Oracle SOA
e
Suite - t r
e 12cocomponents. To access the Worklist application, use the following URL:
D n n
http://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
has
deployed with the
composite application. )
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k log inatonsthe Worklist application, they can view the task assignments, work
After users
p
ee and
queues, n - tr parameter information by selecting the specific task.
task
D no application provides a default webpage with task information, excluding task
The Worklist
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Answer: aak n s
e p t r a
De non-
True

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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

s a
)ha
XMPP EMAIL SMPP Extension drivers
m
n ฺ co eฺ
l a t io uid
s t el nt G
c on tudeservers
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Although
p a k
not parta nof human tasks, notifications are often part of applications that include
e
e tasks.
human t r
- The notification service enables an asynchronous message to be sent to a user
D non channel. The message can be sent as an email message, a voice message, a
by a specific
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: s a
– BPEL notification activities, such as email, IM, and voice) h
a
– Human workflow notifications that also provide actionable ฺ c om ฺ
t i o n ide
messages
t e lla t Gu
– Oracle BAM alerts for monitored events o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
OraclepUMSk enables
a n stwo-way communication between users and composite applications. It
ee ooperations
exposes n r
-t that can be invoked from the BPEL business process or human task to
D n
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

s a
)h a
m
co eฺ
n ฺ
l a t io uid
s t el nt G
2 c onnotification
Set
t u demode and email
a r ni@ thiproperties s S as appropriate.
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a k
The workflow n
notification
a services are communicated through Oracle UMS components.
e
Toeconfigure t r
-the workflow notification properties, use Enterprise Manager Fusion Middleware
D onaccess
Controlnand 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ฺ

s a
)ha
m
co eฺ
3 n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a k
In addition to n the Workflow notification properties, configure the user messaging
configuring
a
e
e driver
email - t r
nsettings to ensure that the email server and protocol settings are correctly
D noTo
specified. 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ฺ

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
3 c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
You can
p a k
monitor a n view the notification activity performed by the human workflow service
and
e
e To
engine. t r
- and test the human workflow notification activity, perform the following steps:
nview
D n o
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
Email Driver a s
m )h
SMTP
n ฺ co eฺ
IMAP/POP
l a t io uid
s t el nt G
c on tude
Email
r ni@ thisimplemented S Email activity is
server
l a
k se as a scope.
u
ฺk to u
p sea k
e e
d © 2014, n
i ( l i c e
arn able
Copyright Oracle and/or its affiliates. All rights reserved.

l k
k Ku sfer
The BPEL
e p a processr a ncomponent provides different ways to notify users through email, IM, SMS,
e Twitter
and - t
nactivities. The example in the slide implements email notification by:
D n o
• 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 User’s Preferred Channel
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

s a
)ha
m
co eฺ
n ฺ
The user notification activity:
l a t io uid
• Sends a message to a
s t el nt G

user’s preferred channel
Enables additional c on tude
properties to be sent
r n i@ is S
with the message
u l k se th
a
a k ฺk to u
e e p se
i ( d © 2014, c e n
l i
arn able
Copyright Oracle and/or its affiliates. All rights reserved.

l k
k Ku sfer
The user
e p anotification
r a n activity enables a BPEL process design in which a notification channel is
eexplicitly
not t
n-specified during design time, and simply indicates that a notification must be
D nonotification
sent. The 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
e. Email activity s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Answer: aa,k
p -teran
d,
e e
D n then notification activity in a BPEL process, a user’s preferred form of notification is
By usingo
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 user’s 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
a
• Add email notification to a BPEL process
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n sDatabased e n notification
and
@ c Stexternal u references
i
rn this and email provide customer lookup
l k a e capabilities.
k u s
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
e ep n-tran
D no

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


various outcomes of the
) has
Manual Approval
process. ฺ c om ฺ
t i o n ide
e llaWorklist G u
n t The
s provides e t application
n a chance to
o
c Sreview d
tu and edit the details
i @
rn this before approving or
l k a e rejecting the order.
k u s
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
e ep n-tran
D no

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
) has
ฺ c om ฺ
An email task advises
t i o n ide
a of Gu
customers of thellstatus
e
s
their
n t
order.
e n t
@ co Stud
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-
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 s a
) ha
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
) has
Export and import
to/from JAR files. ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
In addition
p kto thearun-time
n s Metadata Services Repository, Oracle SOA Suite includes a file-
ee SOA
based n -t r
design-time MDS Repository for use during design time. The repository is
D o
n created when you create a SOA composite application. The default directory
automatically
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Answer:p bk
a a n s
ee When n t r
-artifacts
D
False.
n o are moved into the repository, all dependencies are included and
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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 s a
wires are also packaged. ) h a
m
co eฺ
n ฺ
l a t io uid
A Scope activity of a BPEL
s t el processn t Gthat
is packaged as a custom
c on tude activity in the
Components window
r n i@ iand s Sthat is ready for
import into
l ka other e h projects
tBPEL
u
ฺk to us
p sea k
e e
d © 2014, n
i ( l i c e
arn able
Copyright Oracle and/or its affiliates. All rights reserved.

l k
k Ku sfer
e p a is a rreusable
A template a n part of an Oracle SOA Suite project that you can use to create new
e oThere
projects. t
n- (subpart
are three types of templates, as described in the slide. Use templates to share
D
common n code 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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
s a
Create Template ) h a
Wizard m
co eฺ
n ฺ
l a t io uid
s t el ntMDS G
c on tude Repository

a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
To create k
a template,
a n right-click the appropriate object and select Create Template to invoke
e
theeCreate n - t r
Template wizard. You specify a name and location for the template. The location
D
can be n odesign-time
the 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
) has
ฺ c om ฺ
t i o n ide
The project is t e lla t Gu
created from
o n s den
the template.
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
k atemplate,
To usepaaproject n s in the Create SOA Application wizard, select the start type: SOA
ee oThen,
Template. n r
-t specify the desired template.
D n

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.

s a
)ha
3 m
co eฺ
n ฺ
Review the template
l a t io uid
information and click Finish.
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
1. To
p a k
use n
a component
a template, right-click in the Components swimlane of the composite
e t r
n- window. Select Insert > Component Template.
De overview
n o
2. 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
) has
ฺ c om ฺ
t i o n ide
The component and any t e lla t Gu
4 dependencies are added ons d e n
to the project.
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
4. When
p a akcomponenta n s template is used, the service component and its dependencies are
added t r
ee to othen-project.
D n

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 s a
)ha
m
co eฺ
n ฺ
l a t io uid
s
Bindt eanyl variables
n t G that are
n
co to those
referenced d e
in the template
i @ S tufound in the
r n i s
u l ka se th BPEL project.
3
ฺ k u
e p ak e to
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
1. Scope
p a kactivityantemplates
s can be added to a BPEL process from the Component Palette.
e
2. eWhenothe
t r
n-scope is added, you are prompted to resolve any naming conflicts (if the project
D n
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
a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Answer:p aa,kc, and a es
n
ee ocomponents
n -t r
D
Projects,
n (such as BPEL processes), and scope activities can be packaged as
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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) a
) has
• Execute completely in the context of the parent process,

permitting access to process variables and inheriting c omfault
t i o n ideฺ
handling and compensation logic ella Gu s t ent
co Studn
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
BPEL p a k limited
provides a n s support for modularizing business process logic for reusability. The only
method -t r
ee isotonpackage reusable process logic as completely separate processes, which are
D
utilized n
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.
a
has
• Subprocesses cannot be shared between multiple composites.
)
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
A subprocess
p n is not a valid business process, but is a self-contained snippet of
element
a
e
e logic.
process t r
n- All references in its process snippet resolve to local definitions or arguments,
D nodefined
which are 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ฺ

s a
)h a
m
o ฺ
csubprocess.
A call activity transfers control to the
n ฺ
There is no service invocation.
l a t ioArguments
u i dinethe
call activity map in-scope
s t el variables
n t Gand partner
links to subprocess
argument iscpassed on eitherelement
t u dbyevalue or reference.
parameters. Each

a r ni@ this S
k u lk se
p a kฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
Withinpaa k K BPEL
parent a n s e
fprocess, a call activity transfers control to the subprocess. There is no
e
service t r
n- the call
e invocation. Therefore, no inbound message activity is required to consume the
D
messagenofrom 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 activity’s
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
s a
another (“parent”) process.
)ha
m
co eฺ
n ฺ
l a t io uid
Arguments in the call
variables andn s telactivity tG
map
linksetonthe inline
subprocess
@ coelement
partner
S ud
tparameters. The
i
l k rn in scope
subprocess
aitems e t hisat the time of the call.
can also refer to other

k ฺ ku o us
e p a et
i ( de© 2014, c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
An inline
p a k ansis a subprocess that is embedded in another (“parent”) process.
subprocess
eeactivityn - tr
D
A call executes
no and partner the referenced subprocess code. Arguments in the call activity map in-
scope variables 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
s a
Can be called from any BPEL process in Is part of the parent BPEL process code ) h a
the same composite and is not visible in the composite m
co view
o n ฺ eฺ
Does not have an interface, and can be Can be called only from t i the parent
la partner u i d
BPEL
called only from another BPEL process. It process. It can use t e lthe t G links and
can include partner links. o
in-scope variables n s ofdtheenparent process.
@ c Stu
Defines the parameters to set Can i
rn thdefine
either is the parameters to set or
k a
ฺ k ul canususe e parent process values
e p ak e to
i ( de© 2014,c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
Stand-alone
p k andainline
n s subprocesses are both available only in BPEL 2.0. Both are invoked by
e (extension)
theeBPEL n -t r call activity. Both are visible in the components window in JDeveloper.
D n 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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
Assign a name, and if
2 desired, add a label and/or c on tude
an image.
r niBy@default, i s S
the scope is
a 3
lk sconverted e h
t to a call activity.
k u
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
Inline subprocesses
p a n are created from process scope activities. To create an inline subprocess,
e t r
ecreateonand- configure a scope with the activities that will define the subprocess. To convert
first
D
the scopen 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

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
on istude
A call activity
c
a r ni@ this S 3
generated.

k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
To callpan kinline n
subprocess,
a perform the following steps:
e t r
n-the Subprocesses section of the Component Palette. All available subprocesses
D1.e Expand
n o
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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
Name the subprocess
2 and click OK.
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
To create k
a n BPEL subprocess, perform the following steps:
stand-alone
a
e t r
na- SOA composite application that includes a BPEL 2.0 process. Right-click in the
D1.e Create
n o
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
) has
ฺ c om ฺ
Configure the subprocess,
t i o
5
n ide
4 adding the required logic and
e G u
lla Thetsubprocess
variables. Save your work.
n s t e n is

@ co Stud as an .sbpel file.


stored in the project
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k athenssubprocess in the SOA Composite Editor and select Edit.
3. Right-click
p
e n-the tr desired process logic in the stand-alone subprocess. This can include
D4.e Design
no activities, and partner links.
variables,
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.
s a
)ha
Map parent process
c m
o ฺ
n ฺ
2 values to subprocess
l a t io uide
el nt G
arguments.
s t
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
k K anssubprocess,
To callpaastand-alone
fe perform the following steps:
e t r
n-the Subprocesses section of the Component Palette. All available subprocesses
D1.e Expand
n o
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
) has
A subprocess is a BPEL code snippet that is intended for a specific
purpose. A subprocess can be called and used as it is. An inline ฺ c om ฺ
t i o n idcodee
subprocess of 50 lines can be called twice and the parent l a
el better
process
Gandu
remains at 50 lines, and not 100. Subprocesses s t
perform n t
have a smaller memory footprint than templates. c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
e ep n-tran
D no

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

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Answer: a k
p -tran
a
e e n subprocess can either define the parameters to set or can use parent process
D
True. An o
n inline
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 s a
) ha
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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.

s a
)ha
m
co e3ฺ
n ฺ
1 l a t io uid
s t el nYou t G and
create
You first import a
collection of templates c on tudeBPEL subprocess.
call an inline

from a JAR file.


a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
1. Inp a k
this practice,
a n you first import a collection of templates into the SOA Design Time
e n- t r
De Repository.
n o
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ฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Using the REST Adapter

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
s a
typically described with
either XML or JSON. )ha
m
co eฺ
n ฺ
XML
resource Each
l a t io has
resource u idits
JSON l
teown G
t or
address
n s e n
co SIdentifier tud (URI).
Uniform Resource
i @
rn this
l k a
ฺ k u use
http://<host>:<port>/soa-infra/resources/<partition-name>/relative/resource/path

e p ak e to
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
• REST
p a k stands a n s Representational State Transfer.
for
e nprovides
-t r
D•e REST
n o an alternative to using SOAP-based web services.
• 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


s a
)ha
Edit an item. PUT /items/id m
co eฺ
n ฺ
Delete an item. DELETE /items/id
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a kREST
Recallpthat a n
describes resources (reference to data) in terms of URIs and that REST
e
e nearly
services t r
n-body
always use the HTTP protocol. HTTP messages include a header and a body
D nothe
(although 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 s a


) ha
Uses URI and HTTP verbs to access Uses a WSDL document to access m
co eฺ
resources (data) operations (business logic) n ฺ
l a t io uid
Is stateless WS* standards provide
s t el supportn t Gfor
on tude
stateful transactions.
c
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
RESTp k architectural
isaan a n style, whereas SOAP is a message exchange standard. Comparing
e
e is much
them t r
-like comparing apples and oranges, but in practical terms, they describe ways to
D
accessn onservices.
web 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
• Stateless operations s a
• Operations that require high
)ha
levels of security and m
co eฺ
reliability
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
For webp a k
services a n require robust security, transactions, and reliability, SOAP can leverage
that
e - t r
theeWS* standards, and would typically be a better choice. However, because of its use of URIs
D non message formats such as JSON, REST can offer better performance and
and lighter-weight
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
a
• Support for WADL services
) has
• Support for REST security with the Oracle Web Serviceฺ c om ฺ
Manager (OWSM) policy t i o n ide
la u el nt G
s t
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
a
OraclepSOA kK
Suite a n s
12c
e
fprovides the following REST support:
e t r
on- exposing an existing SOA SOAP service as a REST service.
D•e It nsupports
• 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
) has
ฺ c om ฺ
t i o n ide
Oracle SOA Suite
t e lla t Gu
composite applications
can also be exposed o n s den
@ c Stu
as a REST service.
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
The REST
p a kadapter a n s be used to expose and consume REST services.
can
e t r
De non-

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.

s a
Provide a relative path
for the resources. )ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
Name the operation, resource
path, and HTTP verb. a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
To create
p a k
a REST a nbinding, you provide a name and an optional description, and identify it as
e
e a service
either t r
- or a reference. You then provide a relative path (URI) for the resources.
D
Finally, n onbind
you 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.

s a
)ha
m
co eฺ
n ฺ
Describe the request and
l a t io uid
response messages.
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
When p a k Ktheabinding,
adding n sfe the HTTP verb (method) is selected from a drop-down list. You then
describe
D -tr and response messages by using the Type Chooser.
ee othenrequest
n

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

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
The slide
p a k
shows n finished binding component, the resource URI, and a sample HTTP
the
a
e
message, n-
e oincluding t r both the header (the method or verb can be found here) and the payload
D
(in this n
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k aWADL
The component
p n s can be observed from within JDeveloper.
e t r
De non-

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


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

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Testing
p a
of k
the n
component
a can be completed by using the HTTP analyzer in JDeveloper. The
e t r
e oin nthe- slide shows a request message being sent, and the response received. In this
example
D n the status field of the message was updated by the called operation.
example,

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Answer:
p bk
a a n s
ee queries
n r
-tuse URIs to describe resources.
D
REST
n o

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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ฺ

4
a
) has
1 ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
2
@ c Stu
i
l k arn e this
JDeveloper
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
1. In
p a k practice,
this a n syou modify the HelloBPEL composite application by exposing it as a
e nservice.
-t r
De REST o
n test the service from JDeveloper.
2. You
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ฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Developing Business Rules

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-
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
a
• Integrate a simple rule with a BPEL process
) has
m
• Describe the role of the Rules SDK ฺco ฺ o n ide
t i
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
In this p a k youanlearn
lesson, s basic vocabulary and the concepts for Oracle Business Rules. You
learn -t r
eehowotonconfigure business rules and Decision Tables. You also learn how to invoke your
D n business rule service component from a BPEL process.
configured

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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 a
• Computations such as discounts and premiums ) has

• Reasoning capabilities such as offers based onncustomercom eฺ
value l a t io uid
el G s t ent
co Studn
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k aRules
OraclepBusiness n s enable dynamic decisions at run time, allowing you to automate
policies, n r
ee computations,
-t and reasoning while separating rule logic from the underlying
D o
n code. This allows more agile rule maintenance and enables business analysts to
application
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 a
) has
• Directly by the SOA composite client m
n ฺ co eฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
You can
p a k
create n composite application that includes the BPEL process, business rule,
aaSOA
e
e human
and t r
- service components. These components are complementary technologies.
task
D non focus on the orchestration of systems, services, and people. Business rules
BPEL processes
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.
a
The parameters for these conditions can be changed
) h as
independently of the process. m
ฺ c o ฺ
• Data validation and constraint checks t n
io uide
l
el ona G
– Validate input documents or apply constraints s t n t requests.
• Human task routing c on tude
r n i@ is S
– Policy-based task assignments l a
k seto tspecific h roles or users
k u
ฺ among u users
– Load balancing of
p aktasks t o
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Dynamic
p a k n Rules can perform intelligent routing within a business process based
processing:
a
e t r
n- agreements
oneservice-level or other guidelines. For example, if a customer requires a
D nowithin
response 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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.

s a
)ha
If customer is a Premium customer, THEN apply a 10% discount. m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
Kform, asfbusiness
e
a k
In its simplest
p a n rule can be expressed as an if/then statement. The IF part
e
e oneoornmore
tests t r
- business terms. If the tests pass, one or more actions are performed in the
D n such as adding or changing business terms.
THEN part,
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

Customer.status
Facts are discrete s a
pieces of data
)h a
that constitute the m
co eฺ
input and output n ฺ
values for the
Discount.amount
l a t io uid
business rule. s t el nt G
c on tuWhen de a fact is put
a r ni@ this S forth in memory, it is
k u lk se said to be asserted.

ak e to u
e p
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Rules p a
are kappliedantosdata objects that are known as facts. Facts are discrete pieces of data that
ee othe
constitute n tr and output values for a business rule. Facts must be exposed through XSD
-input
D n Fact definitions make up part of a data model, and must be defined before you can
definitions.
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
s a
ACTION RedShipper GreenShipper BlueShipper
) ha
Assert carrier m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Rules p a
can kalso bea nexpressed in a spreadsheet-like format called a Decision Table. A Decision
e
e is more
Table t r
- compact and intuitive when many rules are needed to analyze many
D non of property values. You can use a Decision Table to create a set of rules that
combinations
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.
s a
)h a
m
coR3 eฺ
Decision Table R1 R2 n ฺ
l a t io uid
CONDITION two_day five_day
s t el next_dayn t G or
If shipChoice
c on tudeinternational
ACTION r ni@GreenShipper i s S
RedShipper
k a t h BlueShipper
Assert carrier
ฺ k ul use
e p ak e to
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k have
Fact properties
p a n sa name, value, data type, and an optional value set. Value sets define a
evalues,
listeof n r
-at range of values, or an enumeration of values for a specified type. A value set
D o
n value space of a fact property data type into buckets that can be used to specify
splits the
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
s a
)h a
approvalLimit m
co eฺ
n ฺ
A global represents a
Working Memory l a t io uid
data value or an
s t el can n t G
expression that can
c o n ude
Globals be variable
be evaluated in rule
i @ or
S t
constant. They are
conditions and
k a rn this similar to public static
expressions.
k l
u use variables in Java.

ak e to
e p
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
A global
p a k anasdata value or an expression that can be evaluated in rule conditions and
represents
ee on-For
expressions. tr example, if a 10% discount is used in several rules, you can create and use a
D n
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
IF/THEN s a
IF/THEN
)ha
m
co eฺ
n ฺ
l a t io uid
Rulesets and Decision Tables
are seen as a unit of s t el nt G
execution and can be chained c on tude
together.
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Rules p a
and kDecisiona nTables are grouped in an Oracle Business Rules object called a ruleset. A
e
ruleset - t r
e is oancollection of one or more related rules and Decision Tables that are seen as a unit
D n and that can be chained together to yield an outcome. A ruleset provides a
of execution
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
s a
Schema
)h a
Data model m
n ฺ co .rules
eฺ
Ruleset t i4o i d
t e lla t Gu
o n s Rule d e n
@ c Stu 5
r n i i s Rule
IF condition
condition1THENTHENaction
u ka se th Define Business Policies
action
l
a k ฺk to u
e e p se
i ( d © 2014, c e n
l i
arn able
Copyright Oracle and/or its affiliates. All rights reserved.

l k
k Ku sfer
a one roramore
You group
e p n facts, functions, globals, value sets, and rulesets in an Oracle Business
t
D on-called athat
e object
Rules
.rulesnextension)
dictionary. A dictionary is an XML file (in the local file system with a
stores the application’s 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.
s a
)h a
rule goldDiscount { m
co eฺ )
if (fact Order ord & fact GoldCustomer(cust: ord.customer) n ฺ
l a t io uid
tel enspent
{
ord.discount = 0.1;
The RL fact GoldCustomer
infer that n if s
a customer
t Gis$500
used to
assert(ord);
the past c othree months,
t u d the customerin is
}
r n i@ forisa S
eligibleh 10% discount.
} l k a e t
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k thatanrequire
For situations
p s more complex business logic, Oracle Business Rules supports a
ee oJava-like
high-level n r
-t language called Oracle Business Rules RL Language (RL Language). RL
D
Languagen 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
s a
Composer )ha
m
co eฺ
n ฺ
Custom Java API l a t io uid
Java s t el nt G
Application c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
The Oracle
p k Business
a n Rules SDK (Rules SDK) is a Java library that provides business rule–
e t r
e on-features that a developer can use to write a rule-enabled program that accesses
management
D n or to write customized rules programs that add rules or modify existing rules. The
a dictionary,
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?
s a
)ha
m
co eฺ
Inference
n ฺ
If yes, execute rules.
l a t io uid
Engine
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
a k K aRules
OraclepBusiness n sfeis a data-driven forward chaining system, in which the facts determine
ee rules
which -
are
n trevaluated. When a matching rule fires, the rule may add more facts. New facts
D nocompared against the rules. The process repeats until a conclusion is reached or the
are again
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

s a
)h a
Facts Value sets m
Globals
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
When paa k K anissdeployed
dictionary
fe in a SOA composite application, Oracle Business Rules lets you
use e - t
e SOAoComposer r to view, edit, and commit changes to a dictionary. SOA Composer is a
D n n editing tool.
browser-based

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

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Answer: a k
p -tran
b
e e
D n isna collection of rules that are considered as a unit of execution, and can be chained
A ruleset o
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
One of the most common ns
tel ent G
uses is to call the component
@ co Stud
i
l k arn e this
from a BPEL process.

k ฺ ku o us
e p a et
i ( de© 2014,c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
A Business
p k Rulesanservice
s component (also called a Decision component) can be used to
ee ondynamic
implement r
-t routing with a Mediator component. It can be implemented as advanced
D
routing n
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ฺ

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c n XML
oinitial u e structures
dfact
Specify the
i@defaultisDecision t
S service input
and
a r nthe h
t message structures.
k u lkand output s e
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
To create k
a Business
a n Rules component in a composite application, perform the following steps:
e - t r
D1.e Drag
non
a Business Rules component into the Components column.
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
s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Creating
p aakbusiness
a n rule in a BPEL process provides you with the option to create a new
e
e oRules
Business t r
- component in the composite application, or to select a Business Rules
D n nthat already exists in the composite application. In addition, creating a business rule
component
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.

s a
)ha
m
co eฺ
Map BPEL variable n ฺ
values to input and l a t io uid
(if the business rule s t el nt G
is synchronous) c on tude
output facts.
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
If you p a
havekalreadya nadded the desired Business Rules component to the composite and
e t r
e onit,-select the desired dictionary and, from that dictionary, the operation. Then map
configured
D n and output facts for the business rule to the appropriate BPEL variables.
the input
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.

The Decision Service WSDL s a


document defines the basic stateless )h a
and stateful web service operations m
co eฺ
n ฺ
that can be invoked.
l a t io uid
The Business s t el metadata
Rules n t G
defines c onmapping
the t u deof the Decision
r i@ operations
nservice i s S to the Decision
a
lk functions. e t h
k u s
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
After you
p a k
create n Business Rules component in your composite application or BPEL
the
a
e
process, - t r
e othenfollowing files are created in the project folder:
D n
• 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ฺ

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c n ude
oseries
The Rules Designer includes @ a S oft
tabs to provide editing
i
n ttohieach
raccess s of
l k a
ofua business e
the elements k
k ฺ u s rule.
p a et o
e
de© 2014, nsand/or its affiliates. All rights reserved.
i (
n le li
Copyright c e
Oracle
a r
K ulk ferab
a k Rules
The Business
p a n sdictionary holds the rules that are executed by an application. The Rules
ee osaves
Designer n r
-t rules and their associated definitions in the dictionary (a .rules file). The
D n is created when you first add a Business Rule component to your composite or BPEL
dictionary
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
Specify Constant and/or @ c SUse tuExpression Builder
i
l k arn e this to define a value.
Final if appropriate.

k ฺ ku o us
e p a et
i ( de© 2014, c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
1. In p a kRulesanDesigner,
the s click the Globals tab, and then click the Create (+) icon.
e t r
- Global window, enter a name (for example, defaultDiscount), select a
D2.e InType
non(for example, int), and in the Value field, click the Expression Builder icon.
the Edit

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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
To define k
a “List ofnValues” value set, perform the following steps:
a
e t r
- Designer, click the Value Sets tab, and then click the Create (+) icon > “List
D1.e Innthe
o nRules
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Rulesets
p a k aanway
provide s of organizing your rules. Before rules can be created, you need to
ee a ruleset
create n r
-t as a container for the rules. After the ruleset is created, rules and Decision
D
Tables n o
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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
To create k
a Decision
a n Table and a condition operand, perform the following steps:
e t r
- Designer, select an existing ruleset. Click the Add icon and select the Create
D1.e Innthe
o nRules
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ฺ

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
The configuration
p a n highlighted thus far have resulted in the definition of a Decision function
steps
e t r
D on- andto invoked
e is exposed
that
providenexposure
by the BPEL process. However, Decision functions do more than
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
e. Human task components s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Answer:
p a
a,kb, c,aen
D
e
e oRules
Business n - ris a component that is similar to the BPEL or Mediator component. It provides a
t
n
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
a
• Integrate a simple rule with a BPEL process
) has
m
• Describe the role of the Rules SDK ฺco ฺ o n ide
t i
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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 is automatically a
from the previous
lesson is
approved. has 4 )
c o m
invoked. 3 o ฺ
n ideฺ
t i
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
In this p a k you
practice, a n s and configure a business rule and call it from a BPEL process. This
create
ee process
BPEL n r
-talso calls the ManualApproval application that you completed in the lesson titled
D n o
“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

s a
)ha
The results of the
business rule are
m
co eฺ
n ฺ
incorporated into the
l a t io uid
order data, and the
s t el nt G
order is published to c on tude
a JMS Queue.
a r ni@ this S
7
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
In this p a k K practice,
optional n s feyou modify, redeploy, and test the OrderProcessing composite
ee onIf-the
application. traorder is approved, either manually or automatically (because the total is
D
below then 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.
s a
)h a
m
coR3 eฺ
Decision Table R1 R2 n ฺ
l a t io uid
CONDITION two_day five_day
s t el next_dayn t G or
If shipChoice
c on tudeinternational
ACTION r ni@GreenShipper i s S
RedShipper
k a t h BlueShipper
Assert carrier
ฺ k ul use
e p ak e to
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k Table
The Decision
p a n suses a [provided] XSD document to define the input and output facts and
e sets
theevalue n r
-tto constrain the possible shipping choices and carriers.
D n o

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-
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
a
• Use a test case to emulate an event message
) has
• Manage events in Enterprise Manager Fusion Middleware ฺ c om ฺ
Control t i o n ide
la u el nt G
s t
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
This lesson
p n the Oracle SOA Suite 12c Event Delivery Network (EDN) and the use
describes
a
e t r
ofe
D
create n on-definitions
the Mediator
event
and BPEL components to publish and consume events. You learn how to
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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

s a
)ha
m
co eฺ
n ฺ
When a business event occurs:
l a t io uid
• Is it of interest to any other services?
s t el nt G
• How should those services be invoked?
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
Decoupled
p k n SOA applications require complete separation of the service consumer
composite
a
e t r
- provider, which is typically achieved through the use of asynchronous
e the service
and
D nonwhere applications can perform in a “fire and forget” mode.
messaging,
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

s a
mediator BPEL mediator )ha
m
co eฺ
describe n ฺ
events Service Infrastructure l a t io uid
s t el nt G
c on tude
MDSa r ni@ this S
EDL XSD
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
The Event
p a kDelivery
a nNetwork (EDN) is not a messaging infrastructure. It coordinates events
e
e theoSOA
within t r
- Suite service infrastructure, and is available to all composites that are running
D n ncontainer (within the same JVM).
in the SCA
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
s a
Tools Wealth of tools Mostly coding Fully declarative ) h
a
tools
ฺ c om ฺ
t i o n ide
Fault
Handling
Developer’s
responsibility
Developer’s
responsibility t e lla t Gu
Automatic

o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
The table
p kin the aslide
n scompares SOAP (service), JMS (messaging), and EDN (events). When
ee areoused
these n r
-t together, you can create a rich and highly functional combination of Service-
D n Architecture (SOA) and event-driven architecture (EDA) approaches to implementing
Oriented
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.

s a
Event
Delivery
subscribe
)ha
Network
m
co eฺ
Events are messages that
n ฺ
typically have a header and
l a t io uid
a payload.
s t el nt G
c onsubscribe t u de
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Events
p a
arek messages.
a n They typically have a header and a payload. The header contains
e
e osuch
metadata t r
- as the event type and a time stamp. The payload contains details that
D n then facts of the event instance that the business logic in the consumer will process.
describe
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"/>
s a
<xsd:element name="quantity" type="xsd:int"
)ha
minOccurs="1"/>
m
co eฺ
</xsd:sequence>
n ฺ
</xsd:complexType>
l a t io uid
</xsd:schema>
s t el nt G
c on tude
r ni@ thXSD
The referenced
a is Sfile describes
k u lk payload
the s eof the event.

ak e to u
e p
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
The code
p ksampleaninsthe slide describes the payload of an event with two values (productID
eequantity).
and n - tr Components that either produce or consume events use this XSD to
D no the payload of the event.
understand

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 s a
<event-definition name="stockUpdated">
<content )ha
m
co eฺ
xmlns:ns0="http://www.example.org/ns/updtstock"
n ฺ
element="ns0:UpdateStock"/>
l a t io uid
</event-definition>
s t el nt G
</definitions>
c on tude
a r ni@ thiPayload sS
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
The EDN
p a k
uses the
a nXML-based Event Definition Language (EDL), which enables you to define
e
eeventoand
the t r
- its associated strongly typed data. This definition is registered with the SOA
D n n and is available to all composites for publication or subscription.
infrastructure,
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 application—it 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
s a
te"
)ha
name="pub1:stockUpdated"/>
m
co eฺ
</business-events>
n ฺ
</component>
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
Publishers kof events
a n do not have to be registered beforehand; anyone can publish an event of
e t r
e thatonis-defined through EDL. Events of a specific type can be published by many
a type
D npublishers, both inside the SCA container and outside of it.
different
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"
s a
name="sub1:stockUpdated"
consistency="oneAndOnlyOne" )ha
m
co eฺ
runAsRoles="$publisher"/>
n ฺ
</business-events>
l a t io uid
</component>
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
Composite
p k n register their interest in events of a specific type with the EDN through
applications
a
e
eMediator
the t r
n-or BPEL components that consume such events.
D n o
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 server—in 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

Java Application Yes No s a


) ha
PL/SQL Yes No m
co eฺ
n ฺ
FMW Control Yes (for testing) No l a t io uid
s t el nt G
In this course, we focus on event c on tude
r ni@inththeis S
publication and subscription
a
Mediator and BPEL
k u lk components.
s e

ak e to u
e p
i ( de© 2014,c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Both the
p a k anand
Mediator s BPEL service components can publish events and subscribe to them.
Other n r
ee applications,
-t including Oracle Application Development Framework (ADF) business
D o
n applications and Java EE applications, can raise events. You can also raise
component
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 Developer’s Guide for Oracle
Application Development Framework. The Oracle Fusion Middleware Developer’s 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Answer: p a,kb, c,adns
a
D n -tr
e components
Alletheseo can publish events.
n

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
) has
ฺ c om ฺ
t i o n ide
4
t e lla t Gu
o n s den
@ c Stu
i
3
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
To create
p keventadefinitions
n s for a composite application, perform the following steps:
e t r
- Event Definition Creation icon on the composite.xml window toolbar.
D1.e Click
non
the
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ฺ

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
3
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
To publishk an event
a n from a Mediator component, perform the following steps:
e - t r
D1.e After
n o nopening the Mediator Editor, for a selected operation, click the Create (+) icon and
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
s a
)ha
m
co eฺ
3 n ฺ
l a t io uid
s t el 4 nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
To subscribe
p to aan
business event in a Mediator component, drag a Mediator component to the
e t r
e on-column in the Composite Editor:
Components
D n “Subscribe to Events” from the drop-down menu.
1. Select
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 event’s 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ฺ

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
One and only one: Events are delivered rinntheir i@ownisglobal S transaction.
a h
lk se t without a global transaction.
Guaranteed: Events are delivered asynchronously
k u
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
After you k
select n event that you want, you can set the level of delivery consistency for the
the
a
e t r
n- to the desired filters. The following delivery consistency levels are available:
e in addition
event
D n o
• 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
) has
ฺ c om ฺ
t i o n ide
In an Invoke activity: t e lla t Gu
• Select Event as the c ons tudtype.
interaction en
• Browse to select r ni@ the event. i s S
• Create or a h
lkbrowseseto at variable to store the event.
k u
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
To publishka n event from BPEL, perform the following steps:
business
a
e t r
an-Invoke activity to the BPEL process.
D1.e Add
non
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
) has
ฺ c om ฺ
t i o n ide
In a Receive or Pick activity: tell
a G u
n s type. e n t
• Select Event as the interaction o
c Stu d
• Browse to selectnthe i @ event.
k
• Create or browse
l ar toeatvariablehis to store the event.
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k to aa nbusiness
To subscribe
p s event in a BPEL process, perform the following steps:
e - t r
D1.e Add
non
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ฺ

s a
)ha
1 2 ฺco m
t i o n ideฺ
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k anManager
OraclepEnterprise s Fusion Middleware Control provides a Business Events page that
e t r
n- to manage, track, and test events in the EDN.
e be accessed
can
D n o
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ฺ

s a
)ha
m
co eฺ
n ฺ
l a t io uid
For a given event, view the tel t G
subscription configuration on tudes n
c
information.
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
Click the
p k n tab to search for and view the different types of subscriptions.
Subscriptions
a
e t r
n- tabbed page enables you to display and search for information about all
e Subscriptions
D
The
n o
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Answer:
p ak
a a n s
e t r
De non-

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
a
• Use a test case to emulate an event message
) has
• Manage events in Enterprise Manager Fusion Middlewareฺ c om ฺ
Control t i o n ide
la u el nt G
s t
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
e ep n-tran
D no

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

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
a k K you
In thisppractice, a n s fe a composite application that updates the inventory quantity of a
create
D ee itemonin-atrdatabase
given table. The application then publishes a stockUpdate event (from a
n
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-
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 a
) has
applications
ฺ c om ฺ
• Use the SOA debugger to step through an application
t i o n ideand
a u
observe values during execution tell tG n s den
o
c Stu
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
In this p a k youanexplore
lesson, s the implementation of unit tests and test suites (a collection of unit
eeto test
tests) n r
-t use cases and conditions that verify the correctness of your application
various
D n o
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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 a
production environment ) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
application–level for:
– Wires a
) has
– Service binding components
ฺ c om ฺ
– Service components (such as BPEL processes t i o n Mediator
and i de
service components) l a
el nt G u
s t
– Reference binding components con tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
a kK
OraclepSOA Suite n s fe an automated test suite framework for creating and running
provides
repeatable
D -traon a SOA composite application.
ee ontests
n
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, a
a part of a message, a non-leaf element, or a leaf element ) has
at a point during SOA composite application execution
ฺ c om by
comparing actual values to expected (asserted)
t i o nvalues.
i d eฺ
la u el nt G
s t
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
e ep n-tran
D no

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 s a
run, by using Oracle Enterprise Manager Fusion ) ha
Middleware Control ฺ c om ฺ
n t io uide
l a
el nt G
Note: Each test run corresponds tooansinglede s t composite
c t u
application instance.
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
The composite
p test
a nframework supports testing various components at the SOA composite
e t r
e on- as listed in the slide.
application–level,
D n
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 a
– Emulations to emulate interactions ) has

– Assertions to validate message content for the interactions c om ฺ
t i o n ide
– Message files containing the test message e llasamples G uused in
t t
the process initiation, emulations, and den
onsassertions c Stu
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Each test
p a kcase must
a n sbelong to a test suite, and can be thought of as a unit test for a composite
ee onEach
application. r
-t test case is executed when the test suite that contains it is run. Test cases
D n the following components:
comprise
• 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
s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
Test cases
p k consist
a nof a collection of process initiations (inbound, outbound, and callback),
e
e onand
emulations, t r
- assertions. Each of these test action types can be added to test cases in test
D
mode ofnthe 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ฺ

s a
)ha
m
co eฺ
n ฺ
Create a Test
l a t io Case.uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
Test suites
p kconsist
a nof a logical collection of one or more test cases. Each test case contains a
e t r
- to be run as the test instance is executed. The execution of a test suite is
seteof commands
D
known asnoantest 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
Specify the service, operation,
2 and possible callback to test.
i
rn 4 tLoad isor generate the output
k a h
message, or specify that
ฺ k ul use output will not be tested.
e p ak e to
i ( de© 2014,c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
To create
p kthe firstatest
n s case, perform the following steps:
e na -name r
t and description for the first test case to be added to the test suite.
D1.e Enter
n o
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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
The Test
test case
Caseeditor
editorlooks
lookslike thens
likethe
tel ent G
assembly editor (composite.xml),
@ co Stud
i
n lanes
rswim
except that the outer swimlanes is
are
are
l k
differently colored.
colored..a e t h
k ฺ ku o us
e p a et
i ( de© 2014, c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
The test
p a k fileaappears
case n s in the Application Navigator window as a child of the test suite, and
r
e filenis-topened in the Test Case window. The test case XML file visually resembles the
theeXML
D no
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">
<assert comparisonMethod="xml-similar"> also includes a wire assertion
<description/> and the description of the
s a
<expected>
<location key="output"/>
output message.
)ha
<message>
m
co eฺ
***
n ฺ
<CreditCheckResponse xmlns="http://www.example.org/ns/ccauthorize">
<status>VALID</status>
l a t io uid
</CreditCheckResponse>
s t el nt G
on tude
***
</message>
c
ni@ this S
</expected>
</assert>
a r
</wireActions>
</compositeTest>
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
When p a
you kcreate aantest case, several folders are created in the project. The tests folder
e
e all
contains t r
- test case XML files. In the slide is an example of a test case file. It is built from
the
D non that is provided to the wizard, including the initiating input message, and a wire
the information
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.

s a
)h a
m
Generate sample messages
o themฺ
cload
automatically, or
n ฺ e
t
from a file
l a ioor manual
u i dinput.
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
With the
p a k
appropriate
a n test case file opened in JDeveloper, double-click the wire of the SOA
e
composite - t
e oapplicationr area to test. This displays the Wire Actions dialog box, from which you
D n nemulations and assertions for the selected part of the SOA composite application.
can design
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.

s a
)ha
m
co eฺ
n ฺ
Specify the event to Sample
l a t io can ubeid
data
emulate and the
t el nandt G
generated
s edited.
target subscribers.
co Studn e
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
The unit
p a k framework
test a n s enables you to create a test case in a test suite that publishes an event
ae
to e subscriber
n r
-t component such as a Mediator.
D o
n an event, perform the following steps:
To emulate
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
s a
)ha
m
co eฺ
n ฺ
5 l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
You perform
p k n to verify variable data or process flow. Assertions enable you to
assertions
a
e
e test
validate t r
- in a variable or an entire XML document as a process is executed. This is
D ondata
done bynextracting 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
Note: You can create multiple assertions on the same wire.
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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
s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Answer: a k
p -tran
a
e e
D nonmessage initiation or an initiating event is required to run a test case. The absence
An inbound
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
Enter a name for the
test run and click OK. c on tude
a r ni@ this S
k u lk se
p a kฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
Beforepyou kcan run
a nany test cases within a test suite, you must deploy the composite
e
e onproject
application t r
- along with all the test suites it contains to an Oracle SOA Suite 12c runtime
D n such as a development or test system. Test suites must be deployed with the
environment,
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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 A composite application


to monitor and instance is created for
s a
view results. each test case.
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
When p a
you kclick OK
a nin the “Details of test run” window, an instance of the composite application
is e e t r
n-each test
created for case that is executed in the test run. The test cases are initiated by
D noinitiations,
using the 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c SExamine tu the cause
Composite application i
instance ID link to access
l k arn e this of assertion failure.
the Flow Trace page
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
The Test
p a k tabbed
Runs a n s page is displayed after you initiate a test run. Initially, the Test Runs
eemayonot
page n r
-tcontain any information. To update the contents of the page and view the
D n or results for the test cases in a test run, perform the following steps:
progress
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 themselves—the 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Answer: p bk
a a n s
ee suite n -t r
D
A test
n o or test case is executed by clicking the Execute button on the Unit Tests > Test
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
s a
Response?
)h
Web a
Client
SOA Debugger
c m
Service
o ฺ
n ฺ
5
l a t io uide
s t el nt G
c on tWeb u e Test Tool
dService
Examines
4 SOAP/HTTP
a r ni@ this S
HTTP Analyzer
k u lk sJDeveloper
e

ak e to u
e p
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k aSOA
To troubleshoot
p n sapplications, one approach is to follow the life cycle of a client request
eeresponse
and n r
-t(if any) through all the components involved in the interaction. Using this
D o
n you track the flow of a message through the system and examine possible sources
approach,
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
service components, and r i@ is and
Set breakpoints on binding components,
nsynchronous S
a
lk processes. e t h
k u
asynchronous BPEL
s
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
The SOA
p a k
debuggera nprovides a troubleshooting environment within Oracle JDeveloper. You can
e t r
- for troubleshooting on binding components, service components, and
setebreakpoints
D non and asynchronous BPEL processes.
synchronous
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.

s a
Specify in minutes how
)h a
long the client should m
Enter the port on
n ฺ
wait while attempting coto eฺ
which the debugging t io uid
establish a debugging
l a
agent listens.
t
session
s elbeforenstopping.
t G
c on tude
a r ni@ this S
k u lk se
p a kฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
Both local k
and n applications can be debugged. When the debugger is started, the
remote
a
e
Connection -
e onSettings t r window prompts for the server to use for debugging, the debug port, and
D n for the debugger when it is inactive. The debugger properties are stored per project.
the timeout
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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
Breakpointsk are nintentional pausing locations in a SOA composite application that you set
the
a
e t r
n- purposes. You can set breakpoints on a request, on a reply, or on both.
foredebugging
D n o
• 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.
s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
aa
To setp k K anon
breakpoint sfea BPEL process, select Edit. This opens the BPEL process in Oracle
ee Designer.
BPEL n - tr Right-click the BPEL activity on which to set a breakpoint and select Toggle
D no
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.
s a
)ha
m
co eฺ
Enter the request message n ฺ
l a t io HTTPu id
data to send or l click G
e andntpaste the
tcopy
Contentnto s
o fromtuan deXML file.
contentsc S
r i@ Send
nClick i s
l k a e t h Request.
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
To begin
p a k ansof the SOA composite application, right-click the right handle of the service
debugging
ee component
binding n - tr and select Initiate WS Debugging from the shortcut menu. This invokes the
D no Enter the request message data to send and click Send Request, or click
HTTP Analyzer.
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.

s a
)ha
m
co eฺ
n ฺ
l a t io uid
In the Log window at the bottomsof t el nt G
Oracle JDeveloper, click Data. c on tude
Expand the message r i@ isYou
ncontents. S
can double-click
a h
lka valueseto tchange it.
k u
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
The debugger
p stops
a n at the first breakpoint that you set (for example, on the service binding
e t r
e on-In the Log window at the bottom of Oracle JDeveloper, click Data. Expand the
component).
D n contents. You can double-click a value to change it. For non-XML variables, right-
message
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 stack of frames is a breadcrumb a
a corresponding frame is s
created in the Structure window.
trail of the locations that lead you
)ha
to your current location.
A frame is a location. m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
When pyoua kcreate aanbreakpoint, a corresponding frame is created in the Structure window. A
e t r
n- A stack of frames is a breadcrumb trail of the locations that lead you to your
e is aolocation.
frame
D
current n
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

s a
)ha
The debugger steps m
co eฺ
n ฺ
through the copy
l a t io uid
rules in an Assign
s t el nt G
activity one at a time. c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
To stepp a k
through annapplication, use the following function keys or the corresponding toolbar
a
e
e on-
icons: t r
D
• F8nsteps 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
To endpor kdetachafrom
n s a debugging session, perform the following:
n r
eethe oTerminate
-t icon in the tools menu to end a debugging session. The Terminate
D
Click
n Process dialog box is displayed. Select an option:
Debugger
• 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 a
) has
applications
ฺ c om ฺ
• Use the SOA debugger to step through an application
t i o n ideand
a u
observe values during execution tell tG n s den
o
c Stu
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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.

s a
CREDITCARDS
)ha
table
m
co eฺ
Initiate an inbound n ฺ
message. l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
The goal
p a k
of this n is to create a test suite that contains three test cases and to deploy the
practice
a
e
composite n-
e oapplicationt r with its test suite. After the composite application is deployed, you use
D
Oracle n
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
) has
You step through a running ฺ c om ฺ
t i o n ide
BPEL process, one line at a
t e l la t Gu
time, before terminating the
o n s den
debug session.
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-
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 runs a
time ) ha
m co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
Consider k
the n scenario:
following
a
e t r
n- application that you are building interacts with a credit card validation service.
e composite
D
The
n o
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
WS-Security Allow (Y/N)?
) has
Authentication UsernameTokenProfile Authenticate and authorize
c o m
Who? (sign, encrypt, propagate) WS-Security policy
o ฺ
n ideฺ
t i
Policy ste
lla t Gu
Request
o n
enforcement d e n
@ c
point St
u
i
Response
l k arn e this
Client k ฺ ku o us Endpoint Service
p a t
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
p a
Securing k
web n (or any services) involves protection of:
services
a
e t r
n- endpoint, which is the entry point to the service functionality
D•e The
n oservice
• 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-deployment—that 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:
a
<soap:Envelope xmlns:soap="..." xmlns:wsse="...">
<soap:Header> ... ) has
<wsse:Security>
ฺ c om ฺ
<wsse:UsernameToken>
t i o nSecurity
i de
<wsse:Username>jcooper</wsse:Username> l a
el nt token G u
s t
on tude
<wsse:Password>welcome1</wsse:Password>
</wsse:UsernameToken> c
</wsse:Security> ...
a r ni@ this S
</soap:Header> ...
k u lk se
</soap:Envelope>
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
a k K athe
Oraclepsupports n fe standard for Web Service Security (WS-Security) to provide
sOASIS
ee on-trand transport-level security for web services. WS-Security defines a
message-level
D n for adding transport independence and different levels of security to SOAP
mechanism
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
s a
• WS-Security-SwA
)ha
• UsernameTokenProfile 1.1 m
co eฺ
n ฺ
• X509TokenProfile 1.1
l a t io uid
• Security-Policy Use cases Working Draft 2
s t el nt G
Note: OPSS makes use of the Oracle Fusion Middleware
c n udeServer Java Platform
oApplication
Security (JPS) implementation. i @ S t
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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
bindings of service endpoints. external reference endpoints.
) has
<reference name="getCreditCardStatus" ... > ฺ c om ฺ
<interface.wsdl interface=".../getStatusByCC#wsdl.interface(execute)"/>
t i o n ide
<binding.ws
t e l la t Gu
n s den
port=" ... /getStatusByCC#wsdl.endpoint(getStatusByCC/execute_pt)"
o
location=" ... /validationForCC/getStatusByCC?WSDL">
@ c Stu
i
arn e this
<wsp:PolicyReference URI="oracle/wss11_saml_token_client_policy"

l k
orawsp:category="security" orawsp:status="enabled"/>
</binding.ws> </reference>
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k inathe
The examples
p n sslide briefly show how security policies can be attached to service
ee obindings
endpoint n r
-t in the composite.xml file.
D n
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Answer:
p bk
a a n s
e t r
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
a s
m )h
n ฺ co eฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
OWSM p a
is k
designed
a n to define and implement web services security in heterogeneous
e t r
e on- Instead of coding security logic in the application, you can use OWSM to
environments.
D n declarative security and management through predefined policies. The three main
implement
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


Policy Enforcement Point ) has
ฺ c om ฺ
t i o n ide
Oracle Platform Security
t e l la t Gu
Login Module
o n s den
@ c Stu
i
Oracle WebLogic
l k arnServer e t his
k ฺ ku o us
Authenticator
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
OWSMp a k be leveraged
can a n s from Oracle Enterprise Manager Fusion Middleware Control to:
r
e n-t define policies by using the OWSM Policy Manager
D•e Centrally
no
• 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

s a
Metadata
)ha
Store
(MDS)
m
co eฺ
n ฺ
l a t io uid
s t el nt G
Oracle@ con Stude
Fusion
r ni this
Middleware
a
k u lkDatabases e

ak e to u
e p
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k of athensOWSM Architecture include the following:
Components
p tr
e n-Enterprise
D•e Oracle Manager Fusion Middleware Control: Enables administrators to
no Oracle Web Services Manager’s functionality to manage, secure, and monitor
access
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 a
) has
• Message Transmission Optimization Mechanism (MTOM) om
o n ฺc eฺ
l l a ti u id
s te ent G
co Studn
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k types
The different
p a n s policies that are available are the following:
of
e n-t r
D•e WS-ReliableMessaging:
no
The reliable messaging policies that implement the WS-
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 s a
Request
)ha
Assertion 1 Assertion 2 Assertion n m
co eฺ
Response n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
OWSM p a k
policies n of one or more assertions that exhibit a particular capability or
consist
a
e
e oFor
behavior. t r
- example, a security policy could be made up of two assertions: a Log assertion
D n n
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 a
) has
authorization data, such as sending security tokens between
security domains. ฺ c om ฺ
t i o n ide
Example: UsernameToken in plain text (in ateSOAP Gu
lla theader):
s den
<wsse:UsernameToken> o
c Stu n
i @
arn e this
<wsse:Username>jcooper</wsse:Username>
<wsse:Password>welcome1</wsse:Password>l k
</wsse:UsernameToken>
k ฺ ku o us
e p a et
i ( de© 2014, c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Specific
p a k ans (WSS) 1.0 tokens include:
WS-Security
e n-tr
D•e WSSUsernameToken:
noor digest form
This token uses a plain username and password either in plain
text
• 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
k K afornexchanging
SAMLpisameant sfe security information between different security domains
e
(parties), -
e oespeciallyt r authentication details such as user login information, user attributes, and
D n n information in the form of policies.
authorization
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

Policy a
Request
enforcement
ha s
point
m )
Client
Response
ฺ co eฺ
Service
n
l a t io uid
s t el nt G
WS-SecurityPolicy:
c on tude
The oracle/wss_username_token_service_policy
ni@token
policy can be used to rextract i s S
data, apply
a
lkauthorization,
authentication and e h
t and set the subject.
k u s
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
a k K Middleware
OraclepFusion n s fe uses a policy-based model to manage web services. Policies apply
ee oton-the
standards tradelivery of messages. Policies are part of an enterprise policy framework.
D n policies to be centrally created and managed.
This enables
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
Answer:
p ck
a a n s
e t r
De non-

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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-

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
has
• Authenticate.
SAML
• Set subject.
)
CCAuth
ฺ c om ฺ
oracle/wss_username_token_service_policy

t i o n Crediti de
l a
el nt G Service u
Authorization
s t e
Fulfillment
c on • Read t u dsubject.
a r ni@ this •SInsert SAML token.
k u lk se
Finalize oracle/wss11_saml_token_client_policy

p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
The example
p k in a n slide illustrates the use of three different policies to authenticate,
the
e
e oand
authorize, t r
n- propagate username credentials. Following the request flow, web service
D
policiesnare 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
has
orawsp:category="security"
orawsp:status="enabled"/> )
</binding.ws>
ฺ c om ฺ
</service>
t i o n ide
t e lla t Gu
The attachment is added to the servicen(entry
o s den
point) in composite.xml.
@ c Stu
Result: The user is authenticated, i
rncurrent andisthe
subject is associated with l k a the
e t hthread.
u
ฺk to us
p sea k
e e
d © 2014, n
i ( l i c e
arn able
Copyright Oracle and/or its affiliates. All rights reserved.

l k
k Ku sfer
a showsrathe
The slide
e p n policy attachment fragment for the following scenario:
- t
D•e Then- onThe policy enforces the authentication of credentials that are provided via the
scenario: UsernameToken–based identity authentication. In this case:

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ฺ

s a
)ha
m
co eฺ
2
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
You use
p a k
Oracle n
JDeveloper
a 12c to attach policies for testing security in a design-time
e t r
e on-When your application is ready for deployment to a production environment, you
environment.
D n runtime policies in the Oracle Enterprise Manager Fusion Middleware Control
can attach
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"
s a
orawsp:category="security"
)ha
orawsp:status="enabled"/>
m
co eฺ
</binding.ws>
n ฺ
</reference>
l a t io uid
s t el nt G
The attachment is added to ancexternal on tude
reference in composite.xml.
a r
Result: Identity is propagated,ni@ tand h istheS
u
payload is encrypted.
k lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
The example
p in a n slide shows the policy attachment fragment for the following scenario:
the
e - t r
D•e The
n- onThe policy enables SAML token population for outbound SOAP requests by using
scenario: SAML-based identity assertion. In this case:

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
) has
ฺ c om ฺ
2 t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a
To attach
p ka policy
a ntosan external reference, perform the following steps:
r
e n-t the external reference and select Configure WS-Policies.
De1. Right-click
no
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

s a
)ha
m
co eฺ
n ฺ
l a t io uid
Specify the component
to which the policy is to s t el nt G
be attached. c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
Policies
p a k
apply n to the delivery of messages. You can attach security policies to and
security
a
e
e security
detach t r
n- policies from the currently deployed SOA composite applications.
D n o
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
has
validation test.
)
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k policies
5. Select
p a n sthat are appropriate to your environment, and then click Attach.
e nAttach r
-t additional policies as required.
De Note:
o
n you have finished attaching policies, click Validate.
6. When
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 runs a
time ) ha
m co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
e ep n-tran
D no

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
s a
Enroll BookingService booking_client_ep
)ha
m
co eฺ
n ฺ
l a t io uid
Propagate security identity. tel t G
on tudes n
c S
r n i@wss11_saml_token_service_policy
i s
Receive security identity. a
lk se t h
k u
p a kฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
The goal
p a k
of this n is to implement security on the endpoints of composite applications,
practice
a
e
e as the
such - t r
nEnrollment and BookingService interactions.
D n o
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ฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Request-Response Patterns

a
) has
ฺ c om ฺ
Appendix A i o n ide
t
lla t Gu
t e
s den
o
c Stu n
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
p a k ans
e tr
De non-
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
a
• Asynchronous Interaction with a Notification Timer
) has
• One Request, Multiple Responses
ฺ c om ฺ
• One Request, One of Two Possible Responses t i o n ide
t e lla t Gu
• One Request, a Mandatory Response, o n sanddan e nOptional
c u
Response i@ s St
l k arn e thi
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k anpatterns
Request-response
p s are used to facilitate communication between the components of
e
a Business -
e onProcess t r Execution Language (BPEL) process. The request-response operation
D n one input element (the request) followed by one output element (the response).
includes
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

Invoke
BPEL Service s a
)ha
m
co eฺ
Invoke Receive n ฺ
BPEL BPEL
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a
A one-way
p k message
a n interaction pattern is a special type of request-response pattern, where
e t r
- a message to the service, and the service does not need to reply. This could
eclientosends
the
D
be usednfornbusiness 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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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
Mediator request request
s a
BPEL
) ha
Receive
c m
o ฺ
Receive
n ฺ
Route
response
Invoke
response
l a t io uide
fault s t el nt G
fault
Reply
c on tude Reply

r i@ is S
nClient
Client Service
l k a e t h Service
k ฺ ku o us
e p a et
i ( de© 2014,c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k aninteraction,
In a synchronous
p s a client sends a request to a service, and receives an immediate
e n-
e or fault.
reply t r
D n o
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
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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
Mediator request request
s a
) ha
Receive Invoke m
co eฺ
Receive
n ฺ
Route
a t
response
l io uid
response
s t el nt G
Invoke Receive c on tude Invoke
i
rn this@ S
l k aProcessOrder
e
CheckInventory
k ฺ ku o us
e p a et
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k ansinteraction, a client sends a request to a service and waits until the
In an asynchronous
p
ee replies.
service n - tr
D no in the slide shows two diagrams of an asynchronous interaction between two SOA
The image
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
s a
response1
)ha
Receive
m
co eฺ
Invoke
n ฺ
response2
l a t io uid
Sequence
s t el nSequence
t G
Receive on tude
cInvoke
response3 @
a r ni this S
Receive Clientk u lk se Invoke Service
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
a k K atype,
In thispinteraction n sfethe client sends a single request to a service, and receives multiple
tr For example, the request can be to order a product online, and the first
ee onin-return.
responses
D
responsen 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
s a
Invoke
Optional ) ha
response Switch
c m
o ฺ
n ฺ
Scope onMessage A Notify user Invoke A tio
l a u i de
of delay
s t el nt G
response co
n ude When
i @ S t product

k a rn this ships
Receive B
ฺ k ul use Invoke B

e p ak e to
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k of interaction,
In thisptype a n s the client sends a single request to a service, and receives one or
eeresponses.
two n r
-t Here, the request is to order a product online. If the product is delayed, the
D o
servicensends 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 activity’s 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 client’s 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
Receive activity in the client BPEL process. ) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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

Invoke Receive s a
)ha
m
co eฺ
n ฺ
l a t io uid
Pick response
s t el nt G
c on tude
r n i@ is S Invoke
onAlarm onMessage
u l ka se th
Client Service
Timeout logic logic
ฺ k u
e p ak e to
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k ansinteraction with a timeout, a client sends a request to a service and waits
In an asynchronous
p
eeit receives
until n - tra reply, or until a certain time limit is reached, whichever comes first.
D no implementation in the slide shows:
The sample
• 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
s a
h a
Invoke Notify someone Receive m)
when a timeout
n ฺ co eฺ
onAlarm
occurs.
l a t io uid
Scope response tel t G
on tudes n
c
Receive
a r ni@ this S Invoke
Client k u lk se Service
k
a etฺ o u
e p
i ( de© 2014,
c e nsand/or its affiliates. All rights reserved.
a r n le li
Copyright Oracle

K ulk ferab
a k ansinteraction with a notification timer, a client sends a request to a service
In an asynchronous
p
eewaitsofor
and
D n -atrreply, although a notification is sent after a timer expires. The client continues
to wait n
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
Item in ) has
Otherwise
stock?
ฺ c om ฺ
t i o n ide
Pick
t e lla t Gu
Switch

o n s den
response A i@
c Stu
onMessage onMessage
B A k a rn thisInvoke Invoke

k u l B se A B

p akฺ to u
response

( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
K sfe
a k
In an interaction
p n one request and one of two possible responses, the client sends a
using
a
e
e request
single t r
- to a service and receives one of two possible responses. For example, the
D onbe
requestncan 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 process’s 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 client’s 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, anda
depending on the message, its branches do the following: ) has
ฺ c om ฺ
- If Message A is sent, the onMessage A branch handles the response.
t i o n ide
- If Message B is sent, the onMessage B branch handles the response.
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

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
s a
BPEL BPEL
) ha
request request m
co eฺ
n ฺ
Invoke Invoke l a t ioReceive
u id
Receive l
te ent G
n s
response
i @ co responseS tud
Invoke Receive lkarReceive
n this Invoke
Service 1 u
ฺk to us e Service 2
p sea k
e e
d © 2014, n
i ( l i c e
arn able
Copyright Oracle and/or its affiliates. All rights reserved.

l k
k Ku sfer
a ratype,
In thispinteraction
e n the client sends multiple requests to multiple services and receives
n-
e responses
multiple t in return. As shown in the slide, the service client (which is a BPEL
D
process)nouses 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
s a
request request
)ha
m
co eฺ
Receive Invoke Invoke
n ฺ
Receive

l a t io uid
s t el nt G
First c onresponse t u de
Invoke
response Pick i@
a r n this S Invoke
onMessage A lk onMessage B
Service 1 u
ฺk to us e Service 2
p sea k
e e
d © 2014, n
i ( l i c e
arn able
Copyright Oracle and/or its affiliates. All rights reserved.

l k
k Ku sfer
a ratype,
In thispinteraction
e n the client sends multiple requests to different services and expects to
e multiple
receive t
n- responses. However, to implement the first message response pattern, a Pick
D
activitynisoused 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.

Packaged Deployed a
has
Defines
properties
)
JDeveloper
composite.xml SOA
ฺ c om ฺ
Fusion
Archive t i o n Middleware
i de
l a
el nt G u
Control
s t
<component name="MyBPELComponent"> ...
<property name="bpel.config.inMemoryOptimization"> c on tude
true</property>
a r ni@ this S Engine BPEL
</component>
k u lk se
p akฺ to u
( d ee ense
r n i © 2014,
Copyright
e l icOracle and/or its affiliates. All rights reserved.
lka rab l
u
Therep a
arektwoKtypes
n s feBPEL deployment descriptor properties:
of
e n-tra properties, which are specific properties used by the BPEL Engine,
D•e Configuration
no
Enterprise Manager, or both. The server provides some predefined configuration
properties. Refer to the Oracle Fusion Middleware Developer’s 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ฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

You might also like