IRtConnection.TransmitAsync Method

The TransmitAsync method sends the data held by the supplied DataModel to the runtime system. This call is asynchronous. The TransmitAsync method does not wait for a reply and thus does not block the calling process. The call must supply a callback method, which is executed when the TransmitAsync processing completes.

Namespace – ABSuite.AccessLayer.Connector.Core

Assembly – Unisys.ABSuite.AccessLayer.Connector.Core (in Unisys.ABSuite.AccessLayer.Connector.Core.dll)

Syntax

Task<TransmissionObject> TransmitAsync(
   Object datamodel
)

Arguments

Return Value

None. The specified callback method handles the result of the transaction. It receives a TransmissionObject containing a DataModel with the response data from the host system.

Using the IRtConnection Interface for the TransmitAsync Method

The following code is an example of using the TransmitAsync method:

// In the main execution logic, call the TransmitAsync method
       // Create an instance of a PRODModel class
       PRODModel pModel = (PRODModel) ABSConnection.DataHandler.GetDataModelObject("PROD");
       // Populate the PRODModel 
       pModel._UserMAINT = "FIR";
      // Transmit the PRODModel by using the asynchronous method and 
       // supply a callback to handle the response from 
       //the host system
       TransmissionObject trObj = await ABSConnection.DataHandler.TransmitAsync(pModel);
       if (trObj != null && (trObj.State == TransmissionReturnCode.Ok)
       {
 // Check the DataModel type in the returned 
// TransmissionObject by using the ObjectClassName as the name of 
// the Ispec. 
// If it is a type of PRODModel, extract the data.
           if (ABSConnection.DataHandler.GetDataModelType(trObj.ObjectClassName) == typeof(PRODModel))
           {
               // Extract the Data from the PRDOModel object 
              // returned by the Connector.
               PRODModel pModel = (PRODModel)trObj.Datamodel;
               string Name = pModel.NAM;
               string ID = pModel.PRODUCT;
               decimal price = pModel.SELLPRICE;
               Int32 reOrderLevel = pModel.REORDLEV;
           }
       }