Create objects when converting from LER to PER model, extend DDL output

Hi,

so far we use erwin to model our databases.
We design the database in the logical model.
When generating ddl, we select the target database and then have the option through a so called post-script (erwin internal language can access whole model and properties) to add additional ddl statements to the output, depending on logical model properties and other system variables.

Now switching to TOAD (we are testing v3.6) we have some questions:

  • where can i find the reference of the object model used by the scripting machine ?
    It seems to us, that there is actually no doc available for this ( we also found no doc what system objects are predefined like DDLScript.WriteLine, … and in which context they can be used)
  • are there examples on how we can extend the ddl generation process per dbms ?
  • is it possible to create user defined properties in the logical model, which can be set by user and which are available when converting to a physical model (or can be transformed in any way) ?
  • are there examples on how we can make dbms specific modifications to the physical model (f.i. create triggers,…) when we convert from the logical model ?

Thanks Reiner.

Hi Reiner,

thank you for your questions. Toad Data Modeler (TDM) offers a high level of customization - you can add your custom properties to both logical and physical models, moreover you can also add new tabs, comboboxes, texboxes, checkboxes and other controls to existing forms, or you can write scripts/macros that will create new forms.

Before I answer your questions I’d like to note that TDM and ERwin don’t work the same way, TDM is not a cheaper replacement of ERWin. We offer different features and different functionalities that also affect benefits.

You asked for features that are related to logical modeling and conversion from logical to physical model. Let me recommend you to read the following article:
http://blogs.inside.quest.com/modeling/2010/10/19/logical-model-and-synchronization/ You may find out that physical model can be better option for you.

To your questions: If you wish to customize TDM, you have to enable Expert Mode. Click Settings | Options and in section General, check the Expert Mode checkbox. This will enable additional features and also add new items to menus.

Documentation: click Help | Reference to open a document with all classes, functions etc.
Examples: please see the library at http://modeling.inside.quest.com/kbcategory.jspa?categoryID=31
You can find nice example in User Guide. Click Help | User guide and read section Customization - Sample.
Some articles in our blog also show how to customize TDM. See http://blogs.inside.quest.com/modeling/category/customize/

User properties in logical model: Yes this is possible, however conversion to physical model will be difficult, especially if you wish to take advantage of synchronization.

Modification to conversion: if you don’t use inheritance, I recommend to use physical model instead of logical.

Regards,

Vaclav

Hi Vaclav,

thank very much you for your fast reply.
Based on the examples i could find out in principal, how TDM customization works.

Nevertheless, it is very time consuming for beginners to check any example until we find an adequate prototype. It would be very helpful, if TDM would provide an “intro” documentation, where you describe the concepts and some use cases of the TDM customizing in more detail. Having only the class list does not help me, as i can not see the TDM runtime behaviour of that framework (f.i. what calls are done to start some jobs like convert, reverse,…, what is best concept to extend default functionality, …).

For my test, there is still one question left:
In a script function, i want to load plain text from an external file.
This text should then be executed itself as a js script, preferable in the context of the calling function. Do you see any options ?

Regards,
Reiner

Hi Reiner,

you are welcome :slight_smile: I know it is not easy to get oriented in the documentation, but the customization is so complex that I believe trying to explain how everything works would be very time consuming task. That’s why we decided to use another method: we ask users for detailed information, what is their aim and then we recommend some solution plus in majority of cases we create scripts for them. It’s easier for us to write scripts that do what needs to be done than write general information that will consume time also on customers’ side.

You wrote you wish to load plain text from external file. But in order to keep the model up-to-date you will have to maintain both model and external file. What would you say about solution similar to this?
http://blogs.inside.quest.com/modeling/2010/10/21/extra-objects-code-in-generate-sql-file/

You could add what you have in your external file to your model and maintain it as a part of your model. Let me know if this would be OK for you, if not, we can continue with customization…

Regards,

Vaclav

Hi Vaclav,

In our “external file” we do not want to store “static” sql code to be added to ddl file.
We just want to place js script code, which, when exeuted, is able to access the TDM model properties (read only). This script is not just generating ddl output, but also other META data for our software (like we did with ERWIN).

Meanwhile, i know how to exend ddl generation process with scripts stored in TDM packages. The intention of my question was to clarify the limits of TDM scripting functionality.

Regards,
Reiner.

Hi,

OK, thank you for your explanation. It’s new use case for me, because this is the first someone requests external files to be used for generation of outputs.

I am glad you know how to extend DDL generation process. In case you need our help please don’t hesitate to write us.

Regards,

Vaclav