Logo

    Home

    Documentation

    Use Cases

    Training

    Applications

    Release Notes

    SelfHdl/GuID management in external applications with OE databases

    SelfHdl/GuID management in external applications with OE databases

    • 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: selfhdlBuild.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').
        • 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'
      • Existing files will be read and if an id is found, it will be copied to the new file.
    ⚠️
    IMPORTANT → Please check that nameOfDB parameter is properly set in the existing table-definition file. Otherwise ID’s will be randomly generated. Script is matching name of the DB and the name of the table and if match is not found - assign random ID. → Do not us the default DB-name: 'mamain’. If one of your DBs is called “mamain” please contact our support.

    Including SelfHdl generation in external applications

    Please use the procedures carefully. Please feel to contact the support for more information.

    Programs needed:

    startup_sample.p0.3KB
    create.i0.4KB
    generatetriggerprocedures.p1.6KB
    triggerBase.p6.3KB

    Steps to be done

    1. The routine generatetriggerprocedures.p is called with two input parameters. E.g.:
      1. RUN triggerlib/generatetriggerprocedures.p ("sports2000", SESSION:TEMP-DIR).
    2. The following file is generated trigger_create.p
    3. An include is included there for each table. E.g.:
      1. {triggerlib/create.i &Table = "Customer"}.
    4. You can edit the file and enable session triggers only for desired tables.
    5. Then put the trigger_create.p file in a PROPATH of your project in a subdirectory "triggerlib", so that the file is found with RUN triggerlib/trigger_create.p
    6. There you also put the encrypted files create.i and triggerbase.p and there these two procedures can be compiled.
    7. Include the triggerbase.p and trigger_create.p as persistent procedures in your startup routine for the application, as shown in startup_sample.p:
    8. 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 DocumentationDocumentation

    Back to Home Page

    Logo