Revision (revision)

An opening ID is an entry point used to customize business logic. revision is triggered when a new minor revision for an object has been created.

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

Input Objects

Important: The custom script applies to the source objects (ThisObject). To access the target object, use the context object parameters. For more information, see the Context Object Parameters below.

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 revision
Parameter Name Type Read or Write Comments
NEWREVISION String Read Target revision
NEWOBJECT Object Read Target object
Warning: NEWOBJECT can be not valuated. Verify its value before use.
AuditTags List Read Logging event of the transaction.
Important:
  • In read operation (that is, copy, majorrevision, and revision) events, ThisObject is made read-only (setValueInternal returns an error).
  • If an object has only read operations, the execution control considers it outside of the transaction to apply execution rules.
  • Objects used in read operation (that is, copy, majorrevision, and revision) events are not considered part of the transaction, and made read-only (including when they are ThisObject).

Sample


  Let newObject (VPMReference)
  Trace(1, "Execution revision on ", ThisObject.PLM_ExternalID )
  Trace(1, "Test macro REVISION= ", Parameters.Macros.GetString("REVISION"))
  Trace(1, "Test macro NEWREVISION= ", Parameters.Macros.GetString("NEWREVISION"))
  Trace(1, "Test ThisObject.revision = ", ThisObject.revision)

    Validation = true
    if (ThisObject.revision <> Parameters.Macros.GetString("NEWREVISION"))
    {
        ReportUXMessage("Wrong revision")
        Validation = false
    }
  else
  {
      Set newObject = Parameters.Macros.GetObject("NEWOBJECT")
      if (newObject <> NULL)
      {
          newObject.SetAttributeString("description", "revised object")
          Validation = true
      }
      else
      {
          ReportUXMessage("NEWOBJECT creation has failed")
          Validation = false
      }
  }