Retrieving Service Operation Content from Application Engine Programs

This section discusses how to:

  • Retrieve a transaction ID from an application engine program.

  • Instantiate a Message object using a transaction ID.

Understanding Retrieving Service Operation Content from Application Engine Programs

Within the application engine program, you can retrieve the transaction ID and thereby get an instantiated Message object to retrieve the content data respectively.

Retrieving Transaction IDs from Application Engine Programs

Use the GetIBTransactionIDforAE method on the %IntBroker object to get the transaction ID or simply write the SQL to retrieve the ID.

The following examples show how to get the transaction ID from an application engine program and instantiate a Message object.

Method from %IntBroker Object:

StrTransaction = %IntBroker.GetIBTransactionIDforAE
(string OperID, string Run Control ID);

&MSG = %IntBroker.GetMessage(StrTransaction, %IntBroker_SUB);

Or, you can write code within a SQL step similar to the following:

%SelectInit(IBTRANSACTIONID) 
 SELECT IBTRANSACTIONID 
  FROM PSIBRUNCNTL 
 WHERE OPRID = %Bind(OPRID) 
AND RUN_CNTL_ID = %Bind(RUN_CNTL_ID)

Or, you can perform a simple SQLExec as follows:

SQLExec("select ibtransactionid from psibruncntl where oprid = :1 and
 run_cntl_id = :2",

j_book_aet.oprid, j_book_aet.run_cntl_id, &ibtransid);

Instantiating Message Objects Using Transaction IDs

The following code example shows how to instantiate a Message object using the transaction ID from an application engine program:

&MSG = %IntBroker.GetMessage(J_BOOK_AET.IBTRANSACTIONID, %IntBroker_SUB);