Erasing Objects

With ZOM, it is important to differentiate between erasing an object, deleting an object, and destroying an object:

ErasingRemoves the object such that it cannot be referenced in the application. The object’s description in the Object Dictionary is unaffected.
DeletingRemoves the object’s description from the Object Dictionary. Your ability to reference the object in your application is unaffected.
DestroyingErases and deletes the object, as well as removing the object’s registration from ZOM’s database.

Note an object can be both erased and deleted without being destroyed. This happens if ZOMErase and ZOMDelete are used separately, rather than using ZOMDestroy, leaving the object registered in ZOM’s database.

Erasing an object can be accomplished using the ZOMErase command. The following command erases the objects named “Customers”:

ZOMErase Customers

Object Maintenance

Routine tasks performed by every Zim developer are creating, erasing, recreating, moving, and copying objects. Collectively, these tasks are called Object Maintenance. ZOM provides considerable assistance to the developer in this area.

ZOM is designed to process sets of objects and maintain knowledge of object dependencies. ZOM operates on sets of objects, rather than one object at a time. The knowledge of interdependencies enables the ZOM services to intelligently manage a set of objects and sequence operations properly.

When moving a set of objects from one directory to another, ZOM examines the list of objects specified and determines the correct order in which to move them, based on the interdependencies among the objects. The objects are then moved one at a time in the correct sequence.

The following subsections describe how ZOM services can be used to perform common object maintenance tasks. Although the examples tend to be simple, all services described support the various selection criteria and options.

All the ZOM object maintenance services also deal automatically with dependent objects affected by the processes you initiate. For example, dependent objects that become “out-of-date” because of a change to a dependent object are automatically updated. You can control how much work ZOM does to maintain dependent objects by customizing the ZOM configuration. For more information, see ZOMConfig.

ZOM Configuring

The ZOM configuration can be called and altered at any time by invoking the ZOMConfig command.

The configuration options control various aspects of ZOM’s operation:


  • Display Mode

    With this option on, status information is displayed when any ZOM service is executing. The status information indicates what objects are being processed, what processing is being done, and other useful information. You can choose between windowed output, serial line-at-a-time output (default – this is the recommended setting), and no output.


    Error Logging

    With this option on, ZOM maintains an activity log. The activity log tracks the processing done by the ZOM services and also includes any error messages encountered. The activity log can be viewed by invoking the ZOMViewLog command.

    Setting error logging on can slow ZOM services if the log file grows large. In this case, you can turn the option off or periodically clear the Zim error log file “errors.trc” by executing the commands:

    set output errtrace

    set output terminal


    Dependency Tracing

    ZOM maintains an online cross-reference of the dependencies between the objects in your application that enables many of the powerful features of ZOM. With dependency tracing on, the default, ZOM automatically maintains the dependency database as you use the ZOM services. However, this can slow the performance of the ZOM services in some situations. In this case, you can turn the dependency tracing option off to speed up the ZOM services. This disables explosion and implosion operations, and the display of cross reference information.

    Note: The Dependency Trace switches off the Dependency Explosion (no explosion) therefore dependant objects are not recreated, because the dependency is not traced. As dependency information is out dated every time an object is recreated, update this information using ZOMTouch at regular times, i.e. at the end of the day. Switch Dependency Tracing on before executing ZOMTouch.


    Default Zim Directory

    ZOM insists that all objects be assigned an explicit directory name indicating the directory to which the object belongs. Any unassigned directory names (i.e., blank or null) discovered in the Object Dictionary are automatically assigned to the default Zim directory. By default, default Zim directory is set to “zim”.


    Conventions ON

    With conventions on, ZOM automatically sets the DataSave and Compilable object properties on your behalf. The DataSave property is set for any EntitySet or relationship with fields objects registered. The Compilable property is set for any document object that is compiled. With conventions off, you must set these properties explicitly.


    Explode Level

    Explosion level determines the extent of actions ZOM undertakes automatically on your behalf on objects that depend on objects you directly manipulate. For example, if you destroy the EntitySet Employees, what should ZOM do to the Relationships and Roles which depend on Employees for their existence?

    Explode level can be set to either 0 or 1. Explosion level 0 causes ZOM to ignore any dependencies. Explosion level 1 causes ZOM to “touch” any objects that depend on an object that is recreated, renamed, moved, erased or destroyed. Touching an object resets its properties and the dependency database to reflect the current situation.

    The dependency tracing option should be on for explode levels greater than 0.


    New Keyword

    New keyword is a special keyword that is automatically assigned to all newly registered objects. It is a convenient way to keep track of objects are new to your environment over a period of time. By default, new keyword is set to “$new” as shown in the following example:

    ZOMList +k $new

    If you would like to reset objects assigned this keyword so no objects are flagged as new, issue the command

    ZOMSet +k $new ;k $new!

     


    Changed Keyword

    Changed keyword is a special keyword that is automatically assigned to all objects that are changed (i.e., created, re-created, renames, moved, erased, deleted, compiled, and uncompiled) by a ZOM service. It is a convenient way to keep track of which objects have been altered in your environment over a period of time. By default, changed keyword is set to “$changed”.

    ZOMList +k $changed

    To reset objects assigned this keyword, so no objects are flagged as changed, issue the command

    ZOMSet +k $changed ;k $changed!


    Environment Code

    Environment code is used to co-ordinate developments occurring in multiple environments and ensure the objects are registered with unique object keys across all development environments. If you set environment code, ensure that it is different for each development environment.

    If you do not assign an environment code, ZOM generates a random environment code for you. The randomization is designed to make duplicate environment codes unlikely.


    Express Mode

    Operations such as ZOMExport can operate in either a set oriented fashion (express mode is on) or a record-at-a-time fashion. In the former, the command usually performs more quickly. However, you do not see a separate status displayed for each object as it is processed nor is a separate log entry be made for each object. This information is available when express mode is off.


    Process Sort Order

    Within the ZOM Configuration Interface the process order can be selected. The default is blank, but a ZIM developer can set the Process Sort Order by means of a combo box containing object fields. The sort order is used to sort objects that are processed by ZOM, e.g. in the ZOMList command. It is a standard ZIM sort clause and can contain any valid sort criteria.


    Log Object Modifications

    The debug option, Log Object Modifications, permits the enabling/disabling of logging modifications to the DefinitionsLog EntitySet. This entity set records all modifications such as creating an object. Access the Debug view form in the Debug Options Interface. This option can also be set at the command line by entering the statement set logdefinitions on/off.

    To aid client-server development, an additional debug option to add tracing for SQL statements is provided. Access the Trace view form in the Debug Options Interface.

ZOMViewLog

View the activity and error log file.

Syntax

ZOMViewLog

Comments

Enables you to browse through the list of progress and error messages produced by the ZOM services you have been using.

Example

To review the results of the previous ZOM command, enter

ZOMViewLog

ZOMEnable

Enables the ZOM services for use in a Zim session.

Syntax

ZOMEnable

Comments

You must enable ZOM before using any of the ZOM services.

Since ZOM is always enabled, the Object Dictionary facilities in the Development Center use the ZOM services to manage your objects.

Example

The following command enables ZOM.

ZOMEnable

ZOMMake

Rebuilds an application database.

Syntax

ZOMMake

Comments

ZOMMake is the equivalent of executing ZOMRecreate, ZOMTouch, and ZOMCompile in sequence. However ZOMMake has the intelligence to only recreate objects and compile programs that have changed. Not only does ZOMMake recompile programs that have modified dependent objects, but it also recompiles programs where the source code has been modified.

ZOMReset

Rebuilds the ZOM knowledge base.

Syntax

ZOMReset

Comments

ZOMReset command is used as a ‘last resort’ solution to system level problems such as corrupt indexes on the object key for object definitions.

ZOMReset completes the following tasks:

  • Erases the index on the object key for object definitions.
  • Deletes all object keys for object definitions.
  • Recreates the index on the object key for object definitions.
  • Executes the ZOMFixup command.

ZOMDisable

Disables the ZOM services for use in a Zim session.

Syntax

ZOMDisable

Comments

You must enable ZOM before using any of the ZOM services in a Zim session. If you no longer wish to use ZOM, ZOM services can be turned off using ZOMDisable.

With ZOM enabled, the Object Dictionary facilities in the Development Center use the ZOM services to manage your objects. When ZOM is disabled, the Development Center uses basic Zim object management facilities.

Example

The following command disables ZOM.

ZOMDisable

ZOMFixUp

Analyses the information maintained by ZOM and corrects any problems.

Syntax

ZOMFixUp

Comments

This command analyses the information maintained by ZOM and makes any necessary corrections. For example, it makes sure that the object keys and names stored within ZOM are consistent with the information in the Object Dictionary. These sorts of inconsistencies can arise as a result of certain special kinds of manual Object Dictionary updates made outside ZOM. ZOMFixUp does not look at the consistency of object dependency information. Use the ZOMTouch command to update dependency information.

ZOMFixUp also resets any temporary EntitySets (the Shadow Dictionary, for example) used by ZOM to their initial state. These EntitySets can get quite large and, since they contain only temporary data, restoring them to their initial size can save a considerable amount of disk space.

Example

The following command ensures that the information maintained by ZOM is correct and consistent and restores all temporary EntitySets used by ZOM to their initial size.

ZOMFixUp
pt_BRPortuguese