Parameters of Transactions

You can specify input parameters for a transaction to send constant values or random variables specific for a user to the transaction. A transaction has no output parameters. Inside the transaction the input parameters are treated like random variables or constants. Therefore transaction parameters cannot be placed on the left side of assignments.

Syntax

TParList = TParam { ";" TParam }.

TParam   = IdentList ":" PType.

PType    = "string" "(" number ")"
         | "number"
         | "boolean"
         | "float".

TParlist contains the formal input parameters of the transaction. The identifiers in IdentList are parameters of type PType. Random variables returning type number, string, boolean or float and constants of these types are valid parameters of a transaction. Number, type and sequence of the actual parameters of a transaction (defined in the workload section) must correspond to number, type and sequence of the formal parameters of the transaction. Parameters of transactions are passed by reference.

If the actual parameter is a random variable, you must specify the type of the return value of the random variable (number, string, boolean or float), but not the type of the random variable (RndUniN, RndUniI, RndExpF,...), as the type of the formal parameter (PType). The length of the actual parameter must be less than or equal to the length of the formal parameter. If you omit a length specification for a formal parameter of type string, a string parameter of length 253 is defined.

Example

dclrand
  rArtNo1 : RndUniN(1..5000);
  rArtNo2 : RndUniN(5001..10000);

dcluser
  user
    User1
  transactions
    Selling(rArtNo1, "User1") : 100;

  user
    User2
  transactions
    Selling(rArtNo2, "User2") : 50;

dcltrans
  transaction Selling(pArtNo: number; pUser: string)
  var
    i : number init 1;
    j : array [20] of number;
    sName : string;
  begin
    ...
    j[i] := pArtNo;
    sName := pUser;
    ...
    i := i+1;
  end Selling;

The example shows a portion of a Silk Performer program. User1 assigns the actual parameters rArtNo1 (a random variable) and "User1" (a constant string) to the formal parameters pArtNo and pUser of the transaction Selling. User2 assigns the random variable rArtNo2 and the constant string "User2" to the formal parameters pArtNo and pUser of the transaction Selling. The parameter pArtNo is treated like a random variable. Therefore each time pArtNo is used, a new random value is generated.