Delete Administrative Object Trigger

The delete administrative object trigger enables you to customize administrative object deletion behavior through specific program objects.

Related Topics
About Triggers (Automatic Business Rules)
Trigger Reference

Typical scenarios in which the delete administrative object trigger might be used include:

  • Exporting administrative objects to files as backup before deleting those objects.
  • Preventing administrative objects from being deleted by some business administators.
  • Dumping log information to a specific file.
  • Sending out a notification after deleting administrative objects.

Important: You should have an understanding of how ENOVIA event triggers work and how to implement a trigger program before attempting to use to this trigger.

Check Trigger

The check trigger is executed before the normal administrative object deletion code. You can use the check program:


  • To perform pre-event processing, for example, to export an administrative object to a file as backup.
  • To block a delete event so that an administrative object is not deleted. The block happens when the check program returns a non-zero exit code.

To enable the delete administrative object check trigger, you must add a program in the database named DeleteAdminCheck.

DeleteAdminCheck Example

The following is an example of how to use the DeleteAdminCheck program to block all administrative object deletion processes:

add prog DeleteAdminCheck code 'tcl;
eval {
   puts "block admin object delete event"
   exit 1
}';

Action Trigger

The action trigger executes after the delete event transaction is completed. You can use the action program:

  • To perform post-event processing, for example, to generate a report or send out a notification. Three macros are available for delete trigger programs to use:
    • USER: USER_NAME
    • ADMINTYPE:ADMIN_OBJECT_TYPE
    • ADMINNAME:ADMIN_OBJECT_NAME

To enable the delete administrative object action trigger, you must add a program in the database named DeleteAdminAction.

DeleteAdminAction Example

The following is an example of how to use the DeleteAdminAction program to dump administrative object information to a file:

add prog DeleteAdminAction code 'tcl;
eval {
   set output [open c:/tmp/my.log w]
   puts $output "${USER},${EVENT},${INVOCATION},${ADMINTYPE},${ADMINNAME}"
   close $output
}';