Skip to Content
avatar image
Former Member

File Header - PDM Script

Hello. I would like to set some customizations in Oracle script file header. I was able to find how to set the date and the script name with variables ( %DATE% and %NAMESCRIPT% respectively) but there are other informations I don't know how to do. Below, follow a sample header:


/* Script generated on: %DATE% by the user %USER% */ the variable %USER% didn't display any output

/* Script name: %NAMESCRIPT% */

/* Label: ????? */ Here, I want to put information about which configuration label is linked to this document version , if exists.

/* Model/ Version: ??????? */ Here, I want to put what the PDM name and the repositoty version corresponding to script

Regards, Jan.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    Jan 12, 2015 at 10:51 PM

    Hi Jan,

    Instead of %USER%, try %AUTHOR% which will give you the author of the model from the Version Info or the author from the Model Properties box.

    For model version from the Repository use %ExtractionVersion%.

    For model branch name use %ExtractionBranchName%.

    For model version and branch all together, use %ExtractionFullVersion%

    As for the label information where you want to gather the Configuration that it exist in, you may need to pre-run a VBScript like mentioned in earlier post and place that content into a user defined extended attribute (i.e. label) and then use that variable within your DBMS Definition File. the table it would come from is PMCNFG within the Repository. You can find the entire metamodel for the Repository in the \\PowerDesigner 16\Examples\Repository Metamodel.pdm directory.

    This information cam from the Help menu, Metamodel Objects Help. I then looked under Base Model to find the properties available. This is not in the customizing DBMS Definition because these are not common properties that affect DDL generation.

    HTH,

    -Matt C.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 07, 2015 at 01:12 PM

    Hello Jan

    the Variable %USER% doesnt display any Output because its related to the users modeled in your Model, for example to create a user from the model the following code is used:

    [.O:[create user %USER%[ %Definition%]][create schema authorization %USER% %SCHEMADEFN%]]

    in the scope you are trying to use it its not defined and not holding the information of the PowerDesigner user

    But as in VBS the variable USERNAME does hold the PD user you can use .vbscript to get this information:

    This script in the headerscetion of the dbms-definition:

    /* THIS IS A TEST FOR USER

    .vbscript()

    ScriptResult = UserName

    .endvbscript

    , hopefully its succesful */

    Outputs:

    /* THIS IS A TEST FOR USER HTE4974, HOPEFULLY ITS SUCCESFUL */

    the same way you can get name and repository version:

    .vbscript()

    ScriptResult = activemodel.name &"|Version:" & activemodel.ExtractionVersion & "|"

    .endvbscript

    i dont understand what is a configuration label, if its a user defined information put it in an xtended attribute

    regards

    dj

    Message was edited by: dirk jaeckel

    Add comment
    10|10000 characters needed characters exceeded

    • hi

      you might try to play around with these:

      msgbox activemodel.RepositoryInformation

      msgbox activemodel.findinrepository().comment

      msgbox activemodel.findinrepository().connection

      my admin doesn´t give me the right to create Configurations in the repo so i cant evaluate further

      but from the metamodel point of view it looks like the Configurations are not stored on the model directly, hence that there is a collection of Configurations somewhere wich have collections of models.

      dj

  • avatar image
    Former Member
    Jan 16, 2015 at 12:17 PM

    Please, Someone Could tell me how I can extract datas of tables PMCNFG and PMOBJT by VBscript? I haven't found so far.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 07, 2015 at 02:46 PM

    Hi Jan,

    is there anything unanswered ?

    otherwise you should mark the question as answered so everyone can see this immediately.

    all valid variables in a DBMS extension you can find in the help:

    Customizing and Extending PowerDesigner > DBMS Definition Files > PDM Variables and Macros

    dj

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 29, 2015 at 01:41 PM

    Unluckily, In my company it will not be possible to connect in the repository by ODBC.

    I would like to label the script generated with a tag that I could find it easily.

    We have a version control system here and it stores all of projetct artifacts in development or in production. Furthermore we have the PowerDesigner to manage all models in the repository.

    we intend to link informations between two repositories. The alternative was tag the script with some informations.

    Other question: Could I put a string comprising the repository file location in the PDM script generated?


    Thank you for you great help.

    Add comment
    10|10000 characters needed characters exceeded