corsotibco parte7 pag 95 138
TRANSCRIPT
TIBCO Softv,are Inc
Unit .l: TIBCO Enterprise Message Sen^ice (EMS)
An EMS Server can be configurcd as a Rendezvous or TIBCOSmartSockets client. For example, you can publish XMLmessases fiom an EMS client to a RV subscriber and do directnlessage-to-message routing or use BW to transform and route the
messages.
E,MS can intcgrate with third-party J2EE application scrvers (such
as JBoss, WebSphere. Weblogic, etc.) to exchangernessage-driven and entcrprise-driven Java beans. [t also supportsintegration with LDAP and 3rd party naming scrvices (JNDI).
Page 95
M - B W I : T I B C O B us iness l4'orksÎM 5. 4 I nte s rat io rt
BWp lmplementation: Process Batch Order
M-S 94rf ; FJFSS 8*sfn*ss Hlcràs rtr 5.4 fnfeora$*n
DTIBCOlhe Power of Now"
BWP lmplementation: ProcessBatch Order
In the lab that tbliows you implement the ProcessBatchOrdercomponent of the BWP solution.
Page 96 TIBCO Educarion Programs
Process Order Service(rer.(ryl) <:::::::ff
Process Batch Orderlmplementation
Unit 3: TIBCO Enterprise Message Sen,ice (EMS)
Page 97TIBCO Sofrware Inc.
M - B W I : T I B C O B us i ness lvorks r'ìvr 5. 4 I n te s ra t io n
Process Batch Order Definition
Page 98
Process Batch Order is started by a JMS subscriber that is listeningfbr batch orders. The incoming Purchase Order is parsed (using ageneric PO schema) and passed on Í"o Process Order. For errorhandling the parsing and reading ofthe purchase order is grouped andconditionally transitioned.
TI BCO Education Programs
. Receive and log orders
. Use Group activity for error handling
. Calls Process Order for processino
Unit 3: TIBCO Enterprise Message Sen,ice (EMS)
. Use "Log" activity to keep an audit trail. Save for business critical functions. Records visible in Administrator
. Error transitions directlv from activities
. All activities declare formalerror types in Errorlab
. Window > Show Console. Provides detailed log info during development
* Don't have to be in debug mode
. BW Engine has suspend / resume capability. For handling retry logic* Typically on resource timeouts
. Set during deployment configuration
Dùnfiguraliqn lnput outpul: Eri0rOutput
; H tutrvrtyErors
;;S FiIENùlFo rndÉr|eplion I
;iHffiElWffiBr g rtn:u0Fone0En(0ùrnqE{teptro1
+ 3 ftlPlutvaeolton
Logging and Error Handling BestPractices
TIBCO Software Inc
Exception handling is a findamental aspect of BW pro.ject
development. There are three primary ways to handle errors:
r Error transitions directly tiom process activities, which is similarto handling an error fiom a function call
I Croup a set of activities and error transition tiom the group, whichis similar to a try-catch block
r Enable BW's suspend / resumc capability tbr setting up activil.yretries (this feature will be elaborated on in more detail in the"Deployment" section that fbllows in this unit).
Note that most projects will use a combination of each of these errorhandling methods to optimize exception handling across the project.
Page 99
M - BW I : T I B C O B us iner5 l'/61'ft 5rìvr 5. 4 I nt e g rat b n
Sequence Diagram Process BatchOrder
Page 100 'l- I R CO Education P ro g ram s
Lab lmplementation
Unit 3: TIBCO Enterprise Message Senice (EMS)
Page l0lTIBCO Sofnvare Inc
' Develop Process Satch Order
' Test and Debuo process Batch Order
M - BW I : T I B C O B us iness Works'rM 5. 4 I nîe e ratio n
Notes
Page 102 TIBCO Education Proprams
Lab B lmplement Process Batch Order
OverviewIn this lab you develop the Process Bqtch Order process definition to submit purchase orders.
Objectivest Design ProcessBatchOrder, page 104
t Test ProcessBatchOrder, page 1 10
t Explore JMS Topics and Queues (Optional), page 113
t Test Your JMS SkilLs (Going Further), page 115
Prerequisitesr EDUSVR instructor server and userXX student client platform
I TIBCO software installed and configured on your userXX machine:
a Runtime Agent (TRA) 5.5.0
t) Administrator 5.4.0 (userXX domain created)
O BusinessWorks 5.4.0
a EMS 4.4.0 (added to the userXX domain)
I Connectivity to the instructor server for:
a Oracle Database and Mercury Email servers
r C:\bwpXX project
r C:\BWEDU lab files
DirectionsComplete the exercises that follow.
Lab B: Implement Process Batch Order
Page 103TIBCO Software Inc.
M-BWI :'I'|BCO Busirtessl,yortsl Nr 5.4 Inteeratiort
Lab B - Exercise 1: DesignProcessBatchOrder
OverviewProcessBatchOtder wlll include a JMS subscriber listening fbr purchase order submissions. Toprocess the purchase order XML fìle, you will parse it using XSD schema and pass the result toProcessorder. Finally, error handling will be implemented in case parsing/reading Iails.
,---: r-L ì ;----------> i
=.'-----------)L-rG t1lReceiw Batch Log Ofder
Ordefw
Log Error
Steps
l. Organize your bwpXX project by creating two new subfblders and proccss detìnitions.
r Create folder /ProcessDefinitions/orderProcess
a In this fblder, add a new process detìnition named ProcessBaÈchorderr Copy the fblder BusinessUnilServices/ExhibitA and paste into BWP.Core/Services
a Rename the copied fblder fiom ExhibitA to OrderProcess
a Navigate to /BWP.Core/Services/OrderProcess/Implementation
- In this fblder, add a new process defìnition named ProcessOrder
- Open ProcessOrder and transition (connect) Start to End:
Page 104
'#i..99!.!....
Note: You will complete the confìguration of this process in a later lab. In the interim,connectins Start to End wlll facilitate testins.
TI BCO Education P rop rams
Inb B: ImpLement Process Batch Order
2. Verity yovî bwpxx project organization.
3. Confìgure and test a JMS Connectior? resource in fblder /BWP.Core/Connections.
Configuration tab:.
a Name: JMS Connectiona User Name: admin
a Password: {blank}Test the JMS Connecfion resource
Note: If you can't connect, start your EMS Server using TIBCO Administrator or the
Windows Services console. .
TIBCO Sofnvare Inc. Page 105
M - BW I : T I B C O B us inessllorks [M 5. 4 I nte p ratio n
4. Review the Purchase Order XSD fbr parsing incoming purchase orders.
Analysis: This schema is a generic purchase order object. It is used by Process
nànrh Ordu to parse in.o*i-ng PO.xml files. For .oou"ni.n.. *e frau! includedthis schema in tire template you used to create your project.
.,..::..:
r In your project select resource /BWP.Core/Schema./PurchaseOrderSchema
r In the details fiame select the root PurchaseOrder element row
r A graphical view of the schema appears:
3 D i ÉlemÈnt ,: ::btdyès From::,':: Qor{bnl ,i::::: eòrterrt mocet ::.r:r',, :,::::AlH . jres
TIBCO Education P roprams
r From the menu bar select Source to view the XML for this schema:
Page 106
ktb B: Intnlemettt Process Batch Order
5. Start Process Batchorder with a JMS Queue Receiver activity.
t Configuration Í.ab:
a Name: Receive Batsch Ordera JMS Connection: /BWP.Core/Connections/JMS Connection
a Destination Queue: %%bwp/host,.Name%%. PurchaseOrder. BatchNote: Prepend the host.Name global variable to the queue name to make it unique. Atruntime the entire string becomes the queue name USERXX.PurchaseOrder.Batch.
I Leave all other settings as detault and click Apply
Analysis: This queue does not yet exist in the EMS Server. tt will be createddynamically when you send a message to this queue. In other words, EMSsupports the creation of dynamic destinations (queue and topic names).
6. Log the receipt of incoming JMS batch orders by configuring a Write to Log activity.
t Configuration tabl
a Nanre: Log OrderI Transition Receive Batch Order to Log Order. Input tab:
a Construct a message that logs the incoming purchase order:
concat(rrProcessing .IMS baÈch order file: ",$Rece iwe - Batch - Order/Activi tyoutpuÈ,/aody )
7. Read the incoming purchase order XML fìle by configuring a Read File activity.
t ConfÌguration fabi
a Name: Read Po Filer Transition Log Order to Read PO File
t Input tab, map:
a fileName: $Rece iwe - Batch - Orde r,/ac uivi tyouÈpu t,/Body
TIBCO Sofnware Inc. Page 107
M - BW I : T I B C O B us ine s sWo rks't M 5. 4 I nte R ratio n
8. Configure a Parse XML activity t0 parse the purchase order XML tile.
Configuration tab:
a Name: Paree PO xML
a Input Style: text
a Validate Output: checked
Output Editor tab, configure the schema to parse purchase orders:
- Content: XML Element Reference
- Schema: /BWP.Core/Schema,/PurchaseOrderSchema
- Element: PurchaseOrder
Transition Read PO File to Parse PO XMLInput tab, map:
a xmlString: $Read - PO - Fí 1e,/Read.à,c t,ivi tyOuÈputText,Cl as e /f i I eCont,ent / texÈContenÈ
tI
9. Group the XML reading and parsing activities.
Analvsis: In order for the file to be parsed it must first be read. Since these twoactiv-iúes are dependent on each other, grouping them will enable you to capturethe èrror íf éither fails.
Page 108
r Select the Read PO File and Parse PO XML activities (use the <Ctrl> key)
r Group these two selected activities by clicking the "Create a group" icon on the tool bar
t Configuration tab:
a GroupName: PO Filea Group Action: None
I Transition Parse PO XML to PO File group end
T I B C O Education P ro grams
Inb B: lmplement Process Batch Order
10. On successful reading and parsing of the purchase order, invoke Processorder.
r From Lhe project tree, drag and drop the ProcessOrder icon tofhe ProcessBatchorderdesign panel
I Transition fiom PO File group end to ProcessOrder to End
Note: You will return to map the Input to this call process activity afier detiningProcessOrder in the next lab.
I L Log the crror if parsing the purchase order fails by configuring a Write to Log activity,
t Configuration tab:
a Name: Logl ErrorI Transitions:
a PO File group end to Log Error
- Condition Type: Errora Log Error to End
. Input tab:
a Build a message that logs the purchase order fìle name and the error:
concat(trFailed Èo process PO file <',,$Receive-Batch-Order,/ectivityOutsput,/Body, r'>: ",$_error/ErrorRepo r E / Nlsg, $_e rror,/ErrorReport / S tackTrac e )
12. Verify the design of your completed ProcessBatchorder definition.
r-- 3 l--l-]"--r i=7-,Lr!€ Y)
Receiw Balch Log OrderOrder
e3
Log Error
Read PO File Parse Po xML
TIBCO Software lrtc. Page 109
M-BWI: TIBCO BusinessWorkstM 5.4 Intecration
Lab B - Exercise 2: TestProcessBatchOrder
Overview
E,ven though you have not implemented ProcessOrder, at this point you can still perfbrm a
worthwhile test of Proces sBatchOrder.
Steps
l. Compile the tibjmsQueueSender sample client program so that you can use it to submitpurchase orders and test ProcessBatchOrder.
r Open a command prompt window and change directory (cd) to the following directory:
C : \ >cd C: \tibco\rr"rs\samples\ j avaI Issue command dír to view the sample clients provided:
C : \tlbco\EMS\ samples \ j ava>dirr Issue command setup.bat to set the CLASSPATH:
C : \t.lbco\EMS\ samples \ j ava>setupI Issue command j awac to compile the sample client programs:
C : \tibco\EMS\samples\java>javac *. javaNote: If you do not receive any errors the code compiled successfilly. If you have an error,verify that your system's JDK is referenced in your System Path and you ran setup.bat.
2. Run the tibjmsQueueSender program and submit a JMS queue message.
I Using the same command prompt, change directory to C:\BWEDU\BatchOrder\
C : \tibco\EMS\ samples \ j ava>cd C : \BweDu\BatchOrder\r Issue command jmsTrigger.bat to publish a message using the tibjmsQueueSender clienÍ.
C : \BWEDU\ BatchOrder> j msTriggerI Verify the fbllowing acknowledgements you should receive on success:
Publishing into queue:'USERXX.PurchaseOrder.Bat.ch'Sent message : C: \BWEDU\BatchOrder\Batchorderol.xmlrr^^^-^^ L-^ L^-^*- ^--..:en sent
Page ll0 TI BCO Education Programs
Lrb B; lmlrlemcnt Proccss Btrtclt Order
3. Launch TIBCO Administrator and verify that the queue was dynamically created and the
message is pending receipt.
In Administrator navi-9ate to Application Managemen.t > All Service Instances
Click the userXX - EMS 7222 hyperlink
In fhe General tab choose Queues fiom the drop-down menu:
a You should see the queue USERXX. Purchaseorder.Batch has one pending message:
I
I
I
To do this: Alternativelv vou can use the EMS Admin utilitv to verifv that the
queue was dynamically created and the message is pending receipt:
r Start > Programs > TIBCO > TIBCO EMS 4.4.0 > Start EMSAdministration Tool
I To connect to the server, issue command connectI To login.to the server, press <Ente> twice (user admin with no
password)
r To view the queue and pending message, issue command show queues
a You should queue USERXX.PurchaseOrder.Batch with 1 message
'llBCO Software Inc Page lll
M - BW I : T I B C O B us iness [4/orks |Nr 5.4 I nte I rat io tl
4. Using Designer, validate and test ProcessBatchorder.
Validate your project and debug any errors (ignore any ttnassociated ercors)
Righrclick activity Receive Batch Order and select Set BreakPoint After (or Shifi+F8)
Load only ProcessBatchOrder into the Tester (Clear All flrst, then select it)
Expected results:
a The process should connect to the JMS Server and receive the message off the queue,
read and parse the purchase order, send it to ProcessOrder for processing and complete
Note: At the breakpoint, select the Job in the stack and click Resume testing.
T
I
T
I
*%--réftú6èù8
I 6nd
t-- I) +!lJ:11
5. Test the error handling you have implemented for ProcessBatchOrder.
Analysís: There are different versions of BatchOrderXX.xml files (01 to 05, 09)to submit different types of purchase orders: "Ready," "Back Order" and error.
Using a text editor open tìle C:\BWEDlABatchOrder\jmsTrigger.bat
At the end of the line, change the file being ref'erenced to BatchOrder09.xml
Submit another batch order and verifv the exoected result:
a This test instance should fail at the Parse PO XML activity (due to a validation error)and take the Error transition: you can verify this by inspecting the Output tab of the
Parse PO XML activity (the namespace in this PO fìle does not match the XSD)
I When you are done testing, restore the jmsTrigger.bat file to its original state(BatchOrder0l.xml) so that subsequent orders are valid
Page l12 TI BCO Education Proprams
I
I
I
r:a!::èE Ea_*ó-l=,1+
ktb B: Implement Process Batch Order
Lab B - Exercise 3: Explore JMSTopics and Queues (Optional)
OverviewIn this exercisc you explore JMS communications by running two pair of JMS clients: one pair that
exchanges topic messages and another pair that exchange queue messages.
Steps
l. Run the topic publisher.
I Using a command prompt, issue the fbllowin-g commands:
c : \ t ibco\elus\ samples \ j ava>setupC : \ t ibco\EMS\ sampl-es \ j ava> j ava tib jmsTopicPublisher - tsopicsample "Ttris ís a Topic Èest message"
o Verify the fbllowing acknowledgements you should receive on success:
Publishing on topic 'sample'Published message: This is a Topic test message
2. Run the tooic subscriber.
r Using a second command prompt, issue the fbllowing commands:
C : \ tibco\EMS\ samples \ j ava >6eÈup
C : \ t ibco\EMS \ sampl e s \ j ava > j ava tib j msTopicSubscriber-topic sample
a Verify the following acknowledgement you should receive on success:
Subscrj-brng t.o topic: sample
Analysìs: Because the subscriber was not active when the message was sent, itdoes not receive the message. This is the default behavior for topic destinations.In order for a topic .onru*", to receive a message sent when it is inactive, the
topic destination must configured tobe durable.
TIBCO Sofrware In.c. Page l13
M-BWI: TIBCO BusinessWorkstM 5.4 Inteeration
3. With the subscriber listening on the "sample" topic, publish another message.
r From the first command prompt, use the <up arrow> key once to publish another message:
C : \tibco\EMS\samples\j ava>j ava ÈibjmsTopicPublisher -Èopicsample "Thís is a Topic ÈesÈ messagerl
a This time the subscriber should receive the messase since it is active at the time themessage is sent
4. Communicate using JMS queues.
r From the tìst command prompt, issue the following command:
C : \tibco\EMS\samples\ j ava>j ava tíbjmseueueSender -queuesample rrThís is a Queue Eest messagfe'r
Publishing into queue: 'sample'Sent. message: This is a test Queue message
r In the same command prompt window, issue the following command:
C : \tibco\EMS\samples\j ava>j ava ÈibjmseueueReceiwer -queuesamplea Your queue client should receive the message
Analysis:Unlike the default behavior of topic a.*inu,ionr, queues do not haveactive/inactive restrictions on their consumers. This is because a queue can onlvhave one consumer, whereas a topic can have multiole.. lturttPtL.
Page l14 TIBCO Education Programs
Lab B: Implemenî Process Batch Order
Lab B - Exercise 4: Test Your JMSSkills (Going Further)
OverviewYour instructor will review the key concepts presented in this program thus far and answer anyquestions you may have related to web services, enterprise messaging or the other topics covered.
As part of this review you are challenged to design and test a new business process as describedbelow. The instructions are intentionally vague. The purpose is to assess how well you can applysome of the knowledge and practices you have been exposed to in the message unit and lab.
GuidelinesCreate a new BusinessWorks project and design a business process that:
r Receives a JMS topic message and
r Sends the data to a JMS Queue
For testing purposes:
r Use tibjmsTopícPublisher.java to send the message to the process
r Use tibjmsQueueReceiver.java to receive the message from the process
TIBCO Softvvare Inc. Page l15
M - BW I : T I B CO B us ine s sWo r ks'I'M 5.4 I nte p ratio n
Notes
Page lÌ6 TIBCO Education Pro grams
Unit 4 TIBCO Adapter Seruices
Unit 4: TIBCO Adapter Services
This unit introduces you to TIBCO Adapter services with a focus onTIBCO Adapter for ActiveDatabase (ADB). The main features of thisadapter are presented, along with example implementations. The
ADB components are also presented.
In the lab fbllowing this unit you will use ADB in your BWP solutionto create an adapter service to store orders in the database.
t Objectives, page 118
t What Is aTIBCO Adapter?, page I l9
o TIBCO Adapters, page 120
o TIBCO Adapter Features, page I2l
o BW Adapter Services, page I22
o Adapter Service Options, page 123
t TIBCO Adapterfor ActiveDatabase, page 124
o ADB Publication Service, page 125
o ADB Subscription Service, page 127
o ADB Request / Reply Service, page 128
o Example ADB Implementation, page 130
o BWP Implementation: Sales Order Adapter Service, page l3l
t BWP Implementation: Sales Order Adapter Service, page l3 I
o Sales Order Adapter Service Implementation, page 132
o Sales Order Subscription Operation, page 133
o Sales Order Adapter Service Sequence Diagram, page 134
. lnb Implementation, page 135
r Lab C Implement Sales Order Adapter Service, page 137
Page l17
Topics
TIBCO Software Inc.
M-BWI: TIBCO BusinessWorks'tM 5.4 Intesration
Objectives
Page 1 l8
The goal of this unit is to prepare you for implementing a BWAdapter Service using the ADB Adapter. To that end afier completingthis unit you will be able to:
r Describe TIBCO Adapter fbr ActiveDatabase (ADB) componenrsand explain the two types of services ADB provides fbrBusinessWorks projects
I Examine the adapter service features of BusinessWorks in generaland in context of the ADB adapter service you will implement as
part of the Order Processing integration project
r Proceed with creating your Order Processing project andorganizing its workspace and configuring an ADB subscriptionservice
TI BCO Education P ro prams
. Knowledge, Explain BW adapier services, advantages, options. Describe the various types of TIBCO Adapters. ldentify adapter service testing requirements. Describe TIBCO Adapter for ActiveDatabase functionality. Be prepared {o implement a BW adapter service
' Skills. Configure BW adapter service instance. Configure ADB subscriber operalion. Verify transporl detaiis and know options
Unit 4: TIBCO Adapter Services
Gateway between application and TIBCO messaging
Messaging options. RV orJMS
What ls a TIBCO Adapter?
TIBCO Software Inc
A TIBCO Adapter provides a gateway between the application to be
"adapted" and the TIBCO messaging infiastructure. The adaptermodels the methods or operations supported by the target applicationand the capture of external events for integration purposes.
TIBCO Adapters rely on messaging and support either RV or JMS.
Page I l9
M - BW I : T I B C O B tts ines.r Worksr'ùr 5.4 I nt e s. rút io u
TIBCO Adapters
Page 120
TIBCO BusinessWorks supports several leading technology and
application adapters provided by TIBCO, including: ActiveDatabase,Files, SAP/R3, Siebel, PeopleSofÌ and Oracle Financials.
All of these adapters have the same basic characteristics and
finctionality and their services are easily configurable using TIBCOBusinessWorks.
T I B C O Educatio n P ro gram s
Applicationr Adente r for PpnnleSoft
' Adapter for SAP R/3
' Adapter for Siebel. and many more...
. TechnologV. Adapter for ActiveDatabase. Adapter for Files. Adapter for LDAP. and many more...
Unit 4: TIBCO Adapter Servrces
. All adapters built atop TIBCO Adapter SDK 5. API for custom adaoters
. 5.1.0+ TIBCO Adapters. Comoliant with BW 5.1.2+
. 4.1.x+ TIBCO Adapters are BW 5 compliant. Can specify adapter version at design time
TIBCO Adapter Features
TIBCO Sofware Inc.
All TIBCO Adapters are built using the TIBCO Adapter SDK,meaning all TIBCO Adapters have the same basic characteristics andfunctionality.
Both ofÈthe-shelf and custom (SDK) TIBCO 4. l.x adaDters and
greater are fully compliant with BW 5.x.
For TIBCO 4.1.x adapter used with BW 5, you can specify the
adapter version when confìguring the adapter service.
Page 12l
M - B W I : T I B C O B us in e.rs Work.t I rvr 5. 4 I n t e c rclti o rr
BW Adapter Services
Page Ì22
With BusinessWorks adapters are inte_gratcd as a service. A BWadapter service contains both the metadata and the transport fbrrunning the service. This greatly simplifìes the adapter inte_qrationprocess and speeds developn.rent.
TIBCO Educatior't P ro grams
lmplemented in Designer using adapter-specific palettes,resources, schema. Each adapter has it own unique BW palette
l/QSeriP i Adapter Prtrlil
Unir 4: TIBCO Adapter Sen,ices
Pub / Sub. One to many
. Request / Reply. One to one
Transport. JMS or RV
. Format. XML. RV formats
Adapter Service Options
TIBCO Sofnuare Inc.
BW adapter services provide three basic types ofinteraction, publish,subscribe and request/reply. For the transport you can use either RVor JMS and fbr the format you can use the TIBCO ActiveEnterprisefbrmat (AE), XML or JMS formats.
Page I2-7
M-BWI: TIBCO BusinessWorfts]M 5.4 IntegrcLtion
TIBCO Adapter for ActiveDatabase
Page 124
TIBCO Adapter fbr ActiveDatabase (ADB) is a bi-directionalgateway between an RDBMS database (Oracle, Sybase, MS SQLServer) and the TIBCO Enterprise Service Bus, the standardizedmode of communication between TIBCO applications.
ADB uses ODBC calls to communicare with the database. ADBenables data fiom the database to be available in real-time. As soon as
database data is updated, the same data is also sent out as a messageon the Bus via ADB. The message is received in real-time by anyapplication that needs it. The message is sent in an XML format thatapplications connected to the Bus recognize and process. Thissimplifies business operations, because you no longer have to rely onday-end batch processing to move data.
T I B C O Education P ro gram s
. Gateway between RDBMS and TIBCO
. Makes data available in near real time
Unit 4: TIBCO Adaprer Servtces
Triggers insefi data in publication table. Polls publication table and sends message
Advantages. Reduces load on main table. Customizable polling interval
ADB Publication Service
TIBCO Sofnuare Ittc.
You can confì,9ure ADB for three dif'ferent types of services:publication, subscription and requeslreply.
A publishing agent has the task of monitoring some table(s) in the
database and publishing messages. When an application updates atable in the database monitored by a publishing agent, the agentextracts data fiom the changed rows in the database tables andpublishes them on appropriate subjects or destinations using the
Enterprise Service Bus (ESB). A publishing agent relies on triggersand publishing tables in a database to do its work.
Page 125
M-BWI: TIBCO BusinessWorksrM 5.4 Intesration
Page 126
The messages are sent via the TRA onto the Bus using a
broadcast/multicast mechanism. Other ESB-enabled applications alsocommunicate in the same way and thus any other ESB-enabledapplication that requires those messages can receive the messages atthe same time, if they are listening on the specific subjects. Messagescan be either in either in basic message format, or in Active Enterprisewire format. The Enterprise Service Bus features offer reliable orguaranteed message delivery, according to the selected adapterconfiguration.
In this example, an ADB publishing agent is polling a database fbrchanges. When a change is detected, the data is pushed onto the TIBby the publishing agent.
The subscribing agent listens on the BUS on specified subject namefor the data from the publisher. On receipt of the data the subscribingasent writes the data to Database B.
TIBCO Education Programs
Unit 4: TIBCO AcLanter Servx:es
Adapter subscribes to destination
' e.9., Topic, Queue
Statement executed on target table
' Message contains insert/update/delete flag. Exception table to log errors
ADB Subscription Service
TIBCO Sofnuare Inc.
The subscribing agent in a similar manner has the task of receivingmessages and updating the database accordingly. This agent listensfbr messages on a specific subject to do its work. An agent can be
either a publishing agent or a subscribing agent or both.
Page 127
M-BWI : TIBCO Busirre.sWorftsrNr 5.4 IrtÍeeration
ADB Request / Reply Service
Page 128
An ADB RequeslReply service is designed to handle ad hoc requests
fiom applications, similar to a clienlserver environment. This serviceis based on the requeslreply mode of communication usingRendezvous.
This allows an application to submit one or rnore SQL Statements fbrexecution on the application's behalf. You can execute storedprocedures with IN parameters, OUT parameters, or both. When the
execution is completed the agent returns one or more result sets, alongwith a result code to the application.
The adapter instance works like an RPC (Remote Procedure Calls)server. It provides a simple means fbr a client application to execute a
single or a batch of SQL Statements against a database.
'[ I B CO Educctt i on P ro s rttm s
Applications make requests. Request = SQL Statement
Requests executed on target table. Output returned as reply
TIBCO Sofiware Inc.
Unit 4: TIBCO Adapter Servrces
In this example, an ADB request / reply agent is serving an order /entry application that wants on-demand access to a database.
The ADB request / reply agent waits for requests from users of the
order / entry system. On receipt of a request, the ADB agent retrieves
the data tiom the database and sends it to the requesting application.
This example implementation shows multiple applicationscommunicating with a single database using the ADB Adapter. In this
case, the adapters help the databases remain in sync with each others
data. This provides a way of replicating data among dissimilardatabases. This is a solution for incompatibilities arising fromdissimilar databases of multiple vendors. This is also an efficientsolution, as the changes are effective in real time.
Note that the applications connected to the databases do notcommunicate with the ADB adapter. This could potentially reduce a
lot of time and effort in customizing the applications.
Page 129
M-BWI : IIBCO BusinessWorks'r'M 5.4 lntepration
Example ADB lmplementation
Page 1 30
The adapter servìce you will implement is an ADB subscriptionservice that waits (subscribes) for completed sales orders and onreceipt writes them to the sales order DB.
TI BCO Education P rograms
Multi-vend0r data replication. Different geographic locations
Urtit 4: TIBCO Adapter Services
BWP lmplementation: Sales Order Adapter Service
J!€-S lil/f: ?-jSCS Sssin*ss l4l*#ls re 5. 4 J*fe*ra fi*n
NTIBCOThe Power of Nowe
BWP lmplementation: Sales OrderAdapter Service
TIBCO Software Inc. Page I3l
M-BWl: TIBCO Busine.rrWorfrsr'rvr 5.4 Inteprcltion
Sales Order Adapter Servicelmplementation
Page I 32 TI BCO Educatiort P ro gram.s
Unit 4: TIBCO Adanter Servrces
Subscribes to processed sales orders. Published to the adapter by the Store Order activity in the
Process Order def inition
lnserls processed orders into the BWP database. SALES_ORDER and ORDER_DETAIL parent-child tables
conf9u,rron rabrè cbrdrabre*apo'.os: chEe(.pronlaÒrèMàpoings, srbsrùeropronr
€* &l ffi m} Sl t?r dtu K4 co,uhna on' Éj sd€.rDsE.,Bd^, BuF.s ro subsùùe
;;hù,[email protected] iiÈ AEro. u.!iiÀ Ji.t J*r1! cRcÉR_ro iùtro : ; tilI c!sro*ER-,ú aa: zi oFoER_caî€ àoùo.r.î : aI sHFr€Nr c^rE àoboàrèr - a! suFrÉN!-LocÀroN .: ZI ror{_ilouNr rs :j ZI DÉLWRY_rÉrroo I lI FtsDtr-rn : :
srno I -K:L +ES-oFOEF 0
Sales Order Subscription Operation
TIBCO Sofrware Inc.
The Publish to Adapter activity named "Store Order" will be the
component that makes use of the ADB adapter service to store sales
orders to the DB. The Store Order activity is part of the Process Orderprocess defìnition that you will implement in the next lab. It is shownhere to illustrate to you how your adapter service will be used in the
BWP integration project.
Pnoo I l?
M - BW | :'l- | BCO B us ines.rWorks r rvr 5.4 I n te e ration
Sales Order Adapter ServiceSequence Diagram
Page 134 TI B CO Education P ro grams
Unit 4: TIBCO Adctpter Services
. Configure the Sa/es úrder Subscription adapter service
Pjoie(l El'l Vre"r ResourLes P;,efles MLn-U9et TDols Wn0ffi HÉtp
Rstr M" , x @ a, f' Resorrcetoo's
+. ErpodreruLJcremaS-- -q. trpol b #l lc"emas-jl 0 dEr!r': f9c'q J
E -l;""';;;;'ì.. S rte-oors
E "t -dF.úilÈ,.,,\,,.,on I c.EaiepmielrEAF
I TrusFd CeÉifrebs
I uu, cm"
- J-
-
| TrusFo CefiÍ(abs );dFllrlrilEl! l ,,r."*'"-- ;
I r,.t",? '. tne*"-,, I restsr )
* Test the adapter service using the Adapter Tester utility
: ì OrdPrProress no:,_l maprerserrcAda(tersóarp. I
"F FAtGt'rr'lF llEf,nnm i wdk'q ùrdry iclternp
Exmdase: OAd3ptÉriFrActreDatabasE 5 2 (adFagpnie
Lab lmplementation
TIBCO Sofnuare Inc.
Complete the lab that fbllows to in'rplemenr the ADB adaprer scrvice.
To test BW adapter services Designer provides an adapter testingutility. To use this utitity the adapter sofiware must be installed on a
machine in the domain and appear in the listing of "InstalledSofiware" visible in Administrator. This is required so rhar the adaptercan be run in test mode.
Page Ì35
M - B W I : T I B C O B us ine s s Wo r ks'I'M 5. 4 I nte p rat io n
Notes
Page 136 TI B CO Education P ro prams
I-ab C: ImpLement Sales Order Adapter Service
Lab C lmplement Sales Order AdapterSeruice
OverviewIn this lab you implement a BusinessWorks Adapter Service using TIBCO AdapterrM fbrActiveDatabase (ADB). This ADB subscription service will be used by the main process definitronProcessorder to store processed purchase orders to the Sales Order database.
Objectivest Configure Sales Order Adapter Service, page 138
t Test SaLes Order Adapter Service, page 141
PrerequisitesI EDUSVR instructor server and userXX student client platform
r TIBCO Sotiware installed and configured on your userXX machine:
a Runtime Agent (TRA) 5.5.0
a Administrator 5.4.0 (userXX domain created)
a BusinessWorks 5.4.0
a EMS 4.4.0 (added to the userXX domain)
a Adapter for ActiveDatabase 5.2.2
r Connectivity to the instructor server for:
a Oracle Database and Mercury Email servers
r C:\bwpXX project filer C:\BWEDU lab files
DirectionsComplete the exercises that follow.
TIBCO Sofnvare lnc Page 137
M - B W I : T I B C O B us irtess Works'r'rvr 5. 4 I nt e p rat io n
Lab C - Exercise 1: Configure SalesOrder Adapter Service
OverviewTo store the processed order, confìgure an ADB Subscriber to listen for messages and, on receipt,write the order infbrmation to the SALES ORDER and ORDER DETAIL tables.
Steps
l. Verify your EMS Server is started and open your bwpXX project using TIBCO Designer.
2. Create a global variable fbr the ODBC data source name (DSN).
r In the GLobaL VariabLes tab, expand the bwp global variable group
r Create a variable named odbc. DSN whose value is eduswrNote: This DSN is created fbr you on the userXX machine. If not and you need assistance,
relèr to Creating ODBC Data Source (DSN), page 320.
3. Conf igure an ActiveDatabase Adapter Configuration object in fblder /AdapterServices.
t Confi.guration tab:
a Instance Name: SalesOrderSubscriptionXX. Apply
r From the menu bar select ActiveDatabase > Connection templates > Oracle
t Desigtt-time Connection tab'.
a JDBC Driver (verify): tibcosof tware j-nc . j dbc . oracle . OracleDrivera JDBCURL: %%bwp/jdbe.uRL%%
a User Name: %%bwp/user.Name%%
a Password: %%bwp/user. Password%%
I Test the connection
t Run-time Connection tab:
A ODBCDSN: %%bwp/odbc.DsN%%
Page 138 TI BCO Educatiort P rograms