- Description
- Build Table-Definition-File
- Including SelfHdl generation in external applications
- Programs needed:
- Steps to be done
Description
For an overview and an introduction into the B1 GuID please have a look to Build.One GUID: selfhdl
Within the Build.One platform the database field 'SelfHdl' is filled with a specific value that uniquely identifies each record across tables and databases. When new records are created, the framework automatically ensures that the SelfHdl is created.
If new records are created outside the framework (for example, in an external OE database that is modified by both the Build.One application and an external application), then the same routine for creating the SelfHdl must be included as within the framework. In the following, this is implemented using database session triggers.
Build Table-Definition-File
- Use Procedure
buildMultipleDatabasesTableDefinitions.p
- Running it from wURMEL (open CTRL+Shift+Alt+L and search “wurmel”):
-
run Akioma/Swat/Util/buildMultipleDatabasesTableDefinitions.p('param1', 'param2', 'param3').
- Existing files will be read and if an id is found, it will be copied to the new file.
Parameter name | Type | Description |
Param1: db list | CHARACTER | can be empty string(all connected dbs); db list for which to generate the table db file |
Param2: output dir | CHARACTER | can be empty string(temp dir); output for the generated files |
Param3: list of existing definitions | CHARACTER | can be empty string(no existing ids will be considered); gitpod example: 'backend/DB/it4main/table-definitions-swatdb.xml' |
Including SelfHdl generation in external applications
Please use the procedures carefully. Please feel to contact the support for more information.
Programs needed:
Steps to be done
- The routine
generatetriggerprocedures.p
is called with two input parameters. E.g.: RUN triggerlib/generatetriggerprocedures.p ("sports2000", SESSION:TEMP-DIR).
- The following file is generated
trigger_create.p
- An
include
is included there for each table. E.g.: {triggerlib/create.i &Table = "Customer"}.
- You can edit the file and enable session triggers only for desired tables.
- Then put the
trigger_create.p
file in a PROPATH of your project in a subdirectory "triggerlib", so that the file is found withRUN triggerlib/trigger_create.p
- There you also put the encrypted files
create.i
andtriggerbase.p
and there these two procedures can be compiled. - Include the
triggerbase.p
andtrigger_create.p
as persistent procedures in your startup routine for the application, as shown in startup_sample.p:
DEFINE VARIABLE hProc AS HANDLE NO-UNDO.
/* Please check file name on table-definitions-sports2000.xml */
RUN triggerlib/triggerBase.p PERSISTENT SET hProc ("backend/DB/sports2000/table-definitions-sports2000.xml").
SESSION:ADD-SUPER-PROCEDURE(hProc, SEARCH-TARGET).
RUN triggerlib/trigger_create.p PERSISTENT.
Back to Documentation
Back to Home Page