Services
If a service-oriented architecture is to be effective, we need a clear understanding of the
term service. A service is a function that is well-defined, self-contained, and does not
depend on the context or state of other services.
Connections
The technology of Web services is the most likely connection technology of service-
oriented architectures. Web services essentially use XML to create a robust connection.
Composites
Service components
Wires
The SOA Composite Editor enables you to use either of two approaches for designing
SOA composite applications.
WARNING: Always save your changes by selecting Save All from the tool bar menu.
Note: Oracle SOA Suite is not automatically installed with Oracle JDeveloper. Before you
can create an SOA application and project, you must download the SOA Suite extension
for Oracle JDeveloper (file name soa-jdev-extension.zip) from the Oracle Technology
Network and import it into Oracle JDeveloper. For instructions on downloading and
installing the SOA Suite extension for Oracle JDeveloper, see Oracle Fusion Middleware
Installation Guide for Oracle JDeveloper.
To create an application:
2 If Oracle JDeveloper is running for the first time, specify the location for the Java
JDK.
Figure 4-1 shows how Oracle JDeveloper appears the first time you access it.
If Oracle
Jdeveloper... Then...
Has no applications In the Application Navigator in the upper left, click New
Application > SOA Application.
If Oracle
Jdeveloper... Then...
For example, you are
opening Oracle
JDeveloper for the
first time.
2 Click OK.
4 Click OK.
Field Value
Application Enter an application name (for this example, My SOA Application is
Name entered).
Directory Name Accept the default value or enter a different directory path.
2 Accept the default values for all remaining settings, and click next.
The Project Name page of the Create SOA Application wizard appears.
3 Enter a name for the project (for this example, My SOA Project), and click Next.
Note that SOA is automatically selected as the project technology to use.
Note: Composite and component names cannot exceed 500 characters.
A project deployed to the same infrastructure must have a unique name across
SOA composite applications. This is because the uniqueness of a composite is
determined by its project name. For example, do not perform the actions
described. During deployment, the second deployed project (composite)
overwrites the first deployed project (composite).
Application2 Project1
The Project SOA Settings page of the Create SOA Application wizard appears.
The SOA Composite Editor shown it appears. The composite.xml file displays in
the Application Navigator. This file is automatically created when you create a
project. This file describes the entire composite assembly of services, service
components, and references. There is one composite.xml file per SOA project.
You drag service components into the designer to invoke the initial property editor. This
action enables you to define the service interface (and, for asynchronous BPEL
processes, an optional callback interface).
Dragging This
Service
Component... Invokes The...
BPEL Process Create BPEL Process dialog: Enables you to create a BPEL
process that integrates a series of business activities and services
into an end-to-end process flow.
Business Rule Create Business Rules dialog: Enables you to create a business
decision based on rules.
Human Task Create Human Task dialog: Enables you to create a workflow that
describes the tasks for users or groups to perform as part of an
end-to-end business process flow.
The following example describes the procedures to perform when a BPEL process is
dragged into the designer.
2 From the Service Components list, drag a BPEL Process into the designer.
For more information about available templates, see the online help.
Expose as a Deselect this checkbox. This creates a standalone BPEL process. If you
SOAP Service select this checkbox, a BPEL process and inbound web service binding
component are each created and connected.
Oracle BPEL Designer includes BPEL 1.1 and BPEL 2.0 activities that are available for
adding in a BPEL process. These activities enable you to perform specific tasks within a
process. Some activities are available in both BPEL 1.1 and BPEL 2.0. Others are
available in only BPEL 1.1 or BPEL 2.0.
To access these activities, go to the Component Palette of Oracle BPEL Designer. The
activities display under either of two categories:
BPEL Constructs: Displays core activities (also known as constructs) provided by
standard BPEL 1.1 and 2.0 functionality. The activities in this category are
displayed under additional subcategories of Web Service, Activities, and
Structured Activities in BPEL 1.1 and Web Service, Basic Activities, and
Structured Activities in BPEL 2.0.
Oracle Extensions: Displays extension activities that add value and ease of use to
BPEL 1.1 and 2.0 functionality
1.Assign Activity
This activity provides a method for data manipulation, such as copying the contents of
one variable to another. Copy operations enable you to transfer information between
variables, expressions, endpoints, and other elements.
One of the ways you can copy data from source to target in a BPEL Process.
<assign name=Assign_1>
When you Double Click the Activity Icon. Assign popup window will
appear you can perform following operation
Copy operation
2.Compensate Activity
This activity invokes compensation on an inner scope activity that has successfully
completed. This activity can be invoked only from within a fault handler or another
compensation handler. Compensation occurs when a process cannot complete several
operations after completing others. The process must return and undo the previously
completed operations. For example, assume a process is designed to book a rental car, a
hotel, and a flight. The process books the car and the hotel, but cannot book a flight for
the correct day. In this case, the process performs compensation by unbooking the car
and the hotel. The compensation handler is invoked with the compensate activity, which
names the scope on which the compensation handler is to be invoked.
Below Figure shows the Compensate dialog in BPEL 1.1. You can perform the following
tasks:
Click the General tab to provide the activity with a meaningful name.
3. Email Activity
This activity enables you to send an email notification about an event.
Figure A-11 shows the Email dialog in BPEL 1.1 and BPEL 2.0.
4. Empty Activity
This activity enables you to insert a no-operation instruction into a process. This activity
is useful when you must use an activity that does nothing (for example, when a fault
must be caught and suppressed).
5. Flow Activity
This activity enables you to specify one or more activities to be performed concurrently.
A flow activity completes when all activities in the flow have finished processing.
Completion of a flow activity includes the possibility that it can be skipped if its enabling
condition is false.
For example, assume you use a flow activity to enable two loan offer providers (United
Loan service and Star Loan service) to start in parallel. In this case, the flow activity
contains two parallel activities the sequence to invoke the United Loan service and the
sequence to invoke the Star Loan service. Each service can take an arbitrary amount of
time to complete their loan processes.
Figure A-14 shows an initial flow activity with its two panels for parallel processing. You
drag activities into both panels to create parallel processing. When complete, a flow
activity looks like that shown in Figure A-15.
Note: Oracles BPEL implementation executes flows in the same, single execution
thread of the BPEL process and not in separate threads.
6. FlowN Activity
This activity enables you to create multiple flows equal to the value of N, which is
defined at runtime based on the data available and logic within the process. Index
variable increments each time a new branch is created, until the index variable reaches
the value of N.
7. Invoke Activity
This activity enables you to specify an operation you want to invoke for the service
(identified by its partner link). The operation can be one-way or request-response on a
port provided by the service. You can also automatically create variables in an invoke
activity. An invoke activity invokes a synchronous web service or initiates an
asynchronous web service.
The invoke activity opens a port in the process to send and receive data. It uses this
port to submit required data and receive a response. For synchronous callbacks, only
one port is needed for both the send and the receive functions.
The invoke activity supports the bpelx: inputProperty and bpelx: outputProperty that
facilitate the passing of properties through the SOAP header and the obtaining of SOA
runtime system properties for useful information such as the
tracking.compositeInstanceId and tracking.conversationId.
Figure A-20 shows the Invoke dialog in BPEL 1.1. You can perform the following tasks:
When user double clicks on the Java embedding icon, popup window will appear
and user can enter the java code on it.
9. Notification Activities
This activity enables you to send notification about an event to a user, group, or
destination address.
You can send a notification by e-mail, voice mail, fax, pager, or short message
service (SMS).
Figure A-22 shows the Partner Link dialog in BPEL 1.1. You provide the following
details:
The web services description language (WSDL) file of the external service.
The pick activity provides an OnMessage branch. When you double-click the OnMessage
icon in BPEL 1.1, the dialog shown in Figure A-24 appears.
Contains the code for receiving a reply, for example, from a loan service.
onAlarm (does not automatically display; you must manually add this branch by
selecting the Pick activity icon and clicking the Add OnAlarm icon)
Contains the code for a timeout, for example, after one minute.
Whichever branch completes first is executed; the other branch is not executed. The
branch that has its condition satisfied first is executed.
Figure A-25 shows the OnAlarm dialog of the pick activity in BPEL 1.1.
Note: You can also create onMessage branches in BPEL 1.1 scope activities and
onAlarm branches in BPEL 1.1 and 2.0 scope activities. Expand the Scope activity in
Oracle JDeveloper, and browse the icons on the left side to find the branch you want to
add.
If you add correlations to an OnMessage branch, the correlations syntax is placed after
the assign activity syntax. The correlation syntax must go before the assign activity.
4 Before making or deploying the BPEL process, move the correlation syntax
before the assign activity in the BPEL
Figure A-26 shows the Receive dialog in BPEL 1.1. You can perform the following tasks:
This activity allows the process to send a message in reply to a message that was
received through a receive activity. The combination of a receive activity and a reply
activity forms a request-response operation on the WSDL port type for the
process.Figure A-31 Reply Dialog
Figure A-32 shows a rethrow activity within a fault handler (catch activity).
Fault handling is associated with a scope activity. The goal is to undo the incomplete
and unsuccessful work of a scope activity in which a fault has occurred. You define
catch activities in a scope activity to create a set of custom fault-handling activities.
Each catch activity is defined to intercept a specific type of fault.
Figure A-34 shows the Add Catch icon inside a scope activity. Figure A-35 shows the
catch activity area that appears when you click the Add Catch icon. Within the area
defined as Drop Activity Here, you drag additional activities to create fault handling
logic to catch and manage exceptions. For example, a client provides a social security
number to a Credit Rating service when applying for a loan. This number is used to
perform a credit check. If a bad credit history is identified or the social security number
is identified as invalid, an assign activity inside the catch activity notifies the client of
the loan offer rejection. The entire loan application process is terminated with a
terminate activity.
The request is processed inside a flow activity that enables concurrent behavior.
A reply message with the final approval status of the request is sent back to the
customer in a reply activity.
A sequence activity makes the assumption that the request can be processed in a
reasonable amount of time, justifying the requirement that the invoker wait for a
synchronous response (because this service is offered as a request-response operation).
When this assumption cannot be made, it is better to define the customer interaction as
a pair of asynchronous message exchanges.
When you double-click the Sequence icon, the activity area shown in Figure A-36
appears. Drag and define appropriate activities inside the sequence activity.
A switch activity differs in functionality from a flow activity. For example, a flow activity
enables a process to gather two loan offers at the same time, but does not compare
their values. To compare and make decisions on the values of the two offers, a switch
activity is used. The first branch is executed if a defined condition (inside the case
branch) is met. If it is not met, the otherwise branch is executed.
Note:
Figure A-40 shows several terminate activities in the otherwise branch of a switch
activity.
Figure A-42 shows the Transform dialog in BPEL 1.1. This dialog enables you to perform
the following tasks:
Click the second icon (the Add icon) to the right of the Mapper File field to
access the XSLT Mapper for creating a new XSL file for graphically mapping
source and target elements. Click the Edit icon (third icon) to edit an existing
XSL file.
.
21. Wait Activity
This activity allows a process to specify a delay for a certain period or until a certain
deadline is reached. A typical use of this activity is to invoke an operation at a certain
time. This activity enables you to wait for a given time period or until a certain time has
passed. Exactly one of the expiration criteria must be specified.
As the client, the BPEL process needs a valid partner link and an invoke activity with
the target service and the message. As with all partner activities, the WSDL file defines
the interaction.
To accept a message from the client, the BPEL process needs a receive activity.
2. Synchronous Interaction
In a synchronous interaction, a client sends a request to a service, and receives an
immediate reply. The BPEL process can be at either end of this interaction, and must be
coded based on its role as either the client or the service. Figure 12-2 provides an
overview.
When the BPEL process is on the client side of a synchronous transaction, it needs an
invoke activity. The port on the client side both sends the request and receives the reply.
As with all partner activities, the WSDL file defines the interaction.
When the BPEL process is on the service side of a synchronous transaction, it needs a
receive activity to accept the incoming request, and a reply activity to return either the
requested information or an error message (a fault).
3. Asynchronous Interaction
In an asynchronous interaction, a client sends a request to a service and waits until the
service replies. Figure 12-3 provides an overview.
When the BPEL process is on the client side of an asynchronous transaction, it needs an
invoke activity to send the request and a receive activity to receive the reply. As with all
partner activities, the WSDL file defines the interaction.
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.
Each section of Oracle BPEL Designer enables you to perform specific design and
deployment tasks.
Application Navigator
Design window
Source window
History window
Component Palette
Property Inspector
Structure window
Log windowNote:
To learn more about these sections, you can also place the cursor in the appropriate
section and press F1 to display online Help.
Introduction to Partner Links
A partner link enables you to define the external services with which the BPEL process
service component is to interact. You can define partner links as services or references
(for example, through a JCA adapter) in the SOA Composite Editor or within a BPEL
process service component in Oracle BPEL Designer. Figure 5-8 shows the partner link
icon (in this example, named WriteRecord).
A partner link type characterizes the conversational relationship between two services
by defining the roles played by each service in the conversation and specifying the port
type provided by each service to receive messages within the conversation.
Field Description
Name A unique and recognizable name you provide for the partner link.
WSDL The name and location of the Web Services Description Language (WSDL)
URL file that you select for the partner link. Click the SOA Service Explorer icon
(second icon from the left above the WSDL URL field) to access a window for
selecting the WSDL file to use.
My Role The role performed by the BPEL process service component. In this case, the
BPEL process service component does not have a role because it is a
Field Description
synchronous process.
Note:
The Partner Link Type, Partner Role, and My Role fields in the Create Partner Link
dialog are defined and required by the BPEL standard.
Creating a Partner Link
The method by which you create partner links within the BPEL process in Oracle BPEL
Designer impacts how the partner link displays above in the SOA Composite Editor. This
section describes this impact. The WSDL file can be on the local operating system or
hosted remotely (in which case you need a URL for the WSDL).
1 In the SOA Composite Editor, double-click the BPEL process service component.
3 Drag a Partner Link into the appropriate Partner Links swim lane, as shown in
Figure 5-10.
Table 5-3 Impact of Partner Link Creation on the SOA Composite Editor
Creating the Following for a BPEL Displays the Following in the SOA
Process in Oracle BPEL Designer... Composite Editor...
A partner link for an outbound adapter A reference handle for the BPEL
service component
Creating the Following for a BPEL Displays the Following in the SOA
Process in Oracle BPEL Designer... Composite Editor...
A partner link for an inbound adapter A service for the BPEL service
component
Partner Links from an Existing Human Task, Business Rule, or Oracle Mediator
Table 5-8 Impact of Partner Link Creation on the SOA Composite Editor
Creating the Following for a BPEL Displays the Following in the SOA
Process in Oracle BPEL Designer... Composite Editor...
A partner link by dragging an existing human A reference for the BPEL service
task, business rule, or mediator service component
component from the Resource Palette to the
Creating the Following for a BPEL Displays the Following in the SOA
Process in Oracle BPEL Designer... Composite Editor...
BPEL process A wire connecting the BPEL
service component to the
existing human task, business
rule, or mediator
Fault handlers define how the BPEL process service component responds when the web
services return data other than what is normally expected (for example, returning an
error message instead of a number). An example of a fault handler is where the web
service normally returns a credit rating number, but instead returns a negative credit
message.
Provides an example of how a fault handler sets a credit rating variable to -1000.
Fault handling in a BPEL process is reverse work, undoing the partial and unsuccessful
work of a scope in which a fault has occurred. Fault handling differs from compensation
handling in that fault handling takes over when a fault occurs within a scope whereas
compensation reverses the work of a successfully completed scope.
A web service operation cannot complete successfully, and the service returns a
fault
An internal process error occurs, and a standard BPEL fault is thrown. Refer to
the list of BPEL Standard Faults for more information.
Fault handling can be global or local: you can add fault handlers to the process as a
whole or to a scope within the process.
When a fault occurs, normal processing is terminated, and control is transferred to the
corresponding fault handler, as defined in the <faultHandlers> section of the process or
scope.
Note that the process does not enable compensation for a scope in which a fault handler
is invoked.
Fault handlers do not rely on state to determine which nested scopes have completed
successfully.
The code segment in Example 12-1 defines the fault handler for this operation in the
BPEL file:
<faultHandlers>
<catch faultName="services:NegativeCredit" faultVariable="crError">
<assign name="crin">
<copy>
<from expression="-1000">
</from>
<to variable="input" part="payload"
query="/autoloan:loanApplication/autoloan:creditRating"/>
</copy>
</assign>
</catch>
</faultHandlers>
The faultHandlers tag contains the fault handling code. Within the fault handler is a
catch activity, which defines the fault name and variable, and the copy instruction that
sets the creditRating variable to -1000.
When you select web services for the BPEL process service component, determine the
possible faults that may be returned and set up a fault handler for each one.
bindingFault
conflictingReceive
conflictingRequest
correlationViolation
forcedTermination
invalidReply
joinFailure
mismatchedAssignmentFailure
remoteFault
repeatedCompensation
selectionFailure
uninitializedVariable
Not associated with any Web Services Description Language (WSDL) message
<catch faultName="bpws:selectionFailure">
A BPEL fault has a fault name called a Qname (name qualified with a namespace) and a
possible messageType. There are two categories of BPEL faults:
Business faults
Runtime faults
Business Faults
Business faults are application-specific faults that are generated when there is a
problem with the information being processed (for example, when a social security
number is not found in the database). A business fault occurs when an application
executes a throw activity or when an invoke activity receives a fault as a response. The
fault name of a business fault is specified by the BPEL process service component. The
messageType, if applicable, is defined in the WSDL. A business fault can be caught with
a faultHandler using the faultName and a faultVariable.
Runtime Faults
Runtime faults are the result of problems within the running of the BPEL process
service component or web service (for example, data cannot be copied properly because
the variable name is incorrect). These faults are not user-defined, and are thrown by the
system. They are generated if the process tries to use a value incorrectly, a logic error
occurs (such as an endless loop), a Simple Object Access Protocol (SOAP) fault occurs in
a SOAP call, an exception is thrown by the server, and so on.
Several runtime faults are automatically provided. These faults are included in the
http://schemas.oracle.com/bpel/extension namespace. These faults are associated with
the messageType RuntimeFaultMessage. The WSDL file shown in Example 12-2 defines
the messageType:
<message name="RuntimeFaultMessage">
<part name="code" type="xsd:string" />
<part name="summary" type="xsd:string" />
<part name="detail" type="xsd:string" />
</message>
</definitions>
bindingFault
A bindingFault is thrown inside an activity if the preparation of the invocation fails. For
example, the WSDL of the process fails to load. A bindingFault is not retryable. This
type of fault usually must be fixed by human intervention.
remoteFault
A remoteFault is also thrown inside an activity. It is thrown because the invocation fails.
For example, a SOAP fault is returned by the remote service.
replayFault
A replayFault replays the activity inside a scope. At any point inside a scope, this fault is
migrated up to the scope. The server then re-executes the scope from the beginning.
Oracle SOA Suite provides a generic fault management framework for handling faults in
BPEL processes. If a fault occurs during runtime in an invoke activity in a process, the
framework catches the fault and performs a user-specified action defined in a fault
policy file associated with the activity. If a fault results in a condition in which human
intervention is the prescribed action, you perform recovery actions from Oracle
Enterprise Manager Fusion Middleware Control Console. The fault management
framework provides an alternative to designing a BPEL process with catch activities in
scope activities.
This section provides an overview of the components that comprise the fault
management framework.
The fault management framework catches all faults (business and runtime) for
an invoke activity.
A fault policy file defines fault conditions and their corresponding fault recovery
actions. Each fault condition specifies a particular fault or group of faults, which
it attempts to handle, and the corresponding action for it. A set of actions is
identified by an ID in the fault policy file.
A fault policy bindings file associates the policies defined in the fault policy file
with the following:
The framework looks for fault policy bindings in the same directory as the
composite.xml file of the SOA composite application or in a remote location
identified by two properties that you set.
Note:
A fault policy configured with the fault management framework overrides any
fault handling defined in catch activities of scope activities in the BPEL process.
The fault management framework can be configured to rethrow the fault
handling back to the catch activities.
The fault policy file (fault-policies.xml) and fault policy bindings file (fault-
bindings.xml) are placed in either of the following locations:
<property
name="oracle.composite.faultPolicyFile">oramds://apps/faultpolicyfiles/
fault-policies.xml
</property>
<property
name="oracle.composite.faultBindingFile">oramds://apps/faultpolicyfiles
/
fault-bindings.xml</property>
1 From the Component Palette, drag a Throw activity into the designer.
4 To the right of the Namespace URI field, click the Search icon to select the fault
to monitor.
5 Select the fault in the Fault Chooser dialog, and click OK.
The namespace URI for the selected fault displays in the Namespace URI field.
Your fault selection also automatically displays in the Local Part field.
How to Use a Fault Handler within a Scope
If a fault is not handled, it creates a faulted state that migrates up through the
application and can throw the entire process into a faulted state. To prevent this,
contain the parts of the process that have the potential to receive faults within a scope.
The scope activity includes the following fault handling capabilities:
The catch activity works within a scope to catch faults and exceptions before
they can throw the entire process into a faulted state. You can use specific fault
names in the catch activity to respond in a specific way to an individual fault.
The catchAll activity catches any faults that are not handled by name-specific
catch activities.
1 From the Component Palette, drag an Compensate activity into the designer.
Adapters enable you to integrate the BPEL process service component (and, therefore,
the SOA composite application as a whole) with access to file systems, FTP servers,
database tables, database queues, sockets, Java Message Services (JMS), MQ, and
Oracle E-Business Suite. This wizard enables you to configure the types of adapters
shown in Figure 5-17 for use with the BPEL process service component:
Database
Oracle Applications
Oracle B2B
Sockets
Third Party
ADF-BC Service
This service connects Oracle Application Development Framework (ADF) applications
using SDOs with the SOA platform.
AQ Adapter
This adapter acts as both a dequeue (inbound) and enqueue (outbound) messaging
adapter. In the inbound direction, the adapter polls the queues for messages to dequeue
from a destination. In the outbound direction, the adapter enqueues messages to the
queue for subscribers to dequeue.
Oracle B2B
This adapter enables you to browse B2B metadata in the Metadata Service (MDS)
repository and select document definitions.
Oracle B2B is an e-commerce gateway that enables the secure and reliable exchange of
transactions between an organization and its external trading partners. Oracle B2B and
Oracle SOA Suite are designed for e-commerce business processes that require process
orchestration, error mitigation, and data translation and transformation within an
infrastructure that addresses the issues of security, compliance, visibility, and
management.
Database Adapter
This adapter enables a BPEL process to communicate with Oracle databases or third-
party databases through JDBC. To access an existing relational schema, you use the
Adapter Configuration Wizard to do the following:
While your BPEL process deals with XML and invokes web services, database rows and
values are queried, inserted, and updated.
You can also invoke an Oracle Service Bus (OSB) flow or another SOA composite
application in the outbound direction.
EJB Service
This service enables you to send and receive messages through Enterprise JavaBeans
(EJBs).
File Adapter
This adapter acts as both an inbound and outbound adapter. In the inbound direction,
the adapter polls for files in a directory to retrieve and process. In the outbound
direction, the adapter creates files in a directory.
FTP Adapter
This adapter acts as both an inbound and outbound adapter. In the inbound direction,
the adapter polls for files in a directory to retrieve and process. In the outbound
direction, the adapter creates files in a directory.
HTTP Binding
This service enables you to integrate SOA composite applications with HTTP binding.
This service enables you to invoke SOA composite applications through HTTP POST and
GET operations, and invoke HTTP endpoints through HTTP POST and GET operations.
JMS Adapter
This adapter acts as both a consume (inbound) and produce (outbound) messaging
adapter. In the inbound direction, the adapter polls (consumes) messages from a JMS
destination. In the outbound direction, the adapter sends (produces) messages to a JMS
destination.
MQ Adapter
This adapter provides message exchange capabilities between BPEL processes and the
IBM MQSeries messaging software.
Oracle Applications
This adapter provides comprehensive, bidirectional, multimodal, synchronous, and
asynchronous connectivity to Oracle Applications. The adapter supports all modules of
Oracle Applications in Release 12 and Release 11i, including selecting custom
integration interface types based on the version of Oracle E-Business Suite. The adapter
provides real-time and bidirectional connectivity to Oracle Applications through
interface tables, views, application programming interfaces (APIs), and XML Gateway.
The adapter inserts data into Oracle Applications using interface tables and APIs. To
retrieve data from Oracle Applications, the adapter uses views. In addition, it uses XML
Gateways for bidirectional integration with Oracle Applications. XML Gateways are also
used to insert and receive Open Application Group Integration Specification
Socket Adapter
This adapter enables you to model standard or nonstandard protocols for
communication over TCP/IP sockets. You can use this adapter to create a client or
server socket, and establish a connection. The data that is transported can be text or
binary.
Mediators:
Oracle Mediator facilitates integration between events and services, where service
invocations and events can be mixed and matched. You can use a Mediator component
to consume a business event or to receive a service invocation. A Mediator component
can evaluate routing rules, perform transformations, validate, and either invoke another
service or raise another business event. You can use a Mediator component to handle
returned responses, callbacks, faults, and timeouts.
This section provides an overview of Oracle Mediator features:
Transformations
Validations
Java Callout
Event Handling
Dynamic Routing
Error Handling
Oracle Mediator provides support for setting rules based on message payload or
message headers. You can select elements or attributes from the message
payload or the message header and based on the values, you can specify an
action. For example, Mediator receives a file from an application or service
containing data about new customers. Based on the country mentioned in the
customer's address, you can route and deliver data to the database storing data
for that particular country. Similarly, you can route a message based on the
message header.
A routing rule execution type can be either parallel or sequential. You can
configure the execution type from Routing Rules panel.
Transformations
Oracle Mediator supports data transformation from one XML schema to another.
This feature enables data interchange among applications using different
schemas. For example, you can transform a comma-delimited file to the database
table structure.
Validations
Oracle Mediator provides support for validating the incoming message payload
by using a Schematron or an XSD file. You can specify Schematron files for each
inbound message part and Oracle Mediator can execute Schematron file
validations for those parts.
Java Callout
Oracle Mediator provides support for Java callout. Java callouts enable the use of
Java code, together with regular expressions.
Event Handling
Dynamic Routing
Dynamic Routing separates the control logic, which determines the path taken
by the process, from the execution of the process. You can create a dynamic
routing rule from the Mediator Editor.
Error Handling
Oracle Mediator supports both fault policy-based and manual error handling. A
fault policy consists of conditions and actions. Conditions specify the action to be
carried out for a particular error condition.
Oracle Mediator supports echoing source messages back to the initial caller after
any transforms, validations, assignments, or sequencing are performed.
You have many tools to use in a composite, and they may overlap for some cases.
Mediator is particularly useful for content based routing of events, and as a listener for
events. BPEL of course offers more possibilities for business logic and would generally
be suited to defining process logic. A more complex SOA composite likely includes both
components and others as well.
Mediator serves the purpose of a bus. It can be best utilized when used for routing. It
can do routing based on many parameters and the best part is, the routing rules can be
modified at runtime, thus giving the flexibility to choose the target at any point in time.
BPEL
1) Complex Logic
2) Good Support language in form ofactivities
3) Performance wise very slow
4) Support of Dehydration and Instance Monitoring
5) For Long Running process BPEL is the Right Solution
6) To implement the controlled Transactions
Integration of Rules Engine and Human Workflow
7) To implement the service virtualization BPEL is not the right approach
Mediator
1) Less Complex Logic
2) Less Support
3) Three times faster than BPEL
4) No support of de hydration
5) For Long Running process not a proper solution
6) You cannot control the transactions in Mediator.
7) Mediator is the right approach for the service virtualization
Mediator
V alidade
E nrich
T ransform
R oute
O perate
Message Throttling
Service Pooling
Reliable Messaging
Domain Value Maps (DVM) are an interesting feature of Oracle SOA Suite for
supporting Canonical Data Models. They help to map from one vocabulary, used in a
given domain, to another vocabulary used in a different domain. For example, one
domain might represent a country with a numeric code while another domain may
represent a country with the ISO-standard alphanumeric country code. In SOA Suite
10g Domain Value Maps (DVM) are an interesting feature of Oracle SOA Suite for
supporting Canonical Data Models. They help to map from one vocabulary, used in a
given domain, to another vocabulary used in a different domain. For example, one
domain might represent a country with a numeric code while another domain may
represent a country with the ISO-standard alphanumeric country code. In SOA Suite
10g there were part of the old Oracle ESB and in SOA Suite 11g they can be used
from a Mediator component.
Unfortunately this feature is not yet available in Oracle Service Bus (OSB). It will
be added in the future, as the statement of direction states.
This might be less of a problem when using both the Oracle SOA Suite together
with the Oracle Service Bus in a larger architecture. In this case, the
responsibility for mapping these values can be delegated to the SOA Suite 11g
Mediator component, where the DVM functionality is available.
But if only the OSB is used standalone, then such value mappings would be nice
in the OSB as well. With the help of XQuery the DVM functionality can be
implemented in a similar way, so that if the feature is later available in a new
version of OSB, it can be replaced by that with minimal work involved. This blog
entry shows the custom DVM functionality implemented for the Oracle Service
Bus.
CityCode CityName
BELG_MN_STLouis BelgradeStLouis
BELG_NC BelgradeNorthCarolina
CityCode CityName
BO Boston
NP Northport
KN_USA KensingtonUSA
KN_CAN KensingtonCanada
Each domain value map typically holds a specific category of mappings among multiple
applications. For example, one domain value map may hold mappings for city codes and
another may hold mappings for state codes.
Domain value map values are static. You specify the domain value map values at design
time using Oracle JDeveloper, and then at runtime, the domain value map columns are
looked up for values.
MDS
MDS is used as a repository for managing and reusing shared resources like XSD,
WSDL, XSL files.
MDS should be implemented from day 1 of development otherwise developers will run
into XSD mismatch, also during production it will be very tough to keep the XSD same.
The concept is very simple, rather than each project picking the xsd (any other file)
from there project's 'xsd' folder, pick it from the common/shared folder.
Oracle SOA suite 11G provides Central MDS and Local MDS.
*** Ideally all the artifacts should be inside the central MDS.
XRef Tables :
The Xref tables we create is a one-time activity and we can refer to any XREF table from
oramds, if it is properly populated in XREF_DATA. We will be using BPEL process for
populating the data.
Oracle Business Rules is a high performance and lightweight business rules product
that is part of the Oracle Fusion Middleware Suite that can be used in both SOA and
BPM suite.
To have a business process more agile and coherent with the changing demands of
Business, Oracle Business rules is a must for any design. Also it should act as a central
component where all process rules are located.
With OBR 11g one added advantage of business rules is that they can be exposed as any
other web service. This makes it an instant hit as it becomes hot pluggable.
A Decision component, also called a business rule service component, supports use of
Oracle Business Rules in a SOA composite application. Decision components support
the following SOA composite usage.
Rules Designer
Navigation Tab Description
Facts Facts are the objects that rules reason on.
Rulesets with Rules A ruleset provides a unit of execution for rules and for Decision
and Decision Tables Tables. A Decision Table provides a mechanism for describing
data processing tasks.
Stand Alone
From BPEL
Rule
Ruleset
Simple mode for if-then rules aut
Simple to create complex condit
Nested conditions
change from and to or
Create rule dictionary from within BPEL
Leverage BPEL variables and project schema
Dictionary completely setup for writing rules
List of Values or Ranges
If CurrentDate.date = Duri
Then Discount = 15 and st
Introduction to Human Workflow
Many end-to-end business processes require human interactions with the process. For
example, humans may be needed for approvals, exception management, or performing
activities required to advance the business process. The human workflow component
provides the following features:
Deadlines, escalations, notifications, and other features required for ensuring the
timely performance of a task (human activity)
Organization, filtering, prioritization, and other features required for end users
to productively perform their tasks
To use the Human Task Editor, you must understand human task design concepts,
including the following:
The types of users to which to assign tasks
The task participant types available for modeling a task to which you assign
users
Creating and modeling a human task service component in the SOA Composite
Editor
Generating the task form for displaying the human task during runtime in Oracle
BPM Worklist.
2 Accept the default values for outcomes (APPROVE and REJECT). For this task,
these outcomes represent the two choices the manager has for acting on the
vacation request.
3 On the right side of the Parameters section, click the Add icon to specify the task
payload.
The Add Task Parameter dialog is displayed. You now create parameters to
represent the elements in your XSD file. This makes the payload data available to
the workflow task.
4 Select Element.
Business Activity Monitoring is a tool that is useful in monitoring business services and
processes. It actively collects data, applies rules and reports information to users. When
something goes wrong in business processes, BAM can be configured to take corrective
measures such as emailing administrators/support team.
How does BAM interface with other SOA APPLICATIONS?
BAM uses Data Objects to capture and store information from other sources. It uses
Real Time Data Streaming to stream data through Oracle BAM Adapter, JMS connector,
ODI or web service API.
We are going to explore the features of BAM through a simple use-case as shown below:
Click on "Create Data Object" and enter "Employee" in the name field.
Click on "Add Field" and add following fields: id (Auto-incrementing Integer),
name (String), department (String).
Click on "Create Data Object" to finish creation. You can optionally create a sub-
folder to hold Employee object.
Enter "Employee Dashboard" for Report title and select "3D Bar Chart" as report
type.
Select "Employee" object from Data Objects section at the bottom and click on
Next button.
Save this report and it will be visible through "Recent Reports" in Home tab. This
report now shows Employee count grouped by Department.
Note: The UserName field should contain an Oracle BAM user who is a member of
application-level role Administrator or Report Architect. weblogic user by default is an
Administrator.
Clik on OracleBamAdapter from Deployments page. Go to Control tab. Select
OracleBamAdapter, click on Stop and then Start buttons. Now, Oracle BAM
Adapter is ready for use.
Click on Monitor button at the top right corner of the process window to change
to Monitor view.
Change Evaluation Time to Completion. This will activate sensor after the
completion of receiveInput activity. Select Employee element for inputVariable as
shown below.
From BAM Example Process Structure window, right click on Sensor Actions and
Creatte > BAM Sensor Action
Select ActivitySensor_1 for Sensor property. Choose Employee Data Object from
BAM Data Object Chooser.
Select Insert as Operation type. One other interesting operation is Upsert that
stands for Update/Insert. This operation creates an object if one does not exist or
updates an existing one.
Create a new mapping between BAM data object and BPEL input variable as
shown below.
Enter Oracle1 and ORACLE for name and department respectively. Click on Test
Web Service.
Open BAM Active Viewer. Click on Select Report and choose Employee
Dashboard report we saved earlier. We can see the updated graph. Experiment
with different values.
Oracle BPEL Correlation Exemplified
Correlation is one of the important & tricky techniques available within Oracle BPEL
PM. Below taken a simple route to explain the correlation technique.
Whenever a synchronous web service is invoked from Oracle BPEL via a partner link,
only one port is established for communication with the exposed web service which is
used by both request & response messages.
However, when an asynchronous web service is invoked, two ports are opened for
communication: one for request & one for response messages.
What is WS-Addressing?
2. When the message travels through several services and response is solicited by the
initial service from the last service directly
For instance, request flow pro1 -> pro2 -> pro3 and response is received from pro3
->pro1
Implementing Correlation:
In Structure Window of the JDeveloper IDE, right click on the Correlation Sets and
choose 'Create Correlation Set'
Provide a name for your correlation set being created.
In the properties section, select 'Add' to display the property chooser window
Choose 'Create' to create a property on which the correlation has to be initiated.
Provide a name and type for the property.
Go the the correlations tab on the activity (invoke/receive/pick) on which you need to
set & validate the correlation
Add the created correlation set to the activity
In the Structure Window of the JDeveloper, right click on the 'Property Aliases' and
select 'Create Property Alias'
Select the message type that you want to set to the correlation property (already
created)
Now, correlation design is complete. However, correlation will not be established unless
we reference the correlations on the WSDL file of the BPEL process. To do this, import
the correlation WSDL file (created under the project) in the BPEL process main WSDL.
So far we have discussed BPEL processes where all partner links have been defined at
the design time and related to actual web services. We have used a single partner link
for each web service we have communicated with.
In an advanced BPEL process, we might want to define the partner link endpoint
references at runtime. This means that the BPEL process will dynamically determine
which actual web service it will use for a certain invocation, based on the variable
content. This is particularly useful in scenarios where the BPEL process communicates
with several web services that have the same WSDL interface. This has been the case
for our travel process example where American and Delta Airlines' web services shared
the same interface.
At times you have mutiple service end points and you dont want to design your bpel
based on each service.
You can have a single invoke for all the service endpoints using dynamic bining.
<plnk:partnerLinkType name="SupplierBpel2">
<plnk:role name="SupplierBpelProvider2">
<plnk:portType name="client:SupplierBpel2"/>
</plnk:role>
</plnk:partnerLinkType>
<plnk:partnerLinkType name="SupplierBpel3">
<plnk:role name="SupplierBpelProvider3">
<plnk:portType name="client:SupplierBpel3"/>
</plnk:role>
</plnk:partnerLinkType>
3) Initialize variable:
<from>
<EndpointReference xmlns="http://schemas.xmlsoap.org/ws/2003/03/addressing">
<Address/>
<ServiceName/>
</EndpointReference>
</from>
<to variable="partnerReference"/>
4) Initialize the Service and Address , can get these values from WSDL
<assign name="Assign_service1">
<copy>
<from expression='"supplierbpel_client_ep"'/>
<to variable="service_type"/>
</copy>
<copy>
<from expression='"http://192.168.2.3:8001/soa-
infra/services/default/DynamicProvider/supplierbpel_client_ep"'/>
<to variable="Srv_Add"/>
</copy></assign>
<copy>
<from variable="Srv_Add"/>
<to variable="partnerReference"
query="/ns2:EndpointReference/ns2:Address"/>
</copy>
<copy>
<from variable="service_type"/>
<to variable="partnerReference"
query="/ns2:EndpointReference/ns2:ServiceName"/></copy>
Thats it , you can also have a general service in place just for binding at first place.
Oracle BPEL Process Manager uses the dehydration store database to maintain long-
running asynchronous processes and their current state information in a database while
they wait for asynchronous callbacks. Storing the process in a database preserves the
process and prevents any loss of state or reliability if a system shuts down or a network
problem occurs.If you have a large number of composite instances present for a single
or multiple composites the Enterprise Manager will not be a very ideal place to look at if
we want to know the states of these instances.
The table below shows the various State Value for composite instances in the
CUBE_INSTANCE table of the SOA_INFRA schema in the dehydration store. It stores
instance meta data information like creation date, last modified date, current state,
process id etc. Following are processes state codes and their meaning
State Code
Closed and Aborted 8
Closed and Cancelled 7
Closed and Completed 5
Closed and Faulted 6
Closed and (Pending or Cancel) 4
Closed and Stale 9
Initiated 0
Open and Faulted 3
Open and Running 1
Open and Suspended 2
Instance data occupies space in Oracle BPEL Process Manager Schema tables. Data
growth from auditing and dehydration can have a significant impact on database
performance and throughput.
(iv)cube_scope:-Stores the scope data for an instance (for example, all variables
declared in the BPEL flow and some internal objects that help route logic throughout
the flow).
(x)task:-Stores tasks created for an instance. The TaskManager process keeps its
current state in this table.
Durable and Transient Processes:-There are two types of processes in Oracle BPEL
Process Manager. These processes impact the dehydration store database in different
ways.
(i)Transient processes:- this process type does not incur any intermediate
dehydration points during process execution. If there are unhandled faults or there is
system downtime during process execution, the instances of a transient process do not
leave a trace in the system. Transient processes are typically short-lived, request-
response style processes. The synchronous process you design in Oracle JDeveloper is
an example of a transient process.
(ii)Durable processes:- this process type incurs one or more dehydration points in the
database during execution because of the following activities:
* Receive activity
* OnMessage branch in a pick activity
* OnAlarm branch in a pick activity
* Wait activity
Instances of durable processes can be saved in-flight (whether they complete normally
or abnormally). These processes are typically long-living and initiated through a one-
way invocation.
(b)completionPersistPolicy:-
This property configures how the instance data is saved. It can only be set at the BPEL
component level. The completionPersistPolicy property can only be used when
inMemoryOptimization is set to be True (transient processes). Note that this parameter
may affect database growth and throughput (due to reduced I/O).
Value
(i)On (default):-The completed instance is saved normally
(ii)Deferred:-The completed instance is saved, but with a different thread and in another
transaction.
(iii)Faulted:-Only the faulted instances are saved.
(iv)Off:-No instances of this process are saved.