- Add the SelfHdl fields to the database:
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.
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.
This data needs to be present in the zTable database table of the SWAT framework.
RUN Akioma/Swat/Util/ImportTableDefinitionFile.p("D:/temp/target.xml").
Will import the dataset to the database.
3. In the last step generate unique ID's for SelfHdl fields:
RUN Akioma/Swat/Tools/fillselfhdl.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").