User Defined Types (UDTs)


This section discusses COM and ENUM UDTs.

COM Data Types

The supported COM data types for member variables in a struct are:

A COM User Defined Type (UDT, COM type VT_RECORD) is mapped to a TIBCO ActiveEnterprise class. For example:

Table 18 UDT Supported COM Data Types
COM Data Type
Unscoped TIBCO ActiveEnterprise
Data Type Name
Scoped TIBCO ActiveEnterprise Data Type Name
VT_RECORD 
Order 
Order 
MInstance 
/tibco/public/class/ae/…/Order 

ENUMs

The user-defined type ENUMs are mapped as i4 in the repository.

Table 19 ENUMs
COM Data Type
Unscoped TIBCO ActiveEnterprise
Data Type Name
Scoped ActiveEnterprise Data Type Name
ENUM 
i4 
/tibco/public/scalar/ae/i4 

ADO Recordset Data Object

The adapter accepts recordset pointers as method parameters and does the intrinsic conversion to/from a sequence of ActiveEnterprise classes to be in sync with the TIBCO Adapter SDK data types. However, the adapter does not support any embedded pointers as data types. Only the recordset pointers and ADO connection object pointers are supported for the current release, and not IDispatch. For example, in Visual Basic, a recordset can be treated as an object in method parameters. However, in the type library, the object is represented as an IDispatch pointer. Such scenarios, where objects are used in place of the recordset, are not supported. The recordset should be explicitly declared as ADODB.Recordset as method parameters for the adapter to work. The Import Metadata option on the Import Schema tab in TIBCO Designer will accept recordset pointers as method parameters, both in and out types. Among the different types of recordset available in the ADO libraries, only the snapshot recordset is supported, which corresponds to ODBC static cursors.

As all data contained in the recordset object essentially needs to be transported over the TIBCO messaging transport by the adapter, the recordset object implicitly or explicitly cannot contain data types that are not supported by the adapter. If the data type of any field contained in the recordset object is different from the data types supported by the adapter, the adapter will display an error. For example, if the recordset gets the data from an underlying SQL table where the data type for a column is binary, it cannot be transported by the adapter over the TIBCO messaging transport. The adapter displays an exception if any data types other than the supported ones are used in the recordset data object.

A list of mapping for data types in different layers is provided:

Table 20 Mapping for Data Types
SQL Server Data Type
Supported?
ADO Equivalent
OLE Equivalent
AE SDK Equivalent
bigint
No
adBigInt
-
-
binary
No
adBinary
-
-
bit
Yes
adBoolean
VT_BOOL
MBool
char
Yes
adChar
VT_BSTR
MStringData
datetime
Yes
adDBTimeStamp
VT_DATE
MDateTime
decimal
No
adNumeric
-
-
float
Yes
adDouble
VT_R8
MReal
image
No
adVarbinary
-
-
int
Yes
adInteger
VT_INT
MInteger
money
Yes
adCurrency
VT_CY
MFixed
nchar
Yes
adWChar
VT_BSTR
MStringData
ntext
Yes
adWChar
VT_BSTR
MStringData
numeric
No
adNumeric
-
-
nvarchar
Yes
adWChar
VT_BSTR
MStringData
real
Yes
adSingle
VT_R4
MReal
smalldatetime
Yes
adTimeStamp
VT_DATE
MDateTime
smallint
Yes
adSmallInt
VT_I2
MInteger
smallmoney
Yes
adCurrency
VT_CY
MFixed
sql_variant
No
adVariant
-
-
sysname
Yes
adWChar
VT_BSTR
MStringData
text
Yes
adChar
VT_BSTR
MStringData
timestamp
No
adBinary
-
-
tinyint
No
adVarbinary
-
-
uniqueidentifier
No
adGUID
-
-
varbinary
No
adVarbinary
-
-
varchar
Yes
adChar
VT_BSTR
MStringData

All the data types listed in the table are Microsoft SQL server specific. Other data providers might have slight variations on the data types and the mapping to ADO equivalent might vary depending on the provider.

ADO Connection Object

The adapter accepts ADO Connection Object pointers as method parameters and converts to and from ActiveEnterprise connclass classes to stay in sync with the TIBCO Adapter SDK data types. Such objects can only be used by TIBCO ActiveEnterprise clients (like TIBCO BusinessWorks) that want to utilize the COM Server methods using ADO Connection Objects. The TIBCO ActiveEnterprise clients will typically use recordset parameters provided in the other COM Server methods. All the requirements described for recordset parameters in the previous section are applicable. See the examples for more information.

Note that the adapter does not support any embedded pointers as data types; only recordset pointers and ADO Connection pointers are supported for the current release, and not IDispatch. For example, in Visual Basic, an ADO Connection Object can be treated as an object in method parameters. However, in the type library, the object is represented as an IDispatch pointer. Such scenarios, where objects are used in place of the ADO Connection object, are not supported. The ADO Connection object should be explicitly declared as ADODB.Connection as method parameters for the adapter to work.

The Import Metadata option on the Import Schema tab in TIBCO Designer will accept ADO Connection Object pointers as method parameters, both in and out types. The COM server should provide a method which has the Connection object as [out] or [out, retval]. Other COM server methods should have the Connection object as the [in] parameter. As a best practice, the COM server should also provide a method to release the ADO Connection; this method will also have the ADO Connection object as an [in] parameter.

COM Data Type
Unscoped TIBCO ActiveEnterprise Data Type Name
Scoped TIBCO ActiveEnterprise Data Type Name
VT_PTR
connclass
/tibco/public/class/ae/connclass


TIBCO Adapter™ for COM User’s Guide
Software Release 5.3, September 2005
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com