• No results found

Creating a Database Views Elements

In document Lexicon Rev 1.0 (Page 60-63)

Database View (DBVW) Hierarchy 7.3

7.3.2 Creating a Database Views Elements

With a Database View element selected as the CE, the user can create the elements that define the database view’s data contents. This can be achieved by using either the main Create menu or the right click context menu in the Dictionary Explorer.

7.3.2.1 ATTFIL (Attribute Filter)

This element defines a filter that an element’s specified attribute(s) must match to be included in the current view. Both UDAs and Pseudo attributes can be filtered.

A filter is defined in the Basic definition fields of the ATTFIL and includes the following fields:

Attribute: name of the attribute to filter.

Filter operator: a predefined list of operators which determine how the attribute is to be qualified.

All of the available operators are shown here:

Filter value: the value the attribute must match to be true.

For example, to only populate the view with items that have ‘W’ in their name the Basic definition is set to:

Attribute: NAMN

Filter operator: Contains

Filter value: ‘W’

This filter mechanism is the same as the attribute filter that is available within the PDMS search grid.

7.3.2.2 EXPFIL (Expression Filter)

These define a Boolean expression that must evaluate to true for an element to be included in the current view. The expression can be a PML 1 or an XPath 1.0 expression.

AVEVA Plant (12.1)

Some examples of valid PML 1 and XPATH expressions are shown below:

Example PML Expressions Elements that would be listed in the Database View

PSPEC EQ /A3B Items with a Pipe Spec. of /A3B.

HBOR GE 100 Items with Head Bore greater or equal to 100 NB.

SPREF EQ /DIN-SPEC/HE300A Sections with a Specification Reference of DIN Spec HE300A.

FUNC NE ‘FUTURE’ All Equipment whose Function is not equal to FUTURE.

:MANUF EQ ‘Best Pumps Inc.’ OR

:MANUF EQ ‘Better Pumps Ltd.’ All Items where the UDA :MANUF (Manufacturer) is either Best Pumps Inc. or Better Pumps Ltd.

Example XPATH Expressions Elements that would be listed in the Database View

string-length(@RPTX) = 0 All Items with a RPTX (Reporting Text) sting length eq zero character’s

7.3.2.3 ATTCOL (Attribute Column)

This defines a column that returns the attribute value from the current source element(s).

To define an ATTCOL the Attribute field in the Basic definition is set to the name of the database attribute that is to be returned to the view; this can be a UDA or Pseudo attribute.

If the attribute is a qualified attribute then the qualifier must be entered into the Attribute Qualifier field.

An example is a Status Control attribute, where the Status Value Description (STVDSC) is a qualified value of the Status Definition /EquipmentDesignStatus element.

The User-defined name field allows the administrator to add a more user friendly / purposeful name that will make the column more recognisable to the users. If the field is left as unset then the attributes Description field value will be displayed.

The Read only field determines whether the users can interact back to the database and directly change an element’s attribute value via the current database view.

7.3.2.4 EXPCOL (Expression Column)

This defines a column that is based on an expression result. These columns are read only. The expression can be a PML 1.0 or an XPath 1.0 expression.

In the Basic definition of the EXPCOL element the user enters the required PML or XPATH expression in the Expression field. Depending on the syntax of the expression, the user must select the relevant Expression Type; either PML or XPATH from the pull-down list.

The User-defined name field allows the administrator to add a more user friendly / purposeful name that will make the column more recognisable to other users. If the field is left as unset then the attribute’s Description field value will be displayed.

Depending on the evaluated result of the expression, the user must select the relevant UDA type from the pull-down list of available types. Failure to select the correct UDA type may result in the column of the view displaying no information, or returning an error.

7.3.2.5 SRCELE (Source Element)

Instead of using an expression to derive column(s) in the current view from other database elements from the base element, a SRCELE can be used to navigate to the source element from which the attributes or expressions required in the current view are taken. Using a SRCELE helps to separate navigation around the database source elements and can simplify the definition of the columns

The SRCELE creates a sub-view from its position in the hierarchy. All of the attributes and expressions are local to it, rather than being derived from complicated expressions that navigate and return results.

An example may be a BRANCH report requiring information from the owing PIPE. Rather than create multiple EXPCOL’s that are in the format of <Attribute> of PIPE, a single SCRELE could be created and all of the attributes that are required can be created as ATTCOLs.

The element of a SRCELE’s Basic definition are the Expression field, which is the navigational expression; this could be PIPE to navigate up to the owing PIPE, or OWNER of OWNER to navigate up two levels of the hierarchy.

The Auto Creation setting determines whether items can be created within the actual view itself.

The ability to create items within a view is only available within the AVEVA Engineering TAGS module.

AVEVA Plant (12.1)

It is possible to create nested SRCELE items. For instance, if an example DBVW base element type was a Design INST element, the first SRCELE could navigate to the BRANCH element, and in turn another SCRELE at the BRANCH level may navigate to the PIPE element and again to the ZONE element before finally navigating to the SITE element.

An example of the DBVW hierarchy for this type of navigation is shown here. At each level an ATTCOL element has been added to display the NAME.

7.3.2.6 Other Element Types that are available

There are additional element types that a Database View can contain however; these are currently only used by the AVEVA Engineering TAGS module. For information these are listed below with summarised descriptions of what they are used for.

For more detailed information see the AVEVA Training Guide TM-3552 AVEVA Plant Tags (Admin)

Item Type Description

CRERUL

(Creation Rule Element)

Used to allow the definition of creation rules for creating row elements and column elements within a database view. All SRCELE’s are created with one but are not used.

SETATT

(Set Attribute Rule)

A rule used to set an attribute when an element is created. If the value expression is left unset then the application or user are prompted for input.

SETPAR

(Set Parameter Rule)

A parameter for use when executing rules to create elements within the database view.

The Database Views Editor does not need any of the Database View administrative elements to be created before allowing the user to create a Database View. It will automatically create an unnamed DBVWWL (Database View World) element in the first available Dictionary database in the current MDB.

All DBVWs created by the editor are created within same Database View World. If the administrator requires the DBVWs to be in different DBVWWLs then they must first navigate to the relevant position in the Dictionary Explorer and create the Database View manually using either the right mouse menu option, or the Create menu option from the main menu.

In document Lexicon Rev 1.0 (Page 60-63)

Related documents