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

AVEVA™ Diagrams

Customizing Compare/Update using PML Callbacks

  • Last UpdatedFeb 13, 2025
  • 4 minute read

Specific company and Project customizations can be implemented using PML callbacks.

A framework is provided in the cuProjectHandler PML object in the pmllib\common\objects folder. A global instance !!cuProjectHandler of this object is created on entry to any module using Compare/Update.

Note:
Compare/Update PML callbacks are not available for cable catalog operations.

Debug Mode

You can switch on or off debug mode using the commands 'cuDebugOn' and 'cuDebugOff' which have been defined as synonyms to run the corresponding methods. In debug mode, a line of text is output to the command line for each method call.

Where to Add Code

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

Note:
Other parts of the PML code should not be modified.

A number of examples are provided (commented out) in the PML code.

Methods

The following methods are provided in the cuProjectHandler PML object:

Method

Description

.cuProjectHandler()

Constructor.

.debugOn()

Set debug flag.

.debugOff()

Clear debug flag.

.raiseEvents()is BOOLEAN

Switch events on or off.

Called once for each comparison run.

Return FALSE to prevent further callbacks.

.beginCompare(

!module is STRING,

!configurationName

is STRING,

!sourceDatabase

is STRING,

!sourceType

is STRING,

!destinationDatabase is STRING,

!destinationType

is STRING,

!mode is STRING

) is STRING

Add checks before comparing the whole set of objects.

Information from the selected configuration is provided.

Mode: Source or Destination.

Return a non-blank message to abort the whole run.

.beforeCompare(

!element is DBREF

) is STRING

Add checks before comparing a source/destination object that is a DBREF.

Return a non-blank message to skip comparison of this object.

.beforeCompare(

!elementId is STRING

) is STRING

Add checks before comparing a source object that is an external named string.

Return a non-blank message to skip comparison of this object.

.afterCompare(

!compareOk

is BOOLEAN,

!compareResult

is STRING,

!sourceElement

is DBREF,

!destinationElement

is DBREF

)

Add actions after comparing a matched source object that is a DBREF.

CompareResult: Yes, No, Multiple Matches, Linked, Multiple Link.

.afterCompare(

!compareOk

is BOOLEAN,

!compareResult

is STRING,

!sourceId is STRING,

!destinationElement is DBREF

)

Add actions after comparing a matched source object that is an external named string.

CompareResult: Yes, No, Multiple Matches, Linked, Multiple Link.

.afterCompare(

!compareOk

is BOOLEAN,

!compareResult

is STRING,

!element is DBREF

)

Add actions after comparing an unmatched source object that is a DBREF.

CompareResult: Yes, No, Multiple Matches, Linked, Multiple Link.

.afterCompare(

!compareOk

is BOOLEAN,

!compareResult

is STRING,

!element is DBREF,

!dummyDestination is BOOLEAN

)

Add actions after comparing an unmatched destination object that is a DBREF.

CompareResult: Yes, No, Multiple Matches, Linked, Multiple Link.

.afterCompare(

!compareOk

is BOOLEAN,

!compareResult

is STRING,

!sourceId is STRING

)

Add actions after comparing an unmatched source object that is an external named string.

CompareResult: Yes, No, Multiple Matches, Linked, Multiple Link.

.endCompare()

is STRING

Add actions after comparing the whole set of objects.

Return a csv file path to capture list of skipped objects and reasons.

.getCompareResults()

is STRING

Capture the compare results grid content.

Return an Excel file path for compare grid result

.beginUpdate(

!linkInsertedElements is BOOLEAN,

!linkMatchedElement

is BOOLEAN,

!updateLinkedInsertedElements

is BOOLEAN,

!updateLinkedMatchedElements

is BOOLEAN,

!unlinkElements

is BOOLEAN,

!ownerElement

is DBREF

) is STRING

Add actions before updating the whole set of accepted objects.

Settings from the Update dialogue are provided.

Return a non-blank message to abort the whole update.

.beforeUpdate(

!sourceElement

is DBREF,

!destinationElement

is DBREF,

!destinationType

is STRING

) is STRING

Add actions before updating when the matched source object is a DBREF.

Return a non-blank message to skip update of this object

.beforeUpdate(

!sourceId is STRING,

!destinationElement

is DBREF,

!destinationType

is STRING

) is STRING

Add actions before updating when the matched source object is an external named string.

Return a non-blank message to skip update of this object.

.beforeUpdate(

!sourceElement

is DBREF,

!destinationType

is STRING,

!ownerRef is DBREF

) is STRING

Add actions before updating when the unmatched source object is a DBREF.

Set ownerRef to override the owner specified for the run.

Return a non-blank message to skip update of this object.

.beforeUpdate(

!sourceId is STRING,

!destinationType

is STRING,

!ownerRef is DBREF

) is STRING

Add actions before updating when the unmatched source object is an external named string.

Set ownerRef to override the owner specified for the run.

Return a non-blank message to skip update of this object.

.beforeUpdate(

!destinationElement

is DBREF,

!destinationType

is STRING

) is STRING

Add actions before updating when the unmatched destination object is a DBREF.

Return a non-blank message to skip update of this object.

.afterUpdate(

!updateOk

is BOOLEAN,

!updateResult

is STRING,

!sourceElement

is DBREF,

!destinationElement

is DBREF,

!updatedAttributes

is ARRAY

)

Add actions after updating when the matched source object is a DBREF.

UpdateResult: Ok or error message.

.afterUpdate(

!updateOk

is BOOLEAN,

!updateResult

is STRING,

!element is DBREF,

!updatedAttributes

is ARRAY

)

Add actions after updating when the unmatched source or destination object is a DBREF.

UpdateResult: Ok or error message.

.afterUpdate(

!updateOk

is BOOLEAN,

!updateResult

is STRING,

!sourceId is STRING,

!updatedAttributes

is ARRAY

)

Add actions after updating when the unmatched source object is an external named string.

UpdateResult: Ok or error message.

.endUpdate()

Add actions after updating the whole set of objects.

.getUpdateResults()

is STRING

Capture the update results grid content.

Return an Excel file path for update grid results.

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