Buffer Types

The Active Expert supports all TUXEDO buffer types.

FML16 and FML32 Buffers

An operation parameter defined in the Contract Repository is mapped straight to a parameter of the corresponding OLE Automation View. The type of the parameter is determined by the underlying Contract Repository element. For all element types supported by the Contract Repository, there is a matching OLE Automation type except in the case of user-defined structures and carrays. For a discussion of how structures get mapped to OLE Automation refer to the previous section of this document. Carrays are mapped to safearrays of bytes.

FML buffers support multiple occurrences of the same element. If the underlying element of a parameter is defined in the Contract Repository to occur more than once, the corresponding OLE Automation parameter is a safearray of the element's type. For [in] and [inout] parameters, it is the caller's responsibility to allocate the array. If the underlying element is defined in the Contract Repository to occur a fixed number of times, the parameter passed in has to be dimensioned to the same occurrence. For [out] parameters the Active Expert will allocate the array, so the variable passed in can be dimensioned to VARIANT.

The following example highlights the usage of occurring elements.

Listing 4-19 Definition of FML Buffers
typedef string balances[2];
typedef long accounts[2];
void TRANSFER(
in string SAMOUNT,
in accounts accounts,
out balances balances)
raises(TELLER_TRANSFERException);

Listing 4-20 FML Buffers in Visual Basic:
Dim str_SAMOUNT As String
Dim l_accounts(0 To 1) As Long
Dim str_balances(0 To 1) As String
str_SAMOUNT = tb_SAMOUNT.Text
For i = 0 To UBound(l_accounts)
l_accounts(i) = lb_accounts.List(i)
Next i
AccountOCX.TRANSFER str_SAMOUNT, l_accounts, str_balances
For i = 0 To UBound(str_balances)
lb_balances.AddItem str_balances(i)
Next i

Arrays of carrays are mapped to two-dimensional safearrays if the length of the carray element is fixed. If the length is variable; that is, it is defined to be 0 in the Contract Repository, the element is mapped to an array of safearrays of bytes.

VIEW16 and VIEW32 Buffers

TUXEDO views are defined in the Contract Repository via structures. Input and output view buffers used by operations are defined in terms of Contract Repository elements of structure type. An input or an output view buffer is mapped to a single [in] or [out] parameter of the corresponding OLE Automation View method. The type of the mapped parameter is the pseudo-object derived from the corresponding structure.

Views for which the view definition file specifies flags (for example, `C' or `L') are not supported for this release of the Active Expert.

The name of the parameter in the OLE Automation View corresponding to a View buffer is obtained as follows:

Input<operation name>Param
Output<operation name>Param

Carray Buffer

An input or an output carray buffer is mapped to a single [in] or [out] parameter of the corresponding OLE Automation View method. The type of the mapped parameter is a safearray of bytes.

The name of the parameter in the OLE Automation View corresponding to a Carray buffer is obtained as follows:

Input<operation name>Param
Output<operation name>Param

String Buffer

An input or an output string buffer is mapped to a single [in] or [out] parameter of the corresponding OLE Automation View method. The type of the mapped parameter is a BSTR.

The name of the parameter in the OLE Automation View corresponding to a String buffer is obtained as follows:

Input<operation name>Param
Output<operation name>Param.