lr.get_transaction_status
Returns the current status of a transaction. Java
Double lr.get_transaction_status( String transaction )
| Transaction Functions | Java Syntax |
Arguments
| Name | Comments |
|---|---|
| transaction | A string indicating the name of the transaction. |
lr_get_transaction_status returns the current status of an open transaction. lr_get_transaction_status cannot be invoked after lr_end_transaction. Since lr_get_transaction_status can only return the status of an open transaction, it cannot report the final transaction status.
This function can be useful when a transaction that is made up of a number of steps can fail at various points. By checking the status and terminating the Vuser, you can prevent unnecessary activity.
Note: If "Continue on Error" is not set, the transaction may fail on an error. If a lr_get_transaction_status step is after the point where the error occurs, the transaction flow will stop at the error and the step will not be reached.
Return Values
Returns the transaction status or a negative number on error. See Transaction Status
Parameterization
You cannot use standard parameterization for any arguments in this function.
Example
The following example preempts calls that will probably fail by checking the transaction status along the way.
int status;
lr.start_transaction ("Flight");
web.url("home;sz=234x60;tile=1;ord=977672495775323400",
"URL=http://ad.doubleclick.net/...ord=977672495775323400", new String[] {
"Mode=URL", //... web.LAST});
if (lr.get_transaction_status("Flight") == lr.FAIL) {
// web.url has failed the transaction. No point in continuing,
// because future calls will probably also fail.
lr.end_transaction("Flight", lr.FAIL);
return -1;
}
// Carry on ...
status = web.submit_data("flight",
"Action=http://www.Web-tours.com/cgi-bin/tours?ITN_RESPONSE+", new String[] {
"Method=POST", "TargetFrame=",
//...
web.LAST} , new String[] { "MY DATA", //... web.LAST});

