+ All Categories
Home > Documents > TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging...

TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging...

Date post: 19-Jul-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
87
TIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.2 April 2016 Two-Second Advantage ®
Transcript
Page 1: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Two-Second Adv

TIBCO ActiveMatrix® Adapter for Database

ExamplesSoftware Release 7.2April 2016

antage®

Page 2: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Important Information

SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE.USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSE FILE) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME.This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc.TIBCO, Two-Second Advantage, TIBCO ActiveMatrix Adapter for Database, TIBCO ActiveMatrix BusinessWorks, TIBCO Adapter SDK, TIBCO Administrator, TIBCO Business Studio, TIBCO Database Drivers Supplement, TIBCO Designer, TIBCO Enterprise Message Service, TIBCO Hawk, TIBCO ActiveSpaces, TIBCO Rendezvous, and TIBCO Runtime Agent are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries.Enterprise Java Beans (EJB), Java Platform Enterprise Edition (Java EE), Java 2 Platform Enterprise Edition (J2EE), and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle Corporation in the U.S. and other countries.All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only.THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM.THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME.THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES.Copyright © 1999-2016 TIBCO Software Inc. All rights reserved.TIBCO Software Inc. Confidential Information

Page 3: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

| iii

Contents

Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .v

Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .vii

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xTIBCO ActiveMatrix Adapter for Database Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xOther TIBCO Product Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x

Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii

Connecting with TIBCO Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvHow to Join TIBCO Community . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvHow to Access TIBCO Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvHow to Contact TIBCO Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv

Chapter 1 Examples Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1

Examples Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Location of Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Using TIBCO ActiveMatrix BusinessWorks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Working with DAT Files in TIBCO Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Chapter 2 Parent-Child Exercise. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7

Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Adapter Role. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Required Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Execution Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Working Through the Example with TIBCO Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Example Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Example Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Example Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Working Through the Example with Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Example Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Example Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41Example Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

TIBCO ActiveMatrix Adapter for Database Examples

Page 4: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

iv | Contents

Chapter 3 Request-Response Service Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44Required Platforms and Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

Example Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

Example Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52RPC Standard Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52RPC Custom Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Request-Reply Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

Example Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

Chapter 4 TIBCO ActiveMatrix BusinessWorks: Processing a Sales Order . . . . . . . . . . . . . . . 61

Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

Example Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

Example Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

Expected Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Example Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

TIBCO ActiveMatrix Adapter for Database Examples

Page 5: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Figures | v

Figures

Figure 1 Converting a DAT File in TIBCO Designer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Figure 2 Parent-Child Exercise: Publisher Side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Figure 3 Parent-Child Exercise, Subscriber Side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Figure 4 Saving the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Figure 5 Creating a Publication Adapter Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Figure 6 Configuration in the Design-time Connection Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Figure 7 Configuration in the Runtime Connection Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Figure 8 Configuration in the General Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Figure 9 Configuration in the Publisher Options Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Figure 10 Joining the CUSTOMER Table and the ORDER_DETAILS Table . . . . . . . . . . . . . . . . . . . . . . . . . 20

Figure 11 Joining the ORDER_DETAILS Table and the INTERNAL_ORDER_DETAILS Table . . . . . . . . . . . 21

Figure 12 Joining the ORDER_DETAILS Table and the EXTERNAL_ORDER_ITEMS Table . . . . . . . . . . . . 22

Figure 13 Creating a Subscription Adapter Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Figure 14 Joining the SUB_CUSTOMER Table and the SUB_ORDER_DETAILS Table . . . . . . . . . . . . . . . . 26

Figure 15 Joining the SUB_ORDER_DETAILS Table and the SUB_INTERNAL_ORDER_ITEMS Table . . . 26

Figure 16 Joining the SUB_ORDER_DETAILS Table and the SUB_EXTERNAL_ORDER_ITEMS Table . . . 27

Figure 17 Adding Child Table Mappings Between the Publisher and Subscriber Tables . . . . . . . . . . . . . . . . 29

Figure 18 Starting Subscription Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Figure 19 Starting Publication Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

Figure 20 Starting Subscription Service Using the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Figure 21 Starting Publication Service Using the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Figure 22 Importing the Request-Response Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

Figure 23 Process [5] Execute SQL Stmt with Bind Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

Figure 24 Starting the Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

Figure 25 Information That Will be Inserted to the OPERATION_ORDER Table . . . . . . . . . . . . . . . . . . . . . . 52

Figure 26 Select Processes to Load Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Figure 27 RV_[1]INSERT INTO OPERATION_ORDER Process Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

Figure 28 Information That Will be Input to the OPERATION_ORDER Table . . . . . . . . . . . . . . . . . . . . . . . . . 55

TIBCO ActiveMatrix Adapter for Database Examples

Page 6: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

vi | Figures

Figure 29 RV_[6]Execute Procedure SetDescription_input Process Result . . . . . . . . . . . . . . . . . . . . . . . . . . 56

Figure 30 Configuring the Request AE Schema and the Reply AE Schema. . . . . . . . . . . . . . . . . . . . . . . . . . 57

Figure 31 Information That Will be Sent to the Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

Figure 32 RV_[10]Request_Reply SELECT FROM OPERATION_ORDER Process Result . . . . . . . . . . . . . 59

Figure 33 Setting BreakPoints for Rv Sales Order Demo Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

Figure 34 Testing the Sales Order Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

TIBCO ActiveMatrix Adapter for Database Examples

Page 7: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Tables | vii

Tables

Table 1 TIBCO Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x

Table 2 General Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii

Table 3 Syntax Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

Table 4 Values to Use for TIBCO Rendezvous and JMS Transport Types . . . . . . . . . . . . . . . . . . . . . . . . 45

Table 5 Selections Available in the Sample Request Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

TIBCO ActiveMatrix Adapter for Database Examples

Page 8: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

viii | Tables

TIBCO ActiveMatrix Adapter for Database Examples

Page 9: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

| ix

Preface

TIBCO ActiveMatrix® Adapter for Database is a bidirectional gateway between databases and applications configured for the TIBCO environment. The software supports both publish-subscribe and request-response interactions. This manual provides a hands-on introduction to the software.

Topics

• Related Documentation, page x

• Typographical Conventions, page xii

• Connecting with TIBCO Resources, page xv

TIBCO ActiveMatrix Adapter for Database Examples

Page 10: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

x | Related Documentation

Related Documentation

This section lists documentation resources you might find useful.

TIBCO ActiveMatrix Adapter for Database DocumentationThe following documents form the TIBCO ActiveMatrix Adapter for Database documentation set:

• TIBCO ActiveMatrix Adapter for Database Concepts Read this manual for terminology and concepts of the product. The other manuals in the documentation set assume you are familiar with the information in this manual.

• TIBCO ActiveMatrix Adapter for Database Installation Read this manual for instructions on site preparation and installation.

• TIBCO ActiveMatrix Adapter for Database Configuration and Deployment Read this manual for instructions on how to create, configure, and deploy adapter projects.

• TIBCO ActiveMatrix Adapter for Database Examples Read this manual to work through the examples provided with the adapter.

• TIBCO ActiveMatrix Adapter for Database Release Notes Read the release notes for a list of new and changed features. This document also contains lists of known issues and closed issues for this release.

Other TIBCO Product DocumentationYou might find it useful to read the documentation for the following TIBCO products:

Table 1 TIBCO Products (Sheet 1 of 2)

TIBCO Product Description

TIBCO ActiveMatrix BusinessWorks™ This product provides an integration platform for companies to rapidly integrate systems and automate business processes.

TIBCO® Adapter SDK This product provides a class library for developers to implement an adapter with minimal effort.

TIBCO ActiveMatrix Adapter for Database Examples

Page 11: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Preface | xi

TIBCO Administrator™ This product is designed to manage users, monitor machines, and deploy applications that use TIBCO products.

TIBCO Business Studio™ This product is designed for business analysts who need to document business processes, solution engineers who implement business processes, and SOA developers who create composite applications.

TIBCO® Database Drivers Supplement This product provides the licensed DataDirect database JDBC drivers that can be used with TIBCO ActiveMatrix Adapter for Database.

TIBCO Designer™ This product provides a graphical user interface to create TIBCO ActiveMatrix BusinessWorks process definitions, or create or modify TIBCO Adapter configurations.

TIBCO Enterprise Message Service™ This product sends messages from your applications in a format that conforms to the Java Messaging Service (JMS) specification.

TIBCO Hawk® This product is designed to monitor and manage distributed applications and systems throughout the enterprise.

TIBCO Rendezvous® This product uses messages to enable distributed application programs to communicate across a wide variety of hardware platforms and programming languages.

TIBCO Runtime Agent™ This product is a bundle of TIBCO software and third-party software that is required to run many TIBCO applications such as TIBCO ActiveMatrix BusinessWorks and TIBCO Adapters.

TIBCO ActiveSpaces® This product is a peer-to-peer distributed in-memory data grid. TIBCO ActiveSpaces is a form of virtual shared memory that is replicated on distributed devices and applications.

Note: Support for the connection of TIBCO ActiveMatrix Adapter for Database to TIBCO ActiveSpaces is deprecated in this release.

Table 1 TIBCO Products (Sheet 2 of 2)

TIBCO Product Description

TIBCO ActiveMatrix Adapter for Database Examples

Page 12: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

xii | Typographical Conventions

Typographical Conventions

The following typographical conventions are used in this manual.

Table 2 General Typographical Conventions

Convention Use

ENV_NAME

TIBCO_HOME

TIBCO products are installed into an installation environment. A product installed into an installation environment does not access components in other installation environments. Incompatible products and multiple instances of the same product must be installed into different installation environments.

An installation environment consists of the following properties:

• Name Identifies the installation environment. This name is referenced in documentation as ENV_NAME. The default value is TIBCO_HOME.

• Directory The folder into which the product is installed. This folder is referenced in documentation as TIBCO_HOME.

TIB_ADADB_HOME TIBCO Active Matrix Adapter for Database installs into a directory within a TIBCO_HOME. This directory is referenced in documentation as TIB_ADADB_HOME. The default value of TIB_ADADB_HOME depends on the operating system. For example on Windows systems, the default value is C:\tibco\adapter\adadb\ReleaseNumber.

code font Code font identifies commands, code examples, filenames, pathnames, and output displayed in a command window. For example:

Use MyCommand to start the foo process.

bold code font Bold code font is used in the following ways:

• In procedures, to indicate what a user types. For example: Type admin.

• In large code samples, to indicate the parts of the sample that are of particular interest.

• In command syntax, to indicate the default parameter for a command. For example, if no parameter is specified, MyCommand is enabled: MyCommand [enable | disable]

TIBCO ActiveMatrix Adapter for Database Examples

Page 13: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Preface | xiii

italic font Italic font is used in the following ways:

• To indicate a document title. For example: See TIBCO ActiveMatrix BusinessWorks Concepts.

• To introduce new terms. For example: A portal page may contain several portlets. Portlets are mini-applications that run in a portal.

• To indicate a variable in a command or code syntax that you must replace. For example: MyCommand PathName

Key combinations Key name separated by a plus sign indicate keys pressed simultaneously. For example: Ctrl+C.

Key names separated by a comma and space indicate keys pressed one after the other. For example: Esc, Ctrl+Q.

The note icon indicates information that is of special interest or importance, for example, an additional action required only in certain circumstances.

The tip icon indicates an idea that could be useful, for example, a way to apply the information provided in the current section to achieve a specific result.

The warning icon indicates the potential for a damaging situation, for example, data loss or corruption if certain steps are taken or not taken.

Table 3 Syntax Typographical Conventions

Convention Use

[ ] An optional item in a command or code syntax.

For example: MyCommand [optional_parameter] required_parameter

| A logical OR that separates multiple items of which only one may be chosen.

For example, you can select only one of the following parameters: MyCommand param1 | param2 | param3

Table 2 General Typographical Conventions (Cont’d)

Convention Use

TIBCO ActiveMatrix Adapter for Database Examples

Page 14: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

xiv | Typographical Conventions

{ } A logical group of items in a command. Other syntax notations may appear within each logical group.

For example, the following command requires two parameters, which can be either the pair param1 and param2, or the pair param3 and param4.MyCommand {param1 param2} | {param3 param4}

In the next example, the command requires two parameters. The first parameter can be either param1 or param2 and the second can be either param3 or param4:MyCommand {param1 | param2} {param3 | param4}

In the next example, the command can accept either two or three parameters. The first parameter must be param1. You can optionally include param2 as the second parameter. And the last parameter is either param3 or param4.MyCommand param1 [param2] {param3 | param4}

Table 3 Syntax Typographical Conventions (Cont’d)

Convention Use

TIBCO ActiveMatrix Adapter for Database Examples

Page 15: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Preface | xv

Connecting with TIBCO Resources

How to Join TIBCO CommunityTIBCO Community is an online destination for TIBCO customers, partners, and resident experts. It is a place to share and access the collective experience of the TIBCO community. TIBCO Community offers forums, blogs, and access to a variety of resources. To register, go to https://community.tibco.com.

How to Access TIBCO DocumentationDocumentation for this and other TIBCO products is available on the TIBCO Documentation site:

https://docs.tibco.com

Documentation on the TIBCO Documentation site is updated more frequently than any documentation that might be included with the product. To ensure that you are accessing the latest available help topics, please visit us at https://docs.tibco.com.

How to Contact TIBCO SupportFor comments or problems with this manual or the software it addresses, contact TIBCO Support as follows.

• For an overview of TIBCO Support, and information about getting started with TIBCO Support, visit this site:

http://www.tibco.com/services/support

• If you already have a valid maintenance or support contract, visit this site:

https://support.tibco.com

Entry to this site requires a user name and password. If you do not have a user name, you can request one.

TIBCO ActiveMatrix Adapter for Database Examples

Page 16: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

xvi | Connecting with TIBCO Resources

TIBCO ActiveMatrix Adapter for Database Examples

Page 17: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

| 1

Chapter 1 Examples Introduction

This chapter provides an overview of the examples that come with TIBCO ActiveMatrix Adapter for Database and lists the prerequisites for running these examples.

Topics

• Examples Overview, page 2

• Working with DAT Files in TIBCO Designer, page 4

TIBCO ActiveMatrix Adapter for Database Examples

Page 18: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

2 | Chapter 1 Examples Introduction

Examples Overview

Before performing any of these exercises, ensure that TIBCO ActiveMatrix Adapter for Database is installed according to the procedures in TIBCO ActiveMatrix Adapter for Database Installation. These procedures include creating a database account for the adapter and setting the JDBC data source, among other things.

You must be familiar with using TIBCO Designer to open and close projects and drag resources, see TIBCO Designer User’s Guide for more information. TIBCO Designer User’s Guide also describes the multiple file format used by TIBCO Designer, and converting to and from the DAT file format used by the runtime adapter. TIBCO Designer User’s Guide is available from TIBCO Designer by clicking the Help > Designer Help menu choice.

Location of ExamplesThe TIB_ADADB_HOME\demo directory consists of two example folders: bw5 and bw6. The bw5 folder contains all examples running in TIBCO Designer; the bw6 folder contains all examples running in TIBCO Business Studio.

Using TIBCO ActiveMatrix BusinessWorksIf you are using the adapter with TIBCO ActiveMatrix BusinessWorks, the following software must be installed to run the examples. See the readme file for the supported versions of the following software.

• TIBCO Rendezvous

• TIBCO Runtime Agent

• TIBCO ActiveMatrix BusinessWorks

• TIBCO ActiveMatrix Adapter for Database

• Supported database. (See TIBCO ActiveMatrix Adapter for Database Installation.)

• TIBCO Enterprise Message Service 4.x, 5.x, or 6.x (if you are using the JMS transport)

TIBCO ActiveMatrix Adapter for Database Examples describes how to perform examples in the bw5 folder. For instructions on how to perform examples in the bw6 folder, see TIBCO ActiveMatrix Adapter for Database (TIBCO Business Studio) Examples.

TIBCO ActiveMatrix Adapter for Database Examples

Page 19: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Examples Overview | 3

The TIBCO Enterprise Message Service server must be running and accessible to the machine on which the adapter is installed.

TIBCO ActiveMatrix Adapter for Database Examples

Page 20: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

4 | Chapter 1 Examples Introduction

Working with DAT Files in TIBCO Designer

You cannot directly open a DAT file in TIBCO Designer and modify the configurations. To modify the configurations in a DAT file, perform the following steps:

1. Convert a DAT file to a multi-file project.

a. Open TIBCO Designer, the TIBCO Designer dialog is displayed. Click the Administration tab.

Figure 1 Converting a DAT File in TIBCO Designer

b. Click Convert DAT To Files, and the Convert DAT To File-Based Project dialog is displayed. Click Browse next to the DAT File field to select a DAT file you want to convert to a multi-file project.

Click Browse next to the Project Directory field to select a project directory to process this operation.

Click OK.

2. Click the Project tab and then click Open existing project.

Click Browse and select the directory where the converted multi-file project is saved, and then click OK.

3. Click Project > Export Full Project from the menu to export the multi-file project to a DAT file.

TIBCO ActiveMatrix Adapter for Database Examples

Page 21: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working with DAT Files in TIBCO Designer | 5

4. Click Browse next to the Dir Name field, and select the location where you want to save the DAT file. Ensure that the directory is different from the multi-file project directory. Enter the name of the project and click OK.

TIBCO ActiveMatrix Adapter for Database Examples

Page 22: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

6 | Chapter 1 Examples Introduction

TIBCO ActiveMatrix Adapter for Database Examples

Page 23: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

| 7

Chapter 2 Parent-Child Exercise

This chapter explains how to configure an adapter instance to publish and subscribe to data that is stored in related parent and child tables.

Topics

• Example Description, page 8

• Working Through the Example with TIBCO Designer, page 12

• Working Through the Example with Command Line, page 35

TIBCO ActiveMatrix Adapter for Database Examples

Page 24: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

8 | Chapter 2 Parent-Child Exercise

Example Description

This exercise shows how to configure an adapter instance so that a subscriber can receive the data stored in parent and child tables when a publisher sends and inserts a message. On both the publisher and subscriber adapters, a top-level relationship is set between a parent and its child tables. The child table also has a relationship set between itself and its child tables. In addition, the publication child table names must be mapped to the subscription child table names because the names are different.

If a one-to-many relationship is used, the adapter sends one parent row and all the corresponding child rows as one single message. The adapter always sends all related child rows, no matter how deep the nesting is.

Figure 2 shows the publisher-side tables used in the example. The CUSTOMER table contains information, such as the customer ID, name, address, and phone number. Information about the order ID, ship date, order date, and total cost is stored in the ORDER_DETAILS table. The INTERNAL_ORDER_ITEMS table lists items the customer has ordered that can be supplied internally. The EXTERNAL_ORDER_ITEMS table lists items the customer has ordered that can be supplied through a third-party vendor.

TIBCO ActiveMatrix Adapter for Database Examples

Page 25: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Description | 9

Figure 2 Parent-Child Exercise: Publisher Side

When using TIBCO Designer to configure an adapter, you must identify the position of a source table in the parent-child hierarchy. Figure 2 shows the difference between top-level and secondary-level relationships:

• A top-level relationship describes the relationship set between the source or destination database table and its child table.

• A secondary-level relationship describes the relationship set between a child table and another child table.

The CUSTOMER table has a top-level relationship defined between itself and the ORDER_DETAILS table. The ORDER_DETAILS table has a secondary-level relationship set between itself and each of its child tables.

TIBCO Messaging

(Publisher Adapter)

demo2pub

CUSTOMER

CUSTIDNAMEADDRESSPHONE_NO

ORDER_DETAILS

ORDERIDCUSTIDSHIP_DATEORDER_DATETOTAL_COST

EXTERNAL_ORDER_ITEMS

ORDERIDITEMIDQTY_ORDEREDVENDORID

INTERNAL_ORDER_ITEMS

ORDERIDITEMIDQTY_ORDERED

P_CUSTOMER

CUSTIDNAMEADDRESSPHONE_NOADB_SUBJECTADB_SEQUENCEADB_SET_SEQUENCEADB_TIMESTAMPADB_OPCODEADB_UPDATE_ALLADB_REF_OBJECTADB_L_DELIVERY_STATUSADB_L_CMSEQUENCEADB_TRACKINGID

top relationship

secondary relationships

Publishing Table

Source Tables

TIBCO ActiveMatrix Adapter for Database Examples

Page 26: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

10 | Chapter 2 Parent-Child Exercise

Adapter RoleWhen adding the CUSTOMER table, the P_CUSTOMER table and the triggers are automatically generated. After the CUSTOMER table is updated, the new data is copied to the P_CUSTOMER table, which is executed through the triggers. The publisher adapter sends the updated information in a message.

The subscriber adapter receives the same message and writes it to its destination tables. These tables are shown in Figure 3.

Although the subscription child table names are different from the publication child table names, you must keep the column names, column types, and column length the same in both tables, and the subscription child table must be mapped with the publication child table. The destination table has a top-level relationship defined with the SUB_ORDER_DETAILS table, which has a secondary-level relationship defined with the two child tables.

Figure 3 Parent-Child Exercise, Subscriber Side

TIBCO Messaging

(Subscriber Adapter)

demo2sub

SUB_CUSTOMER

CUSTIDNAMEADDRESSPHONE_NO

SUB_ORDER_DETAILS

ORDERIDCUSTIDSHIP_DATEORDER_DATETOTAL_COST

SUB_EXTERNAL_ORDER_ITEMS

ORDERIDITEMIDQTY_ORDEREDVENDORID

SUB_INTERNAL_ORDER_ITEMS

ORDERIDITEMIDQTY_ORDERED

CREATE TABLE_EXCP_CUSTOMER

CUSTID VARCHAR2(10)NAME VARCHAR2(75)ADDRESS VARCHAR2(200)PHONE_NO VARCHAR2(20)ADB_OPCODE INTEGER NULLADB_UPDATE_ALL INTEGER NULLADB_TRACKINGUD VARCHAR2(40) NULLADB_JOIN_ID VARCHAR2(46) NULLADB_ERROR_TEXT VARCHAR(4000) NULLADB_ERROR_TIME DATE DEFAULT SYSDATE

top relationship

secondary relationships

Exception Table

Destination Tables

TIBCO ActiveMatrix Adapter for Database Examples

Page 27: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Description | 11

Required InformationThis exercise uses an Oracle database with TIBCO Rendezvous transport type as an example. The JMS transport type can also be used. When performing this exercise, use the appropriate transport values for your configuration (TIBCO Rendezvous or JMS) and follow the instructions that pertain to your particular database vendor.

You must have the following information to specify your user environment:

• Database user ID

• Database password

• Database service

Execution MethodsYou can work through the example in TIBCO Designer or the command line. The following sections explain how to set up and execute this example by using these two methods.

TIBCO ActiveMatrix Adapter for Database Examples

Page 28: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

12 | Chapter 2 Parent-Child Exercise

Working Through the Example with TIBCO Designer

With TIBCO Designer, you must complete the following sections:

• Example Setup, page 12

• Example Test, page 30

• Expected Results, page 32

• Example Cleanup, page 34

Example SetupTo set up the example, complete the following procedures:

• Creating the Tables and Projects, page 12

• Configuring and Preparing the Publication Adapter Instance, page 14

• Configuring and Preparing the Subscription Adapter Instance, page 22

• Adding Child Table Mappings, page 28

• Changing the Subject Name, page 29

Creating the Tables and Projects

Before starting the example setup, you must finish the following tasks:

• Task A, Create the Tables, page 12

• Task B, Create a Project, page 13

Task A Create the Tables

To create the tables, complete the following steps:

1. Open a command window and change directory to the demo2 directory. For example:

> cd TIB_ADADB_HOME\demo\bw5\demo2

2. Execute the demo2_database_vendor.sql script in the subdirectory to create the tables for your database. For example:

> sqlplus userid/password@dbService @demo2_ora.sql

The script creates the items and displays the status. For example:

TIBCO ActiveMatrix Adapter for Database Examples

Page 29: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 13

SQL*Plus: Release 11.2.0.1.0 - Production on Tue Apr 2 09:31:50 2013

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

Table created.Table created.Table created.Table created.Table created.Table created.Table created.Table created.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

Task B Create a Project

To create a project, complete the following steps:

1. Create a directory to store the project. For example: C:\projects\ADADB_demo2.

2. Start TIBCO Designer and click New Empty Project. The Save Project dialog is displayed.

3. Click Browse next to the Project Directory field, and navigate to the project directory you created. Then click OK.

TIBCO ActiveMatrix Adapter for Database Examples

Page 30: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

14 | Chapter 2 Parent-Child Exercise

Figure 4 Saving the Project

Configuring and Preparing the Publication Adapter Instance

After creating the table and project, you must perform the following tasks to configure and prepare the publication adapter instance:

• Task A, Create the Publication Adapter Instance, page 14

• Task B, Add Publication Service, page 17

• Task C, Add a Table and a Child Table to Publication Service, page 18

• Task D, Add Two Child Tables to the ORDER_DETAILS Table, page 20

Task A Create the Publication Adapter Instance

To create the publication adapter instance, complete the following steps:

TIBCO ActiveMatrix Adapter for Database Examples

Page 31: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 15

1. Click the ADADB_demo2 root folder and then drag the ActiveDatabase Adapter Configuration icon from the Palettes panel to the Design panel. Click OK in the confirmation message dialog that is displayed.

2. Fill in the Configuration tab fields as follows and then click Apply.

— Enter demo2pub in the Instance Name field.

— Select the database type you are using, such as Oracle, in the Vendor list.

— The Write to Database on Save check box is selected by default. This default option writes configuration information to the database when you save the project in TIBCO Designer.

Figure 5 Creating a Publication Adapter Instance

3. Click the Design-time Connection tab and specify database connection parameters for your environment. For details, see TIBCO ActiveMatrix Adapter for Database Configuration and Deployment.

If you clear the Write to Database on Save check box, the publishing table and the related triggers are not generated automatically.

TIBCO ActiveMatrix Adapter for Database Examples

Page 32: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

16 | Chapter 2 Parent-Child Exercise

Figure 6 Configuration in the Design-time Connection Tab

4. Click Test Connection to verify that the parameters you entered are correct for your setup. If the parameters you entered are correct, then a connection successful message is displayed.

Click OK.

5. Click Apply in the Design-time Connection tab.

6. Click the Run-time Connection tab.

— If you select the Use Design-time Connection For Run-time check box in the Design-time Connection tab, then all parameters you entered in the Design-time Connection tab will be copied directly to the Run-time Connection tab, and you cannot make any changes.

— If you clear the Use Design-time Connection For Run-time check box in the Design-time Connection tab, then you can specify parameters in the Run-time Connection tab, and then click Test Connection to verify the parameters you entered are correct.

At run time, the adapter will use the parameters you specified in the Run-time Connection tab.

After successfully testing the connection, click Apply.

If you select the Remember Password check box, the password will be saved in the project, and the Password field in the Run-time Connection tab will contain a masked password when you display this tab.

If you keep the Remember Password check box cleared, the global variable %%adb.password%% will be saved in the project and the Password field in the Run-time Connection tab will be blank when this tab is redisplayed. You have to re-enter the password each time you connect to the database.

TIBCO ActiveMatrix Adapter for Database Examples

Page 33: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 17

Figure 7 Configuration in the Runtime Connection Tab

7. Click the General tab, and type demo2pub.stop in the Termination Subject Or Topic field. Click Apply and then save the project.

Figure 8 Configuration in the General Tab

Task B Add Publication Service

To add Publication Service, complete the following steps:

1. In the Project panel, expand demo2pub > Adapter Services.

TIBCO ActiveMatrix Adapter for Database Examples

Page 34: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

18 | Chapter 2 Parent-Child Exercise

2. Drag the Publication Service icon from the Palettes panel to the Design panel. The icon name changes to ADBPublisher automatically.

3. Select the appropriate transport type in the Configuration tab. By default, the Rendezvous transport type is selected.

If you are using the JMS transport type, select JMS from the Transport Type list, and the fields in the Configuration tab change.

Task C Add a Table and a Child Table to Publication Service

To add a table and a child table to Publication Service, complete the following steps:

1. Click the Table tab and then click the Add Table icon on the toolbar. The Question dialog is displayed.

2. Click OK to retrieve a table from the database, and the Add Table dialog is displayed with the available tables.

3. Select CUSTOMER from the Add Table list, and then click OK. TIBCO Designer loads schema information for the CUSTOMER table. Click Apply.

4. Click the Publisher Options tab and verify that P_CUSTOMER is set in the Publishing Table field. If the value is not set, type the value in the field and click Apply.

Do not select the Publish to ActiveSpaces check box. If you select this check box, you cannot add a child table for Publication Service.

TIBCO ActiveMatrix Adapter for Database Examples

Page 35: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 19

Figure 9 Configuration in the Publisher Options Tab

5. Click the Table tab again and expand the CUSTOMER item. With the CUSTOMER table highlighted, click the Add Child Table icon on the toolbar. The Add Table dialog is displayed.

6. Select ORDER_DETAILS from the Add Table list, and then click OK. TIBCO Designer loads schema information for the ORDER_DETAILS child table.

7. Expand the ORDER_DETAILS table, and add the join between the CUSTOMER table and ORDER_DETAILS table. In the ORDER_DETAILS CUSTID entry, select the User Key check box, and then click the Join To drop-down list. Select CUSTOMER.CUSTID and click Apply.

TIBCO ActiveMatrix Adapter for Database Examples

Page 36: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

20 | Chapter 2 Parent-Child Exercise

Figure 10 Joining the CUSTOMER Table and the ORDER_DETAILS Table

Task D Add Two Child Tables to the ORDER_DETAILS Table

To add two child tables to the ORDER_DETAILS table, complete the following steps:

1. To add the first secondary table relationship, select the ORDER_DETAILS table, and click the Add Child Table icon in the toolbar. The Add Table dialog is displayed.

2. Select INTERNAL_ORDER_ITEMS from the Add Table list and then click OK. TIBCO Designer loads schema information for this secondary detail table.

3. Add the join between the ORDER_DETAILS table and INTERNAL_ORDER_ITEMS table:

a. Expand the INTERNAL_ORDER_ITEMS table, and then select the User Key check box in the INTERNAL_ORDER_ITEMS.ORDERID entry.

b. In the INTERNAL_ORDER_ITEMS.ORDERID entry, click the Join To drop-down list and select ORDER_DETAILS.ORDERID.

TIBCO ActiveMatrix Adapter for Database Examples

Page 37: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 21

Figure 11 Joining the ORDER_DETAILS Table and the INTERNAL_ORDER_DETAILS Table

4. To add the second secondary table relationship, select the ORDER_DETAILS table, and then click the Add Child Table icon on the toolbar. The Add Tables dialog is displayed.

5. Select EXTERNAL_ORDER_ITEMS from the Add Table list, and then click the OK button. TIBCO Designer loads schema information for this secondary detail table.

6. Add the join between ORDER_DETAILS and EXTERNAL_ORDER_ITEMS:

a. Expand the EXTERNAL_ORDER_ITEMS table, and then select the User Key check box in the EXTERNAL_ORDER_ITEMS.ORDERID entry.

b. In the EXTERNAL_ORDER_ITEMS.ORDER_ID entry, click the Join To drop-down list and select ORDER_DETAILS.ORDERID.

TIBCO ActiveMatrix Adapter for Database Examples

Page 38: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

22 | Chapter 2 Parent-Child Exercise

Figure 12 Joining the ORDER_DETAILS Table and the EXTERNAL_ORDER_ITEMS Table

7. Click Apply, and then save the project.

Configuring and Preparing the Subscription Adapter Instance

The publication instance and service of the example are completely set up. Now, complete the following tasks to configure and prepare the subscription adapter instance:

• Task A, Create the Subscription Adapter Instance, page 23

• Task B, Add Subscription Service, page 24

• Task C, Add a Table and a Child Table to Subscription Service, page 25

• Task D, Add Two Child Tables to the SUB_ORDER_DETAILS Table, page 26

TIBCO ActiveMatrix Adapter for Database Examples

Page 39: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 23

Task A Create the Subscription Adapter Instance

To create the subscription adapter instance, complete the following steps:

1. Click the ADADB_demo2 root folder, and then drag the ActiveDatabase Adapter Configuration icon from the Palettes panel to the Design panel. Click OK in the confirmation message dialog that is displayed.

2. Fill in the Configuration tab fields as follows and then click Apply:

— Enter demo2sub in the Instance Name field.

— Select the database type you are using, such as Oracle, in the Vendor list.

— Select the Write to Database on Save check box. This default option writes configuration information to the database when you save the project in TIBCO Designer.

Figure 13 Creating a Subscription Adapter Instance

3. Click the Design-time Connection tab and specify database connection parameters for your environment. For details, see TIBCO ActiveMatrix Adapter for Database Configuration and Deployment.

If you clear the Write to Database on Save check box, the exception table and the opaque exception table are not generated automatically.

TIBCO ActiveMatrix Adapter for Database Examples

Page 40: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

24 | Chapter 2 Parent-Child Exercise

4. Click Test Connection to verify the parameters you entered are correct for your setup.

5. Click OK in the confirmation message dialog that is displayed, and then click Apply.

6. Click the Run-time Connection tab.

— If you select the Use Design-time Connection For Run-time check box in the Design-time Connection tab, then all parameters you entered in the Design-time Connection tab will be copied directly to the Run-time Connection tab, and you cannot make any changes.

— If you clear the Use Design-time Connection For Run-time check box in the Design-time Connection tab, then you can specify the parameters in the Run-time Connection tab, and then click Test Connection to verify the parameters you entered are correct.

At run time, the adapter will use the parameters you specified in the Run-time Connection tab.

After successfully testing the connection, click Apply.

7. Click the General tab, and type demo2sub.stop in the Termination Subject Or Topic field. Click Apply, and then save the project.

Task B Add Subscription Service

To add Subscription Service, complete the following steps:

1. In the Project panel, expand demo2sub > Adapter Services.

2. Drag the Subscription Service icon from the Palettes panel to the Design panel. The icon name changes to ADBSubscriber automatically.

3. Select the appropriate transport type in the Configuration tab. By default, the Rendezvous transport type is selected.

If you are using the JMS transport, select JMS from the Transport Type list, and the fields in the Configuration tab change.

If you select the Remember Password check box, the password will be saved in the project, and the Password field in the Run-time Connection tab will contain a masked password when this tab is displayed.

If you clear the Remember Password check box, the %%adb.password%% global variable will be saved in the project and the Password field in the Run-time Connection tab will be blank when this tab is redisplayed. You have to re-enter the password each time when you connect to the database.

TIBCO ActiveMatrix Adapter for Database Examples

Page 41: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 25

Task C Add a Table and a Child Table to Subscription Service

To add a table and a child table to Subscription Service, complete the following steps:

1. Click the Table tab and then click the Add Table icon on the toolbar. The Question dialog is displayed.

2. Click OK to retrieve the tables from the database, and the Add Table dialog is displayed with the available tables.

3. Select SUB_CUSTOMER from the Add Table list and then click OK. TIBCO Designer loads schema information for this destination table.

4. Expand the SUB_CUSTOMER table and then click the Add Child Table icon on the toolbar.

5. Select SUB_ORDER_DETAILS from the Add Table list and then click OK. TIBCO Designer loads schema information for this child table.

6. Expand the SUB_ORDER_DETAILS table, and add the join between the SUB_CUSTOMER table and SUB_ORDER_DETAILS table:

7. In the SUB_ORDER_DETAILS.CUSTID entry, select the User Key check box, click the Join To drop-down list, select SUB_CUSTOMER.CUSTID, and then click Apply.

When setting a relationship on the subscriber adapter, the columns to index must match the columns indexed in the corresponding child table on the publisher adapter.

When creating a table, if you set the primary key, you do not have to select the User Key check box. If you do not set the primary key in the table, then you must select the User Key check box.

TIBCO ActiveMatrix Adapter for Database Examples

Page 42: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

26 | Chapter 2 Parent-Child Exercise

Figure 14 Joining the SUB_CUSTOMER Table and the SUB_ORDER_DETAILS Table

Task D Add Two Child Tables to the SUB_ORDER_DETAILS Table

To add two child tables to the SUB_ORDER_DETAILS table, complete the following steps:

1. To add the first secondary table relationship, select the SUB_ORDER_DETAILS table, and then click the Add Child Table icon on the toolbar. The Add Tables dialog is displayed.

2. Select SUB_INTERNAL_ORDER_ITEMS from the Add Table list and then click OK. TIBCO Designer loads schema information for this secondary detail table.

3. Expand the SUB_INTERNAL_ORDER_ITEMS table, and add the join between SUB_ORDER_DETAILS and SUB_INTERNAL_ORDER_ITEMS.

4. Select the User Key check box in the SUB_INTERNAL_ORDER_ITEMS.ORDERID entry. Next, click the Join To drop-down list and select SUB_ORDER_DETAILS.ORDERID.

Figure 15 Joining the SUB_ORDER_DETAILS Table and the

When creating a table, if you set the primary key, you do not have to select the User Key check box. If you do not set the primary key in the table, then you have to select the User Key check box.

TIBCO ActiveMatrix Adapter for Database Examples

Page 43: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 27

SUB_INTERNAL_ORDER_ITEMS Table

5. To add the second secondary table relationship, select the SUB_ORDER_DETAILS table, and then click the Add Child Table icon on the toolbar. The Add Tables dialog is displayed.

6. Select SUB_EXTERNAL_ORDER_ITEMS from the Add Table list and then click OK. TIBCO Designer loads schema information for this secondary detail table.

7. In the SUB_EXTERNAL_ORDER_ITEMS.ORDERID entry, select the User Key check box. Next, click the Join To drop-down list and select SUB_ORDER_DETAILS.ORDERID.

Figure 16 Joining the SUB_ORDER_DETAILS Table and the

When creating a table, if you set the primary key, you do not have to select the User Key check box. If you do not set the primary key in the table, then you must select the User Key check box.

TIBCO ActiveMatrix Adapter for Database Examples

Page 44: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

28 | Chapter 2 Parent-Child Exercise

SUB_EXTERNAL_ORDER_ITEMS Table

8. Click Apply, and then save the project.

Adding Child Table Mappings

This task adds a child table mapping for the relationship between Publication Service and Subscription Service. Child tables between a publisher and a subscriber must be mapped unless the tables have the same names. If the subscriber child tables have the same names as the publisher child tables, you do not have to perform this task.

1. Click the Publisher Child Table Name column and enter the following data. Then click Apply:

a. For the SUB_ORDER_DETAILS table, type ORDER_DETAILS.

b. For the SUB_INTERNAL ORDER_ITEMS table, type INTERNAL_ORDER_ITEMS.

c. For the SUB_EXTERNAL_ORDER_ITEMS table, type EXTERNAL_ORDER_ITEMS.

TIBCO ActiveMatrix Adapter for Database Examples

Page 45: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 29

Figure 17 Adding Child Table Mappings Between the Publisher and Subscriber Tables

2. Click the Subscriber Options tab, and type EXCP_CUSTOMER in the Exception Table field.

This defines an exception table for use with this subscription. If an error occurs when you insert, update, or delete data, the data will be inserted into this exception table.

3. Click Apply.

Changing the Subject Name

The subject name must be the same for both Publication Service and Subscription Service.

1. Click the Advanced tab. Do not change the default subject name. Copy the %%Domain%%.%%Deployment%%.adb.demo2sub.ADBSubscriber value in the Message Subject field.

2. In the Project panel, select the ADBPublisher service icon, then click the Advanced tab and paste the subject name copied in the previous step into the Message Subject field.

3. Click Apply, and then save the project.

TIBCO ActiveMatrix Adapter for Database Examples

Page 46: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

30 | Chapter 2 Parent-Child Exercise

Example TestYou are now ready to test the example you have configured. To do so, you must complete the following tasks:

• Task A, Insert Data in the Source Table, page 30

• Task B, Start the Subscription and Publication Services, page 30

Task A Insert Data in the Source Table

Before testing the example, you must insert data into the source table.

1. Open a command window and change directory to the demo2 directory. For example:

> cd TIB_ADADB_HOME\demo\bw5\demo2

2. Execute the demo2ins_database_vendor.sql script in the subdirectory to insert the data. For example:

> sqlplus userid/password@dbService @demo2ins_ora.sql

Task B Start the Subscription and Publication Services

To start the adapter, perform the following steps:

1. Click Tools > Show Adapter Tester from the menu.

2. Click the demo2sub item and then click the Browse button next to the Working Directory field to select a directory to store the temporary files. Click Apply.

3. Click the Console tab and then click Start. The service is started when the message highlighted in Figure 18 is displayed.

Do not select the directory that stores the temporary files as the same as the directory for the project you created.

TIBCO ActiveMatrix Adapter for Database Examples

Page 47: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 31

Figure 18 Starting Subscription Service

4. Repeat step 2 to step 3 to start Publication Service. See the message highlighted in Figure 19.

TIBCO ActiveMatrix Adapter for Database Examples

Page 48: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

32 | Chapter 2 Parent-Child Exercise

Figure 19 Starting Publication Service

Expected ResultsQuery the database as shown:

SQL> select * from SUB_CUSTOMER;

CUSTID-----------------NAME-----------------ADDRESS-----------------PHONE_NO-----------------CUST001Mickey Mouse1000 Disney Store800-555-5555

CUSTID------------------------NAME------------------------

TIBCO ActiveMatrix Adapter for Database Examples

Page 49: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with TIBCO Designer | 33

ADDRESS------------------------PHONE_NO------------------------CUST002Minnie2000, Walt Disney World800-666-6666

SQL> select * from SUB_ORDER_DETAILS;

ORDERID----------------------------CUSTID----------------------------SHIP_DATE ----------------------------ORDER_DAT ----------------------------TOTAL_COST----------------------------1000CUST0012013-05-31 14:02:082013-06-04 14:02:085250.77

ORDERID----------------------------CUSTID----------------------------SHIP_DATE ----------------------------ORDER_DAT ----------------------------TOTAL_COST----------------------------1001CUST0022013-05-31 14:02:082013-06-04 14:02:087817.99

SQL> select * from SUB_INTERNAL_ORDER_ITEMS;

ORDERID ITEMID QTY_ORDERED---------- ----- ----------------1000 PRN 11000 SCN 21001 MON 11001 DISK 2

SQL> select * from SUB_EXTERNAL_ORDER_ITEMS;

ORDERID ITEMID QTY_ORDERED VENDORID---------- ----- ----------- ------------------1000 PRPAP 10 V001

TIBCO ActiveMatrix Adapter for Database Examples

Page 50: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

34 | Chapter 2 Parent-Child Exercise

1000 PRPL 5 V0021001 PRPAP 10 V0011001 PRPL 5 V002

Example CleanupThe cleanup script removes only the example tables that were created by executing the demo2_ora.sql script.

To clean the example, perform the following steps:

1. Change directory to the operation directory:

> cd TIB_ADADB_HOME\demo\bw5\demo2

2. Execute the demo cleanup script to remove the example tables. For example:

> sqlplus userid/pswd@dbService @demo2_cleanup_ora.sql

TIBCO ActiveMatrix Adapter for Database Examples

Page 51: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with Command Line | 35

Working Through the Example with Command Line

With command line, you have to complete the following sections:

• Example Setup, page 35

• Example Test, page 39

• Expected Results, page 41

• Example Cleanup, page 41

Example SetupTo set up the example, complete the following procedures:

• Creating the Tables, page 35

• Inserting Data in the Source Table, page 37

• Modifying the TRA Files, page 38

Creating the Tables

Before starting the example setup, you have to complete the following tasks:

• Task A, Create the Source Table, page 35

• Task B, Create the Publishing Table and Trigger, page 36

• Task C, Create the Subscription Exception Table, page 37

Task A Create the Source Table

To create the source table, complete the following steps:

1. Open a command window and change directory to the demo2 directory. For example:

> cd TIB_ADADB_HOME\demo\bw5\demo2\

2. Execute the demo2_database_vendor.sql script in the subdirectory to create the tables for your database. For example:

> sqlplus userid/password@dbService @demo2_ora.sql

The script creates the items and displays the status. For example:

SQL*Plus: Release 11.2.0.1.0 - Production on Mon Jun 3 09:28:29 2013

TIBCO ActiveMatrix Adapter for Database Examples

Page 52: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

36 | Chapter 2 Parent-Child Exercise

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

Table created.Table created.Table created.Table created.Table created.Table created.Table created.Table created.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

Task B Create the Publishing Table and Trigger

To create the publishing table, complete the following steps:

1. Execute the demo2pub_database_vendor.sql script in the demo2 subdirectory to create the publishing table and relevant trigger for your database. For example:

> sqlplus userid/password@dbService @demo2pub_ora.sql

2. The script creates the items and displays the status. For example:

SQL*Plus: Release 11.2.0.1.0 - Production on Mon Jun 3 09:30:05 2013

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

Table created.Index created.Index created.Index created.Sequence created.Trigger created.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

TIBCO ActiveMatrix Adapter for Database Examples

Page 53: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with Command Line | 37

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Task C Create the Subscription Exception Table

To create the subscription exception table, complete the following steps:

1. Execute the demo2sub_database_vendor.sql script in the demo2 subdirectory to create the subscription exception table for your database. For example:

> sqlplus userid/password@dbService @demo2sub_ora.sql

2. The script creates the items and displays the status. For example:

SQL*Plus: Release 11.2.0.1.0 - Production on Mon Jun 3 09:32:11 2013

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

Table created.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

Inserting Data in the Source Table

After creating tables, you have to insert data into the source table.

1. Open a new command window and change directory to the demo2 directory. For example:

> cd TIB_ADADB_HOME\demo\demo2

2. Execute the demo2ins_database_vendor.sql script in the subdirectory to insert the data. For example:

> sqlplus userid/password@dbService @demo2ins_ora.sql

3. The script creates the items and displays the status. For example:

SQL*Plus: Release 11.2.0.1.0 - Production on Mon Jun 3 09:35:21 2013

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to:

TIBCO ActiveMatrix Adapter for Database Examples

Page 54: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

38 | Chapter 2 Parent-Child Exercise

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

1 row created.1 row created.1 row created.1 row created.1 row created.1 row created.1 row created.1 row created.1 row created.1 row created.1 row created.1 row created.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

Modifying the TRA Files

Before testing the example, you have to modify the TRA files for Publication Service and Subscription Service. To do so, complete the following steps:

1. Open the demo2pub.tra file with the text editor in the demo2 directory.

2. Modify the following variables:

— Settings at design time for this demo. For example:#adb.user doc

#adb.password doc

#adb.url jdbc:tibcosoftwareinc:oracle://192.168.66.153:1521;SID=ORCL

— The absolute path to the DAT file. For example:tibco.repourl C:/tibco/adapter/adadb/7.2/demo/bw5/demo2/ADBDemo2_ora.dat

— The configurl parameter. For example:tibco.configurl demo2pub

3. Open the demo2sub.tra file with the text editor in the demo2 directory.

When setting the database URL, you must use the database that you created the publishing table and trigger in Task B.

TIBCO ActiveMatrix Adapter for Database Examples

Page 55: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with Command Line | 39

4. Modify the following variables:

— Settings at design-time for this demo. For example:#adb.user doc

#adb.password doc

#adb.url jdbc:tibcosoftwareinc:oracle://192.168.66.153:1521;SID=ORCL

— The absolute path to the DAT file. For example:tibco.repourl C:/tibco/adapter/adadb/7.2/demo/bw5/demo2/ADBDemo2_ora.dat

— The configurl parameter. For example:tibco.configurl demo2sub

Example TestYou are now ready to test the example you have configured. To do so, you have to complete the following steps:

1. Open a new command window and change directory to the bin directory. For example:

> cd TIB_ADADB_HOME\bin

2. Start the subscriber adapter. For example:

> adbagent --propFile TIB_ADADB_HOME\demo\bw5\demo2\demo2sub.tra

Subscription Service is started when the message highlighted in Figure 20 is displayed.

When setting the database URL, you must use the database that you created the subscription exception table in Task C.

TIBCO ActiveMatrix Adapter for Database Examples

Page 56: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

40 | Chapter 2 Parent-Child Exercise

Figure 20 Starting Subscription Service Using the Command Line

3. Open a new command window and change directory to the bin directory. Start the publisher adapter. For example:

> adbagent --propFile TIB_ADADB_HOME\demo\bw5\demo2\demo2pub.tra

Publication Service is started when the message highlighted in Figure 21 is displayed.

Figure 21 Starting Publication Service Using the Command Line

TIBCO ActiveMatrix Adapter for Database Examples

Page 57: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Working Through the Example with Command Line | 41

Expected ResultsBefore checking the example results, you have to stop Subscription Service and Publication Service first, and then query the database to check the expected results. See Expected Results on page 32 for more information.

Example CleanupThe cleanup script removes the example tables that were created by executing the demo2_databasevendor.sql script.

1. Exit the query tool. For example:

SQL> exit

2. Execute the cleanup script to remove the example tables. For example:

> sqlplus userid/pswd@dbService @demo2_cleanup_ora.sql

TIBCO ActiveMatrix Adapter for Database Examples

Page 58: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

42 | Chapter 2 Parent-Child Exercise

TIBCO ActiveMatrix Adapter for Database Examples

Page 59: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

| 43

Chapter 3 Request-Response Service Examples

This chapter provides three exercises to demonstrate how to use Request-Response Service, including RPC standard operation, RPC custom operation, and Request-Reply operation.

Topics

• Example Description, page 44

• Example Setup, page 46

• Example Test, page 52

• Example Cleanup, page 60

TIBCO ActiveMatrix Adapter for Database Examples

Page 60: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

44 | Chapter 3 Request-Response Service Examples

Example Description

This exercise contains three samples:

• RPC standard operation

This exercise demonstrates a standard operation. It uses a sample operation program that emulates an RPC client application to send requests to an adapter instance for processing.

• RPC custom operation

This exercise demonstrates a custom operation. It uses a sample operation program that emulates an RPC client application to send requests to an adapter instance for processing.

• Request-Reply operation

This exercise uses a sample request program that emulates a Request-Reply application to send requests to an adapter instance for processing.

The sample request program acts as a client, sending a request to be processed by an adapter instance. After receiving the request, the adapter processes it and sends a response back on its configured subject. Trace information about the transaction is printed in the console window where the adapter instance is started.

Required Platforms and SoftwareThese three examples can be performed on Microsoft Windows or UNIX. Additionally, these examples can be performed with an Oracle, Microsoft SQL, or DB2 database.

You can use the following transport types and message formats:

• TIBCO Rendezvous transport type uses the TIBCO Rendezvous, TIBCO ActiveEnterprise or XML message format.

• JMS transport type uses XML message format.

When performing these examples, use the appropriate transport values for your configuration (TIBCO Rendezvous or JMS) and follow the instructions that pertain to your particular database vendor.

You must have the following information to specify your user environment:

• Database user ID

• Database password

TIBCO ActiveMatrix Adapter for Database Examples

Page 61: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Description | 45

• Database service

The names you will enter for the server and client depend on which transport type you are using, see Table 4.

All required example files are provided with the default installation of TIBCO ActiveMatrix Adapter for Database.

Table 4 Values to Use for TIBCO Rendezvous and JMS Transport Types

Item TIBCO Rendezvous Transport Value JMS Transport Value

Server rvServer jmsServer

Client rvClient jmsClient

TIBCO ActiveMatrix Adapter for Database Examples

Page 62: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

46 | Chapter 3 Request-Response Service Examples

Example Setup

To set up the example, you must run a SQL script that creates the schema and database objects used in the example. You must also create a project in TIBCO Designer and import the example project. The example setup uses an Oracle database.

To set up this example, complete the following tasks:

• Task A, Create the Demo Tables, page 46

• Task B, Import the Exercise, page 46

• Task C, Start the Adapter, page 50

Task A Create the Demo Tables

1. Open a command window and change directory to the operation directory. For example:

>cd TIB_ADADB_HOME\demo\bw5\operation

2. Execute the appropriate request script for your database vendor to create the tables for your database. Use your environment-specific user ID, password, and database service. For example:

>sqlplus userid/pswd@dbService @operation_ora.sql

The script creates the items and displays the status.

3. Exit the query tool.

SQL> exit

Task B Import the Exercise

To import the Request-Response exercise, perform the following steps:

1. Start TIBCO Designer, and then click the New Empty Project button. The Save Project dialog is displayed.

2. Click the Browse button and navigate to the project directory you created and specify a name for the project. Then click OK.

3. Select Project > Import Full Project from the menu, and then click the Browse button to navigate to the TIB_ADADB_HOME\demo\bw5\operation folder. Then select the DAT file you want to import and click OK.

4. In the Import-Options dialog, select Replace existing global variables with those in import and Overwrite on name conflict. Click Apply.

All processes are listed in the project panel shown in Figure 22.

TIBCO ActiveMatrix Adapter for Database Examples

Page 63: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Setup | 47

Figure 22 Importing the Request-Response Sample

TIBCO ActiveMatrix Adapter for Database Examples

Page 64: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

48 | Chapter 3 Request-Response Service Examples

You can use the sample request program to demonstrate features, such as returning the rows in the OPERATION_ORDER table, batching requests, binding time and binary values, or executing other SQL commands.

Table 5 explains the selections available in the sample request program.

Table 5 Selections Available in the Sample Request Program

Selection Description

RPC Standard Operation

Adapter service ADBServer and Processes [1] to [5] demonstrate RPC standard operation support. This emulates an RPC client application that sends requests to an adapter instance for processing.

[1] INSERT INTO OPERATION_ORDER

Sends a request to the adapter to update the OPERATION_ORDER table. You are prompted to provide the order id, description and price. For example:

Enter the order_id: 1

Enter the order_description: 'teal table'

Enter the order_price: 1.99

[2] SELECT FROM OPERATION_ORDER

Sends a request to the adapter to return all rows from the OPERATION_ORDER table.

[3] Execute Any SQL Statement (DLL & DML)

Constructs a custom request and sends it to the adapter using an INSERT, UPDATE, or DELETE statement.

[4] Execute Batch of SQL Statements

Sends a request to the adapter to execute two update and two select statements as a batch operation.

[5] Execute SQL Stmt with Bind Variables

Sends an INSERT statement to the adapter to update the OPERATION_ORDER table. You are prompted to provide an SQL statement "insert into operation_order values (?,’123’,1.22)".

Select BINDS > item and then you have to enter the values in the POSITION field and the DATA field.

The POSITION value depends on the number of question marks (?) in the previous SQL statement. If more than one question mark exists in the SQL statement, you have to duplicate the item by right-clicking item > Statement > Duplicate. See Figure 23.

TIBCO ActiveMatrix Adapter for Database Examples

Page 65: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Setup | 49

RPC Custom Operation

Adapter service ADBServer1 and Processes [6] to [9] demonstrate RPC custom operation support. This emulates an RPC client application that sends requests to an adapter instance for processing.

[6] Execute procedure SetDescription_input

Executes the SetDescription procedure, which takes an item description as input and writes it to the operation_order table. For example:

Enter the id: 30

Enter the order_description: ’spec material’

[7] Execute procedure getPrice_output

Executes the getPrice procedure, which returns an item price for the specified id. For example:

Enter the ID: 30

Returns the price value for the specified order.

[8] Execute procedure paramTest_multiple

Executes the paramTest procedure, which takes an item name and sequence number as input and returns the description, timestamp and sequence number values for that record. For example:

Enter the id: 30

Enter the name: ’abc’

Enter the seqno: 15

[9] Pro_Customer_rvClient_ FINDORDERS

Oracle REF data type support that is used as an OUT parameter only in an Oracle stored procedure.

Request-Reply Operation

Adapter service ADBServer2 and Process [10] demonstrates Request-Reply operation. This emulates a Request-Reply application that sends requests to an adapter instance for processing.

[10] Request_Reply SELECT FROM OPERATION_ORDER

Sends a request to the adapter to return all rows from the OPERATION_ORDER table.

Table 5 Selections Available in the Sample Request Program (Cont’d)

Selection Description

TIBCO ActiveMatrix Adapter for Database Examples

Page 66: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

50 | Chapter 3 Request-Response Service Examples

Figure 23 Process [5] Execute SQL Stmt with Bind Variables

Task C Start the Adapter

To start the adapter, perform the following steps:

1. Select Tools > Show Adapter Tester from the menu.

2. Click the rvServer item and then click the Browse button next to the Working Directory field to select a directory to store the temporary files. Click Apply and then click Start. If you are using the JMS transport, then click the jmsServer item.

3. Click the Console tab to view adapter messages. The service is started when the message highlighted in Figure 24 is displayed.

Before starting the adapter, you have to change the values of the JDBC URL, User Name, and Password fields in the Design-time Connection tab for Publication Service and Subscription Service to be the same as those you used to create the demo tables.

TIBCO ActiveMatrix Adapter for Database Examples

Page 67: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Setup | 51

Figure 24 Starting the Adapter

TIBCO ActiveMatrix Adapter for Database Examples

Page 68: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

52 | Chapter 3 Request-Response Service Examples

Example Test

You are now ready to test the examples. Because the processes listed in the Project panel are using the same test method, so this section only takes one process from each operation as a test example.

RPC Standard OperationTo run this example, perform the following steps:

1. In the Project panel, select RV_[1]INSERT INTO OPERATION_ORDER item.

2. In the Design panel, click the Invoke an Adapter Request-Response Service icon. Click the Input tab, the information that will be inserted into the table is in the field highlighted in Figure 25.

Figure 25 Information That Will be Inserted to the OPERATION_ORDER Table

When you execute the processes in the RPC standard operation or the RPC custom operation, you must execute the processes in order.

TIBCO ActiveMatrix Adapter for Database Examples

Page 69: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Test | 53

3. Click the Tester panel and then click the Start testing viewed process icon . The Select Processes to Load dialog is displayed.

Figure 26 Select Processes to Load Dialog

4. Select the RV_[1]INSERT INTO OPERATION_ORDER(current) check box, and then click Load Selected. The process is now in test mode. When the process is executed, you find the black arrows that point to each activity turn green.

5. In the Adapter Tester dialog, you can see the process status is Success, which indicates that the information is inserted into the OPERATION_ORDER table without problems. See the section highlighted in Figure 27.

TIBCO ActiveMatrix Adapter for Database Examples

Page 70: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

54 | Chapter 3 Request-Response Service Examples

Figure 27 RV_[1]INSERT INTO OPERATION_ORDER Process Result

6. Click Stop testing in the Tester panel to return to design mode.

7. Select Tools > Show Adapter Tester from the menu, and then click Stop.

RPC Custom OperationTo run this example, perform the following steps:

1. In the Project panel, select RV_[6]Execute procedure SetDescription_input item.

2. In the Design panel, click the SETDESCRIPTION icon. Click the Input tab, the information that will be input and written to the OPERATION_ORDER table is in the field highlighted in Figure 28.

TIBCO ActiveMatrix Adapter for Database Examples

Page 71: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Test | 55

Figure 28 Information That Will be Input to the OPERATION_ORDER Table

3. Click the Tester panel and then click the Start testing viewed process icon . The Select Processes to Load window is displayed.

4. Select the RV_[6]Execute procedure SetDescription_input(current) check box and then click Load Selected. The process is now in test mode. When the process is executed, you will find the black arrows that point to each activity turn green.

5. In the Adapter Tester dialog, you can see the process status is Success, which indicates that the information is input and written into the OPERATION_ORDER table without problems. See the section highlighted in Figure 29.

TIBCO ActiveMatrix Adapter for Database Examples

Page 72: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

56 | Chapter 3 Request-Response Service Examples

Figure 29 RV_[6]Execute Procedure SetDescription_input Process Result

6. Click Stop testing in the Tester panel to return to design mode.

7. Select Tools > Show Adapter Tester from the menu, then click Stop.

Request-Reply OperationTo send a request message, perform the following steps:

1. In the Project panel, select the RV_[10]Request_Reply SELECT FROM OPERATION_ORDER item. Then click the Publish to Adapter activity in the design panel.

2. In the Configuration tab, select the RequestReply check box, and then click the Browse button next to the Request AE Schema field and the Reply AE Schema field to add the appropriate schemas. Click Apply. See Figure 30.

Click the Input tab, the information that will be sent to the adapter is in the field highlighted in Figure 31.

TIBCO ActiveMatrix Adapter for Database Examples

Page 73: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Test | 57

Figure 30 Configuring the Request AE Schema and the Reply AE Schema

Figure 31 Information That Will be Sent to the Adapter

TIBCO ActiveMatrix Adapter for Database Examples

Page 74: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

58 | Chapter 3 Request-Response Service Examples

3. Click the Tester panel and then click the Start testing viewed process icon . The Select Processes to Load window is displayed.

4. Select the RV_[10]Reqest_Reply SELECT FROM OPERATION_ORDER(current) check box and then click Load Selected. The process is now in test mode. When the process is executed, you will find the black arrows that point to each activity turn green.

5. In the Adapter Tester dialog, you can see the process status is Success, which indicates that the information is sent to the adapter and all rows are returned from the OPERATION_ORDER table without problems. See the section highlighted in Figure 32.

TIBCO ActiveMatrix Adapter for Database Examples

Page 75: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Test | 59

Figure 32 RV_[10]Request_Reply SELECT FROM OPERATION_ORDER Process Result

6. Click Stop testing in the Tester panel to return to design mode.

7. Select Tools > Show Adapter Tester from the menu and then click Stop.

TIBCO ActiveMatrix Adapter for Database Examples

Page 76: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

60 | Chapter 3 Request-Response Service Examples

Example Cleanup

The cleanup script removes only the example tables that were created by executing the operation_ora.sql script.

To clean the example, perform the following steps:

1. Change directory to the operation directory:

> cd TIB_ADADB_HOME\demo\bw5\operation

2. Execute the demo cleanup script to remove the example tables. For example:

> sqlplus userid/pswd@dbService @operation_cleanup_ora.sql

TIBCO ActiveMatrix Adapter for Database Examples

Page 77: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

| 61

Chapter 4 TIBCO ActiveMatrix BusinessWorks: Processing a Sales Order

This example shows how to use several adapter services within a TIBCO ActiveMatrix BusinessWorks process to process a sales order stored in a database.

Topics

• Example Description, page 62

• Example Setup, page 63

• Example Test, page 65

• Expected Results, page 68

• Example Cleanup, page 69

TIBCO ActiveMatrix Adapter for Database Examples

Page 78: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

62 | Chapter 4 TIBCO ActiveMatrix BusinessWorks: Processing a Sales Order

Example Description

This example shows how Publication Service, Subscription Service and Request-Response Service can be used in TIBCO ActiveMatrix BusinessWorks to process a sales order. When processing the order, the delivery priority assigned to sales items is changed and sales items are verified to ensure that the items are valid.

The BusinessWorks process calls a stored procedure that adjusts the priority of the items on the sales order. The BusinessWorks process also calls a stored procedure that validates each item on the sales order. If an item is invalid, it will be rejected and Subscription Service will delete the invalid sales item.

The following BusinessWorks activities are used in the example:

• Subscribe to New Sales Order

This activity receives a message containing a new sales order from Publication Service.

• Insert New Sales Order

This activity uses Subscription Service to insert the new sales order into the database.

• Adjust Sales Order Priority

This activity invokes the ADJUSTPRIORITY operation of Request-Response Service to adjust the priority of the sales order.

• Update Sales Order Priority

This activity uses Subscription Service to update the priority and shipping notes of the sales order in the database.

• For Each Order Item (Group)

This grouping has two activities. The first activity invokes the VALIDATESALESORDER operation of Request-Response Service to validate each sales order item. The second activity uses Subscription Service to delete the invalid sales order items from the database.

TIBCO ActiveMatrix Adapter for Database Examples

Page 79: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Setup | 63

Example Setup

To set up the example, you must execute a SQL script that creates the schema and database objects used in the example. You must also create a project in TIBCO Designer and import the example project. After importing the project, edit it with account and service information about your database connection.

The example setup uses the Oracle database. SQL scripts are also available for DB2 (db2 used in file names) and Microsoft SQL Server (ms used in file names).

1. Set up the database by running an SQL script with the database account used by the adapter. On a command line, type the following commands:

a. > cd TIB_ADADB_HOME\demo\salesOrder

b. > sqlplus userid/pswd@dbService @salesOrder_ora.sql

2. Configure the design-time and runtime connections in the project.

a. Start TIBCO Designer and then click New Empty Project. The Save Project dialog is displayed.

b. In the Save Project dialog, click Browse and navigate to the project directory you created, specify a name for the project, and then click OK.

c. Select Project > Import Full Project from the menu and then click the ZIP Archive tab. Click Browse, and navigate to the TIB_ADADB_HOME\demo\bw5\salesorder folder. Then select the ZIP file you want to import. In this example, select salesOrderDemo_ora and then click OK.

d. In the Import-Options dialog, select Replace existing global variables with those in import and Overwrite on name conflict. Then click Apply.

e. In the Project panel, expand Adapter Configuration > rvSalesOrderDemo. If you are using the JMS transport type, select jmsSalesOrderDemo.

f. Click the Design-time Connection tab and configure the parameters. Then click Test Connection to verify the connection.

g. Click Project > Save from the menu.

Start the JMS Server

If you are using the JMS transport, you must start the JMS server before testing the example. Ensure that the JMS server is running and accessible to the machine on which the adapter is installed before running any of the processes.

1. Open a command window and change directory to the JMS bin directory.

TIBCO ActiveMatrix Adapter for Database Examples

Page 80: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

64 | Chapter 4 TIBCO ActiveMatrix BusinessWorks: Processing a Sales Order

> cd TIBCO_HOME\ems\bin

2. Start the JMS server. For example: tibemsd

TIBCO ActiveMatrix Adapter for Database Examples

Page 81: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Test | 65

Example Test

To run the example, first start the adapter using the TIBCO Designer Adapter Tester, and then work through the example using the TIBCO ActiveMatrix BusinessWorks Tester.

1. In TIBCO Designer, start the adapter:

a. Select Tools > Show Adapter Tester from the menu.

b. Click the rvSalesOrderDemo item and then click Start. If you are using the JMS transport, click the jmsSalesOrderDemo item.

c. Click the Console tab to view adapter messages.

2. In the Project panel, expand the Process Definition folder and select Rv Sales Order Demo, or Jms Sales Order Demo.

3. Click the Set Breakpoints button , and the Set BreakPoints dialog is displayed.

4. Click Select All and then click OK.

You can use breakpoints to work through the process. Working through the process helps you to see what happens when each activity is executed.

TIBCO ActiveMatrix Adapter for Database Examples

Page 82: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

66 | Chapter 4 TIBCO ActiveMatrix BusinessWorks: Processing a Sales Order

Figure 33 Setting BreakPoints for Rv Sales Order Demo Process

5. Click the Tester panel, and then click the Start testing viewed process icon . The Select Processes to Load window is displayed.

6. Select the Rv Sales Order Demo(current) check box and then click Load Selected. The process is now in test mode.

7. On a command line, insert a row into the source database table:

> sqlplus userid/pswd@dbService @insertSalesOrder_ora.sql

The script creates the items and displays the status. For example:

SQL*Plus: Release 11.2.0.1.0 - Production on Fri Apr 26 15:39:22 2013

Copyright <c> 1982, 2010, Oracle. All rights reserved.

Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

TIBCO ActiveMatrix Adapter for Database Examples

Page 83: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Test | 67

With the Partitioning, OLAP, Data Mining and Real Application Testing options

1 row created.1 row created.1 row created.1 row created.Commit complete.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

8. After the process starter is highlighted (indicating a process has started), click the Step to next activity icon to work through the process.

Figure 34 Testing the Sales Order Example

9. Click Stop Testing to return to design mode.

10. Select Tools > Show Adapter Tester from the menu, and then click Stop.

11. Close the Adapter Tester dialog, and click Project > Exit from the menu.

TIBCO ActiveMatrix Adapter for Database Examples

Page 84: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

68 | Chapter 4 TIBCO ActiveMatrix BusinessWorks: Processing a Sales Order

Expected Results

After running the example, the sales order is changed to contain only the valid sales items. The priority assigned to each valid sales item is also changed.

A query of the original sales order shows the following entries:

select HEADER_NUMBER, PRIORITY, SHIP_NOTE from SO_HEADER; 1-1ABXYZ 2 Regular Shipping

select HEADER_NUMBER, LINE_NUMBER, SHIPPING_NOTE from SO_LINE; 1-1ABXYZ L-1ABXYZ Regular 1-1ABXYZ L-2ABXYZ Regular 1-1ABXYZ L-3ABXYZ Regular

After running the example, a query of the changed sales order shows the following results:

select HEADER_NUMBER, PRIORITY, SHIP_NOTE from NEW_SO_HEADER; 1-1ABXYZ 1 Express Shipping

select HEADER_NUMBER, LINE_NUMBER, SHIPPING_NOTE from NEW_SO_LINE; 1-1ABXYZ L-1ABXYZ Urgent 1-1ABXYZ L-2ABXYZ Urgent

TIBCO ActiveMatrix Adapter for Database Examples

Page 85: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

Example Cleanup | 69

Example Cleanup

The cleanup script removes the example tables that were created by executing the SalesOrder_database_vendor.sql script.

1. Change directory to the salesOrder directory.

> cd TIB_ADADB_HOME\demo\bw5\salesorder

2. Execute the demo delete script to delete data from the example tables.

> sqlplus userid/pswd@dbService @deleteSalesOrder_ora.sql

3. Clean the database objects.

> sqlplus userid/pswd@dbService @salesorder_cleanup_ora.sql

TIBCO ActiveMatrix Adapter for Database Examples

Page 86: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

70 | Chapter 4 TIBCO ActiveMatrix BusinessWorks: Processing a Sales Order

TIBCO ActiveMatrix Adapter for Database Examples

Page 87: TIBCO ActiveMatrix Adapter for Database Examples · format that conforms to the Java Messaging Service (JMS) specification. TIBCO Hawk® This product is designed to monitor and manage

TIBCO ActiveMatrix Adapter for Database Examples

| 71

Index

C

commandssqlplus 12, 34, 35, 36, 37, 41, 60, 69

customer support xv

E

ENV_NAME xiiExample 52, 52, 62examples location 2examples overview 2

P

parent-child exerciseadapter role 10example description 8execution methods 11required information 11working through the example with command

line 35working through the example with TIBCO

Designer 12

R

relationshipssecondary level 9top level 9

request-reply operation 56

request-response service examplesexample cleanup 60example description 44example setup 46example test 52

RPC custom operation 54RPC standard operation 52

S

support, contacting xv

T

technical support xvTIB_ADADB_HOME xiiTIBCO ActiveMatrix BusinessWorks

processing a sales orderexample cleanup 69example description 62example setup 63expected results 68

TIBCO_HOME xii

W

working with DAT files in TIBCO Designer 4


Recommended