QPR Knowledge Base 2017.1

Properties Attribute

Properties Attribute

Previous topic Next topic No directory for this topic  

Properties Attribute

Previous topic Next topic Topic directory requires JavaScript Mail us feedback on this topic!  

Revision history:

Introduced in QPR 2015.1

 

The properties attribute can be used to query all supported attribute and relation names for any PG object. Attribute names can be used as object attributes in QPR Web Services queries and modifications. Relations can be used in the query part of object queries to fetch objects related to the current object.

 

The information is returned in the following format (XML case shown here):

<object id="PG.1429039364.1590761615" name="Misunderstood performance objectives" typename="Risk">

   <properties>

     <attribute name="accesslevel" type="enumerable" parameters="false" requiresparameters="false" readonly="true" />

     <attribute name="addactionurl" type="url" parameters="true" requiresparameters="false" readonly="true" />

...

     <relation name="workflowtickets" type="relation" parameters="false" requiresparameters="false" readonly="true" />

   </properties>

</object>

 

For all the attributes and relations, the following additional information is returned:

 

name: Attribute name in the "script name" format that can be used as object query attribute.

 

prettyname: Pretty name of the attribute. Currently used only for QPR EnterpriseArchitect custom attributes. Contains the user-defined name of the custom attribute.

 

type: Type of the attribute value. Can be any of the following:

ointeger

ofloat

ostring

oboolean

odatetime

odate

otime

oenumerable: Returns value as string by default. Numeric value is returned if EnumAsNumber option is used in ObjectQuery.

oidentifier: Full object ID.

oidentifierlist: List of full object IDs.

ourl

orelation: Can be used in the query part of an object query as object "relation function".

orelationattribute: Used to specify that this attribute acts as prefix for a set of other attributes accessing object at the other end of this relation.

Example (for an information flow): Here attributes matching pattern flow.from.* actually query the attributes of the object at the "from" end of the flow:

     <attribute name="flow" type="relationattribute" parameters="true" readonly="true" />

     <attribute name="flow.from" type="relationattribute" parameters="true" readonly="true" />

     <attribute name="flow.from.id" type="identifier" parameters="false" readonly="true" />

     <attribute name="flow.from.name" type="string" parameters="false" readonly="true" />

It should also be noted that not all the supported attributes are listed in these cases since that list would usually never end (there are cycles in relationships).

obinary

ojson: Attribute value is returned as a string, but the string contains JSON (JavaScript Object Notation) formatted data.

ocomplex: Attributes of complex type are such that they do not match any other attribute type. The complex type is used e.g. for attribute values whose type depends on the objects or have a complex structure of their own. Example: The properties attribute itself is of complex type.

ovariant: Attribute result can be of various different simple types (e.g. string or float) depending on the object for which the query is made.

ovalueseries: Special type reserved for attributes returning values of a single QPR Metrics series.

 

class: A comma-separated list of classes the property belongs to. Valid classes are:

osupportsparameters: Does the attribute/relation support some additional parameters?

orequiresparameters: Does the property require additional parameters to be given in order to be able to function properly. Example:

  isoftype attribute requires the type parameter to be given.

oreadonly: Is the attribute/relation only usable for read-operations (true) or can its value also be altered using QPR Web Services API's modify methods (false).

ocustom: Is the attribute a custom attribute for the object (e.g. action or QPR EnterpriseArchitect element custom attributes)

owriteonly: Is the attribute/relation only usable for write operations (true) or can its value also be read (false).

oeacustomhierarchy: This custom attribute is used as a relation attribute in a QPR EnterpriseArchitect custom hierarchy

 

NOTE: Even if an attribute or relation is supported, its value may still be empty.

 

Notes about PD/EA custom attribute types:

 

Attribute sets are not returned as properties, only the sub-attributes are returned.

System attributes are also returned. These are basically the relation attributes that are used to build custom hierarchies. The names of the attribute types are always "H<HierarchySymbol>Parents" and "H<HierarchySymbol>Children".

Getting sub-attributes of enumerated values is possible. For example, if an element has an enumerated attribute "status" with possible values "undefined", "under development", and "accepted" and the "accepted" value has sub-attribute "valid until", you can query the sub-attribute value using "status.validuntil.value". Note that the enumerated value name (accepted) is not part of the attribute query string. The value is returned only if the enumerated attribute has value "accepted" in the element.

Note that since the value of the enumerated attribute is fetched using "status.value" ("status.values"), these do not work if the enumerated value has a sub-attribute named "value" (or "values") because "status.value" is interpreted as being the sub-attribute named "value".