Skip to Content

Adding custom checks in Powerdesigner extension

Hi,

I want to have the following custom checks added in my CDM, can someone please help me with the VBA scripts for the same:

1. Check if all columns in all entities in a CDM have a data type assigned to it, for any column if the data type is empty, the powerdesigner should return an error.

2. Convert datatypes automatically, e.g all the columns having data type as BOOLEAN, should be converted to CHAR(1) automatically.

3. Reserved SQL keywords should not be used. E.g. we had an entity called ORDER, and we had to manually rename it to ORDERS

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 11, 2017 at 11:35 AM

    1. Every PowerDesigner Data Item, Attribute, Column and Domain has a data type, it is never missing. What you need to check for is the default data type value "<undefined>" - you only need two lines of code in your custom check to do that:

    %Check% = True
    if obj.DataType = "<undefined>" then %Check% = False

    2. Why are you using an implementation-specific data type in a CDM? In the CDM, show the business view of this - it's a binary choice. I suggest you leave them as Boolean in the CDM and LDM, and worry about data type conversion in the PDM, XSM, or OOM, where you can control conversions from conceptual to physical data types.

    3. Again, do not impose physical naming standards on your CDM. An entity is not a collection of things, it represents a single instance. In the PDM, ensure that the 'CODE' for the table is not a reserved word.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 11, 2017 at 03:09 PM

    Hi Amit,

    I fully agree with George, 2 & 3 should be done in the PDM.

    Even though if you'd like to do it in the CDM, please find the model here

    1. There is a standard function: Menu -> Tools .> Check Model (F4)

    2. Please see the Local Extension in the attached model

    3. not implemented -> should be checked/corrected in PDM

    HTH,

    Gabor

    Add comment
    10|10000 characters needed characters exceeded