3.1.5. Pre delete script

  • Overview: Pre delete script.
  • Configuration: Pre delete script.

Overview: Pre delete script

Before you delete an object, if you need to do anything with the available Resources and Devices in that Object, like doing a cleanup action based on those resources or pass resource information to other classes, you can create a Pre delete script while configuring a class and execute it before you delete the object. This will call the PreObjectDeleteBatch point before the object is deleted. Whenever you delete any object that is linked to the Class, the Pre delete script is run and all the information like Class Attributes, Object Attributes and more are available for reference.

Tip: The CIMPLICITY Object Model includes many scripting objects that are developed specifically for classes, including the following.
CimClassActionList (object)
CimClassAttribute (object)
CimClassAttributeList (object)
CimClassDataItemExpression (object)
CimClassDataItemExpressionList (object)
CimClassDataItemList (object)
CimClassEventActionList (object)
CimClassEventList (object)
CimClassInstance (object)
CimClassList (object)
CimClassScript (object)
CimClassScriptList (object)

Configuration: Pre delete script

The content of the Pre delete script depends entirely on your requirements. The one unique feature when configuring the class is that you enter its ID in  the Pre delete script field on the General tab in the Class dialog box.

Class: Pre delete script configuration.
Instantiation: Pre delete script.

To create a new Pre delete script,

  1. Click the > button available to the right of the Pre delete script field, and then select New on the popup menu.
    The New Script Name dialog box opens.
  2. Enter a name in the Script field.
  3. Click OK.
    The CIMPLICITY Program Editor window opens.
  4. Create the script as needed.
  5. Close the CIMPLICITY Program Editor window.
    The script is created and saved.