http://download.oracle.com/technology/tech/soa/soa_best_practices_1013x_drop3.pdf
Oracle BPEL
Introducing BPEL
Business Process Execution Language (BPEL) is a standard that emerged in 2003 and was developed to enable orchestration of web services using an executable XML-based language. BPEL allows you to separate out the definition of your business process from the implementation of the services that it orchestrates. BPEL provides process flow operators such as conditional branching, parallel flow (split/join), and looping. The resulting BPEL process can itself be exposed as a web service, and therefore, be included in other business processes. You can read the BPEL standard at http://oasis-open.org/.
Long-running services
A business process can be short or long, taking minutes, days, or even months. For example, processing a mortgage application can take several weeks and can contain many steps. One of the strengths of BPEL is the way it is designed to handle such long running processes. It has built-in support for asynchronous processing so that when you call another service asynchronously, it waits for the response, even if the server is restarted and no matter how long the wait time is. When the response comes back, the BPEL engine coordinates the response to the BPEL process instance that made the request. You, the business process developer, need not worry about the low-level details of waiting for and correlating the response.
BPEL language
The XML-based language starts with a top-level XML element named Process. The elements of a BPEL process are called BPEL activities. Web services that the process calls or that call into a process are defined with a Partnerlink activity. Within the process, an Invoke activity says where to invoke the partnerlink or, if the web service calls the BPEL process, the Receive activity shows where the call comes into the process. A BPEL process can have variables and an Assign activity is used to assign a value to a variable. Variables are defined as XML elements and are accessed using XPath. Other common BPEL activities are Switch: for branching logic, Flow: for parallel execution, and Faulthandlers: for managing faults.
BPEL Editor
The BPEL Editor gives you a graphical view of the business process flow. In JDeveloper, you create a BPEL component in your composite and when you double-click on the component, the BPEL Editor opens. BPEL is all about XML but you use the graphical editor in JDeveloper to design your process. In fact, although you can edit the BPEL source and enter XML elements directly using text, you usually use the graphical editor for all of your BPEL process editing.
Oracle Mediator
Analogous to a load balancer routing HTTP traffic, the Oracle Mediator routes data from service providers to external partners. In addition, it can subscribe to and publish business events.
Using Oracle Mediator, you create routing services and rules for them. A routing service is the key component for moving a message across the enterprise service bus – from its entry point to its exit point. The rules determine how a message instance processed by the routing service gets to its next destination. Using the rules, Oracle Mediator can perform the following actions:
- Route: Determines the service component (BPEL process, business rule, human task, and mediator) to which to send the messages.
- Validate: Provides support for validating the incoming message payload by using a schematron or an XSD file.
- Filter: If specified in the rules, applies a filter expression that specifies the contents (payload) of a message be analyzed before any service is invoked.
- Transformation: If specified in the rules, transforms document data from one XML schema to another, thus enabling data interchange among applications using different schemas.
During runtime, Oracle Mediator evaluates routing rules, performs transformations, applies optional time delays, and either invokes another service or raises another business event. A routing service can handle returned responses, callbacks, faults, and time-outs. Oracle Mediator can also be used to implement a variety of integration patterns, such as service virtualization, service aggregation, publish and subscribe, fan-in, and fan-out.
About Oracle Service Bus with Oracle Mediator
Oracle Service Bus provides standalone service bus capabilities, enabling separation between application developers and target systems or services. The main users of the Oracle Service Bus are integration developers and operations personnel. Their mission is to shield application developers from changes in the endpoint services or systems and to prevent those systems from being overloaded with requests from upstream applications.
Whereas Oracle Service Bus provides service virtualization and protocol transformations for an Oracle SOA Suite application containing multiple composites, Oracle Mediator is an intra-composite mediation component that is deployed within an application.
Business Rules
Business Rules
Introducing Business Rules decision service
Your composite application does logical branching while processing the application flow and this branching falls into two distinct categories—implementation logic and business logic. Implementation logic is what the developer adds to implement the flow of the application. Business logic is what the business user adds and changes based on business data outside of the application.
The Oracle Business Rules component is most often used from BPEL processes but it can also be used outside of BPEL. It can be used by other service consumers as well as by plain old Java objects or in J2EE applications. With Oracle Business Rules, when business rules need to change, you change only the rule component, not any of the other services or components that call it. Your implementation logic stays the same.
Rules design
You can use JDeveloper to design your rules or you can create a web-based custom user interface to create or edit rules. A web-based rule composer will be provided in a post-R1 release. Using JDeveloper, open your composite and add a Rules component and then double-click on the component to open the Rules editor.
Based on what you specified for the input and output schemas, the rule facts and other data elements are created for use within the rules. The rules run on a Jess-based inference engine and can be simple or complex.
When you design your rule, you take your input fact and compare it against other values until you have your result. The result is assigned to the output fact and returned by the decision service. It is simple to create the rules using JDeveloper, which offers you variables and facts that are in context with your expression as you enter the expression. You can use a date or effective date range, aggregation and other formulas, and decision tables.
Decision tables are an efficient way to describe a rule when there are more than a few cases to your evaluation. You set up the table with each case in a column and for each, you specify the action. The decision table calculates where there are conflicting cases, where your ranges overlap, and also calculates
where you have a hole, where your cases miss a value or range in the input data. Decision tables help you design your evaluation with the confidence that you have done it correctly.
Oracle Metadata Repository
The Oracle Metadata Repository (MDS) stores business events, rulesets for use by Oracle Business Rules, XSLT files for Oracle Service Bus and Oracle Mediator, XSD XML schema files for Oracle BPEL Process Manager, WSDL files, and metadata files for Complex Event Processing.
To publish the MDS services to the outside world, use the Oracle Enterprise Repository provided with the Oracle SOA Governance Suite.
Oracle WSM Policy Manager
Oracle WSM Policy Manager provides the infrastructure for enforcing global security and auditing policies in the Service Infrastructure. By securing various endpoints and setting and propagating identity, it secures applications. Oracle WSM Policy Manager provides a standard mechanism for signing messages, performing encryption, performing authentication, and providing role-based access control. You also can change a policy without having to change the endpoints or clients for this endpoints, providing greater flexibility and security monitoring for your enterprise.
In addition, Oracle WSM Policy Manager collects monitoring statistics with information about the quality, uptime, and security threats and displays them in a Web dashboard. As a result, Oracle WSM Policy Manager provides better control and visibility over Web services.
SOA Composite Application Architecture
A SOA composite is an assembly of services, service components, and references designed and deployed together in a single application. Wiring between the service, service component, and reference enable message communication. The composite processes the information described in the messages.
The graphic provides an example of a composite that includes a mediator service component and a BPEL service component, an inbound service binding component, and an outbound reference binding component.
Service Components
Service components are the building blocks of a SOA composite application. Each service component is hosted in its own service engine container. Messages sent to the service engine are targeted at specific service components. For example, a message targeted for a BPEL process is sent to the BPEL service engine. Service engines process the message information received from the .
The following service components are available. There is a corresponding service engine of the same name for each service component. All service engines can interact together in a single composite.
<!--[if !supportLists]-->· <!--[endif]-->BPEL processes provide process orchestration and storage of synchronous or asynchronous process. You design a business process that integrates a series of business activities and services into an end-to-end process flow
<!--[if !supportLists]-->· <!--[endif]-->Business rules enable you to design a business decision based on rules.
<!--[if !supportLists]-->· <!--[endif]-->Human tasks provide workflow modeling that describes the tasks for users or groups to perform as part of an end-to-end business process flow.
<!--[if !supportLists]-->· <!--[endif]-->Mediators route events (messages) between different components.
Services
Services provide the outside world with an entry point to the SOA composite application. The WSDL file of the service advertises its capabilities to external applications. These capabilities are used for contacting the SOA composite application components. The binding connectivity of the service describes the protocols that can communicate with the service, for example, SOAP/HTTP or a JCA adapter.
References
References enable messages to be sent from the SOA composite application to external services in the outside world.
Wires
Wires enable you to graphically connect the following components in a single SOA composite application for message communication:
<!--[if !supportLists]-->· <!--[endif]-->Services to service components
<!--[if !supportLists]-->· <!--[endif]-->Service components to other service components
<!--[if !supportLists]-->· <!--[endif]-->Service components to reference
Oracle JDeveloper
Oracle JDeveloper is the development component of Oracle SOA Suite. It forms a comprehensive Integrated Service Environment (ISE) for creating and deploying composite applications and managing the composite.
Oracle JDeveloper enables developers to model, create, discover, assemble, orchestrate, test, deploy, and maintain composite applications based on services.
The SOA Composite Editor enables you to create, edit, and deploy services, and also to assemble them in a composite application, all from a single location. These components are integrated together into one application and communicate with the outside world through binding components such as Web services and JCA adapters.
The SOA Composite Editor enables you to use either of two approaches for designing SOA composite applications:
<!--[if !supportLists]-->· <!--[endif]-->The top-down approach of building a composite application puts interfaces first and implementation next. For example, you first add BPEL processes, human tasks, business rules, and Oracle Mediator routing services components to an application, and later define the specific content of these service components.
<!--[if !supportLists]-->· <!--[endif]-->The bottom-up approach takes existing implementations of service components and wraps them with Web service interfaces for assembly into a composite application. For example, you first create and define the specific content of BPEL processes, human tasks, business rules, and Oracle Mediator routing services components, and later create a SOA composite application to which you add these service components.
<!--[if !supportLists]-->· <!--[endif]-->
Oracle JDeveloper provides the following additional editors to design service components:
<!--[if !supportLists]-->· <!--[endif]-->Oracle BPEL Designer: You can create a BPEL process service component in the SOA composite application of Oracle JDeveloper and then design it by using the BPEL Designer, which is displayed, when you double-click a BPEL process in the SOA Composite Editor.
<!--[if !supportLists]-->· <!--[endif]-->Oracle Mediator Editor: You can create a mediator service component in the SOA composite application of Oracle JDeveloper, and then design it by using the Mediator Editor, which is displayed when you double-click a Mediator in SOA Composite Editor.
<!--[if !supportLists]-->· <!--[endif]-->Human Task Editor: You can create a human task service component in the SOA composite application of Oracle JDeveloper and then design it by using the Human Task Editor, which is displayed when you double-click a human task in the SOA Composite Editor.
<!--[if !supportLists]-->· <!--[endif]-->Business Rules Designer: You can create a business rules service component in the SOA composite application of Oracle JDeveloper and then design it by using the Business Rules Designer, which is displayed when you double-click a business rule in the SOA Composite Editor.
Oracle User Messaging Service
Oracle User Messaging Service provides a common service responsible for sending out messages from applications to devices. It also routes incoming messages from devices to applications.
You can easily send outgoing notifications from a BPEL process flow or invoke outgoing and incoming messages for tasks assigned to users from a human task.
Oracle Complex Event Processing
Oracle Complex Event Processing can perform complex correlations and pattern matching.
For a composite application to use Oracle CEP, an Oracle Mediator publishes business events to the Event Delivery Network (EDN). At runtime, the Oracle CEP Service Engine subscribes to these events. The Oracle CEP Service Engine executes a Continuous Query Language (Oracle CQL) query and searches for patterns in event streams. Oracle CQL is a query language based on SQL with added constructs that support streaming data. Using Oracle CQL, you can express queries on data streams to perform complex event processing. The Oracle CEP Service Engine listens on these streams, caches all the necessary individual, seemingly unrelated events and tries to correlate them into specific patterns. The data provided from complex event processing queries can then be used in Oracle BAM.
The potential applications of Oracle CEP are numerous, from electronic trading and risk management to intrusion detection and compliance monitoring.
Specifically, Oracle CEP provides the following functional areas:
<!--[if !supportLists]-->· <!--[endif]-->Data and Event Sources: An Oracle CEP event source identifies a producer of data that your Oracle CQL queries operate on. Event sources include data feeds such as wire services and stock tickers, sensors such as temperature, motion, or radio frequency identification (RFID) detectors, and other devices. Oracle CEP provides a variety of adapters that connect such real-world event sources to your Oracle CQL queries. Oracle CEP adapters support the following event sources: JMS, HTTP publisher/subscriber, and file.
<!--[if !supportLists]-->· <!--[endif]-->Context Creation: Oracle CEP offers a variety of sliding window operators and views (subqueries) that allow you to define the temporal or semantic context in which filtering, correlation and aggregation, and pattern matching takes place. Using windows and views, you can define contexts such as events in the last 5 minutes or events for a particular customer, and so on. Oracle CQL provides a variety of sliding windows, including: range-based (time or constant value), tuple-based, and partitioned. In addition, you can easily define custom window operators.
<!--[if !supportLists]-->· <!--[endif]-->Filtering: Using Oracle CQL, you can specify queries that select on any of the attributes of the events offered by event sources. You use such queries to filter the event sources to obtain events of interest. Oracle CQL provides a rich set of operators, expressions, conditions, and statements for this purpose.
<!--[if !supportLists]-->· <!--[endif]-->Correlation and Aggregation: Using Oracle CQL, you can perform advanced statistical and arithmetic operations on the attributes of the events offered by event sources. Oracle CQL provides: single-row functions that return a single result row for every row of a queried stream or view; aggregate functions that return a single aggregate result based on a group of tuples, rather than on a single tuple; statistical and advanced arithmetic operations based on the Colt open source libraries for high performance scientific and technical computing; and statistical and advanced arithmetic operations based on the java.lang.Math class. In addition, you can easily define custom single-row and aggregate functions.
<!--[if !supportLists]-->· <!--[endif]-->Pattern Matching: Using the Oracle CQL MATCH_RECOGNIZE condition, you can succinctly express complex pattern matching operations for a wide variety of tasks such as algorithmic trading, double-bottom detection, non-event detection, and so on. The following example detects if perishable food is exposed to temperatures of 25 C or higher for more than 5 minutes.
Human Workflow
Introducing the Human Task component
The Human Task component provides a set of functionality that handles different human interaction patterns within a broader business process. For example, you can assign tasks to users or groups; you can define approval rules such as group voting or management chain approvals; you can set up notification options such as an alert when a task is assigned to you. The Human Task component is available as a service and can be used in your BPEL process component when it needs to initiate a human workflow. It can also be used by other service consumers, as well as by plain old Java objects or in J2EE applications. The Human Task component architecture closely models the BPEL4People specification that is currently being defined. Oracle is a one of the core contributors to the BPEL4People specification.
Functional details
The Human Task component provides two core services:
1. A Human Workflow Service, which is responsible for all aspects of executing a workflow consisting of one or more human tasks.
2. A Worklist Application, which provides a web-based user interface for working with the tasks created as part of the human workflow.
Human Workflow Service
The Human Workflow Service is provided both as a WSDL-based service that can be used by any web service client, as well as a set of Java APIs that can be called from a plain Java or a J2EE application. The workflow service comprises of a number of services. Some of the important ones are listed as follows:
• Task Service provides task state management and persistence of tasks. In addition to these services, the task service exposes operations to update, complete, escalate, and reassign tasks.
• Task Query Service provides operations for querying tasks for a user based on a variety of search criteria such as keyword, category, status, business process, attribute, values, and so on.
• Task Metadata Service provides operations to retrieve metadata information related to a task.
• User Metadata Service provides operations to manage metadata such as user work queues, preferences, vacation, delegation rules, and so on.
• Identity Service provides authentication services and operations for looking up user properties, roles, group memberships, and privileges.
• Notification Service delivers notifications with the specified content to the workflow users using a variety of channels like Instant Messaging (IM), SMS, Email, Voice Mail, and so on. The Notification Service utilizes the User Messaging Service (UMS) in the SOA infrastructure.
Worklist application
The Worklist, an ADF-based web application, is used by users to access and act on tasks assigned to them. For instance, in our POProcessing example, we can introduce a new activity in the flow that requires a manager approval for an order greater than a certain value. When such an order is received and approval workflow is initiated, the manager will use the Worklist application to approve or reject this order.
The approval workflow can be a simple single-step approval or could have a number of steps. For example, you may want to escalate the approval to a vice president if the manager doesn't attend to the assigned task within a given time period. The Worklist application provides different functionality based on the user's profile, which means that the manager would have different functions available to him or her as compared to the vice president. Standard user profiles include task assignee, supervisor, process owner, and administrator. Some examples of the functions attached to different roles are:
• Update of payloads
• Attaching documents or comments
Routing tasks to other users
• Completing tasks by providing conclusions such as approvals or rejections
Supervisors or group administrators can also use this application to analyze the tasks assigned to a group and route them appropriately.
Users that have tasks assigned to them can use the application to:
• Perform authorized actions on tasks in the worklist, acquire and check out shared tasks, define personal to-do tasks, and define subtasks
• Filter tasks in a worklist view based on various criteria
• Define custom work queues
• Gain proxy access to part of another user's worklist
• Define custom vacation rules and delegation rules
• Enable group owners to define task dispatching rules for shared tasks
• Collect a complete workflow history and audit trail
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:
<!--[if !supportLists]-->· <!--[endif]-->Human interactions with processes, including assignment and routing of tasks to the correct users or groups.
<!--[if !supportLists]-->· <!--[endif]-->Deadlines, escalations, notifications, and other features required for ensuring the timely performance of a task (human task activity).
<!--[if !supportLists]-->· <!--[endif]-->Presentation of tasks to end users through a variety of mechanisms, including a worklist application (Oracle BPM Worklist).
<!--[if !supportLists]-->· <!--[endif]-->Organization, filtering, prioritization, and other features required for end users to productively perform their tasks.
<!--[if !supportLists]-->· <!--[endif]-->Reports, reassignments, load balancing, and other features required by supervisors and business owners to manage the performance of tasks.
The graphic shows an overview of human workflow:
<!--[if !supportLists]-->· <!--[endif]-->A BPEL process invokes a human task activity when it needs a human to perform a task. A human task activity creates a task in the human task service component.
<!--[if !supportLists]-->· <!--[endif]-->The human task service component uses workflow services to perform a variety of operations in the life cycle of a task, such as querying tasks for a user, retrieving metadata information related to a task, and so on.
<!--[if !supportLists]-->· <!--[endif]-->The human task service component presents tasks to users through a variety of channels, such as Oracle BPM Worklist, email, portals, or custom applications. Oracle BPM Worklist, a role-based application that supports the concept of supervisors and process owners, and provides functionality for finding, organizing, managing, and performing tasks.
Oracle Business Activity Monitoring
Oracle Business Activity Monitoring (Oracle BAM) is a complete solution for building real-time operational dashboards and monitoring and alerting applications over the Web. Using this technology, business user gain the ability to build interactive, real-time dashboards and proactive alerts to monitor their business services and processes. More specifically, Oracle BAM enables business operation workers and managers to:
<!--[if !supportLists]-->· <!--[endif]-->Monitor business processes and services in real-time
<!--[if !supportLists]-->· <!--[endif]-->Analyze events as they occur by correlating events, identifying trends as they emerge, and alerting users to bottlenecks, exceptions, and solutions to business problems
<!--[if !supportLists]-->· <!--[endif]-->Act on current conditions with event-driven alerts, real-time dashboards, BPEL processes, and Web services integration, enabling quick changes or corrective action to business processes
Spring Context
Spring is a popular application framework that enables developers to quickly and easily create high quality applications for deployment into high-end application servers. The spring framework provides a lightweight container that makes it easy to use different types of services. Lightweight containers can accept any JavaBean, instead of specific types of components.
Oracle SOA Suite provides a spring context service component that enables you to use Java interfaces instead of WSDL files in SOA composite applications. You can also integrate components that use Java interfaces with components that use WSDL files in the same SOA composite application. For example, you can have a spring context service component invoke an Oracle BPEL Process Manager service component or an Oracle Mediator service component invoke a spring context service component or Enterprise JavaBean.
No comments:
Post a Comment