Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 8 Using TIBCO Object Service Broker SDK (Java) : Sample Application Using the SDK (Java)

Sample Application Using the SDK (Java)
Compiling and Running the Sample Program
The sample is available in the /install_path/JavaCLI/src folder.
Windows
Using the Sun JDK 1.3, the sample program was compiled and executed with the following assumptions:
The .jar file for the SDK (Java) is install_path\bin\cli.jar
The TIBCO Object Service Broker Data Object Broker and TIBCO Object Service Broker monitor (osMon) are running, with the osMon listening on port 9068
Compile and execute the program using these commands:
1.
2.
3.
Solaris
The sample program was compiled and executed with the following assumptions:
The SDK (Java) .jar file exists as install_path/bin/cli.jar
The TIBCO Object Service Broker Data Object Broker and TIBCO Object Service Broker monitor (osMon) are running, with the osMon listening on port 9068
Use the following commands to compile and run the sample program:
1.
2.
3.
Sample Rule Called by Program
This is a sample of a rule that creates an occurrence of a TDS table, generates an end message, and returns a value. On completion of the rule, the changes are not committed because the transaction is still active. The SDK (Java) program explicitly stops the transaction by issuing stopTrans with a true flag or a false flag to indicate whether the changes are to be committed.

 
RULE EDITOR ===> SCROLL: P
TC007124RU02;
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ TC007124TA01.TEXT = 'RULE "TC007124RU02" IS CALLED'; | 1
_ INSERT TC007124TA01; | 2
_ CALL ENDMSG('END MESSAGE GENERATED BY RULE "TC007124RU02"' | 3
_ ); |
_ RETURN('RETURN VALUE OF RULE "TC007124RU02"'); | 4
_ ---------------------------------------------------------------------------
_

 
Sample Table Referenced by a Rule
The table is defined as follows:

 
COMMAND==> TABLE DEFINITION
Table: TC007124TA01 Type: TDS Unit: TC007124 IDgen: Y
 
Parameter Name Typ Syn Len Dec Class ' Event Rule Typ Acc
---------------- - - --- -- - ' ---------------- - -
_ LOCATION I C 16 0 L ' _
_ ' _
Field Name Typ Syn Len Dec Key Ord Rqd Default Reference
---------------- - - ---- -- - - - ---------------- ----------------
_ KEY I B 4 0 P
_ TEXT S C 50 0
_
_
_
_
_
_
_
_
_
_
PFKEYS: 3=END 12=CANCEL 22=DELETE 13=PRINT 14=FIELDS 21=DATA 2=DOC
New table definition

 
Output from Program
The output from the program is as follows:
Start session completed
Start transaction completed
Rule call TC007124RU02 completed; Return value='RETURN VALUE OF RULE "TC007124RU02"'; End message='END MESSAGE GENERATED BY RULE "TC007124RU02"'
Stop transaction completed
Stop session completed
When the rule is done, a row is added to the table:

 
EDITING TABLE : TC007124TA01
COMMAND ==>
SCROLL: P
KEY TEXT
_ ----------- --------------------------------------------------
_ 1 RULE "TC007124RU02" IS CALLED
_
_
_
_
_
_
_
_
_
_
 
 
 
 
 
 
PFKEYS: 4=INS 16=DEL 5=FIND NXT 6=CHG NXT 18=EXCL 19=SHOW 3=SAVE 12=CANCEL

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved