Transaction MultiPLeXor (TMPLX)

User Guide

Revision 1.0

Product utilisation
____________________

This product have been tested in the respect of quality controls.  ROBERT LAFLAMME is not responsible for wrong usage of this product by the user.  The user must follow usage rules defined in this manuel.  If you get technical problems, you can contact technical support of ROBERT LAFLAMME by rlafla@excite.com eMail.


Introduction
____________

TMPLX product is set of two applications written in Visual Basic (STMPLX, MTMPLX) and one OCX (CTLTMPLX) which can be integrated in development toolkits like Visual C++, Delphi ou Visual Basic.  TMPLX OCX interact whith STMPLX (TMPLX server).  MTMPLX application manage TMPLX operationnal Database.

Principle of operation
______________________

TMPLX server and manager (STMPLX et MTMPLX) are the kernel of the system.  Around the kernel, client applications are developped  by user.  Those client applications are written in integrating CTLTMPLX OCX.  This TMPLX OCX open a way to connect the application to STMPLX server and exchange data between all other clients connected to the server.  STMPLX server task is to analyse an incoming transaction from a client and dostribute this transaction to target clients.  Target clients are selected depending on parameters of TMPLX operationnal Database.

TMPLX  installation
___________________

Required software

Visual Basic 5.0 RUNTIME must be present on computer running TMPLX application.

0. Unzip compressed file in a working directory.  You get one sub-directory by major component of TMPLX. 

You install TMPLX by running three distinct steps.

1. Install of STMPLX (TMPLX server)

On the target host, run StmplxSetup.exe (sub-directory Stmplx\Disque1) program and follow installation instruction displayed. 

2. Install of MTMPLX (TMPLX manager) 

On the same host than the preceding installation, run MtmplxSetup.exe (sub-dorectory: Mtmplx\Disque1) program and follow installation instruction displayed. 

3. Install CTLTMPLX (TMPLX OCX)

On the development host, run CtltmplxSetup.exe (sub-directory: Ctltmplx\Disque1) program and follow installation instruction displayed.

Customization of TMPLX operationnal Database
____________________________________________

TMPLX Database is managed by MTMPLX application.  To exchange data between TMPLX clients, the user must define clients, units of client which can receive transactions and records of client than a client can accept.

User interface MTMPLX help the user in the management process of TMPLX Database.   "MTMPLX usage sample" show how to customize a TMPLX operationnal Database.


Using CTLTMPLX
______________

Connect to and disconnect from STMPLX
_____________________________________

To do the job, an apllication written with CTLTMPLX must be connected to TMPLX server.  The user must set IP address and port number of the host STMPLX. Those values are registred in Windows registry entries for TMPLX OCX.  The registry entries for CTLTMPLX are defined during the first exexution of TMPLX OCX.  The application programmer can modify those registry entries in using standards VB call to registry (functions GetSettings, SaveSettings, etc...) or in running "Regedit" Windows program.

Moreover the ClientIdent and ClientPassword properties must be initialized by values in concondance with the content of TMPLX operationnal Database (a valid client record and his associated password).  Next, the programmer have to call  ConnectToServer method.  TMPLX OCX raise an event named ConnectionEnd with Error_Code property set to status of connection. 

TMPLX OCX after a valid connection return in UnitsIdRef, RecordsIdRef, RecordsPositionRef and RecordsValueRef collection all links to units and records for this connected client.  Thus TMPLX OCX give to the programmer a way to validate transactions sended to and received from STMPLX.  The programmer is responsible of this validation and all the required action needed. 

Knowing units of connected client
_________________________________

UnitIdRef collection is given to the programmeur by TMPLX OCX.  This collection show which are the units for this connected client (from TMPLX operationnal Database).  The application programmer get the units identification by using Item property of the collection.

*** Warning ***    modifying this collection have no impact on the process of TMPLX OCX.


Knowing records of connected client
___________________________________

RecordsIdRef, RecordsPositionValue and RecordsValueref are given to the programmer by TMPLX OCX.  Those collections show which are the records and their definition for this connected client. The application programmer get the record information by using Item property of those collections. 

*** Warning ***    modifying those collections have no impact on the process of TMPLX OCX.

Sending a transaction to STMPLX (TMPLX server)
______________________________________________

The client application is responsible for the formating of transactions which are sended to the server for routing to other clients connected to TMPLX server.

Send_To_Server method is the call used to send a formated transaction by client application. This method need value initialisation of : 

More_Transaction_For_This_Send
------------------------------

Boolean variable.
 
Indicate to TMPLX OCX that it can initiate the transmission process to the TMPLX server.  On "False" value, transmission is initiated immedialty.
 
On "True" value, TMPLX OCX store transactions in internal process and do the transmission in sequence only after a "False" value setting.

This flag is used to help programmer in the management of many transactions in the same bundle.  The programmer do not have to insert delay between transactions.  TMPLX OCX get transactions in memory and wait the end of bundle before sending transactions to TMPLX server.
 
By exemple, suppose than every 10 minute, an unit send twenty transactions.  The client application get those 20 transactions from unit and format them as required before initiate process of sending those formated transactions in using a LOOP.  In the LOOP, the first nineteen transactions are sended with the More_Transaction_To_Send set to "True" value and the last transaction (twentieth) with the More_Transaction_To_Send set to "False value.


Ident_Of_Destination
--------------------

This is the identification of the unit which have to get the transaction sended by this client application. 

Data_To_Send
------------

This is the transaction to transmit to the Ident_Of_Destination.

ConnectionEnd event
___________________


Raise by TMPLX OCX, this event notify the program on the status of connection with the TMPLX server.  The "lng" extension file where you find TMPLX OCX (CTLTMPLX.ocx) show return code available from TMPLX OCX.  Thoses values are set in Error_Code and Error_Message properties of TMPLX OCX.


NewDataFromServer event
_______________________

Notify and return transaction data received form TMPLX server.  This event have two parameters, identification of the unit sending this transaction (Id_Unit) and the transaction data (Data_Unit).
 
Application developper is responsible to code required process according to received data.
 
Registry entries - client application
_____________________________________

Registry entries of TMPLX OCX are created, by default, under application name TMPLXocx.

You can use another application name in including in working directory of client application (using CTLTMPLX.ocx) a file named IdAppl.txt.  This file must contain one line.  This line give the application name selected for this client application.

When you must run many client application of TMPLX on the same host, this functionnality isolate registry entries of each client application and thus you can change parameters of one client application without interfering other applications.

Using MTMPLX
____________

On MTMPLX application startup, the user receive a screen asking him "input the authorization code:".  By default, this authorization code is : "tmplxLogON".

After completion of validation login to manager, the program display the management screen of MTMPLX

Suppose than client No1 have to receive records One and Two (record code GO1 and GO2 in position four and seven of transaction respectively) from unit ZC6.

With MTMPLX program, you have to add a client (click on button). This action open a part of screen and you have to complete the clients area with the identification " No1 ", tab to the next area (Description) and type a client description, tab to the next area (Password) and set the password as you wish and complete the validate password area with the same password set in the preceeding area.  Click on the process button.  You add client No1 in the operationnal database of TMPLX.

Do the same activities to add the unit (ZC6).  However, you have only Units area and description area to complete.
 
In doing two times thoses following activities, you can add the two records add.  You must specify for the record identification " One ", the record value 71;79;49 and start position 4 and.  For the record identification " Two ", the record value 71;79;50 and start position 7 have to be specified.

Attention : a client can receive all records from units linked if you specify record without code validation to this client.  In this case, you would have in the operationnal database of TMPLX a record named " WithoutCode " with a start position 0.  A client linked to this record identification will receive all records from units linked to him.

A last step is required to link units and records to a client.  A click on client No1 listed in the combo " Clients " open a part of screen named " Update or delete a client ".

This part of screen display two link buttons.  Click on " Link unit " and you get another part of screen a the right of the screen.  In the list " Unlinked " select ZC6 and click on right arrow.  You have linked ZC6 to client No1.
 
The same process have to be done with the button " Link record ".

 ***   Warning   ***   It is appropriate to backup, on a regular basis, the operationnal database of TMPLX.  This is the file named TMPLX.mdb.

