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


Chapter 20 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 program was compiled and executed with the following assumptions:
The SDK (Java) .jar file and the source file JCLISAMP.java exist in the current directory.
You can find JCLISAMP.java in the cli.jar file. To copy JCLISAMP.java to the current directory, use the following command:
jar xf cli.jar JCLISAMP.java
Use the following commands to compile and run the sample program:
1.
This starts the z/OS shell.
2.
3.
4.
IBM‑037 is the code page to be used.
See Also
TIBCO Object Service Broker National Language Support about the @NLS1 table.
Sample Rule Called by a Program
This rule 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
After the rule executes, 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