Status Control
AVEVA Sol ut io n s L t d
Disclaimer Information of a technical nature, and particulars of the product and its use, is given by AVEVA Solutions Ltd and its subsidiaries without warranty. AVEVA Solutions Ltd and its subsidiaries disclaim any and all warranties and conditions, expressed or implied, to the fullest extent permitted by law. Neither the author nor AVEVA Solutions Ltd, or any of its subsidiaries, shall be liable to any person or entity for any actions, claims, loss or damage arising from the use or possession of any information, particulars, or errors in this publication, or any incorrect use of the product, whatsoever.
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 AVEVA AVEVA Solutions Ltd or its subsidiaries. All other rights are reserved to AVEV VEVA A Solutions Ltd 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 Ltd. Where such permission is granted, it expressly requires that this Disclaimer and Copyright notice 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 Ltd. The user may also not reverse engineer, decompile, copy, or adapt the associated software. Neither the whole, nor part of the product described in this publication may be incorporated into any third-party software, product, machine, or system without the prior written permission of AVEVA Solutions Ltd, save as permitted by law. Any such unauthorised action is strictly prohibited, and may give rise to civil liabilities and criminal prosecution. The AVEVA products described in this guide are to be installed and operated strictly in accordance with the terms and conditions of the respective license agreements, and in accordance with the relevant User Documentation. Unauthorised or unlicensed use of the product is strictly prohibited. First published September 2009 © AVEVA AVEVA Solutions Ltd, and its subsidiaries AVEV AVEVA A Solutions Ltd, High Cross, Madingley Road, Cambridge, CB3 0HB, United Kingdom
Trademarks AVEV AVEVA A and Tribon are registered trademarks of AVEVA AVEVA Solutions Ltd or its subsidiaries. Unauthorised use of the AVEV VEVA A or Tribon trademarks is strictly forbidden. AVEV AVEVA A product names are trademarks or registered trademarks of AVEV VEVA A Solutions Ltd or its subsidiaries, registered in the UK, Europe and other countries (worldwide). The copyright, trade mark rights, or other intellectual property rights in any other product, its name or logo belongs to its respective owner.
Status Status Contro l
Sta Statu tus s Control Contr ol
Co n t en t s
Pag e
Status Control Intr oduc od ucti tion on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1 As su mp ti on s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1 Guide Gui de Str uctu uc tu re . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
Example Examp le Wor kf low lo w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:1 Status Contro Cont roll Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:2 2:2
Configu ring Status Status Defin Defin itio ns i n Lexic on . . . . . . . . . . . . . . . . . . . . 3:1 Status Status Controller in Design Design and other Constructor Modules . . . . . 4:1 Status Stat us Layou Lay outt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:1 Edit Status Operati ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:4 Status Stat us Histo His to ry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:6 Statis Stat isti ti cal Repor ts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:7 Status Contro Cont rollller er Tool bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:10 Drag and Drop into in to Graphi cal View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:10
Status Status Pseudo Pseudo Att ribu tes and Commands . . . . . . . . . . . . . . . . . . . . 5:1 Pseud o Att A tt ri bu tes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:1 Comman Com mands ds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:2
Using Status Contr ol wi th Data Acc ess Contro l . . . . . . . . . . . . . . . 6:1 Examp les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:1
© 2009 AVEVA Solutions Ltd
i
12.0
Status Status Contro l
Example to Prevent Prevent Modification of an Object of a Certain Certain Status. . . . . . . . . . . . . . . . . . . . 6:1 Example to Catch Catch when the Dictionary Dictionary Database Database has been Deferred . . . . . . . . . . . . . . . . . 6:1 Example to Prevent Prevent Change of Status Status after a Certain Certain Level . . . . . . . . . . . . . . . . . . . . . . . . 6:1 Example to Prevent Prevent Removal of Status Status from an Object Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:2 Example where where a User may only only Amend Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:2
Using Status Con trol tr ol w ith it h Auto Au to Colou rs . . . . . . . . . . . . . . . . . . . . . . 7:1 Examp les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7:1 Example Rule Rule for Equipment Equipment with Design Status Status Pending. . . . . . . . . . . . . . . . . . . . . . . . . . 7:1 Example Rule Rule for Equipment Equipment with Design Work Work Completed or Higher . . . . . . . . . . . . . . . . 7:1 Example Rule Rule for Equipment Equipment with Design Status Status Not Controlled. Controlled. . . . . . . . . . . . . . . . . . . . . 7:1
Customi Cust omi sing si ng Statu s Cont rol ro l us ing PML PML . . . . . . . . . . . . . . . . . . . . . . 8:1 Status Stat us Event s i n PML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:1 Status Change Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:1 Database Change Change Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:2
Custom Cust omisi isi ng t he Status ProjectHandl Proj ectHandl er PML Object . . . . . . . . . . . . . . . . . . . . . . 8:2 Debug Mode. Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:2 Where to add Code Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:3 Methods where you can Add Checks Checks and Abort Changes. Changes. . . . . . . . . . . . . . . . . . . . . . . . . . 8:3 Methods where you can make Dependent Dependent Changes Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:3 Methods where where you can Synchronise Synchronise External External Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:3
Using Usin g t he Statu sData PML Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:3 Members Members
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:4
Constructors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:4 Methods Intended Intended for the User. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:5 Methods to Assign Assign and Remove Remove Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:5 Methods to Promote Promote and Demote Status Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:6 Methods to Set Status Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:7 Internal Methods Methods not Intended to be Called by by User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:7 Example to Set and and Get Status Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:7
Using Usin g the t he Core Statu s Obj ects from fr om PML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:8 8:8 Object STATUSMANAGEMENT STATUSMANAGEMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:8 Object STATUSEVENTS STATUSEVENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:8 Example to Add an Event Handler Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:8 Object STATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:9 Object STATUSVALUE STATUSVALUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:11 Object ASSIGNEDSTATUS ASSIGNEDSTATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:11 Example to Set and and Get Status Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:11
© 2009 AVEVA Solutions Ltd
ii
12.0
Status Status Contro l
Customi sin g Status Control usin g C# (.NE (.NET). T). . . . . . . . . . . . . . . . . . 9:1 Namespaces Namesp aces an d Ass A ssemb emblili es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1 Class es in i n .NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1 Class StatusManagement StatusManagement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1 Class Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1 Class StatusValue StatusValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:2 Class StatusCommand. StatusCommand. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:3 Class StatusEvents StatusEvents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:3 Status Change Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:5 Database Change Change Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:5
Distrib uti ng Cust omis ed Status Status Layout s . . . . . . . . . . . . . . . . . . . . 10:1 10:1 Upgrading Upgr ading Model Manager Manager Statu s Data . . . . . . . . . . . . . . . . . . . . . 11:1 11:1
© 2009 AVEVA Solutions Ltd
ii i
12.0
Status Contro l
© 2009 AVEVA Solutions Ltd
iv
12.0
Status Contro l 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 Hull 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 Lexicon
describes how administrators can set up the status definitions for their project
Status Controller in Design and other Constructor Modules
describes how end users can control the status of their model objects
© 2009 AVEVA Solutions Ltd
1:1
12.0
Status Contro l Introduction
and
provides details of syntax available to application writers
Using Status Control with Data Access Control
gives examples for administrators to extend control of data integrity
Using Status Control with Auto Colours
gives examples for administrators to customise graphical views
Customising Status Control using PML
shows developers how to add functionality from PML
Customising Status Control using C# (.NET)
shows developers how to add functionality from C#
Distributing Layouts
shows where Status Layout files are stored
Status Pseudo Commands
Attributes
Customised
Status
Upgrading Model Manager Status Data
© 2009 AVEVA Solutions Ltd
describes an approach to convert existing status values in Model Management projects.
1:2
12.0
Status Contro l 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.
© 2009 AVEVA Solutions Ltd
2:1
12.0
Status Contro l Example Workflow
2.1
Stat us Co nt ro l Data Mo del 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.
© 2009 AVEVA Solutions Ltd
2:2
12.0
Status Contro l Configuring Status Definitions in Lexicon
3
Configuring Status Definitions in Lexicon Lexicon uses a hierarchy of Status World , Status Definit ion 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 Definit ion (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.
© 2009 AVEVA Solutions Ltd
3:1
12.0
Status Contro l Configuring Status Definitions in Lexicon
The next step is to define the Controll able element types for this Status Definition. Click on the selection button to show the Select element t ypes form.
© 2009 AVEVA Solutions Ltd
3:2
12.0
Status Contro l Configuring Status Definitions in Lexicon
Select EQUIPMENT, click Ad d to li st , 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.
© 2009 AVEVA Solutions Ltd
3:3
12.0
Status Contro l 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. You can 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 clickOK . 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.
© 2009 AVEVA Solutions Ltd
3:4
12.0
Status Contro l 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. Save work and exit Lexicon.
© 2009 AVEVA Solutions Ltd
3:5
12.0
Status Contro l Configuring Status Definitions in Lexicon
© 2009 AVEVA Solutions Ltd
3:6
12.0
Status Contro l Status Controller in Design and other Constructor Modules
4
Status Controller in Design and other Constru ctor 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 To display particular status data, click in the drop down list for Status Layout and select New Status Layout .
Alternatively right click in the empty grid area and select Status Layout .
© 2009 AVEVA Solutions Ltd
4:1
12.0
Status Contro l Status Controller in Design and other Constructor Modules
The Select Status Column s window will be displayed. For the example, check the columns for Design Status.
The Status Controller will display the status data columns. The rows will be populated with those objects that are or could be controlled by the selected status definitions. 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.
© 2009 AVEVA Solutions Ltd
4:2
12.0
Status Contro l Status Controller in Design and other Constructor Modules
The user can 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 .
© 2009 AVEVA Solutions Ltd
4:3
12.0
Status Contro l Status Controller in Design and other Constructor Modules
The user will be prompted to enter a name for the layout.
This name will then appear in the Status Layout dropdown 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 Oper ations In the Status Controller select the rows for the objects to be controlled, right click in the selected area, and click Edit Status .
© 2009 AVEVA Solutions Ltd
4:4
12.0
Status Contro l Status Controller in Design and other Constructor Modules
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 As si gn to the initial value, enter a Comment (optional), and then click on OK or Ap pl y.
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.
© 2009 AVEVA Solutions Ltd
4:5
12.0
Status Contro l Status Controller in Design and other Constructor Modules
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 .
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.
© 2009 AVEVA Solutions Ltd
4:6
12.0
Status Contro l Status Controller in Design and other Constructor Modules
The Status History also has right click options including Export to Excel .
4.4
Statistical Reports The Statisti cal Report option displays the Statistical Report window which display data and charts for the Focus Status on the selected objects.
Hovering the cursor over one of the regions on the chart give s some figures for the objects it represents.
© 2009 AVEVA Solutions Ltd
4:7
12.0
Status Contro l Status Controller in Design and other Constructor Modules
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.
For example, selecting List Elements displays a list of the elements for that r egion (you can copy and paste from this window).
© 2009 AVEVA Solutions Ltd
4:8
12.0
Status Contro l Status Controller in Design and other Constructor Modules
A right click menu in the background of the window offers various options, including a range of Chart Types .
For example here is a 3D cylinder bar chart.
© 2009 AVEVA Solutions Ltd
4:9
12.0
Status Contro l Status Controller in Design and other Constructor Modules
The Chart Legend option controls positioning of the legend, e.g. left, right, etc.
4.5
Stat us Co ntr ol ler To ol bar The most commonly used functions are available in the Status Controller toolbar.
The icons represent Promote, Demote, Edit Status , Remove Status, Status History, Statisti cal Report and Save Status Layout .
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).
© 2009 AVEVA Solutions Ltd
4:10
12.0
Status Contro l 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. At tr ib ut e
Qual if ier
Retu rn s
Remar k
STVPRO
STADEF
STAVAL
Get the promote STAVAL element for the assigned STADEF
STVDEM
STADEF
STAVAL
Get the demote STAVAL element for the assigned STADEF
STADEF array
Get all assigned STADEFs
STVLST 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
© 2009 AVEVA Solutions Ltd
5:1
12.0
Status Contro l Status Pseudo Attributes and Commands
The following pseudo attribut es are available on Status Definitions (STADEF). At tr ib ut e
Qual if ier
Retu rn s
Remar k
STVREF
string/number
STAVAL
Get the STAVAL with the given name or number (NUMVAL)
REF array
All elements controlled by this STADEF
STVUSD
The following pseudo attributes are available on Status Values (STAVAL). At tr ib ut e
5.2
Qual if ier
Retu rn s
Remar k
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
Commands STM ASS[ign] /Definit ion [t o SELELE] ['co mment']
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] /Definitio n [ from SELELE]
Removes Status /Definition from current element or SELELE making it uncontrolled by this status. STM RESET /Definit ion [on SELELE] ['comm ent']
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] /Definitio n [on SELELE] ['co mment']
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] /Definit ion [on SELELE] ['co mment']
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
© 2009 AVEVA Solutions Ltd
5:2
12.0
Status Contro l Status Pseudo Attributes and Commands
STM SET /Definitio n [ /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.
© 2009 AVEVA Solutions Ltd
5:3
12.0
Status Contro l Status Pseudo Attributes and Commands
© 2009 AVEVA Solutions Ltd
5:4
12.0
Status Contro l Using Status Control with Data Access Control
6
Usi ng Status Cont rol wi th Data Access Con trol 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 ( BADREF ( ATTRIB STVVAL(ID /DesignStatus ) ) ) 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
© 2009 AVEVA Solutions Ltd
6:1
12.0
Status Contro l 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 defin e 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
© 2009 AVEVA Solutions Ltd
6:2
12.0
Status Contro l 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.
© 2009 AVEVA Solutions Ltd
7:1
12.0
Status Contro l Using Status Control with Auto Colours
© 2009 AVEVA Solutions Ltd
7:2
12.0
Status Contro l 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
Stat us Ch an ge Even ts
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
Ar g No
Type
Descri pt io n
1
STRING
Reference number of controlled object
2
STRING
Reference number of status definition
3
STRING
Reference number of from status value (may be =0/0)
© 2009 AVEVA Solutions Ltd
8:1
12.0
Status Contro l Customising Status Control using PML
8.1.2
8.2
4
STRING
Reference number of to status value (may be =0/0)
5
STRING
Return message aborts operation if set but only on Before … operations
Datab as e Ch an ge Ev en ts
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
Ar g No
Type
Desc ri pt io n
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
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 f ollowing commands.
! ! st at usPr oj ect Handl er . debugOn( ) ! ! st at usPr oj ect Handl er . debugOf f ( ) 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.
st at usPr oj ect Handl er . bef or eSt at usChange( / P1501A, / Desi gnSt at us, / Wor kSuspended, / Wor kSt ar t ed) st at usProj ect Handl er . af t er St at usChange( / P1501A, / Desi gnSt at us, / Wor kSt ar t ed, / WorkSt ar t ed)
© 2009 AVEVA Solutions Ltd
8:2
12.0
Status Contro l 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.
- - ========================================================== - - St ar t of cust omi sat i on
- - End of cust omi sat i on - - ========================================================== 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 where you can 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.
! r et ur nMessage = | St at us er r or: You may not del et e a cont r ol l ed obj ect | By default, the only check made in the statusProjectHandler is to prevent a general user from deleting a controlled object.
8.2.4
Methods where you can make Dependent Changes The methods Af ter Status As si gn , Af ter Statu sRem ov e and Af ter Status Chan ge 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 where you can Synchronise External Systems The methods After Savew or k and Af ter Flu sh 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).
© 2009 AVEVA Solutions Ltd
8:3
12.0
Status Contro l Customising Status Control using PML
8.3.1
8.3.2
Members
Member
Type
Description
status
ARRAY
Holds a single core Status object for internal usage
statusValue
ARRAY
Holds a single core AssignedStatus object for internal usage
element
DBREF
Model object
definition
DBREF
Status definition
list
ARRAY
Array of statusData objects for multiple object/ definition combinations
bulk
BOOLEAN
True if object holds a list of statusData objects False if object holds status information directly
value
DBREF
Status value
valname
STRING
Status value name
description
STRING
Status value description
number
REAL
Status value number
comment
STRING
Status comment
steps
ARRAY
Available transitions as strings
debug
BOOLEAN
Debug flag
refreshMode
STRING
Refresh mode - None/Part/Full (set to None by default for best performance)
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( DBREF of object )
Constructor for all status definitions on a single object
statusData( ARRAY of DBREF of objects )
Constructor for all status definitions on array of objects
statusData( DBREF of object, DBREF of status definition )
Constructor for single object and single status definition
© 2009 AVEVA Solutions Ltd
8:4
12.0
Status Contro l Customising Status Control using PML
statusData( Constructor for single object and single status DBREF of object, definition STRING name of status definition ) statusData( ARRAY of DBREF of objects, DBREF of status definition )
Constructor for array of objects and single 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
8.3.4
Met ho ds In ten ded f or t he Us er
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
Methods to Assign and Remove Status
Method
Description
assign()
Assign stored status definition to object(s)
assign ( STRING comment )
Assign stored status definition to object(s) and set comment
assignStatus( DBREF of status definition )
Assign status definition to object(s)
assignStatus( Assign status definition to object(s) STRING name of status definition ) assignStatus( DBREF of status definition,
Assign status definition to object(s) and set comment
STRING comment )
© 2009 AVEVA Solutions Ltd
8:5
12.0
Status Contro l Customising Status Control using PML
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( DBREF of status definition)
Remove status definition from object(s)
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( STRING comment )
Promote stored status for object(s) and set comment
promoteStatus( DBREF of status definition )
Promote status for object(s)
promoteStatus( Promote status for object(s) STRING name of status definition ) promoteStatus( DBREF of status definition, STRING comment )
Promote status for object(s) and set comment
promoteStatus( STRING name of status definition, STRING comment )
Promote status for object(s) and set comment
demote()
Demote stored status for object(s)
demote( STRING comment )
Demote stored status for object(s) and set comment
demoteStatus( DBREF of status definition )
Demote status for object(s)
demoteStatus( Demote status for object(s) STRING name of status definition ) demoteStatus( DBREF of status definition, STRING comment )
Demote status for object(s) and set comment
demoteStatus( STRING name of status definition, STRING comment )
Demote status for object(s) and set comment
© 2009 AVEVA Solutions Ltd
8:6
12.0
Status Contro l Customising Status Control using PML
8.3.6
8.3.7
8.3.8
Met ho ds to Set Stat us
Method
Description
set( STRING name of status value)
Set stored status for object(s)
set( STRING name of status value, STRING comment )
Set stored status for object(s) and set comment
setStatus( DBREF of status definition, STRING name of status value )
Set status for object(s)
setStatus( STRING name of status definition, STRING name of status value)
Set status for object(s)
setStatus( DBREF of status definition, STRING name of status value, STRING comment )
Set status for object(s) and set comment
setStatus( STRING name of status definition, STRING name of status value, STRING comment )
Set status for object(s) and set comment
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
debugOff()
Internal method to clear debug flag
debugOn()
Internal method to set debug flag
getStatus()
Internal method to get status data using core object
queryStatus()
Internal method to get status data using queries
refreshMode( STRING )
Internal method to set refreshMode
sortSteps()
Internal method to return available transitions
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.
© 2009 AVEVA Solutions Ltd
8:7
12.0
Status Contro l Customising Status Control using PML
! mySt at us = obj ect st at usDat a( ) ! mySt at us. assi gn( ) ! mySt at us. pr omot e( ) ! mySt at us. pr i nt ( ) ! cur r ent St at us = ! mySt at us. descr i pt i on
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:
i mpor t ' Aveva. Pdms. Dat aManagement . PML' handl e any - - i gnor e i f al r eady l oaded endhandl e usi ng namespace ' Aveva. Pdms. Dat aManagement . PML'
8.4.1
Object STATUSMANAGEMENT Holds systems information relating to Status Control. Methods include:
8.4.2
Method
Description
statuses()
Returns the available statuses as an array of STATUS
Object STATUSEVENTS Holds information relating to status events. Methods include:
8.4.3
Method
Description
statusEvents( STRING name of status definition )
Constructor that initialises for the status definition
Initialise( STRING name of status definition )
Initialises 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.
! st at usManagement = obj ect st at usManagement ( ) ! st at usDef i ni t i ons = ! st at usManagement . st at uses( ) ! st at usEvent s = obj ect st at usEvent s( )
© 2009 AVEVA Solutions Ltd
8:8
12.0
Status Contro l Customising Status Control using PML
! s t at us Event s . i ni t i al i s e( ! s t at us Def i ni t i ons [ 1] ) ! st at usEvent s. addEvent Handl er ( ' Bef or eSt at usChange' , ! ! handl er Obj ect , ' bef or eSt at usChange' )
8.4.4
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
© 2009 AVEVA Solutions Ltd
8:9
12.0
Status Contro l Customising Status Control using PML
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
© 2009 AVEVA Solutions Ltd
8:10
12.0
Status Contro l Customising Status Control using PML
8.4.5
Ob jec t STATUSVA LUE Represents a status value. Methods include:
8.4.6
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:
8.4.7
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.
! st at us = obj ect st at us( ' / Desi gnSt at us' ) ! s t a t us . as s i gn( ' / E1301' ) ! st at us. pr omot e( ' / E1301' , ' Ready f or checki ng' ) ! cur r ent St at us = obj ect assi gnedSt at us( ' / Desi gnSt at us' , ' / E1301' )
© 2009 AVEVA Solutions Ltd
8:11
12.0
Status Contro l Customising Status Control using PML
! val ueName = ! cur r ent St at us. cur r ent Val ue( ) . name( ) ! descri pt i on = ! cur r ent St at us. cur r ent Val ue( ) . descr i pt i on( ) ! number = ! cur r ent St at us. cur r ent Val ue( ) . number( ) ! comment = ! cur r ent St at us. comment ( )
© 2009 AVEVA Solutions Ltd
8:12
12.0
Status Contro l Customising Status Control using C# (.NET)
9
Cu stom isi ng Status Cont rol usi ng C# (.NET) As an alternative to (or in combination with) PML customisation, customisation can also be undertaken in .NET applications. Examples below are g iven in the C# language.
9.1
Nam es paces an d Ass em bl ies The .NET status objects described below are defined in the Aveva.Pdms.DataManagement.dll assembly, which will be found in the standard PDMS install directory (PDMSEXE). To use these status objects, programmers will need reference to the Aveva.Pdms.Database.dll assembly also found in PDMSEXE. (You may wish to reference other PDMS .NET assemblies - please 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:
usi ng Aveva. Pdms. Dat aManagement ; usi ng Aveva. Pdms. Dat abase;
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
Cl as s Stat us Man ag em en t 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:
St at us[ ] st at uses = St at usManagement . St at uses;
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:
St at us st at us = St at us( "/ Desi gnSt at us" ) ; DbEl ement st at usDef i ni t i onEl ement ; // ... St at us stat us = St at us( st at usDef i ni t i onEl ement ) ;
© 2009 AVEVA Solutions Ltd
9:1
12.0
Status Contro l Customising Status Control using C# (.NET)
The screenshot below of the Visual Studio Object Browser details the public interface of the Status class:
9.2.3
Cl as s Stat us Val ue 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:
St at us st at us = St at us( "/ Desi gnSt at us" ) ; St at usVal ue st at usVal ue = St at usVal ue( st at us, " / Appr oved") ; Or:
DbEl ement st at usVal ueEl ement ; // ... St at usVal ue st at usVal ue = St at usVal ue( st at usVal ueEl ement ) ;
© 2009 AVEVA Solutions Ltd
9:2
12.0
Status Contro l Customising Status Control using C# (.NET)
Alternatively, the array of all StatusValues for a given status definition can be obtained directly from a Status object:
St at us st at us = St at us( "/ Desi gnSt at us" ) ; St at usVal ue[ ] st at usVal ues = st at us. Val ues; The remaining functions of the StatusValue class are displayed in the Visual Studio Object Browser below:
9.2.4
Cl ass Stat us Co mm an d 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
Cl as s Stat us Ev en ts 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
© 2009 AVEVA Solutions Ltd
9:3
12.0
Status Contro l Customising Status Control using C# (.NET)
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:
St at us st at us = St at us( "/ Desi gnSt at us" ) ; St at usEvent st at usEvent = st at us. Event ; st at usEvent . Bef or eSt at usChange += new St at usEvent . Bef or eSt at usChangeEvent Handl er ( My_Bef or eSt at usChange ); // ... / / Event handl er pr i vat e voi d My_Bef or eSt at usChange ( obj ect sender , Cancel St at usEvent Ar gs e) { / / Do any ext r a act i ons and check st at us change i s al l owed i f ( / * abor t st at us change requi r ed */ ) { e. Cancel = t r u e; e. Message = " r eason not t o pr oceed"; } } The list of available status events is displayed in the Visual Studio Object Browser display as follows:
© 2009 AVEVA Solutions Ltd
9:4
12.0
Status Contro l Customising Status Control using C# (.NET)
9.2.6
Stat us Ch an ge Ev en ts 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
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
The element to be controlled
Status
Status
The Status object
From
StatusValue
The from StatusValue object
To
StatusValue
The to StatusValue object
CancelStatusEventArgs
9.2.7
Name
Type
Description
Model
DbElement
The element to be controlled
Status
Status
The Status object
From
StatusValue
The from StatusValue object
To
StatusValue
The to StatusValue object
Cancel
Bool
Cancel the ongoing operation
Message
String
With this as the message
Datab as e Ch an ge Ev en ts The Before … event methods can cancel the operation. Event
Arguments
BeforeSavework
object sender, CancelDBChangeEventArgs e
AfterSavework
object sender, DBChangeEventArgs e
© 2009 AVEVA Solutions Ltd
9:5
12.0
Status Contro l Customising Status Control using C# (.NET)
BeforeFlush
object sender, CancelDBChangeEventArgs e
AfterFlush
object sender, DBChangeEventArgs e
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
© 2009 AVEVA Solutions Ltd
9:6
12.0
Status Contro l 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: \ Document s and Set t i ngs\ j ohn. smi t h\ Local Set t i ngs\ Appl i cat i on Dat a\ Aveva\ PDMS\ BASSt at usGr i dPr of i l es 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.
© 2009 AVEVA Solutions Ltd
10:1
12.0
Status Contro l Distributing Customised Status Layouts
© 2009 AVEVA Solutions Ltd
10:2
12.0
Status Contro l 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.
© 2009 AVEVA Solutions Ltd
11:1
12.0
Status Contro l Upgrading Model Manager Status Data
© 2009 AVEVA Solutions Ltd
11:2
12.0
Status Contro l
Index
C
L
Change Events Database . . . . . . . . . . . . . . . . . 8:2 9:5 Status . . . . . . . . . . . . . . . . . . . . . . . . 9:5 Class Status . . . . . . . . . . . . . . . . . . . . . . . . 9:1 StatusCommand . . . . . . . . . . . . . . . . 9:3 StatusEvents . . . . . . . . . . . . . . . . . . 9:3 StatusManagement . . . . . . . . . . . . . 9:1 StatusValue . . . . . . . . . . . . . . . . . . . 9:2 Classes .NET . . . . . . . . . . . . . . . . . . . . . . . . . 9:1 Commands . . . . . . . . . . . . . . . . . . . . . . . 5:2 Customising StatusProject Handler PML Object . . 8:2
Lexicon Configuring Status Definitions . . . . . 3:1
,
D Data Model Status Control . . . . . . . . . . . . . . . . . . 2:2
M Methods Abort Changes . . . . . . . . . . . . . . . . . Add Checks . . . . . . . . . . . . . . . . . . . Assign and Remove . . . . . . . . . . . . . Dependent Changes . . . . . . . . . . . . Intended for User . . . . . . . . . . . . . . . Internal . . . . . . . . . . . . . . . . . . . . . . . Promote and Demote . . . . . . . . . . . . Set Status . . . . . . . . . . . . . . . . . . . . Synchronise External Systems . . . .
8:3 8:3 8:5 8:3 8:5 8:7 8:6 8:7 8:3
N Namespaces and Assemblies . . . . . . . . 9:1
E
O
Example Add Event Handler . . . . . . . . . . . . . . 8:8 Set and Get Status Data . . . . 8:7 8:11
Object Assignedstatus . . . . . . . . . . . . . . . 8:11 Status . . . . . . . . . . . . . . . . . . . . . . . . 8:9 Statusevents . . . . . . . . . . . . . . . . . . 8:8 Statusmanagement . . . . . . . . . . . . . 8:8 Statusvalue . . . . . . . . . . . . . . . . . . 8:11
,
G Graphical View Drag and Drop . . . . . . . . . . . . . . . . 4:10
P PML Core Status Objects . . . . . . . . . . . . . 8:8
© 2009 AVEVA Solutions Ltd
Index page 1
12.0