Delete (delete)

An opening ID is an entry point used to customize business logic. delete is triggered when an object has been deleted.

Note: For more information about customization by business rules, see Customization by Business Rules.

This page discusses:

General Information

This opening ID is a precommit opening. For more information about the specificities of a precommit opening, see Precommit Openings.

Definition Description
PLM Opening ID delete
Customization intent Not applicable
Execution context Server

Input Objects

Important:
  • The object (ThisObject) is already deleted. Its attributes can be accessed but not modified (read-only mode). For more information, see the Context Object Parameters section below.
  • When an object is destroyed in the transaction, only the precommit delete is fired.

Context Object Parameters

Table 1. Business Object Standard Parameters
Parameter Name Type Read or Write Comments
EVENT String Read Any of the supported events.
NAME String Read Business object name
ORGANIZATION String Read The organization that owns the business object
OWNER String Read The owner of the business object
PHYSICALID String Read The physical ID for the business object
POLICY String Read The business object policy
PROJECT String Read The project (collaborative space) that owns the business object
REVISION String Read Business object revision
TYPE String Read Business object type
Table 2. Relationship Standard Parameters
Parameter Name Type Read or Write Comments
EVENT String Read Any of the supported events.
FROM Object Read The FROM business object
Warning: FROM can be not valuated. Verify its value before use.
PHYSICALID String Read The PHYSICALID of the relationship
RELTYPE String Read The relationship type
TO Object Read The TO business object
Warning: TO can be not valuated. Verify its value before use.
Table 3. Additional Parameters for delete
Parameter Name Type Read or Write Comments
AuditTags List Read Logging event of the transaction.

Sample of Business Object Deletion

    
    Let ProjectValue=""
    Let Idx=-1
    ProjectValue = Parameters.Macros.GetString("PROJECT")
    Idx = ProjectValue->Search("3DS Collab Space")
    if (Idx >= 0)
    {
        if (ThisObject.current == "RELEASED")
        {
            ReportUXMessage("Cannot delete Released object")
            Validation = false
        }
        else
        {
            Validation = true
        }
    }
    else
    {
        ReportUXMessage("Cannot delete object from 3DS Collab Space")
        Validation = false
    }

Sample of Relationship Deletion

    Let objDesc (String)
    Let macroTO (PLMEntity)

    Set objDesc = ThisObject.GetAttributeValue("PLMInstance.V_description")
    Trace(1, "retrieved relation's description = #", objDesc ) 
    if (objDesc <> "to delete")
    {
	ReportUXMessage("wrong object deletion: " + objDesc)
        Validation = false
    }
    else
    {
        Set macroTO = Parameters.Macros.GetObject("TO")
        if (macroTO <> NULL)
	{
	    ReportUXMessage("TO object has not been deleted: " + macroTO.GetAttributeValue("PLMEntity.V_description"))
	    Validation = false
	}
	else
	{
    	    Trace(1, "TO object is NULL as expected")
	    Validation = true
	}
    }

Sample Using AuditTags

The following sample contains a script that issues a message with the audit tag information it has retrieved for the object:

let UserFactAuditTag(EKLAuditTag)
let EventAuditTag(EKLAuditTag)

let TagInfo (String)
let lTags (List)

lTags = Parameters.AuditTags.GetValue(ThisObject)

if lTags.Size() > 1
{
    UserFactAuditTag = lTags.GetItem(1)
    EventAuditTag = lTags.GetItem(2)

    TagInfo = "Modeler operation details - " + "UserFact: " + UserFactAuditTag + " / Event: " + EventAuditTag + " / Instance Title: " + ThisObject.PLM_ExternalID + " / Instance   Description: " + ThisObject.GetAttributeString("PLMInstance.V_description")
    Trace(1, TagInfo)
}
else
{
    Trace(1, "No audit tags found on this object")
}
Validation = true