You are on page 1of 46

Unit 2: lntroducins TIBCO BusinessWorks

Notes

TIBCO Sofnvare Inc. Pnoe 7\


swDr b' or d t.t ot tDrl1 pg o ) BI J

f Ìt)Utta:^sa f'9 t\.t.s1roAlss'autsng O)Blf :!,+lg-W


Unit 3: Process Desigrt and Testing

Unit 3 Process Design and Testing

This unit introduces you to the TIBCO BusinessWorksTM process


design environment fèaturing TIBCO DesignerrM and
BusinessWorks resource palettes.
Following this unit are some exercises in which you design and test a
series of BW processes.

Topics
t Objectives, page 58
t TIBCO Designer, page 59
t Projects, page 60
t Process Design, page 61

t ActiviQ Configuration, page 63


t XPath Formula Builder, page 64
t TIBCO Query Designer, page 65
t Project Resources, page 66
t Process Testing, page 67

t Project Templates, page 69


t Project GLobal VariabLes, page 70
t Lab Introduction, pageTl

TIBCO Software Inc. Page 57


M-BWE: TIBCO BusinessWortsfrvr 5.4 Essentials

' Knowledge
. Describe development and testing using TIBCO Designer
. Define componènts in BW process definitions
. Explain resources, management and administration capabilities

. Skills
. Create and access projects
. Design and test BW processes
- Configure activities and resources
. Manage BW projects
. Experience version control options for BW projects

Objectives
Atier completing this unit you will know:
r How to navigate the BusinessWorks project development
environment (TIBCO Designer)
I What a BusinessWorks process defìnition comprises
r How to confìgure project activities and services
r How to use shared project resources
r How to incorporate external resources into a BusinessWorks
project
r How to test at design-time your BusinessWorks projects
Additionally, you will be prepared to proceed with Lab A in which
you develop a simple BusinessWorks project.

Page 58 Tl BCO Education Prosrams


IIrtit -J: Process Desí.gn tutd k.sting

lntuitive. palette-based GUI with drag'and-drop funclionality


Posilion in prolect tree changes palettes displayed

TIBCO Designer
TIBCO Designer is an easy-to-use GUI fbr configuring. .lesigning
and testing BusinessWorks pro.jects. As a component of'BW. TIBCO
Designer provides a rich. integrated development environmcnt
including project directory (upper left), pro.ject resources (lower ìeft),
process design (upper right), and activity confìguration (lower right).

Palettes provide easy acccss to proeess activitics. You simply


drag-and-drop resources fiom the palette to the design panel to add
them to your project. Which palette is displayed depends on the object
selected in the project tree. BW palettes contain two types of objects:

r Activities which are used to detìne actions within a Drocess


definition
r Resources which defìne things such as configuration details which
are used (by refèrence) in activities

TIBCO Softwarc lrtc. Pctge 59


M-RWE:'l'IBCO IlusinessWork.rr rr 5.4 Essential.s

. Designer builds integration projects


: {PrOleLIlÈm0lale

. Project contents
: i qdanlEt SeNitel

' ! ìEAP
. Folders for organization t iI sirt rt
t, l''i[fgrn".r,
. Processes 'ì Busrnes: Pracesses
: lr'ler l4ina0emPnl
. Resources
"\)
I ,l ireate ùrtlpr
i. ì starter Proce:ies
. External connections + f- I 5Un PrQtettÈt
' I Transformation Processes
* ,l Ltnitrests
t f tr"ti,lrt rn Pr!.essÈs
. Project storage i
lutntP I
I,lìrrrÉl,:[der
rftel

. Folders and files on disk


Get OrdBr rSlatus

. Connections for version-control systems

Projects
BusinessWorks 5.x proiects are fìle based and map to the system f ile
structure of the operating system. The multi-filc approach supports
and enables a team development environmcnt where multiple
developers can work on a single project. You can add fìles to a project
simply by copying them into the system fìle structure and then
choosing the Designer menu item Project > Retiesh.

The BW 5 multi-file approach also supports pro.iect versioning. You


can check-in / out components using a Revision Control System
(RCS) such as Visual Source-Satè. Perfbrce. or TIBCO Canon. Note
that the use of an RCS is optional.

'f IBCO Eclucrttion Progrcuns


Page 60
Unit 3: Prctcess Design cuttl Testùtg

r Process: Activities connected by transitions


. Activitres: access dala
* Transitions: execution path

= A process:
. Contains a start and end
. Can call sub-processes

*---
ir=;tr---)
j=-1
oqorler

Process Design
TIBCO Designer t'eatures a graphical. intuitive design space fbr
developing processes. Proeesscs contain activities linked together by
transitions. You can have multiple transitions fiom one activity to
another. and transitions can be conditional. You can also have
multiple processes and sub-processes. BW process definitions have a
beginning and an end.

A BusinessWorks process definition is a Directed Acylic Graph


(DAG) containing a single start node (starting activity) with any
number of directional (Directed) transitions to other nodes
(activities).

There may not be any transitions to an activity which has been


possibly previously visited (Acyclic). In BusinessWorks all
transitions must lead to the single required'End' activity or to optional
'Generate Error' activities.

TIBCO Sofnuare Inc. Pnoe 6l


M - BW E : T I B C O B us iness l{orks'IM 5. 4 E s s e ntict Ls

Any single process activity (source) may have multiple transitions out
and each transition must be one of four allowed types:

r Success Source activity of transition did not have an exception.


-
You may create as many of this as required. If there is no
exception in the source activity then every 'Success' transition will
be taken. The developer has no control over the order ofthe
transitions. The process definition executes using a single thread.
r Error Source activity of transition did have an exception (only
-
one allowed per source).

r Success with Condition Source activity of transition did not


-
have an exception and a stated boolean XPath expression
evaluates to true. Ifthere is no exception in the source activity then
every 'Success with condition'transition which evaluates to true
will be taken. Any 'Success' transitions will also be taken. The
developer has no control over the order of the transitions.
I Success with No Matching Conditions Source activity of
-
transition did not have an exception and there were no'Success
with condition' transitions which were true. (only one allowed).
Any 'Success' transitions will also be taken. The developer has no
control over the order ofthe transitions.

Page 62 T I B C O Education P ro g rams


IJnit 3: Process Desigrt cutd Testiug

. Data input and output mapping

Process Data: Ell '-rl lnaitityrr,p,n' |fr"lli _:__j*l __L

I 'i fùùt
;
1: A $,qlolrrl!arialrleî
:+: * $_Fro[Èssr:: ]rtÈ'l i,i i/rttÈ $8"À11 1_Pfodrct_ilueryIFerDrd[$count]iOTT,úH "
;ìÉ |lF'EquEst-lr
l:i & SBf,L2Lr1 _prtrdurt_LjuÈri
- 3 HÈttrd
: il|i pRorrucr_ro
ilÍ[1n.qr,,re
:l,l orl_cr
,l,l AVE clsÌ
1'$ 6Trtar
l,J $urrl

, Wizards to help you configure activities

Activity Conf iguration


Confi-guration is done on a per activity basis using the lower right
(configuration) pane I of Designer. For most process activities there
are at least three configuration tabs:

r Configuration Which involves defining (naming) the activity


-
and specifying certain settings.

r Input Which allows you to map the data input to the activity.
-
r Output Which allows you to view the data that will be output
by activity.
-
Certain activities may also have Headers, Input and Output Schema
tabs that may require further configuration. In addition.
BusinessWorks provides GUI tools (see next two slides) to help
configure activities.

TIBCO So;t'nuare Inc Page 63


M - II W E : T I B C O IJ u sir t e.r.r Wor*sr\r 5. 4 Essen t i a Ls

Used in activities and transitions


. Drag and drop expression building
. Automatic syntax verification as you build

Functions I Cr:nstants I
Evaluation Context
(nonel
XPath Forrnula
:($invErrlorylndÈx = count($Prtr:es: ]jlIe$c+*J-qsdqttstatusl ìor 3l

tB $,tnrrFute- -

XPath Formula Builder


The XPath Formula Builder is a kcy t-eature of the BusincssWorks
developmcnt envirclnment.
This wizard allows you to conveniently map input and output data fbr
the selected activiLy. Using industry-standard programming functions
you can -qraphically manipulate data fbr the selected activity.

XPath stands tor XML Path Language. It is a language that describes


how to locate and process items in XML documents by using an
addressing syntax based on a path through the document's logical
structure or hierarchy.

XPath expressions, which you create using the XPath Formula


Builder, allows you to graphically tbrmulate how to created new data
by a combination of Process Data (data created in this process
instance by previously activated activities), XPath functions (an
extensible set of methods), and predefined constants.

T I BC O Ed uccrt ir.trt P ro q rams


Page 64
(/ttit 3: Process DesÌgn cutd Testing

' SQL auto-generated

' Syntax check


and test mOdes
. Test as you build

i- ----::l:gr+=i'..ir;:-,--l- .st,.*-i. !-.*ì--]-'s-trrg-


ir*" niqfiiiiflnÉ-friili"il'liÉ j;;i ne rii;il
;lìi" aoi tù;l_.:
nB rio;
Ì:Jùmf Par!l_r! !an]: ,!iù_,r-ir .!.d r)o:1 :!_,:rJr ì
,lDeilrnrtl
!È! l
i:"d
;
l5h!{trv:Ú7n*
.. ..........:-.........-...........,-......1 r]-

TIBCO Query Designer

The TIBCO Query Designer is another ease-ofiuse BusinessWorks


f'eature.

This wizard allows you to graphically and dynamically build SQL


queries fbr your processes. This utility also provides syntax
verification and a testing mechanism to validate your query betbre
implementing it into your process.

TIBCO So_fnuare Inc Pnoe 65


M-BWE: TIBCO Businessl4/orksr'\'r 5.4 Essenrials

Shared resources are reusable across the proiect


Can be:
. XML, XSD, WSDL files
. Connections to external systems
- JDBC, FTP, TCP etc
9;i
J4r r'f )
,: lÈsè:
trlvelrrsoasè 'linq( iÚa.iii F4 der

{cr!rr, a tril'lurarúr andl!!'i:tn

PÓr:ìj a'Pún(rrr

È,*

-':; - ::1

Project Resources
For any proiect you arc developing using BusinessWorks, you can ust:
shared resoLtrces to accept data fiom various external sources,
including:
r JMS and RV
r HTTP(S) / SMTP / FTP
r JDBC
r SOAP
r Files

You can also use adapter rcs()urccs to integrate with extcrnal sources
via a TIBCO Adapter and definc schema objects fbr accepting
external data.

TI B CO Educcttion P ro grcuns
Page 66
IJnit -ì: Proce.ss De,sign ctnd Testing

Suilt-i n testerldebugger
r Tnc,l mrrltinlc nrna4cses
. Fxamine process data
- input and Output tabs
. Examìne errors
* Error msg, Siror,v Ccnsole, Elror talls

Process Testing
Process testing can be done at desi-qn-time usin-g the Designer GUI. If
an activity within your process definition fails you'll be ablc to easily
identify and debu_c it using the testing utility. During testing standard
errors are made available via an error dialclg and console window. In
addition you can enhance crror output by mapping error schema to an
activity input and view such crrors via Dcsigner error tabs.
C)ncc tcstcd you can easily validatc the pro.iect tbr deployment and
then quickly create the deployment package using Designer. We will
discuss these topics in the ncxt unit.

The Designer debugger is interactive and provides many advanced


t-eatures that make testing your BW proiect easy. You will use each of
these fèatures extensively during the implementation labs that fbllow,
includins:

'flBCO So.frware Inc l)noa 67


M - Il W I: : TIB C 0 Iì us i n er.q ltrplli.er \r 5. 4 E s,s en t i u Ls

I Breakpoints can be set bcfbre and after activitics to stop thc


testing midstream so you can examine runtime data and operations
I Multiple processes can be loaded lbr testing so you can debug
sevcral parts ()r an entire prt-rjee t

Input data can


be supplied to a process so that you can tcst it
indepenclcntly of the process on which it is dependcnt l'or data

Show Console displays thc Java console so you can view erlors
and debug accordingly: -d will enhance lhe amount of messa.gcs
shown in the Console window

Page 68 TIBCO Ed ucation ProEiratns


Unit -l: Pro<:ess Design antl Testing

' Used to:


. Create common look and feel for development
. Enforce adherence to naming standards
. Provide stafting point for development

:Ji ProteclTemplate
- .li Adapler SeMces

,J sre
i:', ì-ì Siebel

- t-I dr5rnÉs5 PrùtÈ55É5


::i l:li OrdÈr ManaqÈmÈnl
- i treale O,der
i i-i Sl3der Pr9ctsses
+ I iub Pr!' Ps9e9
* ,I Tfanstbrmil on F[r ÉssÈ6
Ltrtrty ser res
rj1
. - Ltn tresrs r ìCustomFrnalons
--
* lvardrlnr Prnc,.sseg
L I lÙIe L-ifner
r r ErrPúl rf hanill nú
. ì tnn ai ::tion
r trrnier rrnEf
L!gqrnq
UntTest5

Project Templates
A good practice fbr managing the development environment is to
segregate the project using fblders by distinguishing among process
definitions, adapter services, shared connections, shared resources
and global variables.

Segregating your project along these lines will enable you to defìne
"ownership" among developers working on the project so that
multiple developers can work on the same pro.ject. You can use BW's
import/export facility to merge the project into one tìnal project when
the development work is completed and you are ready to deploy
project componentS.

TIBCO Sofnvare Inc. Page 69


M - B W E : T IB C O B us in ess Worksîrvt 5. 4 lis.s e n r i a L s

' Global variables specify data that changes at deployment


. Examples:
- Environment specific values
. Database connections
* Trace and debug settings

' Eases migration between


environments

. Values changed by administrator during deployment

Project Global Variables


BusincssWorks uses global variables tbr environment scttings, so to
modify sub.iect names fbr a specifìc domain cnvironment you only
have to change the appropriate global variable. Once again, BW
provides an existing subject naming scheme that is parameterized.
These parameters can be easily modifìed to match your project's
domain environnrcnt.

With BW, RV nressage subject names and sessions are


auto-generated, and the domain name is part of the auto-generated
subject name. If there are site-wide naming requirements, you may
have to modify the default subject names fbr each domain
environment you are establishing.

Note that Global Variables can be grouped, usefil tbr RCS locking
with multi developer projects.

Page 70 TI BCO Education Prcgratns


Unit 3: Process Design and 'festing

. Create new project from template

. Design and test BW process


. Pedorm Credit Check

#-€,*1
gal 0d Accoud lnfo
#

Lab Introduction
In the exercise that tbllows you develop and test a BW process and
learn how to navisate the Desisner interfàce.

TIBCO Sofrware Inc. Pnoe 7 I


'
!'ò"
'
suDrd o.td uollo)npa o) glJ zl aSDd

seloN

slDuuassg , 9 wr.elroA4ssaulsng o)8lJ :aaq-n


Lab A: ImpLement Perform Credit Check

Lab A Implement Perform Credit Check

Overview
In this lab you learn the fundamentals of developing TIBCO BusinessWorks'" process definitions
in the TIBCO Designer'" environment.

Objectives
t Create New ProjectfromTemplate, page74
t Design Perform Credit Check, page 78
t Test Perform Credit Check, page 84
Prerequisites
r TIBCO Sotiware installed and contìgured 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 ro the userXX domain)
r Connectivity to the EDUSVR instructor server tbr:
a BWP Home Page at http : / / eduevr z BOSO /bw/ index. html
a Oracle Database
r C:\BWEDU lab fìles

Directions
Complete the exercises that follow.

TIBCO Software Inc. Page 73


M - BW E : T I BC O B us ine.t.rWork.!] Ì!r 5.4 Es se n r ia I s

Lab A - Exercise 1: Create New


Project from Template

Overview
ln this cxercise you create a new TIBCO BusinessWorks (BW) pro.ject using a pre-def incd
templatc that includes some top-levcl fblders and a tèw global variablcs.

Steps

l. Start the relevant TIBCO services and set them to "automatic.

r There are three TIBCO services to be concerned with in this course:


a TIBCO Administrator 5.4 (userXX)
a TIBCO EMS Server (PlD: xxx)
a TIBCO Hawk Agent (userXX)
Note: For help starting these services, refèr to Mcmaging Windovvs Sen'ices on page l6l.

Z. Create a new BusinessWorks pro1ect named bwpxx using the provided ten'rplate.

Analysis: TIBCO DesignerrM templates facilitate project organization and shared


development. You can create a project-wide template containing folders,
metadata, shared libraries and global variables. Templates allow you to
standardize and reuse resources.

I Start > Programs > TIBCO > TIBCO Designer 5.5 > Designer 5.5
r Select New project from template
r Browse to and open file C:\BWEDU\Templates\bwpXX.designertemplate
r When Designer opens you are prompted to save the pro.ject:
a Projcct Directory: C: \BwEDu\bvrpxx (replace XX with your ID, e.g., bwp09'1
r Click OK and the development environment fbr your bwpXX projcct opens
Note: When Designer initially opens it presents Tips which can be disabled.

Page 74 T I BCO Educcttion P ro grcuns


Lab A: ImpLement Perform Credit Check

3. Customize the TIBCO Designer palette view and your prel-erences.

Analysis: The default layout of TIBCO Designer is three panels with the project
tree on rhe left. You can change thts(Edit > Preferences > View) but keep in mind
that all lab instruction, urruÀ" the default tayout.

Select the PaLettes tab in the far leti pane; notice that the default view shows all activities
and resources in one palette called General Resources
To categorize the resources and activities into individual palettes, tiom the tool bar click
the Switch Palette Modes icon ffi (this mode is assumed going fbrward)

4. Explore the project template.

r Select the Project tab in the tar lefi pane


r In the project tree select the roorlevel bwpXX project fblder (uppermost in the tree)
r Notice that the template contains several pre-defined subfblders tbr organizing your
project, including:
a AdapterServices
a AESchemas
a BusinessUnit
a BWP.Core
- Connections

- CustomJava

- Schema
a Deployments
a ProcessDefinitions

Analysis: Thte A.,ESchemas folderlcontains adapter metadata unA by default


in anv ttgco Desisner-based proiect. The otherfolders have been "*irt*
creaied fbr
you and saved to a úmptate to organire and lacilitate development.
The Bzsiness {Jnit lolder is a template within the template. It can be used to create
additional proiect subfolders,as required. The BWP.òore folder conrains some
pre-delined r.iour"", and schemas.
The Exhibit A folder contains a generiò set of subfolders [ha[ you will copy and
rename for each set of services iou will be implementing.

TIBCO Sofnvare Inc Pnoe 7\


M-BWE: TIBCO BusitressWarks'rì\'r 5.4 Essentictls

5. Create a project subfblder nanìed CreditCheck.

r Select the existing project folder /BWP.Core


r In the design panel to the right, righrclick and select New Folder
r In the ConJiguration tab:
a Name: Serwices
. Click Apply (lower right)
r Select thc existing pro.ject fblder /BusinessUnilServices/ExhibitA
a In the project tree. right-click on the ExhibitA fblder and select Copy
r Sclect the newly created project fblder /BWP.Core/Services
a In the design panel to the right, right-click and select Paste
a Rename the ExhibitA tblder to CreditCheck
. Click Apply
r From the TIBCO Designer tool bar, select the Save icon to save your project
I Verify your project:

iî.-. i'q*t,{rlanterSer'rires
---
i. 1 lAEijtlnPmaS .

+ J HLlSlllDS!ir-rnlî
- _i BWP CDre
,., -j Cnnnections
, : , É*oroerne
, iS CustomJava
:=: i:i schema
,I ft Cre,:litCh,:rrkschemB
& Purchase0rderschema
-'
,-_ :::ìa
|JJ s.enitces
^

ii .'iì trsditDhÈDk
T rJ Contract
ì * {: unitTest
ii i..'-t lrrterface
. *t {I lmplementarron
, .$ oeptoyÀEnts
",:! Hr0CeSSUEllnlll0ns

WARNING: Apply your settings each time you name or configure a folder, resource
or process activity. Also, save your proiect frequently. An asterisk (.) next to the
project in the title bar indicates changes have not been saved.

Page 76 T I BCO Ecl ucat io tt P ro e rants


Lab A: Impl.ement Perfornx Credit Check

6. Explore and contìgure project -slobal variables.

Analysis: Global variables are available project-wide and facilitate shared


development. The value of a global variable is substituted at runtime for all
occunences of the global variable name.

r Select Lhe GLohul VariabLes tab in the f'ar letì pane


I Click the pencil icon at the top of the variables listing to open the Glohal VoriubLes editor
r At the bottom of the listed variables you'll variable _9roup named ówp
see a
I Expand the bwp group. revealing fbur _qlobal variables created fbr you
r For the host.Name variable. click in the value fìeld and change XX to match your ID
a For oxample: USERO 9 (please use all capital letters fbr this cntry)
r For the user.Name and user.Password variables change XX to match your ID
a For exan.rple: user09 (these cntries are lower case)
r Click OK to closc the editor
r Fronr thc Dcsigner tool bar. click the Save icon to save your project (or Project > Save)

1. Test the prc-defined resourcc /BWP.Core/Connections/OrderDB to verify connectivity with


the instructor database.

r Select the OrderDB resource


r This resource is confìgured fbr you with the tbllowing parameters and global variables:
a Name: OrderDB
a Connection Type: JDBC
a JDBC Driver: tibcosoftwareinc . j dbc . oracle. OracleDriver
a Database URL: %%bwp / ldbc. URL%%

a User Name: %%bwp/user.Name%%


a Password: %%bwp/user.Paeeword%%
r Click Test Connection to verify connectivity with the instructor server

TIBCO Sofrware Inc Page 77


M - BW E : TI B C O B us inesr WorÈs'r'Nr 5. 4 Es se nt iaLs

Lab A - Exercise 2: Design Perform


Gredit Check

Overview
PerformCreditCheck takes an account number and an amount as input parameters (Start), queries
the OrderDB fbr current account intbrmation (Get Account InJò) and computes the credit status
(Credit Check). The returned Status is either "Accepted," "Rejected" or "Failed" (EnÒ.

Steps

l. In fblder /BWP.Core/Services/CreditCheck/Implementation define the


PerformC reditCheck Drocess.

I Drag-and-drop a Process Definition tiom the Process palette to the [mpLementation folder
I Name this process Perf ormCreditCheck
I From the project tree, select the PerformCreditCheck process defìnìtion to see the Start and
End activities that exist by default with any process definition

Analysis: The lollowing naming conventions are observed:


r Processes; Services, Folders and Resources do not have spaces in their
names and use initial capital letters
: r Process activities do use spaces between names and initial capitals letters,
the exception being. where default activity names are used that do not
employ spaces. such as RetrieveResources

Page 78 TI BCO Education P ro prams


Lab A: lmpLement Perform Credit Check

2. Inthe PerformCreditCheck process, add and transition the tbllowing activities:


Start > JDBC Query > Mapper > End.

Analysis: To familiarize you with the Designer interlace and BusinéssWorks


."rour."r, fìrst creal.e the proiect shell activities
and their transitions. then
configure them in order oiprocessing. from left lo right.

I From the JDBC palette, add a JDBC Query activity


I From the General Activities palette, add a Mapper activity
I On the tool bar, select the Create transition icon and connect the activities as tbllows:
a Start to JDBC Query
a JDBC Query to Map Data
a Map Data to End
a JDBC Query to End, which is taken on Error if the database query fàils

To do this: To change the transitìon condition from success (default) to error:


r Select (clickl the transitìon line between the two acrivities
r [n the Configuratior fab select the condition rype Error

3. Verify the design of your PerformCreditCheck process defìnition up to this point.

E}
tia

Tip: This example uses the "Multi-Bend" line mode.To change the default line mode,
fróm the Designer menu select View > Defa.utt Line Mode.

TIBCO Sofrware Inc. Page 79


ù4 - RW E :'l' I B C O B us i r tess ll'orks I \r 5. 4 Es s e rt ri u I s

4. lnitiate PefiornrCreditChec'k using the provided CreditCheckSchema.

r In the Or.rtltut Editor tab of the Start activity.


a Click the "Add Child" icon. creating the root clement
a Selcct the "root" element and contìgure it:

- Content: XNIL Element Reference


- Schema: Browse to and select /BWP.Core/Schem.r/CreditCheckSchema with
Element CreditCheckRequest
- Inthc Pret'ievr.' pancl tc'rtheri,ght.selecttheTreetab andviewthcdataelenrcnts
required tbr a credit check recluest: Amount and AccountID

By Namespace ì Bv Searcn I

Namespate Do.umÈntation lree I

g ared l,lf I rlR,É(l


It tilr,.^, .ril;;*,pr*-t**;*,r#"rk j] rÉÉl
il,i .cm: rnt

m
El

::Afinunl
em ent ilil .scrqurl D

gf I cqntel I

- Click OK to close the "Select a Resource..." intertacc


- When you arc done the conl'igufation shcluld look like this:

[onfguration Output Editorì Outputl EnorOutput!

content ffi
$ il!trEfttt!ÉtGl Cardinality: ffi
Schema: !httft.J)'y,n r/i lrh l0 cr:ìffrih'uvpigrltprÌtfr';iifÈdltDhÈf k

Elemenl: iCredita hÉDkRequest

IMPORTANT Note: Inputs to a process can be defìned ìn its Sfarf activity; outpul
from a process can be defined in its End activity. It is good practice to use schema
for input and output data as XSD is required to exposc a process as a service.

Page 80 TIBCO Etlucatiort P rogrcuns


Lab A: Imnlenlettt Pe,-form Credit Clrcck

5. Query thc CUSTOMER_ACCOUNT table by configurin_9 the JDBC Qaen' activity to


retrieve the account infbrmation fbr a specified AccountlD.

I JDBC Query Name: cet AccounÈ Inf o


r JDBC Connection: Browse to and select /BWP.Core/Connections/OrderDB
r Type in or build using the TIBCO Query Design er this qucry (see "To do this" below):
SELECT CUSTOMER-ACCOI]NT . AMOIJNT-OWED,
CUSTOMER-ACCOI'NT . AVAI LABLE-CREDI T
FROM CUSTOMER-A,CCOUNT
I^THERE ( (CUSTOMER A,CCOIINT.ACCOT]NT ID =?))

To do this: To build this SQL using the TIBCO Query Designer'.


I Click "Build using wizard" (pencil icon)
r E,xpand your userXX accounr, then Tables
r Drag-and-drop the CUSTOMER_ACCOUNT table to the panel at right
r Double-click each table row to include it in the query
r For the ACCOUNT_ID column at the bottom of the Query Designer:
a Uncheck "Show"
a In the Where cell type = ? and press <Enter> on your keyboard
r In the SQL tab check "Do not use schema names in SQL statement"
r Verify that your query matches the SQL shown above
r Click OK to close the TIBCO Query Designer
Note: In this instance, if you try to use the SQL tester or syntax checker
neither will work because of the expected input parameter defined using =f .

r [n the Configuration tab. click + in the "Prepared Parameters" section to add a new
parameter named Prepared_Param_l that is of data type VARCHAR
r In rhe Input tab click Fetch
r To map the data input fbr this activity:
a From the available Process Data on the leti, select element
$Start\Credi tCheckReques t \AccountID
a Drag it to the Acrivlh' Input element on the right
j dbcQueryAct ivi tytnput \Prepared_Param_1
I [n the Output tab, expand "resultSet/Record" and verify that the AMOUNT_OWED and
AVAILABLE CREDIT elements are returned

'ilBCO So.ftware Inc. Page 8l


M - BW E : TI B C O B us ine s sWo r ks't t\r 5. 4 E s s e n t iaLs

6. Compute the customer's credit Status by contìguring the Mapper activity.

Analysis: To compute the credit Sraras build an XPath expression: If (record


returned from the database AND Amount + outstanding balance <= available
credit; then credit Status is "Accepted." else Status is "Éejected."

r Mapper Name: Check Credit


r In the Input Editor, add required string Status (replace "root" as fbllows):
a Content: Element of Type
a Name: StaÈus
a Cardinality: Required
a Type: String
r For the Input use a "suround with Choice" statement to determine the credit Status

To do this: To create rhis choose condition, use the XPath Formula Builder:
r Select the text string "Status" (NOT the text lield next to "Status")
r Rieht-click and select Statement > Surround with Choice
t N,r-b., of when conditions: I
: ;;;;;;"; o",*',",,i,ii"i
:;;;
I Now that you have the "Choose" condition, use the pencil icon to open the XPath
Expression Edítor and build the fbllowing booLean expression:
a When: (counÈ($Get-AccounÈ-Info/resu1Èset/Record) > 0) and
( $start/CreditCheckRequest/AmounÈ +
(

$Get -Account - Inf o/resuI tSet,/Record t 1-l /.AMoItNT_owED)


<= $Get-Account-rnfo/resultSeÈ/Record [1] /AVAILABLE cREDrÎ)
- Status: "AccepEed"
a Otherwise:

- Status: "Rejected"
r In the Output tab for this activity, verify that Status is returned

Tip: You can copy this expression from C:\BWEDUU(Path\Expressions.txt. lf you


have errors, use the Mapper Check and Repairteature to fix them. A dialog displays
the potential problems in the mapping. Select the Fxcheckbox to repair any errors,

Page 82 TI BCO Education P rograms


Lab A: Implenrcnt Perfonn Credit Check

1. Complete the process by configuring the End activity to return the result of the credit check.

Analysis: The End activity can be configured to return the result(s) from a
completed process defìnition. In this case the result is either Status (" Accepted" or
"Rejected".l or Failed if the database query fails.

ln the Input Editor tab fbr the End activity:


a Click the "Add Child" icon, creating roor
a Select the "root" elenrent and conlì,9ure it:

- Content: XML Element Reference


- Schema: Browse to and select /BWP.Core/Schema/CreditCheckSchema
- Element: CreditCheckResult
For the Input to Status. create a "Surround with Choice" statement with 1 when condition:
a When: g_error (in the Mapping Wizarcl select "Set fbrmula" then Finish)
- Status: nFaiIedtr
a Otherwise:
- Status: $Check-Credit,/Status

8. Verify your completed PerformCreditCheck design.

r)redilChe ckRequest
- AccountlO
- AmDunt

Tip: Use the Label activity (in the GeneralActivitiespalette) to comment a process.

TIBC} Sofnare Inc. Page 8.1


M-BWE: TIBCO BusinessWorkstM 5.4 EssentiaLs

Lab A - Exercise 3: Test Perform


Credit Check

Overview
In this exercise you explore the Designer test environment and test your PetformCreditCheck
process definition.

Steps

l. Confìgure your test environment pref-erences.

Analysis: You can configure the'TIBCO Designer Tester ta suit your preferences
and view testing as it transitions through a process. ,
l

r From the Designer menu select View > Test Options > Moving Ball Options
r Select "Show Ball"
r Set the testing speedtoTSVo

2. Validate the project to check tbr errors.

r From the Designer menu select Project > Validate Project for Deployment
r If confìgured correctly, you should not have any errors (other than those listed under
"Unassociated Errors & Warnings," which can be ignored)
r If you do have project-associated errors, double clicking the error within the "Validate
Project" dialog will take you to the misconfìgured resource in your project so you can fix it
r Revalidate and repair until all relevant errors are cleared
r Close the project validator when done

Page 84 TI BCO Education Programs


[nb A: ImoLement Pefform Credit Check

3. Test Pe(ormCreditCheck and verify it returns the "Accepted" status.

Analysis: To test foi an "Accepted" credit check: p.:u-td"j v.alid. AccountID and
amount and verifv the result in the Input Data Lab ol the End activitv.

r In the Tester tab click the green arrow icon, bringing up the Select Processes to Load dialog
r Verify that PerformCreditCheck is checked and click Load Selected

trwp0B
- :l evve core
:ljj s-eruices
i::.13 Creditcheck
l;ìl lmFlementstion
:.,? è Performcredttcheck(curred)

.' "'n'", .'...........J

r In the Input Data dialog prompt that appears, enter the fbllowing data and click OK:
i' Amount: 3000.00
a AccountlD: L234L234L234L234

-, tuf:
Lo;d From File
:i'tóadftqffP;jeor '

t Amounl 3ùù0 00
+tucouÍllD 1?34123412141214 :?!9]gl5

r An instance of the process should execute; when it does, check the Input Data tab of the
End activity for the "Accepted" result:

t&--^ "$,€ @
Gd Accoufr lffo ._E.r.q...

Credn Check

TIBCO Sofware Inc. Page 85


M-BWE: TIBCO BusinessworkstNt 5.4 Essentials

4. Test PerformCreditCheck and verity it returns the "Rejected" status.

Analysis: To test for a "Rejected" credit check, change the input data so that the
runounl being requested isleyond the available limiiand verily the result.
, ,'a '..,. ..,,,,: ..
I First, change the input data tbr the PerformCreditCheck process by pressing the <Fl2> key
Note: Alternatively you can righrclick the Start activity and select "Add Input Data" or
click the "Supply input data" icon on the Designer menu bar.
r Enter the tbllowing data and click OK:
a Amount:4000.00
a AccountlD: 11111111-1-111-l-1-LL
r In the Tester tab "Jobs" tblder, select the PerformCreditCheck process definition and click
the green "Create a job" icon to create a new job instance with the new data:

enO {ewC.CrreJBeniiresioreditcherktlmplementati0niFErî0rmCreditoherk.prrtcess}
li* :l

i** End iBWP C0rei5EruicesicrÈditChÈrkrlmtllementati0niPedormùrÈditCherh.pr0DÈ:ìs)


ÈF-

X
à{

{.
ét
J'

Cre ate à ioh

r Once the job process completes, select the End activity then check fhe Input Data tab for
the "Rejected" result

Page 86 TI BCO Education P ros rams


Lab A: ImnLemetxt Perform Credit Check

5. Test PerformCreditCheck and verify it returns a "Failed" credit check.

Analvsis: To test for a "Failed" credit check. vou will need to induce an error. We
will ào this by changing the database login so that it is invalid.
"onn".tion
r Stop Designer test mode by click the red "Stop testing" icon

ii".x, [* g"l igt.rp c*.,s*ir-,lcredrtchecErlmprem*ntrt,onir"ror*c""-,lncrr".,,p*.1 ;


-- I -"l.lotrs
:,1--
l!j{ :-, & Jolr-7000(viewed iotr}
i- li$ End (Bt/lP.Crreiseruicèsicreditchetl4lmFlemEntation/PelformDreditcheùk.pr0ùess)
StoÈ lestinq Ctrl.F2

WARNING: You should not make chanqes to Vour proiect while it is in test mode.
Stop testing before making any edits.

r In the GLobaL Variables tab, change the value of the To7obwpluser.NameTo% variable fiom
"userXX" to user and save the changes
r Place PerformCreditCheck into test mode
r This time the process should tail at the Get Account Info activity and take the Error
transition; check the [nput Data tab of the End activity fbr the "Failed" result:

@"- @
ENI

t,, .td
credrt check

conîquatjonl lrBlt Edltorl tnpul Erru sttremasl Prcce6s Dala Input Dlla I Eror 0ulpul

; y' Étr0r9 . 3i ContEnt É Bourcs


:::!'a nso;c.i,ecf CheckFe
j:ì 1 ns8:Credìtehe,-. :lii
, mtnS:n9u
ììì1 : -an cbt,"

TIBCO Software Inc. Page 87


M-BWE: TIBCO Busines.rll'orksrNr 5.4 Essenticils

6. Retest PeformCreditCheck fbr other types of scenarios.

Stop Designer test mode and reset the original LLserXX value tbr the
To7obw pl user.N anteTo7o global variable
Retest PeformCreditCheck using a valid AccountlD available in the
CUSTOMER_ACCOUNT database table as show below:

For exanrple, you could retest the credit check using:


a AccountlD: 3333333333333333
a Amount: 99999 - 00 fbr "Accepted"
a Amounr: L0l-000.00 fbr "Rejected"
Lastly, test Pe(orntCreditCheck using an invalid AccotuttlD (one that is not in the
CUSTOMER ACCOUNT table):
a This result should be "Re.jected" because of the initial part of'the Check Creclit
expression which verities that the account record exists in the databasc:
(coun! ($Get-AccounE-Info/resultSet/Record) > 0)

1. When you are done testing. stop Designcr test mode.

Page BB TI BCO Educcttion Programs


Lab A: Implement Perform Credit Check

Notes

TIBCO Software Inc Page 89


sxuDrSord Ltoll'rnpa oJalJ 06 a30d

saloN

sl0l tu a ss gf s
'
oA4s s aul sn g o ) I IJ :
3 /l1g -
w
^.r,sry
Unit 4: Generating Services

Unit 4 Generating Seruices

This unit explores BusinessWorks support fbr SOAP-based Web


Services. This unit prepares you fbr the lab implementation that
tbllows in which you design the Credit Check Web Service.

Topics
t Objectives, page 92
t What Are Web Services?, page93

t SOAP Web Services in BusinessWorks, page 94


t SOAP Message Format, page 95

t Generating a Service, page 98


t Result of Service Generation, page 99

t SOAP Web Service Client, page 100


t Lab Implementatiorz, page l0l

TIBCO Sofnuare Inc. Page 9 I


M-BWE: TIBCO BusinessWorkslrvr 5.4 EssentiaLs

. Knowledge
" Describe 3W supporl for Web Services
. Define SOAP message characteristics

. Skills
. Build a Service
. Suild a Service cliant
. Test Service using Client

Objectives
The main obiective of this unit is to prepare you to in'rplement the
various process definitions comprising Credit Check Web Service.To
that end in this unit you will:

r Explore the Web Services capabilities of BusinessWorks


I Learn what standards are supported

r Learn how to organize your project development envlronment


r Examine and discuss the process defìnitions comprising Credir
Check Web Service

r Explore advanced fèatures of the interactive debugger

Atier completing this unit you will proceed with the fìrst phase of the
implementation as specified in the lab that fbllows.

Page 92 TI B CO Ed ucation P ro grams


Urtit 4: CenercLting Services

Service-orientated computing using open lP standards


' Network interface to application functionality

Most Web Services use SOAP format

What Are Web Services?


A Web Service enables an application to be acccssed over a network
using Internet protocols.

Web Services is a -gencric term. The only requirenrent placed on a


Web Service is that it must be capable of sending ancl receiving
messages using some combination of standard Internet protocols.
Most Web Services use SOAP as the data exchange tbrmat and HTTP
as the transport mechanism. BusinessWorks also supports JMS as the
transport mechanism.

TIBCO Software Inc. Page 93


M - BW E :'t I B C O B us i n e.rr Worttl Nr 5. 4 E s.s e n r i ct l.s

. Web Services support in BusinessWorks


. TCP/lP connectivity
. l\4essage transport (HTTP, JMS)
. Comrnon data represenlalion (XML)
. Common communication protocol (SOAP)
. Service discovery (WSDL, UDDI)

. BusinessWorks can be both a SOAP server and client

SOAP Web Services in


BusinessWorks
TIBCO BusinessWorks supports SOAP-based Web Services usin-q
lnternet and technology standards such as HTTP, JMS, XML. SOAP
and WSDL.

A SOAP Server is the Web Service provider. A SOAP Client requests


a Web Service. BusinessWorks can act as both a Web Service client.
making SOAP requests, and as a SOAP Server handling requests and
communicating with back-end applications.

This is fbr use by aclient in automating the clients creation of an


XML fìle fbr requesting those services. In order to find the WSDL
tìle, the web service can advertise itself in a UDDI (Universal
Description, Discovery and Integration) service. UDDI is a potential
way fbr advertising and discovering Web Services.

Pnoe 9zl TIBCO Etlucation Programs


Urtit J: Gctrcratirg Serlir'er

XML Document
Entire message XML
SOAP Envelope document
SOAP Header (optional)
Header describes how to
Header Block nrnaace tho moccrno

Header Block Body contains the data


payload

SOAP Body (required)

Message Body

SOAP Message Format


The SOAP message fbrmat is a specification that defines a simplc
XML document identiiying the infbrmation to be transt'erred. and a
set of rules fbr translating application and platfbrm-specific data types
into XML representations. It relies heavily on XML standards like
XML Schema and XML Namespaces fbr its definition and function.
SOAP's design makes it suitable fbr a wide variety o['application
messaging and integration patterns.

A SOAP envelope is an XML document. Contained in this document


are optional Header elements specifying how the message should be
processed, e.g. routing and delivery settings, authentication,
authorization, transaction contexts, etc. The Borly element is required
and contains the actual message to be delivered and processed.

TIBCO Softuvare Inc Page 95


M-BWE:'fl BCO tsusines,rtvor*sr rvr 5.4 Essentittls

SOAP Web Service Operations


In more technical ternls, a Web Service is an interface positioned
betwecn the application code and the desired user of that code (hunian
or machine). A Web Service acts as an abstraction layer, isolating the
platfbrm- and language-specific details fìom the user. This means that
any application that supports the Web Service can access the
back-end application functionality.

Service availability is specifìed by a WSDL tìle. A WSDL (Web


Services Description Language) file is an XML document that
specifics how a client is to interf'ace with the Web Service provider.

The most common fbrm of Web Service is to call procedures running


on a server, in which case the request message encodes CaLl this
subroutine with these arguments and the reply message encodes Here
are the re.strlts of the strbroutine caLl.

Page 96 't I BCO Education P rogrants


Unit 4: Generating Services

The sequence of events tbr this type of scenario would be:


I Application code contains the business logic implementation
r SOAP Server receives incoming requests (via SOAP over HTTP
or JMS)
r Service Proxy decodes requests into calls to the application code

I Service Proxy may then encode a response fbr Service listener to


reply with

Because of the abstraction provided by the standards-based intertace,


it does not matter whether the application services are written in Java
and the browser is written in C++, or the application services are
deployed on a Unix box while the browser is deployed on Windows.
Web Services enable cross-platfbrm interoperability in a way that
makes the application platform irrelevant.

TIBCO Software Inc. Page 97


M - Il WE :'f I B C O B us i nes.e l.{171ft5 r \r 5. I Es se n t ict I s

. Conve{ existing proce$s to service


" The process is the 'operatìon'
. Options:
. One service per process
Frum WSDL

. One service for multiple processes


. Servics from WSDL

Generating a Service
BW providcs WSDL resources lor defining Web Scrvice interf'aces
and SOAP activities fbr building Web Service servers and clients.

Abstract WSDLs are constructed using the WSDL rcsourcc and the
message, operation and port type parameters that are requircd for the
interface. Abstract WSDLs are derived tiom an XSD schen'ra that you
create using BW or that you import into your project.

The concrete WSDL, the one used by clients to call the Web Service,
is derived fiom the application of the abstract WSDL to a SOAP
activity and the specification of the HTTP or JMS rransporr tbr that
activity. In other words, the concrete WSDL = the abstract WSLD
plus the transport (EMS/JMS or HTTP).

Page 98 T I IICO Education P ro grams


Unit 4: Generating Services

' Abstract WSDL file


. Schema nffielFrmareiúlh€rk
q':!ri1.ry3.T:

. Port
à, nlPetrÈrmúrediCh€ak-sÈfricÈ
i+dsPEturnrLreditChÈÈk

-
. Service interface definition
" Transport
. Concrele WSDL fiie

. Call Process to invoke the oneration

#*,-."-*5$
srd callprocess Eild

Result of Service Generation


With BW 5.4, the process definition fbr which you are generating the
service is the operation.

The result of service generation are three additional components:


I The abstract WSDL containing the inputs and outputs (defined as
XSD schema)
r The service interf'ace definition, including the transport and the
resulting concrete WSDL
I A call process to invoke the operation process

TIBCO Software |ttc. Page 99


ll'l-BWE: 'f IBCO Busirte.s.sWork.s.fNr 5.1 Essentia.Ls

To invoke service:
. Access concrete WSDL

To test service:
. Run clienf process

SOAP Web Service Client


Petform Credit Check is the backend application providing rhe
desired ['unctionality, in this case a credit check. This process takes
two inputs. the customer account number and the purchase order
price, queries the database for the account inlormation and computes
the oredit status using a Mapper activity.

The SOAP Server is Credit Check Service which wraps the backend
application, Pe('orm. Credit Check, and exposes it as a Web Service.
lmplementing this process involves generating the WSDL fìle based
on an XSD schema and building the process using SOAP resources.

Invoke Credit Check is a client activity to call the credit check web
service. In the lab that fbllows, atier you have built the SOAP Server
you a simple client to test the Web Service. In a later lab, when you
implement the Process Order process, you will build the functioning
client invocation fbr rhe Order Processing integration projcct.

Page 100 T I B C O Etlucctt ion P ro g rarns

You might also like