Oracle BPEL Process Manager: Services Orchestration Student Guide Volume 1 D17514GC10 Production 1.0 June 2005 D19183
Authors Maria Palazzolo Glenn Stokol Technical Contributors and Reviewers Satish Abburi Lakshminarayanan Bhagat Krishnaprem Bhatia Avi Borthakur Krishna Cheemalamarri John Deeb Mark Kennedy Edwin Khodabakchian Yogeshwar Kuntawar Mahadevan Nainani Probal Nandy Prashant Nema Nagavalli Pataballa Ravi Rangaswamy Kireet Reddy Bharath Sampath David Shaffer Devesh Sharma Sanjeev Sondur Herb Stiel Raj Venkatesan Sunil Wadhwa Copyright 2005, Oracle. All rights reserved. This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your 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 may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS The U.S. Government s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract. Oracle, JD Edwards, PeopleSoft, and Retek are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Publisher Giri Venugopal
Contents Preface 1 Introduction Objectives 1-2 Course Objectives 1-3 Lessons 1 6 1-4 Lessons 7 12 1-5 Appendices 1-6 Course Environment 1-7 Course Business Process Scenario 1-8 Lesson 2 Practice: Installing Oracle BPEL Process Manager 1-9 Lesson 3 Practice: Creating a Simple BPEL Process 1-10 Lesson 4 Practice: Invoking Synchronous and Asynchronous Services 1-11 Lesson 5 Practice: Adding Parallel Flow and Conditional Branching 1-12 Lesson 6 Practice: Adding Exception Handling 1-13 Lesson 7 Practice: Adding Transformation Services to BPEL 1-14 Lesson 8 Practice: Using File Adapter to Read Input Data from a File 1-15 Lesson 9 Practice: Using Adapters to Write to Files and Databases 1-16 Lesson 10 Practice: Incorporating Human Workflow Service 1-17 Lesson 11 Practice: Adding Sensors 1-18 Lesson 11 Practice: Adding E-mail Notification 1-19 Summary 1-20 2 Understanding Basic Concepts and Architecture Objectives 2-2 Services and Composite Applications 2-3 Service-Oriented Architecture 2-4 Life Cycle of Service-Oriented Architecture Applications 2-5 Service-Oriented Architecture: Components 2-6 Introducing Web Services 2-7 Web Service Architecture and Standards 2-8 SOAP Message Structure 2-10 A SOAP Example 2-11 Service Invocation 2-12 Orchestrating Services Through BPEL 2-13 What Is BPEL? 2-14 Benefits of BPEL 2-15 Standards: Building Blocks of BPEL 2-16 Oracle BPEL Process Manager Architecture 2-17 Oracle BPEL Process Manager: Key Features 2-19 BPEL Process Manager Server 2-20 Core Engine Architecture 2-21 Performance and Scalability 2-23 Service Adapters 2-24 iii
Integrated Adapters 2-25 Oracle Application Server Adapters 2-26 Data Transformation Services 2-27 Oracle BPEL Process Manager: Methodology 2-28 Oracle Integration 2-29 Oracle Integration InterConnect 2-30 Oracle Integration B2B 2-31 Oracle Integration BAM 2-32 Installing Oracle BPEL Software 2-33 Oracle BPEL Process Manager: Components 2-34 Creating Connections 2-35 Creating the BPEL PM Server Connection 2-36 Creating the Database Connection 2-37 Summary 2-39 Practice for Lesson 2 2-40 3 Building a Simple BPEL Process Objectives 3-2 The BPEL Standard 3-3 JDeveloper BPEL Designer 3-5 The HelloWorld Process 3-6 Creating the HelloWorld Process 3-7 Creating a New Workspace 3-8 Creating a New Project 3-9 Initial State of the BPEL Process 3-10 Anatomy of a BPEL Project 3-11 Adding an Assign Activity to the Process 3-12 Creating a Copy Rule 3-13 Using the XPath Expression Builder 3-14 BPEL Process Source Structure 3-15 BPEL Activities in HelloWorld 3-16 The HelloWorld BPEL Source 3-17 BPEL Depends on WSDL and WSDL Extensions 3-19 The HelloWorld Design-Time WSDL Source 3-20 Validating and Deploying a BPEL Process 3-22 Deployment with JDeveloper 3-23 The BPEL Suitcase 3-24 Testing the Process 3-26 Auditing and Debugging the Instance 3-27 BPEL Activities 3-28 Summary 3-29 Practice 3: Creating the HelloWorld Process 3-30 iv
4 Orchestrating Services with BPEL Objectives 4-2 Orchestrating Services Through BPEL 4-3 Developing a BPEL Service 4-4 Initial Structure of a Synchronous Service 4-5 Initial Structure of an Asynchronous Service 4-6 Initial Structure of an Empty Service 4-7 Synchronous Services 4-8 Partner Links and Service Invocation 4-9 Partner Links 4-10 Invoking a Synchronous Service 4-11 Creating the OrderBooking BPEL Process 4-12 Importing a User-Defined XML Schema 4-13 Setting the BPEL Process Message Types 4-14 Including a Partner Link 4-15 Configuring the Partner Link Activity 4-16 BPEL Variables 4-17 Creating the Input Variable 4-18 Creating the Output Variable 4-19 Synchronous Flow: Invoking the Credit Rating Service 4-20 Assigning Input Data 4-21 Configuring Assign Activity Copy Rules 4-22 Assigning the Output 4-23 Viewing the BPEL Process 4-24 Deploying and Running the Process 4-25 Reviewing the Source Code 4-26 Invoking an Asynchronous Service 4-29 WS-Addressing and Correlation 4-30 Implementing Correlation Sets 4-31 Understanding the BPEL Asynchronous Service 4-32 Including a Partner Link for Rapid Distributors 4-33 Invoking the Rapid Distributors Service 4-34 Configuring a Receive Activity 4-35 Configuring the Variable Assignment 4-36 Viewing the Asynchronous Process Activities 4-37 Deploying and Running the Process 4-38 Summary 4-39 Practice 4: Invoking Synchronous and Asynchronous Services 4-40 5 Enhancing the BPEL Process with Parallel Processing and Conditional Branching Objectives 5-2 Processing with Parallel Flows 5-3 Parallel Flow: Example 5-4 v
Adding a Parallel Flow to the Process 5-5 Configuring a Flow Branch 5-6 Configuring a Second Flow Branch 5-7 Including a Partner Link for Select Manufacturing 5-8 Invoking Select Manufacturing in the Second Branch 5-9 Adding and Configuring the Receive Activity in the Second Branch 5-10 Adding and Configuring the Assign Activities in the Second Branch 5-11 Deploying and Running the Process 5-12 Conditional Branching with Switch 5-13 Adding Conditional Branching Logic 5-14 Including the Switch Activity 5-15 Including the Assign for Rapid Distributors 5-16 Including the Assign Activity for Select Manufacturing 5-17 Deploying and Running the Process 5-18 Summary 5-19 Practice 5.1: Parallel Processing 5-20 Practice 5.2: Conditional Branching 5-21 6 Increasing Process Reliability Through Fault Handling and Exception Management Objectives 6-2 Defining a Scope Structure 6-3 Adding a Scope Structured Activity 6-4 Catch and CatchAll 6-5 Managing Faults 6-6 Adding a CatchAll Exception Branch 6-7 Setting a Value for the Credit Rating 6-8 Adding Comments to the Order 6-9 The CatchAll in the OrderBooking Process 6-10 Deploying and Running the Process 6-11 Understanding BPEL Concepts: Pick and onalarm 6-12 Pick with an <onmessage> and <onalarm> 6-13 Understanding Compensating Transactions 6-14 Compensating Transactions 6-15 Understanding the BPEL compensationhandler 6-16 Adding a Compensation Handler 6-18 Summary 6-19 Practice 6: Adding a Branch for Exception Handling 6-20 7 Adding Transformation Services to BPEL Objectives 7-2 Oracle BPEL Process Manager Transformation Services 7-3 Adding Transformation Services 7-4 Importing the Schema for the Input (Purchase Order) 7-5 Importing the Schema for the Output (Purchase Order Acknowledgement) 7-6 vi
Configuring the Transform Activity 7-7 Using the XSLT Mapper 7-8 XSLT Mapper: Key Features 7-9 XSLT Mapper: Extensive Function Set 7-10 Creating the Mappings 7-11 XSLT Mapper: Array Handling 7-13 XSLT Mapper: Conditional Mapping 7-14 XSLT Mapper: Automap 7-15 Map Testing Tool 7-16 Testing the Transformation 7-17 Dictionary and Report Generation 7-18 Summary 7-19 Practice 7: Adding Transformation Services to BPEL 7-20 8 Invoking a BPEL Service Through Adapters Objectives 8-2 Adapter Services 8-3 Adapter Framework 8-4 Benefits of Adapters 8-5 OracleAS Adapter: Key Features 8-6 OracleAS Adapters 8-7 OracleAS Adapter Services for Outbound Two-Way Synchronous Communication 8-8 OracleAS Adapter Services for Outbound One-Way Asynchronous Communication 8-9 OracleAS Adapter Services for Inbound One-Way Asynchronous Communication 8-10 Oracle AS Adapter Integration with Oracle BPEL Process Manager 8-11 OracleAS Adapter and Oracle BPEL Process Manager Integration 8-12 Adapter and Oracle BPEL Process Manager Outbound Architecture 8-13 Adapter and Oracle BPEL Process Manager Inbound Architecture 8-14 Design Time of Technology Adapters for Oracle BPEL Process Manager Integration 8-15 Technology Adapters Integrated in JDeveloper 8-16 File and FTP Adapter 8-17 Database Adapter 8-18 Database Adapter Implemented with TopLink 8-19 Oracle Applications Adapter 8-20 Advanced Queuing (AQ) Adapter 8-21 JMS Adapter 8-22 OEM Adapters 8-23 Design Time of OEM Adapters for Oracle BPEL Process Manager Integration 8-24 Oracle Application Explorer 8-25 Using the File Adapter: Example 8-26 Selecting an Adapter Service 8-27 Configuring the File Adapter 8-28 Creating the Partner Link for Calling the OrderBooking Process 8-30 vii
Configuring the Receive Activity for the File Adapter 8-31 Invoking the OrderBooking Process 8-32 Configuring the Assign Activity for Input and Output 8-33 Deploying and Running the Process 8-34 Summary 8-35 Practice 8: Using a File Adapter to Read the Input Data From a File 8-36 9 Accessing Adapter-Enabled Services from BPEL Objectives 9-2 Invoking the File Adapter as a Service from BPEL 9-3 Creating a Partner Link for the File Adapter 9-4 Designing the Write File Activities 9-7 Viewing the Write File Activities 9-8 Deploying and Running the Process 9-9 Extending OrderBooking to Invoke POAcknowledge 9-12 Creating the Partner Link 9-13 Invoking the File Write Service 9-14 Assigning the Input 9-15 Assigning the Output 9-16 Deploying and Running the Process 9-17 Invoking a Database Adapter as a Service from BPEL 9-18 Creating the FulfillOrder BPEL Process by Using the Database Adapter Service 9-19 Creating a Partner Link for Writing to the Database 9-20 Invoking the Database Write Service 9-24 Designing the Database Record Transformation 9-25 Deploying and Running the Process 9-28 Invoking the FulfillOrder Service from OrderBooking 9-30 Creating the Partner Link to Call FulfillOrder 9-31 Invoking and Receiving the Input from FulfillOrder 9-32 Configuring the Assign for Input 9-33 Configuring the Assigns for Output 9-34 Modifying the FulfillOrder Process for Exception Processing 9-35 Adding Database Exception Handling 9-36 Setting the Status to False 9-37 Adding a While Activity 9-38 Adding an Exception Branch for the Scope Activity 9-39 Adding a Wait Activity 9-40 Deploying and Running the Processes 9-41 Undeploying Processes 9-43 Summary 9-44 Practice 9.1: Invoke the File Adapter as a Service from BPEL to Write a File 9-45 Practice 9.2: Extend OrderBooking to Invoke POAcknowledge 9-46 viii
Practice 9.3: Invoke a Database Adapter as a Service from BPEL 9-47 Practice 9.4: Invoke the FulfillOrder Service from OrderBooking 9-48 10 Extending a BPEL Process with Human Workflow Services Objectives 10-2 Workflow Services in Oracle BPEL Process Manager 10-3 Human Workflow Requirements 10-4 Workflow as a Service 10-5 Workflow Services 10-6 End-to-End Scenario 10-7 Workflow Services: Task Management Service 10-8 Workflow Services: Task Routing Service 10-9 Workflow Services: Task Action Service 10-11 Workflow Services: Identity Service 10-12 Workflow Services: Worklist Service 10-13 Workflow Services: Notification Service 10-14 Modeling Workflow in JDeveloper BPEL Designer 10-15 Defining the Users 10-16 Modeling Workflows in JDeveloper BPEL Designer 10-17 Including a User Task 10-18 Setting the Workflow Pattern and Specifying the Task Details 10-19 Specifying the Outcome, Notifications, and Assignment Policy 10-20 Assigning the Task 10-21 Specifying Management Chain Levels and Task Routing Conclusions 10-22 Viewing the Results 10-23 Creating the Assign Activities for Accept, Reject, and Other 10-24 Assigning the Output 10-25 Viewing the Human Workflow Activities 10-26 Deploying and Running the Process 10-27 Extending the OrderBooking Process to Call the OrderApproval Process 10-29 Deploying and Running the Process 10-30 Summary 10-31 Practice 10.1: Create the OrderApproval Process 10-32 Practice 10.2: Add User Tasks for Manual Approval or Rejection of Purchase Orders 10-33 11 Administering Processes Using Monitoring and Sensor Technology Objectives 11-2 BPEL Monitoring and Administration 11-3 Describing the Consoles 11-4 Exploring the BPEL Console 11-5 Managing the BPEL Domain 11-6 Oracle BPEL Process Manager Administration Interface 11-7 Interfacing with BAM 11-8 ix
Understanding Sensors 11-9 Creating Sensors 11-10 Setting Sensors 11-11 Sensors in the OrderBooking Process 11-12 Deploying and Running the Processes 11-13 Viewing Sensor Data 11-14 Notification Services 11-15 Adding a Notification to a Process 11-16 Specifying the E-Mail Parameters 11-17 E-Mail Configuration File 11-18 Installing the XMail E-Mail Server 11-19 Configuring the E-Mail Client 11-20 Specifying the Voice Parameters 11-21 Specifying the SMS Parameters 11-22 The Wireless Configuration File 11-23 Summary 11-24 Practice 11.1: Add Sensors to the OrderBooking Process 11-25 Practice 11.2: Add E-Mail Notification to the OrderBooking Process 11-26 12 Reviewing Advanced Features and Interfaces for Oracle BPEL Process Manager Objectives 12-2 Understanding the Java Business Delegate 12-3 Invoking a BPEL Process from Java 12-4 Invoking One-Way and Two-Way Operations from Java 12-5 Invoking a BPEL Process from JSP 12-6 Invoking a BPEL Process with the JSP Tag Library 12-7 Executing Java Code in a BPEL Process 12-8 Web Services Invocation Framework 12-9 Java Code with WSIF Bindings 12-10 WSIF EJB Binding: Example 12-11 WSIF Java Calls 12-12 Embedding Java Code in BPEL 12-13 Java Embedding with <bpelx:exec> 12-14 A <bpelx:exec> Code Example 12-15 BPEL Deployment Descriptor Properties 12-16 Defining Preference Properties 12-17 Defining Deployment Descriptor Properties in JDeveloper 12-18 Obtaining a Preference Property Value 12-19 Updating a Preference Value at Run Time 12-20 The demos Directory 12-21 The interop Directory 12-22 The references Directory 12-23 The tutorials Directory 12-24 x
The utils Directory 12-25 Summary 12-26 Appendix A: Solutions to Practices Appendix B: Glossary Appendix C: Scripts Appendix D: Introduction to XML Extensible Markup Language D-2 A Simple XML Page: Example D-3 XML Document Structure D-4 The XML Declaration D-5 Components of an XML Document D-6 XML Elements D-7 Markup Rules for Elements D-8 XML Attributes D-9 Using Elements Versus Attributes D-10 XML Entities D-11 XML Comments D-12 A Well-Formed XML Document D-13 Comparing XML and HTML D-14 XML Development D-15 Editing XML in Oracle JDeveloper 10g D-16 What Is a Document Type Definition? D-17 Why Validate an XML Document D-18 General DTD Rules D-19 The Contents of a DTD D-20 Simple DTD Declaration: Example D-21 Referencing the DTD D-22 Element Declarations D-23 Attribute Declarations D-25 CDATA and Enumerated Attribute Types D-26 NOTATION Declaration and Attribute Type D-27 What Is an XML Namespace? D-28 Declaring XML Namespaces D-29 XML Namespace Prefixes D-30 Index xi