Compartir a través de


Implementing the RequesterTrx element

To control whether the Transaction Requester publishes your document type for a create, update or delete, use the RequesterTrx element of the XML node. The RequesterTrx element enables you to specify whether the Transaction Requester should publish the current transaction as an XML document.

To use the RequesterTrx in a document type, you need to use an eConnect stored procedure named eConnectOutVerify. This stored procedure prevents the Transaction Requester from publishing a document where the RequesterTrx flag is set to 0.

To use the eConnectOutVerify stored procedure, call the eConnectOutVerify from the eConnect pre and post stored procedure of the business object associated with your XML node. To use the eConnectOutVerify stored procedure, your pre and post procedures must supply the following values:

  • Use the DOCTYPE parameter to specify the Transaction Requester document type. Use the same DOCTYPE value you used to add the document type to the eConnect_Out_Setup table. In the following example, the Transaction Requester document type is Employee.
  • Use the INDEX parameters (INDEX1 - 15) to identify the specific document you want to exclude from the Transaction Requester. You must supply a value for each index you defined in the eConnect_Out_Setup table for your document type. In the following example, the value of @I\_vEMPLOYID is assigned to INDEX1 to specify the ID of the employee.

The following SQL examples shows how to use eConnectOutVerify from the pre and post procedures for the Employee example. Notice how the pre procedure uses eConnectOutVerify to identify document type and the employee. Also, notice how the post procedure sets the eConnectOutVerify Delete parameter to 1. The Delete parameter restores the original configuration of the Transaction Requester.

Pre procedure example
/*** Call eConnectOutVerify proc ***/
if (@I_vRequesterTrx =0)
begin
    exec @iStatus = eConnectOutVerify
        @I_vDOCTYPE ='Employee',
        @I_vINDEX1=@I_vEMPLOYID ,
        @I_vINDEX2='',
        @I_vINDEX3='',
        @I_vINDEX4='',
        @I_vINDEX5='',
        @I_vINDEX6='',
        @I_vINDEX7='',
        @I_vINDEX8='',
        @I_vINDEX9='',
        @I_vINDEX10='',
        @I_vINDEX11='',
        @I_vINDEX12='',
        @I_vINDEX13='',
        @I_vINDEX14='',
        @I_vINDEX15='',
        @I_vDelete = 0,
        @O_iErrorState = @ iCustomState output
    select @iError = @@error
    if @iStatus = 0 and @ iError <> 0
    begin
        select @iStatus = @ iError
    end
    if (@iStatus <> 0) or (@ iCustomState <> 0)
    begin
        select @O_iErrorState = 9999 /* eConnectOutVerify proc returned an error value */
        exec @iStatus = taUpdateString
            @O_iErrorState ,
            @oErrString ,
            @oErrString output,
            @O_oErrorState output
    end
end

Post procedure example

/*** Call eConnectOutVerify proc ***/
if (@I_vRequesterTrx =0)
begin
    exec @iStatus = eConnectOutVerify
        @I_vDOCTYPE ='Employee',
        @I_vINDEX1=@I_vEMPLOYID ,
        @I_vINDEX2='',
        @I_vINDEX3='',
        @I_vINDEX4='',
        @I_vINDEX5='',
        @I_vINDEX6='',
        @I_vINDEX7='',
        @I_vINDEX8='',
        @I_vINDEX9='',
        @I_vINDEX10='',
        @I_vINDEX11='',
        @I_vINDEX12='',
        @I_vINDEX13='',
        @I_vINDEX14='',
        @I_vINDEX15='',
        @I_vDelete = 1,
        @O_iErrorState = @ iCustomState output
    select @iError = @@error
    if @iStatus = 0 and @ iError <> 0
    begin
        select @iStatus = @ iError
    end
    if (@iStatus <> 0) or (@ iCustomState <> 0)
    begin
        select @O_iErrorState = 9999 /* eConnectOutVerify proc returned an error value */
        exec @iStatus = taUpdateString
            @O_iErrorState ,
            @oErrString ,
            @oErrString output,
            @O_oErrorState output
    end
end