Promote (promote)

An opening ID is an entry point used to customize business logic. promote is triggered when the state of an object is changed to be that of the next state.

Note: For more information about customization by business rules, see Customization by Business Rules.
Warning: It is strongly discouraged to make a set of attributes.

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 promote
Customization intent Not applicable
Execution context Server

Input Objects

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. Additional Parameters for promote
Parameter Name Type Read or Write Comments
STATENAME String Read Source state
NEXTSTATE String Read Target state, if promotion succeeds
AuditTags List Read Logging event of the transaction.

Sample

    Trace(1, "Execution promote_script on ", ThisObject.PLM_ExternalID )

    Trace(1, "Test macro STATENAME= ", Parameters.Macros.GetString("STATENAME"))
    Trace(1, "Test macro NEXTSTATE= ", Parameters.Macros.GetString("NEXTSTATE"))
    Trace(1, "ThisObject.current= ", ThisObject.current)

    Validation = true
    if (ThisObject.current <> Parameters.Macros.GetString("NEXTSTATE"))
    {
        ReportUXMessage("Wrong maturity state")
        Validation = false
    }
    
    ThisObject.SetAttributeString("PLMEntity.V_description", "attribute modified by promote_script")
    ThisObject.SetAttributeString("description", "basic modified by promote_script")