Skip to end of metadata
Go to start of metadata

This document gives an overview of the contents of the appSolute RTB Automation Toolkit. 

Automation Toolkit Structure

automation_toolkit
├───ant
│   └───template
│       └───props
├───appSolutions
│   └───appSolute
│       ├───RTB
│       │   ├───Automation
│       │   │   ├───definitions
│       │   │   └───js
│       │   └───Base
│       └───Utils
├───config
│   └───Jenkins
├───examples
├───logs
├───scm
│   └───custom
│       └───rtb
│           ├───images
│           ├───p
│           └───Utils
├───scripts
└───vendor
    ├───js
    └───lib


Automation Toolkit Contents

The toolkit contains the core features listed below.

Extended API for automation

An extended API

The core of the automation toolkit is an extended API written in OOABL. The API is built up with a base class that contains the core functionality and an implementing class that is used by the various wrapper API procedures that implement the automation processes. 
The extended API contains a collection of methods that can be used to automate common processes in Roundtable. The methods use a combination of the standard RTB API (rtb/p/rtb_api.p) and RTB Proxy procedures (rtb/proxy/p/*) to perform various common RTB work-flow actions. 

Base class:

appSolutions/appSolute/RTB/Base/RTBAutomationApi.cls

Implementation class to use for API:

appSolutions/appSolute/RTB/RTBAutomationApi.cls

Extensions to the base class should be done in appSolutions/appSolute/RTB/RTBAutomationApi.cls or some other class that inherits the base class.

API Wrapper procedures for CLI / script execution

The directory

appSolutions/appSolute/RTB/Automation

contains a series of wrapper procedures that can be used in scripts to execute from the command line or use in tools like Jenkins to perform common RTB actions.

These include:

  • appSolutions/appSolute/RTB/Automation/adrtb_selectivecompile.p - perform a selective compile of a workspace

  • appSolutions/appSolute/RTB/Automation/adrtb_createrelease.p - create a release in a workspace

  • appSolutions/appSolute/RTB/Automation/adrtb_buildimport.p - build an import control table in a workspace

  • appSolutions/appSolute/RTB/Automation/adrtb_processimport.p - process an import control table in a workspace

  • appSolutions/appSolute/RTB/Automation/adrtb_processschema.p - build and process schema updates in a workspace

  • appSolutions/appSolute/RTB/Automation/adrtb_makedeployment.p - make a deployment from a workspace

  • appSolutions/appSolute/RTB/Automation/adrtb_wsintegritycheck.p - check the integrity of all objects in a workspace

  • appSolutions/appSolute/RTB/Automation/adrtb_template.p - template wrapper procedure that can be used as a starting point for new procedures.

Ant scripts and template scripts

The "ant" directory contains sample Apache Ant scripts that can be used to execute the above wrapper procedures, either from the command line, scripts or from Continuous Integration tools like Jenkins.

Ant scripts with common content to be imported into and re-used in other scripts:

  • ant/ad_common_targets.xml

  • ant/ad_openedge_targets.xml

  • ant/rtb_common_targets.xml

Ant scripts for performing selected RTB processes:

  • ant/build_rtb_compile.xml
  • ant/build_rtb_deployment.xml
  • ant/build_rtb_import.xml
  • ant/build_rtb_release.xml
  • ant/build_rtb_schema.xml
  • ant/build_rtb_wsintegritycheck.xml

BuildJsonProps - property file

All of the ant scripts assume that a JSON properties file is used with all of the properties needed for the various processes.The name of the properties file to be used during script execution is set with the BuildJsonProps property.

A sample file is located in config/process_windows.json for use for all the APIs in a Windows environment.

It is recommended to have a separate "process.json" file for each platform (all APIs) or a separate JSON file for each workspace.

NB: Previous versions of the toolkit used .props files. These are no longer valid with the latest Ant scripts.

RTBProxyHelper Class

The following two classes are central to the toolkit:

  • scm/custom/rtb/Utils/RtbProxyHelper.cls 
  • scm/custom/rtb/Utils/TempTableHelper.cls

They provide an OOABL layer for accessing the RTB proxy procedures (used by the RTB plugin and commonly . RTBProxyHelper is the main helper class. In addition to wrapper methods to calling the RTB proxies, there are useful custom methods in here as well.

The following example shows how to use the RTBProxyHelper to create a task:

DEFINE VARIABLE oRTBProxyHelper AS scm.custom.rtb.Utils.RtbProxyHelper NO-UNDO.
    DEFINE VARIABLE hAppServer      AS HANDLE                              NO-UNDO.
    DEFINE VARIABLE iTaskNum        AS INTEGER                             NO-UNDO.

    oRTBProxyHelper = NEW scm.custom.rtb.Utils.RTBProxyHelper(hAppServer).

    DO ON ERROR UNDO, THROW:
        iTaskNum = RTBProxyHelper:rtbCreateTask(pcWorkspace).

        CATCH AppErr AS Progress.Lang.AppError :
            UNDO, THROW AppErr.
        END CATCH.
    END.

Using one of the custom methods, a task with more properties set can be created:

DEFINE VARIABLE oRTBProxyHelper AS scm.custom.rtb.Utils.RtbProxyHelper NO-UNDO.
    DEFINE VARIABLE hAppServer      AS HANDLE                              NO-UNDO.
    DEFINE VARIABLE iTaskNum        AS INTEGER                             NO-UNDO.

    oRTBProxyHelper = NEW scm.custom.rtb.Utils.RTBProxyHelper(hAppServer).

    DO ON ERROR UNDO, THROW:
        iTaskNum = RTBProxyHelper:custRtbCreateTask(
            INPUT  pcWorkspace,
            INPUT  SUBSTITUTE("Automatically created task for import of task : &1", piTaskNum),
            INPUT  "":U, /* pcTaskDescription */
            INPUT  "":U, /*pcTaskUserTaskref */
            INPUT  "sysop", /*pcProgrammer */
            INPUT  "sysop"). /*pcManager */

        CATCH AppErr AS Progress.Lang.AppError :
            UNDO, THROW AppErr.
        END CATCH.
    END.

Sample scripts

The scripts directory contains a series of sample scripts to illustrate the syntax for executing the included ant scripts and wrapper procedures.

The line below illustrates how to call the ant script (from a windows cmd file) to build the contents of a workspace. It contains the minimum properties that have to be set for the scripts to work:

@call ant -buildfile C:\Development\appsolute_rtb_automation_toolkit\ant\build_rtb_compile.xml -Dbuild.props=C:/Roundtable/rtb11eval/demo112/config/devel-process.props -Dbasedir=C:/Development/appsolute_rtb_automation_toolkit

Customization and extensions

To customize the core APIs in the toolkit, it is recommended to do this as an inherited class of the base appSolutions/appSolute/RTB/RTBAutomationApi.cls class, with overrides to replace the methods that need to be changed or new methods to add new functionality. This is actually how the main API class - appSolutions/appSolute/RTB/RTBAutomationApi.cls - has been written.

#!ABL

 CLASS appSolutions.appSolute.RTB.RTBAutomationApi
       INHERITS appSolutions.appSolute.RTB.Base.RTBAutomationApi:
    ...
 END CLASS.
  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous.