Download as pdf or txt
Download as pdf or txt
You are on page 1of 62

Status Control

AVEVA Solutions Limited

Disclaimer
1.1 AVEVA does not warrant that the use of the AVEVA software will be uninterrupted, error-free or free from
viruses.

1.2 AVEVA shall not be liable for: loss of profits; loss of business; depletion of goodwill and/or similar losses; loss of
anticipated savings; loss of goods; loss of contract; loss of use; loss or corruption of data or information; any
special, indirect, consequential or pure economic loss, costs, damages, charges or expenses which may be
suffered by the user, including any loss suffered by the user resulting from the inaccuracy or invalidity of any data
created by the AVEVA software, irrespective of whether such losses are suffered directly or indirectly, or arise in
contract, tort (including negligence) or otherwise.

1.3 AVEVA's total liability in contract, tort (including negligence), or otherwise, arising in connection with the
performance of the AVEVA software shall be limited to 100% of the licence fees paid in the year in which the user's
claim is brought.

1.4 Clauses 1.1 to 1.3 shall apply to the fullest extent permissible at law.

1.5 In the event of any conflict between the above clauses and the analogous clauses in the software licence under
which the AVEVA software was purchased, the clauses in the software licence shall take precedence.

Copyright
Copyright and all other intellectual property rights in this manual and the associated software, and every part of it
(including source code, object code, any data contained in it, the manual and any other documentation supplied
with it) belongs to, or is validly licensed by, AVEVA Solutions Limited or its subsidiaries.

All rights are reserved to AVEVA Solutions Limited and its subsidiaries. The information contained in this document
is commercially sensitive, and shall not be copied, reproduced, stored in a retrieval system, or transmitted without
the prior written permission of AVEVA Solutions Limited. Where such permission is granted, it expressly requires
that this copyright notice, and the above disclaimer, is prominently displayed at the beginning of every copy that is
made.

The manual and associated documentation may not be adapted, reproduced, or copied, in any material or
electronic form, without the prior written permission of AVEVA Solutions Limited. The user may not reverse
engineer, decompile, copy, or adapt the software. Neither the whole, nor part of the software described in this
publication may be incorporated into any third-party software, product, machine, or system without the prior written
permission of AVEVA Solutions Limited, save as permitted by law. Any such unauthorised action is strictly
prohibited, and may give rise to civil liabilities and criminal prosecution.

The AVEVA software described in this guide is to be installed and operated strictly in accordance with the terms
and conditions of the respective software licences, and in accordance with the relevant User Documentation.
Unauthorised or unlicensed use of the software is strictly prohibited.

Copyright 1974 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved. AVEVA shall not
be liable for any breach or infringement of a third party's intellectual property rights where such breach results from
a user's modification of the AVEVA software or associated documentation.

AVEVA Solutions Limited, High Cross, Madingley Road, Cambridge, CB3 0HB, United Kingdom.

Trademark
AVEVA and Tribon are registered trademarks of AVEVA Solutions Limited or its subsidiaries. Unauthorised use of
the AVEVA or Tribon trademarks is strictly forbidden.

AVEVA product/software names are trademarks or registered trademarks of AVEVA Solutions Limited or its
subsidiaries, registered in the UK, Europe and other countries (worldwide).

The copyright, trademark rights, or other intellectual property rights in any other product or software, its name or
logo belongs to its respective owner.
Status Control

Revision Sheet

Date Version Comments / Remarks


September 2011 12.1.1 Status Change Events has been modified.
Commands and Psuedo Attributes added.
New Graphical view added.
Replacement screens with new toolbar icons.
January 2012 Copyright added to all pages.
Status Control
Status Control

Status Control

Contents Page

Status Control
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
Guide Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1

Example Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:1


Status Control Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:2

Configuring Status Definitions in Lexicon . . . . . . . . . . . . . . . . . . . . 3:1


Status Controller in Design and other Constructor Modules . . . . . 4:1
Status Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:1
Edit Status Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:5
Status History. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:7
Statistical Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:7
Status Controller Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:10
Drag and Drop into Graphical View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:11

Status Pseudo Attributes and Commands . . . . . . . . . . . . . . . . . . . . 5:1


Pseudo Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:1
Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:3
Clean Up Orphan Status Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:3

Using Status Control with Data Access Control . . . . . . . . . . . . . . . 6:1

© Copyright 1974 to current year. i 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control

Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:1
Example to Prevent Modification of an Object of a Certain Status. . . . . . . . . . . . . . . . . . . . 6:1
Example to Catch when the Dictionary Database has been Deferred . . . . . . . . . . . . . . . . . 6:1
Example to Prevent Change of Status after a Certain Level . . . . . . . . . . . . . . . . . . . . . . . . 6:1
Example to Prevent Removal of Status from an Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:2
Example where a User may only Amend Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:2

Using Status Control with Auto Colours. . . . . . . . . . . . . . . . . . . . . . 7:1


Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7:1
Example Rule for Equipment with Design Status Pending. . . . . . . . . . . . . . . . . . . . . . . . . . 7:1
Example Rule for Equipment with Design Work Completed or Higher . . . . . . . . . . . . . . . . 7:1
Example Rule for Equipment with Design Status Not Controlled. . . . . . . . . . . . . . . . . . . . . 7:1

Customising Status Control using PML . . . . . . . . . . . . . . . . . . . . . . 8:1


Status Events in PML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:1
Status Change Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:1
Database Change Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:2
Customising the StatusProjectHandler PML Object. . . . . . . . . . . . . . . . . . . . . . 8:2
Debug Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:2
Where to add Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:3
Methods to Add Checks and Abort Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:3
Methods to make Dependent Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:3
Methods to Synchronise External Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:3
Using the StatusData PML Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:3
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:4
Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:5
Methods Intended for the User. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:5
Methods to Assign and Remove Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:6
Methods to Promote and Demote Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:6
Methods to Set Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:7
Internal Methods not Intended to be Called by User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:7
Example to Set and Get Status Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:8
Using the Core Status Objects from PML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:8
Object STATUSMANAGEMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:8
Object STATUSEVENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:8
Example to Add an Event Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:9
Object STATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:9
Object STATUSVALUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:11
Object ASSIGNEDSTATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:11
Example to Set and Get Status Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:12

© Copyright 1974 to current year. ii 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control

Customising Status Control using C# (.NET) . . . . . . . . . . . . . . . . . . 9:1


Namespaces and Assemblies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1
Classes in .NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1
Class StatusManagement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1
Class Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1
Class StatusValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:2
Class StatusCommand. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:3
Class StatusEvents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:3
Status Change Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:4
Database Change Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:5

Distributing Customised Status Layouts . . . . . . . . . . . . . . . . . . . . 10:1


Upgrading Model Manager Status Data . . . . . . . . . . . . . . . . . . . . . 11:1

© Copyright 1974 to current year. iii 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control

© Copyright 1974 to current year. iv 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Introduction

1 Introduction

Status Control is the ability to control and report on the status of individual model objects as
they progress through their lifecycles. It can be applied to any model objects, e.g. tagged
items, catalogue components, drawings, etc. It can be expressed in a variety of ways, e.g.
Approved for Construction, 80% Complete, Clash Free, etc.
The desired project configuration is created by administrators as Status Definitions in
Lexicon. It is applied to model objects by end users in any of the constructor modules -
Design, Outfitting, Paragon, Spooler, Diagrams, Hull, Draft and Marine Drafting - using the
Status Controller.
Status Control can be tightly coupled with Data Access Control. For example, it can be
configured so that only certain users may approve an object. It can also be configured to
prevent changes to an object once it has achieved a particular status.
A core concept for Status Control is that of a Controlled Object. A Controlled Object is
defined as any model object that has one or more Status Values assigned to it. A Controlled
Object may be controlled for multiple statuses to suit processes for design, manufacturing,
fabrication, construction, etc.

1.1 Assumptions
End users have a basic knowledge of PDMS/Marine.
Administrators have a reasonable knowledge of Lexicon, and if required can use the Access
Control Assistant in Admin.
Developers have a reasonable knowledge of PML and/or C# (.NET).

1.2 Guide Structure


This guide is structured as follows.

Introduction presents some concepts and overview

Example Workflow illustrates a worked example used throughout this


guide and explains the underlying data model

Configuring Status Definitions in describes how administrators can set up the status
Lexicon definitions for their project

Status Controller in Design and describes how end users can control the status of
other Constructor Modules their model objects

© Copyright 1974 to current year. 1:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Introduction

Status Pseudo Attributes and provides details of syntax available to application


Commands writers

Using Status Control with Data gives examples for administrators to extend
Access Control control of data integrity

Using Status Control with Auto gives examples for administrators to customise
Colours graphical views

Customising Status Control using shows developers how to add functionality from
PML PML

Customising Status Control using shows developers how to add functionality from
C# (.NET) C#

Distributing Customised Status shows where Status Layout files are stored
Layouts

Upgrading Model Manager Status describes an approach to convert existing status


Data values in Model Management projects.

© Copyright 1974 to current year. 1:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Example Workflow

2 Example Workflow

Consider the following simple workflow for a Design Status definition which will be used as a
worked example.

This example has a primary route from starting work through to releasing, with stages for
checking and approving, and options at various stages to put back for rework.

© Copyright 1974 to current year. 2:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Example Workflow

2.1 Status Control Data Model


The Status Control data model defines an Example Workflow as a Status Definition
(STADEF) object owning a set of Status Value (STAVAL) objects. Individual model objects
reference the Status Values via Status Link (STALNK) objects, as illustrated below.

Status Link objects reside in the same database as the model objects they reference, so that
they are globally distributed with those model objects. The Status Link holds references to
the model object and to the Status Value, along with attribute data for comments and history.
So status data is not stored directly on the model object and the user does not need write
access to the model object in order to set its status.
The Status Link objects are not visible to the end user, but the status data is available on the
model object as pseudo attributes. Administrators need to know of their existence for
purposes of Data Access Control.

© Copyright 1974 to current year. 2:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Configuring Status Definitions in Lexicon

3 Configuring Status Definitions in Lexicon

Lexicon uses a hierarchy of Status World, Status Definition and Status Value data types
to define a Example Workflow. In the Lexicon Dictionary Explorer, right click on the
Dictionary WORLD and select New Status World then enter a name in the Current Element
Editor.

Right click on the new Status World in the Explorer and select New Status Definition (the
user can also create Status Groups to contain Status Definitions). Enter a Name and
Description in the Editor

Note: These will typically be similar but the description can include spaces and will be used
in the Status Controller if it is set.

© Copyright 1974 to current year. 3:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Configuring Status Definitions in Lexicon

The next step is to define the Controllable element types for this Status Definition. Click on
the selection button to show the Select element types form.

© Copyright 1974 to current year. 3:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Configuring Status Definitions in Lexicon

Select EQUIPMENT, click Add to list, and then click OK. The user can add other types if
the definition is to apply to multiple types of elements.
Right click on the Status Definition in the Explorer and select New Status Value. Enter a
Name, Description and Numerical value in the Editor.

Note: Numerical value is optional and may be used as a percentage or a simple value.

© Copyright 1974 to current year. 3:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Configuring Status Definitions in Lexicon

Note: Status Value name uniqueness applies only within the owning Status Definition. So
you can use repeat names such as Preliminary and Released in different
definitions.

Repeat this process to create the rest of the Status Values.


Then go to each Status Value and set its Valid transitions. Click on the selection button to
show the Select valid status transitions window.

Select the status values that will be valid transitions from this value and click OK.
In the drop-down selection for Promote and Demote, select the appropriate values.

Note: Promote and demote are optional and simply denote a main route through the
workflow - any valid transitions not marked as promote or demote will still be
available in the Status Controller.

© Copyright 1974 to current year. 3:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Configuring Status Definitions in Lexicon

Select the Status Definition again in the Explorer and note its Initial status.

Note: It will be set to the first status value by default but the user can change this if
required.

The Status Definition is now complete and ready for use.


Right click on the Status Definition in the Dictionary Explorer and select Graphical View to
see a workflow diagram as shown below. Click on any status value in the graphical view to
make it current in the Explorer.

© Copyright 1974 to current year. 3:5 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Configuring Status Definitions in Lexicon

Save work and exit Lexicon.

© Copyright 1974 to current year. 3:6 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

4 Status Controller in Design and other


Constructor Modules

The constructor modules such as Paragon, Design and Outfitting, use the Status Controller
to interact with Controlled Objects. Click on Display > Status Controller to display the
Status Controller window. Initially this will be empty.

4.1 Status Layout


The first time Status Controller is displayed, the user is prompted to select a scope of
elements to include using the Set Layout Scope Elements window.

Click Add to display the Reference Browser. Use the Explorer and Search tabs to select
the required owning elements, then click OK. If the Scope window is cancelled, all
controllable elements can be included in the Status Controller content.

Note: This can take several minutes. If unsure what to include, select an element such as a
zone that has few offspring; the scope can always be changed later.

To display particular status data, click in the drop-down list for Status Layout and select New
Status Layout.

© Copyright 1974 to current year. 4:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

Alternatively right click in the grid area and select Status Layout.

The Select Status Columns window is displayed. For the example, check the columns for
Equipment Design Status then click OK.

© Copyright 1974 to current year. 4:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

The Set Layout Scope Elements window is displayed to allow scope selection. If cancelled,
the Status Controller will be populated with those objects that are or could be controlled by
the selected status definitions. A selected scope will reduce the number of rows populated,
which can mean a much faster display of the Status Controller. If more than one Status
Definition has been selected, one can be selected as the Focus Status in the drop-down list,
and this will be used for Edit Status operations.

Use the Set Layout Scope toolbar button to modify the currently displayed scope.

© Copyright 1974 to current year. 4:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

Display other attribute columns by right clicking in one of the column titles and selecting
Column Setup. The pseudo attribute expressions for the status columns already added will
be shown in this window.

Note: The user can show the status of a related object in its own column. For example, if
the user is managing status of schematic equipment (SCEQUI), they can show the
status of a linked EQUI using an expression like

STVDSC( /DesignStatus ) of Deslnk numb 1


See Pseudo Attributes for details of status pseudo attributes.
The chosen column layout can be saved by right clicking in one of the column titles and
selecting Save Status Layout.

The user will be prompted to enter a name for the layout.

© Copyright 1974 to current year. 4:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

This name will then appear in the Status Layout drop-down list on the Status Controller. Use
Save Status Layout As to save the layout with a different name.

Note: The other options available on the right click menu from the column titles, including
Settings and Export to Excel, which function similarly to in the Search Results.

4.2 Edit Status Operations


In the Status Controller select the rows for the objects to be controlled, right click in the
selected area, and click Edit Status.

This will display the form to edit values of the Focus Status for the selected objects. Initially
the objects are Not Controlled, i.e. they have not been assigned a status value (for this
status definition - they may have status values for other status definitions). Click on the
drop-down list and select Assign to the initial value, enter a Comment (optional), and then
click on OK or Apply.

© Copyright 1974 to current year. 4:5 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

The available options for status values will then reflect the valid transitions in the status
definition. For example, from Work Completed, there are two transitions.

If Promote and Demote transitions have been defined, these can be selected directly.

This will display a variant of the Edit Status window showing appropriate options.

Note: Actual values will be shown if all selected objects share the same values, otherwise
they will be displayed as mixed.

© Copyright 1974 to current year. 4:6 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

The Remove Status option will delete the status data for the selected objects, so that they
will no longer be controlled.
The Navigate To option will be enabled for a single row selection and will set the current
element.

4.3 Status History


The Status History option displays the Status History window for the selected objects
which lists the status transitions along with other session history.

The Status History also has right click options including Export to Excel.

4.4 Statistical Reports


The Statistical Report option displays the Statistical Report window which display data and
charts for the Focus Status on the selected objects.

© Copyright 1974 to current year. 4:7 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

Hovering the cursor over one of the regions on the chart gives some figures for the objects it
represents.

A right click context menu is available while the cursor is over a region on the chart. The
selected option is applied to the objects represented by that region.

© Copyright 1974 to current year. 4:8 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

For example, selecting List Elements displays a list of the elements for that region (you can
copy and paste from this window).

A right click menu in the background of the window offers various options, including a range
of Chart Types.

© Copyright 1974 to current year. 4:9 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

For example here is a 3D cylinder bar chart.

The Chart Legend option controls positioning of the legend, e.g. left, right, etc.

4.5 Status Controller Toolbars


The most commonly used functions are available in the Status Controller toolbars.

The Focus Status Toolbar enables selection of status layout, scope and focus status
definition. The button in between these represents Save Status Layout.

© Copyright 1974 to current year. 4:10 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

The Status Commands Toolbar buttons represent Promote, Demote, Edit Status, Remove
Status, Status History and Statistical Report.
The Element Interaction Toolbar buttons represent Select CE in Grid, Select CE Members
in Grid, and Select Graphical Selection in Grid.

4.6 Drag and Drop into Graphical View


The user can select one or more rows in the Status Controller and then drag and drop them
into the 3D View to add them to the drawlist (provided they are suitable object types).

© Copyright 1974 to current year. 4:11 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Controller in Design and other Constructor Modules

© Copyright 1974 to current year. 4:12 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Pseudo Attributes and Commands

5 Status Pseudo Attributes and Commands

A number of pseudo attributes are available on controlled objects to return their current
status data, and a set of commands are provided to set status data. These provide an
alternative to using the object methods described above.

5.1 Pseudo Attributes


The following pseudo attributes are available on any controlled object.

Attribute Qualifier Returns Remark


STVPRO STADEF STAVAL Get the promote STAVAL element for the
assigned STADEF
STVDEM STADEF STAVAL Get the demote STAVAL element for the
assigned STADEF
STVLST STADEF array Get all assigned STADEFs
STVNUM STADEF integer Get the numerical value for the assigned
STAVAL
STVDSC STADEF string The description of assigned STAVAL
STVCOM STADEF string The current comment from the latest
status command
STVNAM STADEF string The name of the assigned STAVAL
STVVAL STADEF STAVAL The current STAVAL for the STADEF
STVLNK STADEF STALNK Ref to the STALNK element (internal)
STVASD STADEF array Get all eligible STADEFs, may include
currently assigned
STVTRV STADEF array Get valid transitions from current STVVAL
STVUNR REF array Get a list of unresolved STAVAL
references from associated STALNKs
STVMOD STADEF String Status last modification date
STVUSE STADEF String Status last modified by user
STVHIS STADEF REF array The status history as a list of STAHIS
elements

© Copyright 1974 to current year. 5:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Pseudo Attributes and Commands

The following pseudo attributes are available on Status Definitions (STADEF).

Attribute Qualifier Returns Remark


STVREF string/number STAVAL Get the STAVAL with the given name or
number (NUMVAL)
STVUSD REF array All elements controlled by this STADEF

The following pseudo attributes are available on Status Values (STAVAL).

Attribute Qualifier Returns Remark


STVUSD REF array All elements controlled by this STADEF
and with this STAVAL current
STVPRO STAVAL Get the promote STAVAL element from
this STAVAL
STVDEM STAVAL Get the demote STAVAL element from
this STAVAL

To query a qualified pseudo attribute on the command line, enter the qualifier in brackets
noting the space required in front of the closing bracket, e.g.
Q STVVAL(/DesignStatus )
This will return the name of the status value, e.g. /WorkPending
To obtain this information in PML2, add the required status definitions into an array and use
the qualified attribute method as illustrated below.
!statusDefinitions[1] = /DesignStatus
!statusValues = !!ce.attribute('STVVAL', !statusDefinitions)
In this example the first element of the status values array will now be set to the status value
object, e.g.
Q var !statusValues[1].desc
will return the string 'Work Pending'.
When using status value as a condition in a collection, a command like the following will not
return the expected objects:
var !myItems collect all equi with (stvval( /EquipmentDesignStatus )
eq /Approved )
This is because the name of the status value is local to the definition (so that the same
name can be used in multiple definitions). Instead use one of these:
var !myItems collect all equi with (stvnam( /EquipmentDesignStatus )
eq '/ Approved')
var !myItems collect all equi with (stvnum( /EquipmentDesignStatus ) gt 75)

© Copyright 1974 to current year. 5:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Pseudo Attributes and Commands

5.2 Commands
STM ASS[ign] /Definition [to SELELE] ['comment']
Assigns Status /Definition to current element or SELELE making it controlled by this status
and sets the current status value to INIVAL. If a comment is given, it will be set otherwise
any current comment is cleared.

STM REM[ove] /Definition [from SELELE]


Removes Status /Definition from current element or SELELE making it uncontrolled by this
status.

STM RESET /Definition [on SELELE] ['comment']


Resets current value of status /Definition on current element or SELELE to INIVAL. There
does not need to be a valid transition from current value to initial value. If a comment is
given, it will be set otherwise any current comment is cleared.

STM DE[mote] /Definition [on SELELE] ['comment']


Sets current value of status /Definition on current element or SELELE to the value defined
as demote (STVDEM). If a comment is given, it will be set otherwise any current comment is
cleared

STM PRO[mote] /Definition [on SELELE] ['comment']


Sets current value of status /Definition on current element or SELELE to the value defined
as promote (STVPRO). If a comment is given, it will be set otherwise any current comment
is cleared

STM SET /Definition [/Value] [on SELELE] ['comment']


Sets current value of status /Definition on current element or SELELE to /Value. There need
to be a valid transition from current value to /Value. If a comment is given, it will be set
otherwise any current comment is cleared.

STM CO/mment /Definition [on SELELE] 'comment'


Set/modify current comment for status /Definition on current element or SELELE to
'comment'. This is done without modifying any other value of the current status.

5.3 Clean Up Orphan Status Links


Clean Up Orphan Status Link Elements (STALNK)
Deleting status controlled elements leaves orphan STALNK elements behind, with their
attribute CELREF reported as BADREF by Dice. A new PML function has been added to fix
this problem. Execute !!stmcleanup() on the command line to clean up all STALNKs with
an invalid CELREF.
Example:
!!stmcleanup()

© Copyright 1974 to current year. 5:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Status Pseudo Attributes and Commands

© Copyright 1974 to current year. 5:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Using Status Control with Data Access Control

6 Using Status Control with Data Access Control

Status Control can be tightly coupled with Data Access Control to preserve data integrity.
Below are some examples of what can be achieved. They have been created on the basis
of Roles where the first PEROP grants all rights on all element and attribute classes, and
then successive PEROPs deny some rights under specific conditions.

6.1 Examples

6.1.1 Example to Prevent Modification of an Object of a Certain Status


This is to prevent changes to an object once it has reached a level of completion.
Create a PEROP that denies modify and delete operations on equipment for all attributes
once the Design Status is greater than or equal to 50%. Here is the condition to use.
COND ( ATTRIB STVNUM(ID /DesignStatus ) GE 50 )
A suitable error message would be: DAC: You may not modify object that has status Work
Completed

6.1.2 Example to Catch when the Dictionary Database has been Deferred
This traps the situation where a user has tried to defeat the access control by deferring the
dictionary database containing the status definitions.
Create a PEROP that denies modify and delete operations on equipment for all attributes if
the Design Status is not a valid reference. Here is the condition.
COND ( NOT UNSET ( ATTRIB STVUNR ) )
A suitable error message would be: DAC: You may not modify an object with an unresolved
status

6.1.3 Example to Prevent Change of Status after a Certain Level


This is to allow a user to move an object into a For Check state but prevent them from
moving it out. A more privileged user will have the task of promoting it to Checked.
Create a PEROP that denies modify and delete operations on STALNK (status link)
elements for attribute VALREF (status value reference) if the current value of Design Status
is For Check. Here is the condition.
COND ( ATTRIB OWNER OF VALREF EQ ID /DesignStatus AND ATTRIB DESC OF
VALREF EQ 'For Check' )
A suitable error message would be: DAC: You may not change the Design Status of this
object as it is awaiting Check

© Copyright 1974 to current year. 6:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Using Status Control with Data Access Control

6.1.4 Example to Prevent Removal of Status from an Object


This is to prevent a user from removing status from a controlled object.
Create a PEROP that denies delete operations on STALNK (status link) elements if they are
controlled by Design Status. Here is the condition.
COND ( ATTRIB OWNER OF VALREF EQ ID /DesignStatus )
A suitable error message would be: DAC: You may not remove Design Status from this
object.

6.1.5 Example where a User may only Amend Status


This example illustrates how to prevent a user from making any changes, other than those
related directly to status assignment and transition.
Create a PEROP that grants all operations to the status hierarchy. The PEROP should be
applied to the following element type:
STLNKW HIERARCHY
This will apply the PEROP to all objects in the status hierarchy. Assign this PEROP (and
only this PEROP) to the user.
This is a positive DAC. It grants access rights to objects. It is therefore not possible to define
a specific DAC error message which will be shown if the user tries to carry out a forbidden
action (for example an attempt to create an element). A generic DAC error message will be
shown in these cases

© Copyright 1974 to current year. 6:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Using Status Control with Auto Colours

7 Using Status Control with Auto Colours

Status values can be used in the Element Rules for Auto Colours.

7.1 Examples

7.1.1 Example Rule for Equipment with Design Status Pending


Rule Name: Equipment Pending
Types: EQUI
Rule: attrib stvnum( /DesignStatus ) eq 0

7.1.2 Example Rule for Equipment with Design Work Completed or Higher
Rule Name: Equipment Completed
Types: EQUI
Rule: attrib stvnum( /DesignStatus ) ge 50

7.1.3 Example Rule for Equipment with Design Status Not Controlled
Rule Name: Equipment Not Controlled
Types: EQUI
Rule: badref ( attrib stvval( /DesignStatus ) )
If these Element Rules are defined, then Auto Colour rules can be added, for example to
show completed equipment in green, pending equipment in yellow, and uncontrolled
equipment in red.

© Copyright 1974 to current year. 7:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Using Status Control with Auto Colours

© Copyright 1974 to current year. 7:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

8 Customising Status Control using PML

Status Control operations can be carried out using PML. All the operations that can be
carried out using the Status Controller can also be done using the appropriate objects and
syntax.
Specific company and project requirements can be implemented using Status Events and a
framework is provided for this purpose.

8.1 Status Events in PML


Status Control provides an event mechanism that can be customised for individual company
and project requirements. User methods can be added as event handlers and will be called
with a single array argument. The following events are supported.

8.1.1 Status Change Events

Event Description
BeforeStatusAssign Before a status is assigned to an object
AfterStatusAssign After a status is assigned to an object
BeforeStatusRemove Before a status is removed from an object
AfterStatusRemove After a status is removed from an object
BeforeStatusChange Before a status is changed/promoted/demoted on an
object
AfterStatusChange After a status is changed/promoted/demoted on an
object
BeforeControlledElementDelete Before a controlled object is deleted

Arg No Type Description


1 ARRAY String reference numbers of controlled objects
2 STRING Reference number of status definition

© Copyright 1974 to current year. 8:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

3 STRING Reference number of to status value (may be =0/0)


4 STRING Return message aborts operation if set but only on Before …
operations

8.1.2 Database Change Events

Event Description
BeforeSavework Before savework when there are changes to status data
AfterSavework After savework when there are changes to status data
BeforeFlush Before flush when there are changes to status data
AfterFlush After flush when there are changes to status data

Arg No Type Description


1 STRING Reference number of status definition
2 ARRAY String reference numbers of objects that had status assigned
3 ARRAY String reference numbers of objects that had status changed
4 ARRAY String reference numbers of objects that had status removed
5 STRING Return message aborts operation if set but only on Before …
operations

8.2 Customising the StatusProjectHandler PML Object


A framework for customising events is provided in the PML object
statusProjectHandler.pmlobj in the pmllib\common\objects folder. A global instance of this
object is created on entry to the constructor module. It adds the event handlers and has
methods for each event.

8.2.1 Debug Mode


The user can switch ON or OFF a debug mode with the following commands.
!!statusProjectHandler.debugOn()
!!statusProjectHandler.debugOff()
In debug mode a line of text is output to the command line for each event. For example here
is the output for object P1501A when promoted from Work Suspended to Work Started.
statusProjectHandler.beforeStatusChange(/P1501A,
/DesignStatus, /WorkSuspended, /WorkStarted)
statusProjectHandler.afterStatusChange(/P1501A,
/DesignStatus, /WorkStarted, /WorkStarted)

© Copyright 1974 to current year. 8:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

8.2.2 Where to add Code


Each event method processes its arguments and creates some variables that may be of use
to the developer.
Each place where customised code can be added is delimited as follows.
--==========================================================
-- Start of customisation

-- End of customisation
--==========================================================

Important: Other parts of the statusProjectHandler PML object should not be modified.

A number of examples are provided (commented out). These make use of the statusData
PML object documented below.

8.2.3 Methods to Add Checks and Abort Changes


All of the Before … methods can be used to make additional checks and can abort the
operation by returning an error message, such as to prevent a status change if a particular
condition is not met. A variable has been provided for this purpose, e.g.
!returnMessage =
|Status error: You may not delete a controlled object|
By default, the only check made in the statusProjectHandler is to prevent a general user
from deleting a controlled object.

8.2.4 Methods to make Dependent Changes


The methods AfterStatusAssign, AfterStatusRemove and AfterStatusChange can be
used to make dependent changes when one of these operations is completed, e.g. to
cascade a change of status on an assembly to its offspring in the assembly hierarchy.

8.2.5 Methods to Synchronise External Systems


The methods AfterSavework and AfterFlush can be used to synchronise data in external
systems once the changes to status data have been committed in the Dabacon databases.

8.3 Using the StatusData PML Object


The PML object statusData.pmlobj is provided in the pmllib\common\objects folder to allow
easy manipulation of status data from PML. It encapsulates a number of core objects that
are documented below and that can be used directly if preferred.

Note: The statusData object can hold status data for a single object and status definition
combination, or it can hold an array of statusData objects for multiple objects and
status definition combinations (see the constructor methods below).

© Copyright 1974 to current year. 8:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

8.3.1 Members

Member Type Description


status ARRAY Status objects for internal usage
list ARRAY StatusData objects for multiple object/definition
combinations
bulk BOOLEAN True if object holds list of StatusData objects
False if object holds status information directly
definition DBREF Status definition
statusName STRING Name of status definition
elements ARRAY Model objects controlled by status definition
elementNames ARRAY Model object names
values ARRAY Status value objects
valnames ARRAY Status value names
descriptions ARRAY Status value descriptions
numbers ARRAY Status value numbers
comments ARRAY Status value comments
users ARRAY Status last modification dates
modifieds ARRAY Status last modified by users
transitions ARRAY Available transitions as array of arrays of strings
element DBREF First element in array
elementName STRING First element name in array
value DBREF First status value in array
valname STRING First status value name in array
description STRING First status value description in array
number REAL First status value number in array
comment STRING First status value comment in array
user STRING First status last modification date in array
modified STRING First status last modified by user in array
steps ARRAY First array of available transitions
debug BOOLEAN Debug flag
refreshMode STRING Refresh mode - None/Part/Full (set to None by
default for best performance)

© Copyright 1974 to current year. 8:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

8.3.2 Constructors

Method Description
statusData() Constructor for all status definitions on CE
statusData( Constructor for single status definition on CE
STRING name of status definition )
statusData( Constructor for all status definitions on a single
DBREF of object ) object
statusData( Constructor for all status definitions on array of
ARRAY of DBREF of objects ) objects
statusData( Constructor for single object and single status
DBREF of object, definition
DBREF of status definition )
statusData( Constructor for single object and single status
DBREF of object, definition
STRING name of status definition )
statusData( Constructor for array of objects and single status
ARRAY of DBREF of objects, definition
DBREF of status definition )
statusData( Constructor for array of objects and single status
ARRAY of DBREF of objects, definition
STRING name of status definition )

8.3.3 Methods Intended for the User

Method Description
output() is ARRAY of STRING Return one line status summary per object
(automatically does a refresh with refresh mode part)
outputAll() is ARRAY of STRING Return multi line status details per object
(automatically does a refresh with refresh mode full)
print() Print one line status summary per object
printAll() Print multi line status details per object
refresh() Reread status data
refreshModeFull() Set refresh mode to full (slows performance)
refreshModeNone() Set refresh mode to none (best performance)
refreshModePart() Set refresh mode to part

© Copyright 1974 to current year. 8:5 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

8.3.4 Methods to Assign and Remove Status

Method Description
assign() Assign stored status definition to object(s)
assign ( Assign stored status definition to object(s) and set
STRING comment ) comment
assignStatus( Assign status definition to object(s)
DBREF of status definition )
assignStatus( Assign status definition to object(s)
STRING name of status definition )
assignStatus( Assign status definition to object(s) and set comment
DBREF of status definition,
STRING comment )
assignStatus( Assign status definition to object(s) and set comment
STRING name of status definition,
STRING comment )
remove() Remove stored status definition from object(s)
removeStatus( Remove status definition from object(s)
DBREF of status definition)
removeStatus( Remove status definition from object(s)
STRING name of status definition )

8.3.5 Methods to Promote and Demote Status

Method Description
promote() Promote stored status for object(s)
promote( Promote stored status for object(s) and set comment
STRING comment )
promoteStatus( Promote status for object(s)
DBREF of status definition )
promoteStatus( Promote status for object(s)
STRING name of status definition )
promoteStatus( Promote status for object(s) and set comment
DBREF of status definition,
STRING comment )
promoteStatus( Promote status for object(s) and set comment
STRING name of status definition,
STRING comment )
demote() Demote stored status for object(s)

© Copyright 1974 to current year. 8:6 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

demote( Demote stored status for object(s) and set comment


STRING comment )
demoteStatus( Demote status for object(s)
DBREF of status definition )
demoteStatus( Demote status for object(s)
STRING name of status definition )
demoteStatus( Demote status for object(s) and set comment
DBREF of status definition,
STRING comment )
demoteStatus( Demote status for object(s) and set comment
STRING name of status definition,
STRING comment )

8.3.6 Methods to Set Status

Method Description
set( Set stored status for object(s)
STRING name of status value)
set( Set stored status for object(s) and set comment
STRING name of status value,
STRING comment )
setStatus( Set status for object(s)
DBREF of status definition,
STRING name of status value )
setStatus( Set status for object(s)
STRING name of status definition,
STRING name of status value)
setStatus( Set status for object(s) and set comment
DBREF of status definition,
STRING name of status value,
STRING comment )
setStatus( Set status for object(s) and set comment
STRING name of status definition,
STRING name of status value,
STRING comment )

8.3.7 Internal Methods not Intended to be Called by User

Method Description
init() Internal method to initialise member data
clear() Internal method to clear member data

© Copyright 1974 to current year. 8:7 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

debugOff() Internal method to clear debug flag


debugOn() Internal method to set debug flag
refreshMode( STRING ) Internal method to set refreshMode
sortSteps() Internal method to return available transitions

8.3.8 Example to Set and Get Status Data


The example is for the case where there is one available status definition for the current
element. The set of commands assigns that status to the current element, promotes it, prints
out the data, and gets the current status value description into a string variable.
!myStatus = object statusData()
!myStatus.assign()
!myStatus.promote()
!myStatus.print()
!currentStatus = !myStatus.description

8.4 Using the Core Status Objects from PML


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'

8.4.1 Object STATUSMANAGEMENT


Holds systems information relating to Status Control. Methods include:

Method Description
statuses() Returns the available statuses as an array of STATUS

8.4.2 Object STATUSEVENTS


Holds information relating to status events. Methods include:

Method Description
statusEvents( Constructor that initialises for the status definition
STRING name of status definition )
Initialise( Initialises for the status definition
STRING name of status definition )

© Copyright 1974 to current year. 8:8 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

addEventHandler( Adds an event for the stored status definition that


STRING event name, will call the method on the object
ANY object name,
STRING method name)

8.4.3 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')

8.4.4 Object STATUS


Represents a status definition. Methods include:

Method Description
status( Constructor
STRING name of status definition )
assign( Assign status to object
STRING name of object )
assign ( Assign status to objects
ARRAY of names of objects )
assign ( Assign status to object and set comment
STRING name of object,
STRING comment )
assign ( Assign status to objects and set comment
ARRAY of names of objects,
STRING comment )
controlledElements() Returns an array of names of objects controlled by
this status
demote( Demote status on object
STRING name of object )
demote ( Demote status on objects
ARRAY of names of objects )
demote ( Demote status on object and set comment
STRING name of object,
STRING comment )

© Copyright 1974 to current year. 8:9 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

demote ( Demote status on objects and set comment


ARRAY of names of objects,
STRING comment )
description() Returns description of status definition
initialValue() Returns STATUSVALUE initial value of status
definition
name() Returns name of status definition
promote( Promote status on object
STRING name of object )
promote ( Promote status on objects
ARRAY of names of objects )
promote ( Promote status on object and set comment
STRING name of object,
STRING comment )
promote ( Promote status on objects and set comment
ARRAY of names of objects,
STRING comment )
remove( Remove status from object
STRING name of object )
remove ( Remove status from objects
ARRAY of names of objects )
set ( Set status on object
STRING name of object,
STRING name of status value)
set ( Set status on object
STRING name of object,
STATUSVALUE status value)
set ( Set status on objects
ARRAY of names of objects,
STRING name of status value )
set ( Set status on objects
ARRAY of names of objects,
STATUSVALUE status value)
set ( Set status on object and set comment
STRING name of object,
STRING name of status value,
STRING comment )
set ( Set status on object and set comment
STRING name of object,
STATUSVALUE status value,
STRING, comment )

© Copyright 1974 to current year. 8:10 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

set ( Set status on objects and set comment


ARRAY of names of objects,
STRING name of status value,
STRING comment )
set ( Set status on objects and set comment
ARRAY of names of objects,
STATUSVALUE status value,
STRING comment )
values() Returns array of STATUSVALUE for this status
definition

8.4.5 Object STATUSVALUE


Represents a status value. Methods include:

Method Description
statusValue( Constructor
STRING name of status definition,
STRING valname of status value )
statusValue ( Constructor
STATUS status definition,
STRING valname of status value )
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

8.4.6 Object ASSIGNEDSTATUS


Represents the status link data for an object. Methods include:

Method Description
assignedStatus( Constructor
STRING name of status definition,
STRING name of model object )
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

© Copyright 1974 to current year. 8:11 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using PML

8.4.7 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()

© Copyright 1974 to current year. 8:12 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using C# (.NET)

9 Customising Status Control using C# (.NET)

As an alternative to (or in combination with) PML customisation, customisation can also be


undertaken in .NET applications. Examples below are given in the C# language.

9.1 Namespaces and Assemblies


The .NET status objects described below are defined in the
Aveva.Pdms.DataManagement.dll assembly, which is found in the standard PDMS install
directory (PDMSEXE). To use these status objects, programmers need reference to the
Aveva.Pdms.Database.dll assembly also found in PDMSEXE. (To reference other PDMS
.NET assemblies - refer to PDMS.NET documentation for further details.)
To access this software from Visual Studio, add the assemblies to the project references
and declare interest in the namespaces at the top of the client C# files:
using Aveva.Pdms.DataManagement;
using Aveva.Pdms.Database;

9.2 Classes in .NET


The following classes are available in C#. These correspond to and have similar
functionality to the PML objects described above.

9.2.1 Class StatusManagement


This static class gives access to all the status definition elements in the current MDB. As a
static class no instances of the class are created. The class has a single property, Statuses,
which returns an array of Status objects (described below), used as follows:
Status[] statuses = StatusManagement.Statuses;

9.2.2 Class Status


This class gives access to a named status definition determined in the constructor either by
name or as a DbElement:
Status status = Status("/DesignStatus");
DbElement statusDefinitionElement;
// ...
Status status = Status(statusDefinitionElement);
The screenshot below of the Visual Studio Object Browser details the public interface of the
Status class:

© Copyright 1974 to current year. 9:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using C# (.NET)

9.2.3 Class StatusValue


This class gives access to the data relating to a Status Value (STAVAL element). This
represents one of the legal states that an element controlled for a given status definition
may have. The status definition and value can be determined via the class constructors:
Status status = Status("/DesignStatus");
StatusValue statusValue = StatusValue(status, "/Approved");
Or:
DbElement statusValueElement;
// ...
StatusValue statusValue = StatusValue(statusValueElement);
Alternatively, the array of all StatusValues for a given status definition can be obtained
directly from a Status object:
Status status = Status("/DesignStatus");

© Copyright 1974 to current year. 9:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using C# (.NET)

StatusValue[] statusValues = status.Values;


The remaining functions of the StatusValue class are displayed in the Visual Studio Object
Browser below:

9.2.4 Class StatusCommand


This static class gives access to all the status functionality. As a static class no instances of
the class are created. This class effectively duplicates the functionality otherwise available
through instances of the Status class. The Visual Studio Object Browser display is as
follows:

9.2.5 Class StatusEvents


This class gives access to all the status change events. An instance of the class cannot be
instantiated directly by constructor. Instead an instance can be created from the
Status.Events property, or from the static functions
StatusEvent.GetStatusEventObject(Status s) or StatusEvent.GetStatusEventObject(). The
following example shows the registration of an event handler for the BeforeStatusChange
event together with a sample implementation of the registered event handler:

© Copyright 1974 to current year. 9:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using C# (.NET)

Status status = Status("/DesignStatus");


StatusEvent statusEvent = status.Event;

statusEvent.BeforeStatusChange += new
StatusEvent.BeforeStatusChangeEventHandler(My_BeforeStatusChange
);

// ...

// Event handler
private void My_BeforeStatusChange (object sender,
CancelStatusEventArgs e)
{
// Do any extra actions and check status change is allowed

if ( /* abort status change required */ )


{
e.Cancel = true;
e.Message = "reason not to proceed";
}
}

The list of available status events is displayed in the Visual Studio Object Browser display as
follows:

9.2.6 Status Change Events


The Before … event methods can cancel the operation.

Event Arguments
BeforeStatusAssign object sender, CancelStatusEventArgs e
AfterStatusAssign object sender, StatusEventArgs e
BeforeStatusRemove object sender, CancelStatusEventArgs e

© Copyright 1974 to current year. 9:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using C# (.NET)

AfterStatusRemove object sender, StatusEventArgs e


BeforeStatusChange object sender, CancelStatusEventArgs e
AfterStatusChange object sender, StatusEventArgs e
BeforeControlledElementDelete object sender, CancelStatusEventArgs e

StatusEventArgs

Name Type Description


Model DbElement[] Array of elements that is/to be controlled
Status Status The Status object
To StatusValue The to StatusValue object

CancelStatusEventArgs

Name Type Description


Model DbElement[] Array of elements that is/to be controlled
Status Status The Status object
To StatusValue The to StatusValue object
Cancel Bool Cancel the ongoing operation
Message String With this as the message

9.2.7 Database Change Events


The Before … event methods can cancel the operation.

Event Arguments
BeforeSavework object sender, CancelDBChangeEventArgs e
AfterSavework object sender, DBChangeEventArgs e
BeforeFlush object sender, CancelDBChangeEventArgs e
AfterFlush object sender, DBChangeEventArgs e

© Copyright 1974 to current year. 9:5 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Customising Status Control using C# (.NET)

DBChangeEventArgs

Name Type Description


Status Status The Status object
Assigned DbElement[] Array of DbElements that had Status assigned
Changed DbElement[] Array of DbElements that had Status changed
Removed DbElement[] Array of DbElements that had Status removed

CancelDBChangeEventArgs

Name Type Description


Status Status The Status object
Assigned DbElement[] Array of DbElements that had Status assigned
Changed DbElement[] Array of DbElements that had Status changed
Removed DbElement[] Array of DbElements that had Status removed
Cancel Bool Cancel the ongoing operation
Message String With this as the message

© Copyright 1974 to current year. 9:6 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Distributing Customised Status Layouts

10 Distributing Customised Status Layouts

Individual users can customise and save their own status layouts. This process is described
in Status Layout in Status Controller in Design and other Constructor Modules. As an
administrator you may decide to create a set of project standard status layouts for all users
on the project.
Status layouts are stored in files in the user’s Local Settings Application Data folder, for
example, for the project BAS the folder will be:
C:\Documents and Settings\john.smith\Local Settings\Application
Data\Aveva\PDMS\BASStatusGridProfiles
An administrator who has created a set of status layouts in their own folder can copy these
files and distribute them to other users to include in their own equivalent folders. There is no
need to copy the LastSelectedStatusGridProfile or WindowsLayout files in this folder as
these will be created automatically.

© Copyright 1974 to current year. 10:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Distributing Customised Status Layouts

© Copyright 1974 to current year. 10:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Upgrading Model Manager Status Data

11 Upgrading Model Manager Status Data

This section suggests an approach to upgrading status data created by AVEVA Model
Manager.
For Model Manager, the equivalent to a Status Definition is a list of values for a particular
controlled object type and is defined in VPE. Individual controlled objects then hold one of
these values in a specified attribute, e.g. :mmstatus.
A Status Definition could be created for each list of values, applied to the particular
controlled object type. Where the controlled object type is qualified by a filter, e.g. PIPE with
PURP 'Civils', this could be implemented as a UDET, e.g. :CivilsPipe.
An allowable transition should be set from the initial value to each other value in the
definition, to support the next stage (some of these transitions could be removed later).
A macro would then be written, to loop through each controlled object, assign its appropriate
status definition then set it to the equivalent status value for its Model Manager status data.

© Copyright 1974 to current year. 11:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control
Upgrading Model Manager Status Data

© Copyright 1974 to current year. 11:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control

Index

C L
Change Events Lexicon
Database . . . . . . . . . . . . . . . . . 8:2, 9:5 Configuring Status Definitions . . . . . 3:1
Status . . . . . . . . . . . . . . . . . . . . . . . . 9:4
Class M
Status . . . . . . . . . . . . . . . . . . . . . . . . 9:1
StatusCommand . . . . . . . . . . . . . . . . 9:3 Methods
StatusEvents . . . . . . . . . . . . . . . . . . 9:3 Abort Changes . . . . . . . . . . . . . . . . . 8:3
StatusManagement . . . . . . . . . . . . . 9:1 Add Checks . . . . . . . . . . . . . . . . . . . 8:3
StatusValue . . . . . . . . . . . . . . . . . . . 9:2 Assign and Remove . . . . . . . . . . . . . 8:6
Classes Dependent Changes . . . . . . . . . . . . 8:3
.NET . . . . . . . . . . . . . . . . . . . . . . . . . 9:1 Intended for User . . . . . . . . . . . . . . . 8:5
Commands . . . . . . . . . . . . . . . . . . . . . . . 5:3 Internal . . . . . . . . . . . . . . . . . . . . . . . 8:7
Customising Promote and Demote . . . . . . . . . . . . 8:6
StatusProject Handler PML Object . . 8:2 Set Status . . . . . . . . . . . . . . . . . . . . 8:7
Synchronise External Systems . . . . 8:3
D
N
Data Model
Status Control . . . . . . . . . . . . . . . . . . 2:2 Namespaces and Assemblies . . . . . . . . 9:1

E O
Example Object
Add Event Handler . . . . . . . . . . . . . . 8:9 Assignedstatus . . . . . . . . . . . . . . . 8:11
Set and Get Status Data . . . . 8:8, 8:12 Status . . . . . . . . . . . . . . . . . . . . . . . . 8:9
Statusevents . . . . . . . . . . . . . . . . . . 8:8
G Statusmanagement . . . . . . . . . . . . . 8:8
Statusvalue . . . . . . . . . . . . . . . . . . 8:11
Graphical View
Drag and Drop . . . . . . . . . . . . . . . . 4:11 P
PML
Core Status Objects . . . . . . . . . . . . . 8:8

© Copyright 1974 to current year. Index page 1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Status Control

PML Object
StatusData . . . . . . . . . . . . . . . . . . . . 8:3
Pseudo Attributes . . . . . . . . . . . . . . . . . . 5:1

R
Reports
Statistical . . . . . . . . . . . . . . . . . . . . . 4:7

S
Status
Controller Toolbar . . . . . . . . . . . . . . 4:10
Distributing Customised Layouts . . 10:1
Edit Operations . . . . . . . . . . . . . . . . . 4:5
History . . . . . . . . . . . . . . . . . . . . . . . 4:7
Layout . . . . . . . . . . . . . . . . . . . . . . . . 4:1
Status Change
Events . . . . . . . . . . . . . . . . . . . . . . . 8:1
Status Control
Auto Colours . . . . . . . . . . . . . . . . . . . 7:1
C# . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1
Data Access Control . . . . . . . . . . . . . 6:1
Examples . . . . . . . . . . . . . . . . . 6:1, 7:1
using PML . . . . . . . . . . . . . . . . . . . . 8:1
Status Controller
Constructor Modules . . . . . . . . . . . . 4:1
Design . . . . . . . . . . . . . . . . . . . . . . . 4:1
Status Events
PML . . . . . . . . . . . . . . . . . . . . . . . . . 8:1

W
Workflow
Example . . . . . . . . . . . . . . . . . . . . . . 2:1

© Copyright 1974 to current year. Index page 2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.

You might also like