Broadcast Agent scripts: Updating AccountingIntegrator Rule Engine via Broadcast Agent

Integrating AccountingIntegrator Rule Engine into the Broadcast Agent

Common.xml file

Customizable XML parameters for functions in Common.xml file

Changing from FTP to SFTP

Integrating AccountingIntegrator Rule Engine into the Broadcast Agent

To simplify the integration of AccountingIntegrator EnablerRule Engine into the Broadcast Agent, the Agent scripts AutoCommit.xml, BackToDesign.xml and UpdateProduction.xml implement:

  • An example to copy the ctx.mvt and mvt.mvt files to a local ${RDJ_EXEC}/dat path, without executing update scripts.
    1. Enter this variable in the User parameters attribute of the AccountingIntegrator Enabler Axway Server: -DCOPY_RM=1.
    2. Check that the variables execution path (RDJ_EXEC) in the Parameters tab points to the copy destination.
    3. The -DCOPY_RM=1 argument is ignored if -DUPDATE_RM=1 is present.
  • An example to update a local AccountingIntegrator Rule Engine, that is, an AccountingIntegrator Rule Engine installed on the same machine as the Broadcast Agent.
    1. Enter this variable in the User parameters attribute of the AccountingIntegrator EnablerAxway Server: -DUPDATE_RM=1.
    2. Check that the variables execution path (RDJ_EXEC) and installation path (RDJ_HOME) in the Parameters tab of the Axway Server are set correctly.
  • An example to update a remote AccountingIntegrator Rule Engine via an FTP transfer between a Windows and UNIX machine.
    1. Create a CommNetwork with CommNetwork type TCP.
    2. Under the Host > Communication tab, select the TCP CommNetwork and set Main Host Name with the FTP hostname.
    3. Under the Axway ServerParameters tab:
      1. Enter this variable in the User parameters attribute of the AccountingIntegrator Enabler Axway Server: -DUPDATE_RM=1.
      2. Check that the variables execution path (RDJ_EXEC) and installation path (RDJ_HOME) in the Parameters tab of the Axway Server are set correctly.
      3. Select Remote installation and enter Remote user name and Remote user password in the Parameters tab of the AccountingIntegrator Rule Engine.

In addition, the common functions called during execution are stored in the Common.xml file. You can customize the content of these functions when you install AccountingIntegrator Enabler.

Caution: When using -DUPDATE_RM=1 to broadcast to a remote AccountingIntegrator Rule Engine (Remote installation is selected), the update scripts RDJRCH and RDJMAJ will not be called. The update procedure is done by the target machine.

Common.xml file

The Common.xml file provides the functions:

The file contents are shown as follows:

     <!-- ================================================================ -->

     <!-- Name   : Common                                                  -->

     <!-- Date   : 10 12 2004                                              -->

     <!-- Author : XRDJ                                                    -->

     <!-- ================================================================ -->

     

     <!-- ================================================================ -->

     <!-- Name   : fileTransfer                                           -->

     <!-- Object : Transfer data in a remote  Rule Engine environment     -->

     <!-- Date   : 10 12 2004                                              -->

     <!-- Author : XRDJ                                                    -->

     <!-- Values : RDJ_EXEC       XRDJ  Rule Engine Operating PATH         -->

     <!--        : RDJ_HOME       XRDJ  Rule Engine Repository PATH        -->

     <!--        : FT_GET_PATH    Data path source                         -->

     <!--        : FT_PUT_PATH    Data path output                         -->

     <!--        : FT_HOST        XRDJ  Rule Engine TCP/IP HostName machine -->

     <!--        : FT_HOST_TYPE   XRDJ  Rule Engine machine type            -->

     <!--        : FT_USER        XRDJ  Rule Engine Login machine           -->

     <!--        : FT_PWD         XRDJ  Rule Engine Pwd machine            -->

     <!--        : FT_TMP_PATH    PATH for temporary files                  -->

     <!--                                                                  -->

     <!-- Pre-Requisite for ANT FTP : apache-ant-1.6.2 / commons-net-1.2.2 -->

     <!-- ================================================================ -->

     <target name="fileTransfer">

        <echo message=" "/>

        <echo message="================| Files Transfer |================="/>

        <echo message="Get Files PATH          : ${FT_GET_PATH}"/>

        <echo message="Put Files PATH          : ${FT_PUT_PATH}"/>

        <echo message="TCP/IP HostName machine  : ${FT_HOST}"/>

        <echo message="Login machine            : ${FT_USER}"/>

        <echo message=" "/>

        

        <ftp server="${FT_HOST}"

             userid="${FT_USER}"

             password="${FT_PWD}"

             remotedir="${FT_PUT_PATH}"

             binary="no"

             verbose="yes"

             action="put">

      <fileset dir="${FT_GET_PATH}">

                <include name="*.*"/>

                </fileset>

        </ftp>

        

     </target>

     <!-- ================================================================ -->

     <!-- Name   : fileCopy                                                -->

     <!-- Object : Copy data in a local  Rule Engine environment           -->

     <!-- Date   : 10 12 2004                                              -->

     <!-- Author : XRDJ                                                    -->

     <!-- Values : RDJ_EXEC       XRDJ  Rule Engine Operating PATH         -->

     <!--        : RDJ_HOME       XRDJ  Rule Engine Repository PATH        -->

     <!--        : FC_GET_PATH    Data path source                         -->

     <!--        : FC_PUT_PATH    Data path output                         -->

     <!--        : FC_USER        XRDJ  Rule Engine Login machine           -->

     <!--        : FC_PWD         XRDJ  Rule Engine Pwd machine             -->

     <!--        : FC_TMP_PATH    PATH for temporary file                  -->

     <!-- ================================================================ -->

     <target name="fileCopy">

        <echo message=" "/>

        <echo message="===================| Files Copy |==================="/>

        <echo message="Get Files PATH  : ${FC_GET_PATH}"/>

        <echo message="Put Files PATH  : ${FC_PUT_PATH}"/>

        <echo message=" "/>

        

        <copy todir="${FC_PUT_PATH}/dat">

                <fileset dir="${FC_GET_PATH}">

                <include name="*.*"/>

                </fileset>

        </copy>

        

     </target>

     <!-- ================================================================ -->

     <!-- Name   : localScriptExecution                                    -->

     <!-- Object : Execute a local  Rule Engine script                     -->

     <!-- Date   : 10 12 2004                                              -->

     <!-- Author : XRDJ                                                    -->

     <!-- Values : RDJ_EXEC       XRDJ  Rule Engine Operating  PATH        -->

     <!--        : RDJ_HOME       XRDJ  Rule Engine Repository PATH        -->

     <!--        : SE_USER        XRDJ  Rule Engine Login machine           -->

     <!--        : SE_PWD         XRDJ  Rule Engine Pwd machine             -->

     <!--        : SE_SCRIPT      Script to execute                        -->

     <!--        : SE_SCRIPT_PATH Script PATH                              -->

     <!--        : SE_TMP_PATH    PATH for temporary files                  -->

     <!-- ================================================================ -->

     <target name="localScriptExecution">

<echo message=" "/>

        <echo message="=============| Local script execution |============="/>

        <echo message="Script   : ${SE_SCRIPT_PATH}/${SE_SCRIPT}"/>

        <echo message="RDJ_EXEC : ${RDJ_EXEC}"/>

        <echo message="RDJ_HOME : ${RDJ_HOME}"/>

        <echo message=" "/>

<exec dir="${SE_SCRIPT_PATH}"

              executable="${SE_SCRIPT_PATH}/${SE_SCRIPT}"

              output="${SE_TMP_PATH}/script_execution.log"

              resultproperty="SE_RES"

              failifexecutionfails="true">

        <env key="RDJ_EXEC" value="${RDJ_EXEC}"/>

        <env key="RDJ_HOME" value="${RDJ_HOME}"/>

        </exec>

        <concat>

                <fileset dir="${SE_TMP_PATH}" includes="script_execution.log"/>

        </concat>

        <antcall target="exitErrorScriptExecution"/>

     </target>

     

     <target name="exitErrorScriptExecution" depends="common_check" unless="isScriptExecutionResultOk">

        

        <echo message=" "/>

        <echo message="===================| ERROR !!!! |==================="/>

        <echo message=" An error has occurred during script execution ... "/>

        <echo message=" "/>

        <fail> An error has occurred during script execution </fail>

     </target>

     <target name="common_check">      

          <condition property="isScriptExecutionResultOk">

<equals arg1="${SE_RES}" arg2="0"/>

          </condition>

     </target>

     

Customizable XML parameters in Common.xml file

Some parameters are differentiated by a prefix XX, where XX refers to:

  • FT for fileTransfer functions (FT_USER, FT_PWD, FT_TMP_PATH...)
  • FC for fileCopy functions (FC_USER, FC_PWD, FC_TMP_PATH...)
  • SE for localscriptExecution functions (SE_USER, SE_PWD, SE_TMP_PATH...)
Parameter Description Functions concerned

RDJ_EXEC

File path to the AccountingIntegrator Rule Engine operating directory. This parameter is the value of the Operating Path [RDJ_EXEC] field of the Axway Server object.

All

RDJ_HOME

File path to the AccountingIntegrator Rule Engine installation directory. This parameter is the value of the Installation path [RDJ_HOME] field of the Axway Server object.

All

XX_GET_PATH

File path to the directory where the Broadcast Agent stores the update configuration ctx.mvt and mvt.mvt.

All

XX_PUT_PATH

File path to AccountingIntegrator Rule Engine configuration directory [RDJ_EXEC]/dat

All

FT_HOST

Name of Host used in the AccountingIntegrator Enabler AxwayServer object specified as either of the following values:

  • Name of the Host object referenced in the Axway Server, if you selected the Remote  Rule Engine check box.
  • localhost

fileTransfer only

FT_HOST_TYPE

Operating system of the host machine. For example, Win32, Win9x, UNIX, and so on.

fileTransfer only

XX_USER

Value of the Remote user field in the Axway Server object.

All

XX_PWD

Value of the User password field in the Axway Server object.

All

XX_TMP_PATH

Temporary directory for the current transformation environment. The system purges this directory at the end of the current transaction.

All

SE_SCRIPT

Name of the script to execute: RDJMAJ and RDJRCH

localScriptExecution only

SE_SCRIPT_PATH

File path to script to execute: [RDJ_EXEC]/script

localScriptExecution only

Changing the transfer protocol from FTP to SFTP (SSH File Transfer Protocol)

To add extra security for the transfer of the data to the AccountingIntegrator  Rule Engine, you can use the SFTP protocol.

In order to do this, however, you must perform manually the following steps:

  1. Stop the AccountingIntegrator Agent, if started.
  2. Open the Common.xml file located in the [INSTALL_FOLDER]/ Composer\enablers\AccountingIntegrator\broadcast\lib\axway\misc\AccountingIntegrator\agent\Shell_Reference_Xml.
  3. Modify the “fileTransfert” target by deleting or commenting the “ftp” task, as in the example below.

<!--ftp server="${FT_HOST}"

userid="${FT_USER}"

password="${FT_PWD}"

remotedir="${FT_PUT_PATH}"

binary="no"

verbose="yes"

action="${FT_ACTION}">

<fileset dir="${FT_GET_PATH}">

<include name="${FT_FILESET}"/>

</fileset>

</ftp-->

  1. Then add the following task:

<scp trust="true" todir="${FT_USER}:${FT_PWD}@${FT_HOST}:${FT_PUT_PATH}">

<fileset dir="${FT_GET_PATH}">

<include name="${FT_FILESET}"/>

</fileset>

</scp>

  1. Start the AccountingIntegrator Agent and perform broadcast operations with the new protocol.

Back to top

Related Links