Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Engineering

Customizing the StatusProjectHandler PML Object

  • Last UpdatedMar 10, 2023
  • 2 minute read

A framework for customizing events is provided in the PML object statusProjectHandler.pmlobj in the pmllib\common\objects folder. A Global instance of this object is created on entry to the constructor module. It adds the event handlers and has methods for each event.

Debug Mode

The User can switch ON or OFF a debug mode with the following commands.

!!statusProjectHandler.debugOn()

!!statusProjectHandler.debugOff()

In debug mode, a line of text is output to the command line for each event. For example, here is the output for object P1501A when promoted from Work Suspended to Work Started.

statusProjectHandler.beforeStatusChange(/P1501A,

    /DesignStatus, /WorkSuspended, /WorkStarted)

statusProjectHandler.afterStatusChange(/P1501A,

    /DesignStatus, /WorkStarted, /WorkStarted)

Where to Add Code

Each event method processes its arguments and creates some variables that may be of use to the developer.

Each place where customized code can be added is delimited as follows.

  --==========================================================

-- Start of customisation

-- End of customisation

--==========================================================

Important:
Other parts of the statusProjectHandler PML object should not be modified.

A number of examples are provided (commented out). These make use of the statusData PML object documented below.

Methods to Add Checks and Abort Changes

All of the Before … methods can be used to make additional checks and can abort the operation by returning an error message, such as to prevent a status change if a particular condition is not met. A variable has been provided for this purpose, e.g.

!returnMessage =

    |Status error: You may not delete a controlled object|

By default, the only check made in the statusProjectHandler is to prevent a general User from deleting a controlled object.

Methods to Make Dependent Changes

The methods AfterStatusAssign, AfterStatusRemove, and AfterStatusChange can be used to make dependent changes when one of these operations is completed, e.g. to cascade a change of status on an assembly to its offspring in the assembly hierarchy.

Methods to Synchronize External Systems

The methods AfterSavework and AfterFlush can be used to synchronize data in external systems once the changes to status data have been committed in the DataBase CONtrol Program (DABACON) Databases (DBs).

TitleResults for “How to create a CRG?”Also Available in