BEA Logo BEA eLink Adapter for BroadVision Release 1.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   eLink Adapter for BroadVision Doc Home   |   eLink Adapter for BroadVision User Guide   |   Previous Topic   |   Next Topic   |   Contents   |  

eLink Adapter for BroadVision Object Library API

 

This appendix supplies reference information on each of the objects in the BroadVision Adapter Object Library. A summary of these objects is provided Table 4-2:

Table 4-2 Summary of BroadVision Objects

Object

Create With

Description

BVI_TuxAdapter

new

Stores the Adapter Configuration File and is used to create BVI_TuxSession objects.

BVI_TuxSession

BVI_TuxAdapter::
getNewSession()

Stores errors that occur within a BroadVision session when creating BVI_TuxService objects.

BVI_TuxService

BVI_TuxSession::
getNewService()

Represents the remote eLink Platform service. Create a new BVI_TuxService object for each distinct service you are calling. Also create a new BVI_TuxService object for each simultaneous asynchronous service you are calling.

BVI_TuxMessage

new

Represents a buffer containing request parameters or a response from the remote eLink Platform service. Capable of storing an entire table of information.

BVI_TuxError

Created automatically as necessary

Contains error information returned from the remote eLink Platform application, the eLink Platform environment and the Adapter.

 


BVI_TuxAdapter

Represents the Adapter object.

Attributes

None

BVI_TuxAdapter(string configFile)

Creates and returns a BVI_TuxAdapter object.

Parameters

configFile points to the configuration file. This file would contain various parameters for the adapter.

Returns:

A reference to newly created BVI_TuxAdapter object.

BVI_TuxSession BVI_TuxAdapter::getNewSession()

Creates and returns a BVI_TuxSession object. The newly created object should be attached to the BroadVision session object by the JavaScript developer

Parameters

None

Returns

A reference to a newly created BVI TuxSession object.

 


BVI_TuxSession

Represents a eLink Platform session.

Attributes

Readonly BVI_TuxError error

that contains error information encountered during a call to the BVI_TuxSession::getNewService() method

BVI_TuxService BVI_TuxSessioni::getNewService(String serviceName)

Creates and returns a new BVI_TuxService object.

Parameters

serviceName is the BroadVision application name for the new service. This serviceName should be mapped to a valid eLink Platform service name in the adapter configuration file.

Returns

A reference to a newly created BVI_TuxService object.

 


BVI_TuxService

Represents an eLink Platform service.

Attributes

readonly string serviceName

//BroadVision application name for the service

readonly BVI_TuxMessage input

//Input message required for this service

readonly BVI_TuxMessage output

//Output message for this service

readonly BVI_TuxError error

//Error returned from this service

bool BVI_TuxService::execute(BVI_TuxMessage message)

Calls the corresponding eLink Platform service. Caller of the execute call blocks till a reply is available from the eLink Platform service.

Parameters

message is the request message to be sent to the remote eLink Platform service.

Returns

True if the call is successful. The response from the eLink Platform service is available in the output attribute of the current service object. False if the call fails. The attribute error contains an error indication if the call fails.

bool BVI_TuxService::executeAsync(BVI_TuxMessage message)

Calls the corresponding eLink Platform service.

Parameters

message is the request message to be sent to the remote eLink Platform service.

Returns

True if the call is successful. To access the response from the called eLink Platform service, method getReply() should be called. False if this call fails. Attribute error contains an error indication if the call fails.

boolean BVI_TuxService::getReply()

This method should be called only after the executeAsync() method is called, otherwise the method fails and returns false.

Parameters

None

Returns

True if the call is successful. The response from the eLink Platform service is available in the output attribute of the current service object. False of the call fails. Attribute error contains an error indication if the call fails.

boolean BVI_TuxService::Cancel()

Cancels a previous executeAsync() call. This method should be called only after the Execute async() method is called; otherwise, the method fails and returns false.

Parameters

None

Returns

True if the call is successful. False otherwise.

 


BVI_TuxMessage

Represents a message traveling to or from an eLink Platform service object.

Attributes

readonly BVI TuxError error

//Contains errors encountered during a call to methods

boolean addShort(string name, short value)

Represents a message traveling to a Tuxedo service object.

Parameters

name is the eLink Adapter field name.
value is the value to be added to this buffer.

Adds value to the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean addLong(String name, long value)

Parameters

name is the eLink Adapter field name.
value is the value to be added to this buffer.

Adds value to the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean addChar(string name, char value)

Parameters

name is the eLink Adapter field name.
value is the value to be added to this buffer.

Adds value to the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean addFloat(string name, float value)

Parameters

name is the eLink Adapter field name.
value is the value to be added to this buffer.

Adds value to the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean addDouble(string name, double value)

Parameters

name is the eLink Adapter field name.
value is the value to be added to this buffer.

Adds value to the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean addString(string name, string value)

Parameters

name is the eLink Adapter field name.
value is the value to be added to this buffer.

Adds value to the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean addBytes(string name, BVI_ValueList value)

Parameters

name is the eLink Adapter field name.
value is the value to be added to this buffer. It is expected that for each element's `e' of value, e.octetValue contains valid data.

Adds value to the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean setLong(string name, int occurrence long value)

Parameters

name is the eLink Adapter field name.
occurrence is the occurrence of the field to get.
value is the value gotten from the buffer.

Sets the value from the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean setShort(string name, int occurrence, Short value)

Parameters

name is the eLink Adapter field name.
occurrence is the occurrence of the field to get.
value is the value gotten from the buffer.

Sets the value from the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean setChar(string name, int occurrence, char Value)

Parameters

name is the eLink Adapter field name.
occurrence is the occurrence of the field to get.
value is the value gotten from the buffer.

Sets the value from the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean setFloat(string name, int occurrence, float value)

Parameters

name is the eLink Adapter field name.
occurrence is the occurrence of the field to get.
value is the value gotten from the buffer.

Sets the value from the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean setDouble(string name, int occurrence, double value)

Parameters

name is the eLink Adapter field name.
occurrence is the occurrence of the field to get.
value is the value gotten from the buffer.

Sets the value from the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean setString(string name, int occurrence string value)

Parameters

name is the eLink Adapter field name.
occurrence is the occurrence of the field to get.
value is the value gotten from the buffer.

Sets the value from the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean getShortDef(string name, int occurrence, BVI_Value value, short defaultValue)

Parameters

name is the FML name.
occurrence of the field to get.
value contains the value.short value gotten from the buffer.
defaultValue is the default value to return.

Gets the value from the buffer as an occurrence of name into the value. If either field specified by name and occurrence does not exist, defaultValue is returned in value.

Returns

True if the value can be gotten successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean getCharDef(string name, int occurrence, BVI_Value value, char defaultValue)

Parameters

name is the FML name.
occurrence of the field to get.
value contains the value.short value gotten from the buffer.
defaultValue is the default value to return.

Gets the value from the buffer as an occurrence of name into the value. If either field specified by name and occurrence does not exist, defaultValue is returned in value.

Returns

True if the value can be gotten successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean setBytes(string name, int occurrence, BVI_ValueList value)

Parameters

name is the eLink Adapter field name.
occurrence is the occurrence of the field to get.
value is the value gotten from the buffer. It is expected that for each element of `e' of value, e.octetValue contains valid data.

Sets the value from the buffer as an occurrence of name.

Returns

True if the value can be added successfully. False if the call fails. The attribute error contains the error due to which this call failed.

int getOccurrenceCount(stringname)

Parameters

name is the eLink Adapter field name.

Gets the number of occurrences of name in this message.

Returns

Number of occurrences of name in this message. If the function fails, -1 is returned.

boolean getLongDef(string name, int occurrence, BVI_Value value, long faultValue)

Parameters

name is the FML name.
occurrence of the field to get.
value contains the value.long value gotten from the buffer.
defaultValue is the default value to return.

Gets the value from the buffer as an occurrence of name into the value. If either field specified by name and occurrence does not exist, defaultValue is returned in value.

Returns

True if the value can be gotten successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean getFloatDef(string name, int occurrence, BVI_Value value, float defaultValue)

Parameters

name is the FML name.
occurrence of the field to get.
value contains the value.double value gotten from the buffer.
defaultValue is the default value to return.

Gets the value from the buffer as an occurrence of name into the value. If either field specified by name and occurrence does not exist, defaultValue is returned in value.

Returns

True if the value can be gotten successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean getDoubleDef(string name, int occurrence, BVI_Value value, double defaultValue)

Parameters

name is the FML name.
occurrence of the field to get.
value contains the value.long value gotten from the buffer.
defaultValue is the default value to return.

Gets the value from the buffer as an occurrence of name into the value. If either field specified by name and occurrence does not exist, defaultValue is returned in value.

Returns

True if the value can be gotten successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean getStringDef(string name, int occurrence, BVI_Valuev value, string defaultValue)

Parameters

name is the FML name.
occurrence of the field to get.
value contains the value.string value gotten from the buffer.
defaultValue is the default value to return.

Gets the value from the buffer as an occurrence of name into the value. If either field specified by name and occurrence does not exist, defaultValue is returned in value.

Returns

True if the value can be gotten successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean getbytesDef(string name, int occurrence, BVI_Value value, BVI_ValueList defaultValue)

Parameters

name is the FML name.
occurrence of the field to get.
value contains the value gotten from the buffer.
defaultValue is the default value to return.

Gets the value from the buffer as an occurrence of name into the value. If either field specified by name and occurrence does not exist, defaultValue is returned in value.

Returns

True if the value can be gotten successfully. False if the call fails. The attribute error contains the error due to which this call failed.

boolean nextField(BVI_Value name, BVI_Value occurrence)

Parameters

name is the name of a field when the method is called and the name of the next field when the method returns. It is expected that name.stringValue contains the eLink Adapter for BroadVision field name.
occurrence of the field when the method is called. Occurrence of the next field when the method returns. It is expected that occurrence.intValue contains the occurrence.

Finds the next field in this TuxMessage object after name and occurrence.

Returns

True if the next field exists. False if the end of the buffer is reached. The attribute error is set to null. False if an error occurs. The attribute error contains the error due to which this call failed.

boolean fieldType(string name)

Parameters

name is the name of the field whose type is to be determined.

Returns the type of name.

Returns

A string containing a type of name. If the field type of the name cannot be determined, then the returned string will be empty.

 


BVI_TuxError

Represents various errors generated by the adapter library.

Attributes

int errorType

//Type of the error

int errorCode

//Code of the error

string message

//string representation of the error message

errorType can take these values

eLink PlatformERROR
APPLICATIONERROR
ADAPTERERROR

When errorType is eLink PlatformERROR

This error is returned when the adapter library receives an error from an ATMI call. message contains error messages obtained by calling tpstrerror() for the errorCode. errorCode can take one of the following values:

TPEABORT

1

TPEBADDESC

2

TPEBLOCK

3

TPEINVAL

4

TPELIMIT

5

TPENOENT

6

TPEOS

7

TPEPERM

8

TPEPROTO

9

TPESVCERR

10

TPESVCFAIL

11

TPEABORT

12

TPETIME

13

TPETRAN

14

TPGOTSIG

15

TPERMERR

16

TPEITYPE

17

TPEOTYPE

18

TPERELEASE

19

TPEHAZARD

20

TPEHEURISTIC

21

TPEEVENT

22

TPEMATCH

23

TPEDIAGNOSTIC

24

:

When errorType is APPLICATIONERROR

This error is returned only in response to BVI_TuxService.execute() and BVI)TuxService.getReply(). This error is returned if the called service executes tpreturn (TPFAIL). errorCode contains error code as returned by the called eLink Platform service. This code is obtained from the variable tpurcode. message is null. The error returned by a called eLink Platform service is available in BVI_TuxService.output.

When errorType is ADAPTERERROR

This error is returned when, for an Adapter-level error, errorCode can take one of the following values:

BAD_FIELD

The field name referred is not defined in the adapter configuration file.

FML_ERROR

An error has occurred while calling one of the eLink Platform FML functions. An attribute message of a current error object has the description about the error.

EXECUTEASYNC_NOT_CALLED

BVI_Service.get reply() or BVI_Service.cancel() is called without calling BVI_Service.executeAsync().

SERVICE NOT DEFINED

Service name is not defined in the Adapter Configuration file.

EXECUTEASYNC_IN_USE

BVI_TuxService.execute() or BVI_TuxService.executeasync() is called while a call to BVI_TuxSErvice.executeasync() is pending on the current service object.

 


Configuration File Structure

All of the variables defined at the eLink Adapter level are listed in the Server section.

//eLink Platform environment variables
*SERVER

TUXDIR=<eLink Platform directory>

APPDIR=<Application directory>

TUXCONFIG=<full path of eLink Platform configuration file>

FLDTBLDIR32=<Fields table directory>

FIELDTBLS32=<Name of the field table file>

// Variable Required to Login to the eLink Platform application

USER_NAME=<User Name>

CLIENT_NAME=<Client Name>

PASSWORD=<Password>

GROUP_NAME=<Group Name>

DATA=<data>

The Polling Interval for BVI_Service.execute call and enable debug/trace mode

PRALLEL_MODE_SLEEP_MILLISECONDS=<Time in milliseconds>

DEBUG_TRACE=1

//For each service that the eLink Adapter can call, there is an entry in the configuration file as follows:

*FIELD

FML_NAME=<Name of field in FML>

ADAPTER_FIELD_NAME=<Name of the field in BroadVision>

TUXCONFIG=<full path of eLink Platform configuration file>

FLDTBLDIR32=<Fields table directory>

FIELDTBLS32=<Name of the field table file>

*SERVICE

NAME=<eLink PlatformDomainServiceName>

ADAPTER_SERVICE_NAME=<BroadVisionDomainServiceName>

Adapter Configuration File Example

*SERVER

TUXDIR=</opt/tuxedo65>

APPDIR=<etc/salesapp>

TUXCONFIG=<etc/salesapp/tuxconfig>

FLDTBLDIR32=<etc/salesapp>

FIELDTBLS32=<fieldtable>

PARALLEL MODE SLEEP MILLISECONDS=1000

DEBUG_TRACE=1

USER_NAME=usr

CLIENT_NAME=clt

PASSWORD=paswd

GROUP NAME=grp

DATA=data

*FIELD

FML_NAME=SOURCE_ACCOUNT_NUMBER

ADAPTER_FIELD_NAME=SourceAccountNumber

*FIELD

FML_NAME=DESTINATION_ACCOUNT_NUMBER

ADAPTER_FIELD_NAME=DestinationAccountNumber

*FIELD

FML_NAME=AMOUNT_TO_TRANSFER

ADAPTER_FIELD_NAME=Amount

*FIELD

FML_NAME=TRANSFER_RESULT

ADAPTER_FIELD_NAME=Result

*SERVICE

Name=Balance enquiry

ADAPTER_SERVICE_NAME=InquireBalance