Page tree
Skip to end of metadata
Go to start of metadata

How to setup the DB to be compatible with the SWAT framework


  1. Add the SelfHdl fields to the database:

  2. The following sample runs a Progress client to generate two .DF files in the <DBPath> folder


    Replace the <DBPath> with the path where your database resides.

    Replace the <DBName> with your physical database name

    Replace the <PathTo> with the folder where your Swat framework is


    prowin -rr -db <DBPath>\<DBName> -1 -p <PathTo>\app\ofr-backend\pCrm\src\tools\addSelfHdlToTables.p -T <DBPath> -param "<DBName>"


    This generates a file addSelfHdl_<DBName>.df and addSelfHdl_<DBName>_Idx.df file.
  3.  

Import first the addSelfHdl_<DBName>.df schema file. This will add a SelfHdl field to each table. And then import the addSeelfHdl_<DBNAme>_Idx.df which will set a unique index on the selfhdl field.


2. Connect the database from OpenEdge Developer Studio, which is configured to the SWAT framework.

Run from Scratchpad :

RUN Akioma/Swat/Util/buildTableDefinitionFile.p("", "D:/temp/target.xml", "<DBName>", ?).

This script generates a Dataset XML file, which contains the tablenames of the database but with extra information for the swat framework.


3. In the last step generate unique ID's for SelfHdl fields:

RUN Akioma/Swat/Tools/InitializeRecordIdentifiers.p ("d:/temp/target.xml", "*", "<DBName>").

This script runs through all tables which are defined in the target.xml file and generates for each record a unique ID. This is a character of 36 bytes, example 1ET:a6e06d912fb315bc7114285ef8eb725c


Database changes which need to be synchronized with zTable


The zTable is necessary to assign selfHdl values. So it is necessary to add only new tables to the zTable list.

If you already have generated the target.xml in step 2 you can use this xml file as source.xml.

Generate the new target.xml, which contains synchronized data from the database:

RUN Akioma/Swat/Util/buildTableDefinitionFile.p("D:/temp/source.xml", "D:/temp/target.xml", "<DBName>", ?).

In the next step, import the data definition to the zTable:

RUN Akioma/Swat/Util/ImportTableDefinitionFile.p("D:/temp/target.xml").


If the tables don't have the SelfHdl field, the step 1 is necessary to generate and import the SelfHdl field.


Set up GIT Projects (initialize customer specific projects (GIT > Config, Backend and Webui))


The code repositories for each environment need to be set up after the DB has been setup.

Preferably there should be a dedicated GIT project for each PoC. The initial setup can be done with copying the existing repositories of another PoC environment too though.

  • No labels