+ All Categories
Home > Documents > TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter...

TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter...

Date post: 21-Mar-2018
Category:
Upload: lyanh
View: 236 times
Download: 3 times
Share this document with a friend
87
TIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 Two-Second Advantage ®
Transcript
Page 1: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix® Adapterfor Database

ExamplesSoftware Release 7.0July 2013

Two-Second Advantage®

Page 2: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

Important Information

SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDEDOR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITEDADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLEDSOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FORANY OTHER PURPOSE.USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF ALICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSEAGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USERLICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THESOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSE FILE) OR IF THERE IS NO SUCH SOFTWARELICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATEDIN THE “LICENSE” FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMSAND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND ANAGREEMENT TO BE BOUND BY THE SAME.This document contains confidential information that is subject to U.S. and international copyright laws andtreaties. No part of this document may be reproduced in any form without the written authorization of TIBCOSoftware Inc.TIBCO, Two-Second Advantage, TIBCO ActiveMatrix Adapter for Database, TIBCO ActiveMatrix Binding Typefor Adapter, TIBCO ActiveMatrix BusinessWorks, TIBCO ActiveMatrix Implementation Type for TIBCOAdapters, TIBCO ActiveMatrix Service Bus, TIBCO ActiveMatrix Service Grid, TIBCO Adapter SDK, TIBCOAdministrator, TIBCO Business Studio, TIBCO Database Drivers Supplement, TIBCO Designer, TIBCOEnterprise Message Service, TIBCO Hawk, TIBCO Rendezvous, and TIBCO Runtime Agent are either registeredtrademarks 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 Corporationin the U.S. and other countries.All other product and company names and marks mentioned in this document are the property of theirrespective owners and are mentioned for identification purposes only.THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALLOPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAMETIME. SEE THE README FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFICOPERATING SYSTEM PLATFORM.THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS ORIMPLIED, 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 BEINCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKEIMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED INTHIS DOCUMENT AT ANY TIME.THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY ORINDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDINGBUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES.Copyright © 1999-2013 TIBCO Software Inc. ALL RIGHTS RESERVED.TIBCO Software Inc. Confidential Information

Page 3: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

| 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 TIBCOmmunity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvHow to Access TIBCO Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvHow to Contact TIBCO Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv

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

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

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

Chapter 2 Parent-child Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

Example Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Adapter Role. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Required Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Execution Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

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

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

Page 4: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Example Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

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

Page 5: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Figures | v

Figures

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

Figure 2 Parent-child Exercise, Publisher Side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

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

Figure 4 Saving the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

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

Figure 6 Configuring in the Design-time Connection Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Figure 7 Configuring in the Runtime Connection Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Figure 8 Configuring in the General Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Figure 9 Adding the Publication Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Figure 10 Add Table Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Figure 11 Configuring in the Publisher Options Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

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

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

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

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

Figure 16 Adding an Subscription Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

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

Figure 18 Joining theSUB_ORDER_DETAILS Table and the SUB_INTERNAL_ORDER_ITEMS Table . . . . 27

Figure 19 Joining the SUB_ORDER_DETAILS Table and the SUB_EXTERNAL_ORDER_ITEMS Table . . . 28

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

Figure 21 Starting the Subscription Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Figure 22 Starting the Publication Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

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

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

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

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

Figure 27 Starting the Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

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

Page 6: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

vi | Figures

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

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

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

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

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

Figure 34 Information That Will be Sent to the Adapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

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

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

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

Page 7: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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

Page 8: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

viii | Tables

Page 9: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

| ix

Preface

TIBCO ActiveMatrix Adapter for Database software 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

Page 10: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

x | Related Documentation

Related Documentation

This section lists documentation resources you may 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 may find it useful to read the documentation for the following TIBCO products:

Table 1 TIBCO Products

TIBCO Product Description

TIBCO ActiveMatrix® Binding Type for Adapters

This product is an ActiveMatrix binding that integrates the TIBCO Adapters with the ActiveMatrix environment.

TIBCO ActiveMatrix BusinessWorks™

This product provides an integration platform that enables companies to rapidly integrate systems and automate business processes.

TIBCO ActiveMatrix® Implementation Type for TIBCO Adapters

This product allows you to upload and deploy TIBCO Adapter configurations (packaged as EAR files) using the TIBCO ActiveMatrix Administrator GUI.

Page 11: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Preface | xi

TIBCO ActiveMatrix® Service Bus

This product is a lightweight enterprise service bus (ESB) that mediates the communication between applications and services by routing and transforming disparate data formats and transport protocols.

TIBCO ActiveMatrix® Service Grid

This product is a scalable and extensible platform for developing, deploying, and managing applications that conform to a service-oriented architecture.

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

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 can 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 needed to run many TIBCO applications such as TIBCO ActiveMatrix BusinessWorks and TIBCO Adapters.

Table 1 TIBCO Products (Cont’d)

TIBCO Product Description

Page 12: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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]

Page 13: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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

Page 14: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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

Page 15: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Preface | xv

Connecting with TIBCO Resources

How to Join TIBCOmmunityTIBCOmmunity 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. TIBCOmmunity offers forums, blogs, and access to a variety of resources. To register, go to http://www.tibcommunity.com.

How to Access TIBCO DocumentationYou can access TIBCO documentation here:

http://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 username, you can request one.

Page 16: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

xvi | Connecting with TIBCO Resources

Page 17: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

| 1

Chapter 1 Examples Introduction

This chapter contains an overview of the examples and lists the prerequisites needed to run the examples.

Topics

• Examples Overview, page 2

• Working with DAT Files in TIBCO Designer, page 3

Page 18: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

2 | Chapter 1 Examples Introduction

Examples Overview

Before performing any of these exercises, make sure 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 need to 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.

Examples LocationThe examples are in the following location:

TIB_ADADB_HOME\demo

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)

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

Page 19: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working with DAT Files in TIBCO Designer | 3

Working with DAT Files in TIBCO Designer

You cannot directly open a DAT file in TIBCO Designer and make modifications to the configurations. To do this, 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 the Convert DAT To Files button, the Convert DAT To File-Based Project dialog is displayed. Click the Browse button beside the DAT File field to select a DAT file you want to convert to a multi-file project.

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

Click the OK button.

2. Click the Project tab, and then click the Open Existing Project button.

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

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

4. Click the Browse button beside the Dir Name field, and select the location of the directory you want to save the DAT file to. Ensure that the directory is

Page 20: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

4 | Chapter 1 Examples Introduction

different from the multi-file project. Enter the name of the project and click the OK button.

Page 21: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

| 5

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 6

• Working Through the Example with TIBCO Designer, page 10

• Working Through the Example with Command Line, page 35

Page 22: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

6 | 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 publication and subscription sides, a top-level relationship is set between a parent and its child tables. The child table also has a relationship set between it 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 there is a one-to-many relationship, 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.

Page 23: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Description | 7

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 it and the ORDER_DETAILS table. The ORDER_DETAILS table has a secondary-level relationship set between it 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

Page 24: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

8 | 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 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 subscrription 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

Page 25: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Description | 9

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 need the following information to specify your user environment:

• Database user ID

• Database password

• Database service

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

Page 26: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

10 | Chapter 2 Parent-child Exercise

Working Through the Example with TIBCO Designer

With TIBCO Designer, you need to complete the following sections:

• Example Setup, page 10

• Example Test, page 30

• Expected Results, page 32

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

• Creating the Tables and Projects, page 10

• Configuring and Preparing the Publication Adapter Instance, page 12

• Configuring and Preparing the Subscription Adapter Instance, page 22

• Adding Child Table Mappings, page 29

• Changing the Subject Name, page 30

Creating the Tables and Projects

Before starting the example setup, you need to finish the following tasks:

• Task A, Create the Tables, page 10

• Task B, Create a Project, page 11

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\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 Tue Apr 2 09:31:50 2013

Page 27: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 11

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 the project, complete the following steps:

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

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

3. Click the Browse button beside the Project Directory field, and navigate to the project directory you created, and then click the OK button.

Page 28: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

12 | Chapter 2 Parent-child Exercise

Figure 4 Saving the Project

Configuring and Preparing the Publication Adapter Instance

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

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

• Task B, Add the Publication Service, page 16

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

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

Task A Create the Publication Adapter Instance

To create the Publication Service, complete the following steps:

Page 29: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 13

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

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

— Enter demo2pub in the Instance Name field.

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

— The Write To Database On Save checkbox is checked 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 uncheck the Write To Database On Save checkbox, the publishing table and the related triggers will not be generated automatically.

Page 30: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

14 | Chapter 2 Parent-child Exercise

Figure 6 Configuring in the Design-time Connection Tab

4. Click the Test Connection button 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 the OK button.

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

If you check the Remember Password checkbox, the password will be saved in the project, and the Password field will contain the masked password when you display this tab.

If it is unchecked, the global variable %%adb.password%% will be saved in the project and the Password field will be blank when you redisplay this tab. You need to re-enter the password each time when you connect to the database.

Page 31: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 15

6. Click the Runtime Connection tab

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

— If you uncheck the Use Design-time Connection For Runtime checkbox in the Design-time Connection tab, then you can specify the parameters in the Runtime Connection, and then click the Test Connection... button to verify the parameters you entered are correct.

At runtime, the adapter will use the parameters you specified in the Runtime Connection tab.

After successfully testing the connection, click the Apply button.

Figure 7 Configuring in the Runtime Connection Tab

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

Page 32: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

16 | Chapter 2 Parent-child Exercise

Figure 8 Configuring in the General Tab

8. Select Project > Save from the menu.

Task B Add the Publication Service

To add the Publication Service, complete the following steps:

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

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

Page 33: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 17

Figure 9 Adding the Publication Service

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

If you are using JMS transport type, select JMS from the Transport Type drop-down list, and the fields in the Configuration tab will be changed.

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

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

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

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

Page 34: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

18 | Chapter 2 Parent-child Exercise

Figure 10 Add Table Dialog

3. Select the CUSTOMER item from the Add Table drop-down list, then click the OK button. TIBCO Designer loads schema information for the CUSTOMER table. Click the Apply button.

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 the Apply button.

Page 35: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 19

Figure 11 Configuring 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 in the toolbar. The Add Table dialog appears.

6. Select the ORDER_DETAILS item from the Add Table drop-down list, then click the OK button. 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:

a. In the ORDER_DETAILS CUST_ID entry, check the User Key checkbox, and then click the Join To drop-down list. Select the CUSTOMER.CUST_ID item and click the Apply button.

Page 36: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

20 | Chapter 2 Parent-child Exercise

Figure 12 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, then click the Add Child Table icon in the toolbar. The Add Table dialog appears.

2. Select the INTERNAL_ORDER_ITEMS item from the Add Table drop-down list, then click the OK button. TIBCO Designer loads schema information for this secondary detail table.

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

a. Expand the INTERNAL_ORDER_ITEMS table, then check the User Key checkbox in the INTERNAL_ORDER_ITEMS.ORDER_ID entry.

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

Page 37: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 21

Figure 13 Joining the ORDER_DETAILS Table and the INTERNAL_ORDER_DETAILS Table

4. To add the second secondary table relationship, select the ORDER_DETAILS table, then click the Add Child Table icon in the toolbar. The Add Tables dialog appears.

5. Select EXTERNAL_ORDER_ITEMS from the Add Table drop-down list, 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, then check the User Key checkbox in the EXTERNAL_ORDER_ITEMS.ORDER_ID entry.

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

Page 38: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

22 | Chapter 2 Parent-child Exercise

Figure 14 Joining the ORDER_DETAILS Table and the EXTERNAL_ORDER_ITEMS Table

7. Click the Apply button, then select Project > Save from the menu.

Configuring and Preparing the Subscription Adapter Instance

The publication instance and service of the example is 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 the Subscription Service, page 24

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

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

Page 39: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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, then drag the ActiveDatabase Adapter Configuration icon from the Palettes panel to the Design panel. Click the OK button in the confirmation message dialog that is displayed.

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

— Enter demo2sub in the Instance Name field.

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

— Check the Write To Database On Save checkbox. This default option writes configuration information to the database when you save the project in TIBCO Designer.

Figure 15 Creating a Subscription Adapter Instance

If you uncheck the Write To Database On Save checkbox, the publishing table and the related triggers will not be generated automatically.

Page 40: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

24 | Chapter 2 Parent-child Exercise

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.

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

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

6. Click the Runtime Connection tab

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

— If you uncheck the Use Design-time Connection For Runtime checkbox in the Design-time Connection tab, then you can specify the parameters in the Runtime Connection, and then click the Test Connection... button to verify the parameters you entered are correct.

At runtime, the adapter will use the parameters you specified in the Runtime Connection tab.

After successfully testing the connection, click the Apply button.

7. Click the General tab, and type demo2sub.stop in the Termination Subject Or Topic field. Click the Apply button, then select Project > Save from the menu.

Task B Add the Subscription Service

To add the 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.

If you check the Remember Password checkbox, the password will be saved in the project, and the Password field will contain the masked password when you display this tab.

If it is unchecked, the global variable %%adb.password%% will be saved in the project and the Password field will be blank when you redisplay this tab. You need to re-enter the password each time when you connect to the database.

Page 41: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 25

Figure 16 Adding an Subscription Service

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 in the Transport Type drop-down list, and the fields in the Configuration tab will be changed.

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

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

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

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

3. Select the SUB_CUSTOMER item from the Add Table drop-down list, then click the OK button. TIBCO Designer loads schema information for this destination table.

4. Expand the SUB_CUSTOMER table, then click the Add Child Table icon in the toolbar.

Page 42: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

26 | Chapter 2 Parent-child Exercise

5. Select SUB_ORDER_DETAILS from the Add Table drop-down list, then click the OK button. 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.CUST_ID entry, check the User Key checkbox, and then click the Join To drop-down list and select SUB_CUSTOMER.CUST_ID, then click the Apply button.

Figure 17 Joining the SUB_CUSTOMER Table and the SUB_ORDER_DETAILS Table

When setting a relationship on the subscription side, the columns to index must match the columns indexed in the corresponding child table on the publication side.

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

Page 43: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 27

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, then click the Add Child Table icon in the toolbar. The Add Tables dialog is displayed.

2. Select the SUB_INTERNAL_ORDER_ITEMS item from the Add Table drop-down list, then click the OK button. 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. Check the User Key checkbox in the SUB_INTERNAL_ORDER_ITEMS.ORDER_ID entry. Next, click the Join To drop-down list and select SUB_ORDER_DETAILS.ORDER_ID.

Figure 18 Joining theSUB_ORDER_DETAILS Table and the SUB_INTERNAL_ORDER_ITEMS Table

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

Page 44: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

28 | Chapter 2 Parent-child Exercise

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

6. Select the SUB_EXTERNAL_ORDER_ITEMS item from the Add Table drop-down list, then click the OK button. TIBCO Designer loads schema information for this secondary detail table.

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

Figure 19 Joining the SUB_ORDER_DETAILS Table and the SUB_EXTERNAL_ORDER_ITEMS Table

8. Click the Apply button, then select Project > Save from the menu.

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

Page 45: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 29

Adding Child Table Mappings

This task adds a child table mapping for the relationship between the publishing and subscribing side. Child tables between a publisher and 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 need to perform this task.

1. Click the Child Table Mappings tab.

2. Click the Publisher Child Table Name column and enter the following data, then click the Apply button:

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.

Figure 20 Adding Child Table Mappings Between the Publisher and Subscriber Table

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

Page 46: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

30 | Chapter 2 Parent-child Exercise

This defines an exception table for use with this subscription. If an error occurs when inserting, updating or deleting data, the data will be inserted into this exception table.

4. Click the Apply button.

Changing the Subject Name

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

1. Click the Advanced tab. Do not change the default subject name. Copy the %%Domain%%.%%Deployment%%.adb.demo2sub.ADBSubscriber from 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 the Apply button, then select Project > Save from the menu.

Example TestYou are now ready to test the example you have configured. To do so, you need to 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 need to 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\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. Select Tools > Show Adapter Tester from the menu.

Page 47: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 31

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

3. Click the Console tab, then click the Start button. The service is started when the message highlighted in Figure 21 is displayed.

Figure 21 Starting the Subscription Service

4. Repeat step 2 to step 3 to start the Publication Service. See the message hilighted in Figure 22.

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

Page 48: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

32 | Chapter 2 Parent-child Exercise

Figure 22 Starting the 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------------------------ADDRESS

Page 49: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with TIBCO Designer | 33

------------------------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 V0011000 PRPL 5 V002

Page 50: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

34 | Chapter 2 Parent-child Exercise

1001 PRPAP 10 V0011001 PRPL 5 V002

Example CleanupThe cleanup script removes only the example tables that were created when the demo2_ora.sql script was run.

To clean up the example, perform the following steps:

1. Change directory to the operation directory:

> cd TIB_ADADB_HOME\demo\demo2

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

> sqlplus userid/pswd@dbService @demo2_cleanup_ora.sql

Page 51: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with Command Line | 35

Working Through the Example with Command Line

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

• Example Setup, page 10

• Example Test, page 30

• Expected Results, page 32

• Example Clean Up

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 for the Publication Service and Subscription Service, page 38

Creating the Tables

Before starting the example setup, you need to finish the following tasks:

• Task A, Create the Source Table, page 35

• Task B, Create the Publishing Table and Triggers, 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\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

Page 52: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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 Triggers

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 triggers 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

Page 53: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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 need 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:

Page 54: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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 for the Publication Service and Subscription Service

Before testing the example, you need to modify the TRA files for the Publication Service and the 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.0\demo\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 tables in Task B.

Page 55: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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.0\demo\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 need 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\demo2\demo2sub.tra

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

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

Page 56: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

40 | Chapter 2 Parent-child Exercise

Figure 23 Starting the 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\demo2\demo2pub.tra

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

Figure 24 Starting the Publication Service Using the Command Line

Page 57: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Working Through the Example with Command Line | 41

Expected ResultsBefore checking the example results, you need to stop the Subscription and Publication Services first, 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 when the demo2_databasevendor.sql script was run.

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

Page 58: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

42 | Chapter 2 Parent-child Exercise

Page 59: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

| 43

Chapter 3 Request-Response Service Examples

This chapter provides three exercises to demonstrate how to use the adapter’s 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

Page 60: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

44 | Chapter 3 Request-Response Service Examples

Example Description

This exercise contains three samples:

• RPC standard operation

This exercise demonstrates 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 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 was started.

Required Platforms and SoftwareThese three examples can be performed on Microsoft Windows or UNIX. It 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 need the following information to specify your user environment:

• Database user ID

• Database password

• Database service

Page 61: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Description | 45

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

Page 62: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

46 | Chapter 3 Request-Response Service Examples

Example Setup

To set up the example, you must run an 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\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 the OK button.

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

4. In the Import-Options dialog, select the Replace Existing Global Variables With Those In Import and Overwrite On Name Conflict radio buttons, then click the Apply button.

Page 63: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Setup | 47

All processes are listed in the section highlighted by the blue rectangle in Figure 25.

Figure 25 Importing the Request-Response Sample

Page 64: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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

Send 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

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

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

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

[4] Execute Batch of SQL Statements

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

[5] Execute SQL Stmt with Bind Variables

Send 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, then you need to enter the values in the POSITION field and the DATA field.

The POSITION value depends on the number of the question mark (?) in the above SQL statement. If more than one question marks exist in the SQL statement, you need to duplicate the item by right clicking item > Statement > Duplicate. See Figure 26.

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 adpater instance for processing.

Page 65: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Setup | 49

[6] Execute procedure SetDescription_input

Execute 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

Execute 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

Execute 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

Send 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

Page 66: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

50 | Chapter 3 Request-Response Service Examples

Figure 26 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, then click the Browse button beside the Working Directory field to select a directory to store the temporary files. Click the Apply button. Click the Start button. 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 27 is displayed.

Before starting the adapter, you need to change the value of JDBC URL, User Name, and Password in the Design-time Connection tab for the Publication and Subscription Services to be the same as those you created the demo tables.

Page 67: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Setup | 51

Figure 27 Starting the Adapter

Page 68: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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 the 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 by the blue rectangle in Figure 28.

Figure 28 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.

Page 69: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Test | 53

3. Click the Tester panel, then click the Start Testing Viewed Process icon . The Select Processes To Load dialog is displayed.

Figure 29 Select Processes to Load Dialog

4. Check the RV_[1]INSERT INTO OPERATION_ORDER(current) checkbox, then click the Load Selected button. The process is now in test mode. When the process executes, you will find the black arrows that point to each activity have turned green.

5. In the Adapter Tester dialog, you can see the process status is Success that means the information is inserted into the OPERATION_ORDER table without problems. See the section highlighted by the blue rectangle in Figure 30.

Page 70: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

54 | Chapter 3 Request-Response Service Examples

Figure 30 RV_[1]INSERT INTO OPERATION_ORDER Process Result

6. Click the Stop Testing button to return to design mode.

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

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 by the blue rectangle in Figure 31.

Page 71: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Test | 55

Figure 31 Information That Will be Input to the OPERATION_ORDER Table

3. Click the Tester panel, then click the Start Testing Viewed Process icon . The Select Processes To Load window is displayed.

4. Check the RV_[6]Execute procedure SetDescription_input(current) checkbox, then click the Load Selected button. The process is now in test mode. When the process executes, you will find the black arrows that point to each activity have turned green.

5. In the Adapter Tester dialog, you can see the process status is Success, this means the information is input and written into the OPERATION_ORDER table without problems. See the section highlighted by the blue rectangle in Figure 32.

Page 72: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

56 | Chapter 3 Request-Response Service Examples

Figure 32 RV_[6]Execute Procedure SetDescription_input Process Result

6. Click the Stop button to return to design mode.

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

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

1. In the Project panel, select RV_[10]Request_Reply SELECT FROM OPERATION_ORDER item.

2. In the Configuration tab, check the RequestReply checkbox, and then click the Browse button beside the Request AE Schema field and the Reply AE Schema field to add the appropriate schemas. Click the Apply button. See Figure 33.

Click the Input tab, the information that will be sent to the adapter is in the field highlighted by the blue rectangle in Figure 34.

Page 73: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Test | 57

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

Page 74: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

58 | Chapter 3 Request-Response Service Examples

Figure 34 Information That Will be Sent to the Adapter

3. Click the Tester panel, then click the Start Testing Viewed Process icon . The Select Processes To Load window is displayed.

4. Check the RV_[10]Reqest_Reply SELECT FROM OPERATION_ORDER(current) checkbox, then click the Load Selected button. The process is now in test mode. When the process executes, you will find the black arrows that point to each activity have turned green.

5. In the Adapter Tester dialog, you can see the process status is Success, this means the information is sent to the adapter and all rows are returned from the OPERATION_ORDER table without problems. See the section highlighted by the blue rectangle in Figure 35.

Page 75: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Test | 59

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

6. Click the Stop Testing button to return to design mode.

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

Page 76: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

60 | Chapter 3 Request-Response Service Examples

Example Cleanup

The cleanup script removes only the example tables that were created when the operation_ora.sql script was run.

To clean up the example, perform the following steps:

1. Change directory to the operation directory:

> cd TIB_ADADB_HOME\demo\operation

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

> sqlplus userid/pswd@dbService @operation_cleanup_ora.sql

Page 77: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

| 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 69

• Example Cleanup, page 70

Page 78: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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

Example Description

This example shows how the adapter’s Publication, Subscription and Request-Response services 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 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 the adapter’s Subscription service will delete the invalid sales item.

The following BusinessWorks activities are used in the example:

• Subscribe to New Sales Order

The activity receives a message containing a new sales order from the adapter's Publication service.

• Insert New Sales Order

The activity uses the adapter's Subscription service to insert the new sales order into the database.

• Adjust Sales Order Priority

The activity invokes the ADJUSTPRIORITY operation of the adapter's Request-Response service to adjust the priority of the sales order.

• Update Sales Order Priority

The activity uses the adapter's 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 the adapter's Request-Response service to validate each sale order item. The second activity use the adapter's Subscription service to delete the invalid sales order items from the database.

Page 79: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Setup | 63

Example Setup

To set up the example, you must run an 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. Setup the database by running an SQL script using the database account used by the adapter. In a command window:

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, then click the New Empty Project button. The Save Project dialog is displayed.

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

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

d. In the Import-Options dialog, select the Replace Existing Global Variables With Those In Import and Overwrite On Name Conflict radio buttons. Then click the Apply button.

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 the Test Connection button to verify the connection.

g. Select Project > Save from the menu.

Page 80: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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

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.

> cd TIBCO_HOME\ems\bin

2. Start the JMS server. For example: tibemsd

Page 81: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Test | 65

Example Test

To run the example, you first start the adapter using the TIBCO Designer Adapter Tester, then step 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, then click the Start button. If you are using the JMS transport, click the jmsSalesOrderDemo item.

c. Click the Console tab to view adapter messages.

2. In the Palettes 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 the Select All button, then click the OK button.

Breakpoints allow you to step through the process. Stepping helps you to see what happens when each activity is executed.

Page 82: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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

Figure 36 Setting BreakPoints for Rv Sales Order Demo Process

5. Click the Tester panel, then click the Start Testing Viewed Process icon . The Select Processes To Load window is displayed.

6. Check the Rv Sales Order Demo(current) checkbox, then click the Load Selected button. The process is now in test mode.

7. In a command window, 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 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

Page 83: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Example Test | 67

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 step through the process.

Figure 37 Testing the Sales Order Example

9. Click the Stop Testing button to return to design mode.

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

Page 84: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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

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

Page 85: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

Expected Results | 69

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

Page 86: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

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

Example Cleanup

The cleanup script removes the example tables that were created when the SalesOrder_database_vendor.sql script was run.

1. Change directory to the salesOrder directory.

> cd TIB_ADADB_HOME\demo\salesorder

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

> sqlplus userid/pswd@dbService @deleteSalesOrder_ora.sql

3. Clean up the database objects.

> sqlplus userid/pswd@dbService @salesorder_cleanup_ora.sql

Page 87: TIBCO ActiveMatrix Adapter for Database Examples · PDF fileTIBCO ActiveMatrix ® Adapter for Database Examples Software Release 7.0 July 2013 ... This product provides the licensed

TIBCO ActiveMatrix Adapter for Database Examples

| 71

Index

C

commandssqlplus 10, 34, 35, 36, 37, 41, 60, 70

customer support xv

E

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

P

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

line 35working through the example with TIBCO

Designer 10

R

relationshipssecondary level 7top level 7

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 70example description 62example setup 63expected results 69

TIBCO_HOME xii

W

working with DAT files in TIBCO Designer 3


Recommended