Download End-to-End e-business Transaction Management

Transcript
Important: The second parameter should match the pattern “ScriptName.*”,
where the .* indicates any characters, and ScriptName is the name of the
Rational Robot Script. Using our example above, valid transaction IDs could
be “MyTransaction” and “MyTransactionSubtransaction1”. The third parameter
is the description, which will be displayed in the TMTP Topology view, so it
should be a value that will provide useful information when viewing the
Topology.
As you can see, the application handle is sent to the ARM API and a transaction
handle is retrieved (Example 9-5).
Example 9-5 Retrieving the transaction handle
getid_handle =a rm_getid(appl_handle,"MyTransaction","LegacySystemTx",0,"0",0)
Now you can start the transaction. The line below (Example 9-6) needs to
precede the script steps where the transaction you want to measure takes place.
Example 9-6 Specifying the transaction start
start_handle =arm_start(getid_handle,0,"0",0)
Again, ARM gets a handle ad returns another; in this case, it gets the transaction
handle you got and returns a start handle. The handle is needed to end the right
transaction.
After the transaction completes with a successful Verification Point, you need to
end the transaction using the call in Example 9-7.
Example 9-7 Specifying the transaction stop
stop_rc = arm_stop(start_handle,0,0,"0",0)
This will close the transaction. As you can see, we ensure that we are closing the
transaction by starting the stop call, which includes the transaction start handle.
The last call (Example 9-8) you need is for cleanup purposes and can be
included at the end of the script. The end call sends the application handle you
received with the initialization.
Example 9-8 ARM cleanup
end_rc = arm_end(appl_handle,0,"0",0)
This will complete the set of API calls for the transaction you are simulating.
Chapter 9. Rational Robot and GenWin
353