Application of VBScript in PD

xiaoxiao2021-03-06  74

The openness and custom configuration feature of PowerDesigner 9.

The introduction of Visual Basic Scripting makes PowerDesigner 9 have powerful open features. Through this simple programming language, users can add the desired functions you want to add in the PowerDesigner application.

In this design blueprint, we will explain this feature by examples.

Introduction

Microsoft Corporation defines a simple scripting language and is widely used in the industry and all Windows platforms. This is Visual Basic Script, which enables the user to easily and quickly operate the objects and object collections in the application. PowerDesigner 9 provides support for Visual Basic scripting languages, users can use VBScript, operate PowerDesigner objects in memory, or complete various tasks associated with it, for example, browsing modules or objects for arbitrary objects. To achieve this, you need to know the meta model of PowerDesigner. Therefore, PowerDesigner provides a wealth of online help, including PowerDesigner object definitions and object methods for user operation.

With VBScript, users can create a variety of powerful applications. For example, load and store modules, access object definitions, check objects, change object attribute values, or create or delete objects based on special needs.

How to create VB Script

In PowerDesigner's "Tools" menu, users will see a new "Customize Command" submenu. With this menu, users can create new scripts and join into the PowerDesigner menu to achieve fast and convenient calls.

After selecting the "Edit / Run Scripts" command, a dialog window will open, and the user can type or load the VB Script code in the window, complete the test, debug, etc., store or use the standard function to edit content. For easy reading and understanding, the code is fully marked with a striking color.

Figure 1 VB Script editor

Custom menu

After completing the test and debugging of the code, you need to save it as a script file. Users can create a new command in the PowerDesigner menu using the Customize Commands option to quickly call the created script.

Figure 2: Custom Options dialog

Online help

In the toolbar of the VB Script Editor, click the "?" Button to get online help, learn more about the PowerDesigner meta model.

Figure 3: VB Script online help

Online help provides information about all of the PowerDesigner all objects. It will list the attribute values ​​of these objects and the available object set status. At the same time, it also provides global variables, special data type formats, and related information about global methods.

Example statement

PowerDesigner provides a rich instance library, detailing the various feature applications that users use VB Script can create:

· Create a module and its objects (create an activity chart, as a "copy" of business flow chart ...)

· Delete objects in the module (delete dedicated properties in the OOM module ...)

· Create an object (convert class into interface ...)

· Change the object properties (inserted into all the domain names, copy the name to the code, and standardize the code ...)

· Complete some inspection tasks, issue a warning message (check for a specific database, does not part to the standard PowerDesigner check process ...)

· Production report

Example

In order to better illustrate the simplicity of the code, let's take an example that will create a distinction column for each table of the current module (below). Expansion PowerDesigner

With this powerful tool, users can further expand their features and features on the basis of PowerDesigner, develop a perfect application for different needs.

转载请注明原文地址:https://www.9cbs.com/read-109483.html

New Post(0)