Using the Core Status Objects from PML
- Last UpdatedAug 14, 2025
- 3 minute read
Access to status data is provided via a set of core objects as described below. These require the appropriate import and using namespace commands:
import 'Aveva.Pdms.DataManagement.PML'
handle any
-- ignore if already loaded
endhandle
using namespace 'Aveva.Pdms.DataManagement.PML'
Object STATUSMANAGEMENT
Holds systems information relating to Status Control. Methods include:
|
Method |
Description |
|
statuses() |
Returns the available statuses as an array of STATUS |
Object STATUSEVENTS
Holds information relating to status events. Methods include:
|
Method |
Description |
|
statusEvents(STRING name of status definition ) |
Constructor that initializes for the status definition. |
|
Initialise(STRING name of status definition) |
Initializes for the status definition. |
|
addEventHandler(STRING event name, ANY object name, STRING method name) |
Adds an event for the stored status definition that will call the method on the object. |
Example to Add an Event Handler
The example gets the available status definitions and sets an event handler for the first definition.
!statusManagement = object statusManagement()
!statusDefinitions = !statusManagement.statuses()
!statusEvents = object statusEvents()
!statusEvents.initialise(!statusDefinitions[1])
!statusEvents.addEventHandler('BeforeStatusChange',
!!handlerObject, 'beforeStatusChange')
Object STATUS
Represents a status definition. Methods include:
|
Method |
Description |
|
status(STRING name of status definition) |
Constructor. |
|
assign(STRING name of object) |
Assign status to object. |
|
assign (ARRAY of names of objects) |
Assign status to objects. |
|
assign (STRING name of object, STRING comment) |
Assign status to object and set comment. |
|
assign (ARRAY of names of objects, STRING comment) |
Assign status to objects and set comment. |
|
controlledElements() |
Returns an array of names of objects controlled by this status. |
|
demote(STRING name of object) |
Demote status on object. |
|
demote (ARRAY of names of objects) |
Demote status on objects. |
|
demote (STRING name of object, STRING comment) |
Demote status on object and set comment. |
|
demote (ARRAY of names of objects, STRING comment ) |
Demote status on objects and set comment. |
|
description() |
Returns description of status definition. |
|
initialValue() |
Returns STATUSVALUE initial value of status definition. |
|
name() |
Returns name of status definition. |
|
promote(STRING name of object) |
Promote status on object. |
|
promote (ARRAY of names of objects) |
Promote status on objects. |
|
promote (STRING name of object, STRING comment) |
Promote status on object and set comment. |
|
promote (ARRAY of names of objects, STRING comment) |
Promote status on objects and set comment. |
|
remove(STRING name of object) |
Remove status from object. |
|
remove (ARRAY of names of objects) |
Remove status from objects. |
|
set (STRING name of object, STRING name of status value) |
Set status on object. |
|
set (STRING name of object, STATUSVALUE status value) |
Set status on object. |
|
set (ARRAY of names of objects, STRING name of status value) |
Set status on objects. |
|
set (ARRAY of names of objects, STATUSVALUE status value) |
Set status on objects. |
|
set (STRING name of object, STRING name of status value, STRING comment) |
Set status on object and set comment. |
|
set (STRING name of object, STATUSVALUE status value, STRING, comment) |
Set status on object and set comment. |
|
set (ARRAY of names of objects, STRING name of status value, STRING comment) |
Set status on objects and set comment. |
|
set (ARRAY of names of objects, STATUSVALUE status value, STRING comment) |
Set status on objects and set comment. |
|
values() |
Returns array of STATUSVALUE for this status definition. |
Object STATUSVALUE
Represents a status value. Methods include:
|
Method |
Description |
|
statusValue(STRING name of status definition, STRING valname of status value ) |
Constructor. |
|
statusValue (STATUS status definition, STRING valname of status value) |
Constructor. |
|
description() |
Returns description of status value. |
|
name() |
Returns valname of status value. |
|
number() |
Returns number of status value. |
|
validTransitions() |
Returns array of STATUSVALUE that are valid transitions. |
Object ASSIGNEDSTATUS
Represents the status link data for an object. Methods include:
|
Method |
Description |
|
assignedStatus(STRING name of status definition, STRING name of model object) |
Constructor. |
|
comment() |
Returns comment from status link. |
|
currentValue() |
Returns STATUSVALUE status value that status link refers to. |
|
definition() |
Returns STATUS status definition that status value is owned by. |
|
thisElement() |
Returns STRING reference number of model object that status link refers to. |
Example to Set and Get Status Data
The example assigns Design Status to an equipment item then promotes it with a comment. Then it gets the status data and returns the status value, description, number and comment. The comment comes direct from the assigned status object, but the other values are via the reference to the status value object.
!status = object status('/DesignStatus')
!status.assign('/E1301')
!status.promote('/E1301', 'Ready for checking')
!currentStatus = object assignedStatus('/DesignStatus',
'/E1301')
!valueName = !currentStatus.currentValue().name()
!description = !currentStatus.currentValue().description()
!number = !currentStatus.currentValue().number()
!comment = !currentStatus.comment()