Changes

Activity:GetObjectsByPropertyValue (Activity)

2,378 bytes added, 14:36, 29 July 2013
Created page with "{{ActivityInfoBox | title = Get Objects By Property Value | name = GetObjectsByPropertyValue | image = | imagecaption = Activity GetObjectsByPropertyValue | purpose = Query o..."
{{ActivityInfoBox
| title = Get Objects By Property Value
| name = GetObjectsByPropertyValue
| image =
| imagecaption = Activity GetObjectsByPropertyValue
| purpose = Query obejcts by a property value
| category = Object Primitives
| returns = The result of the query
| version = 2.1.15+
}}
The GetObjectsByPropertyValue queries object [[Instance|instances]] by comparing a named property to a given value.



==Arguments==

{| class="wikitable sortable" | width = "50%"
|-
! Argument !! Type !! Direction !! Purpose
|- align="left"
| MetaClass|| MetaClass|| In || The [[MetaClass]] to query
|- align="left"
| PropertyName|| String|| In || The [[MetaProperty]] to use for comparison
|- align="left"
| Operator|| QuerySearchItemOperator|| In || The compare method, valid operators are:
* QuerySearchItemOperator.Equals
* QuerySearchItemOperator.NotEqual
* QuerySearchItemOperator.GreaterThan
* QuerySearchItemOperator.GreaterAndEqualThan
* QuerySearchItemOperator.LowerThan
* QuerySearchItemOperator.LowerAndEqualThan
|- align="left"
| PropertyValue|| Object|| In || The value to compare against
|- align="left"
| Index|| Integer|| In || The index if an indexed value is to be compared; set to -1 for regular value
|- align="left"
| FirstMatch|| BaseClass || Out || The first object the query returned
|- align="left"
| Result|| List<BaseClass> || Out || The result of the query
|}

==Usage==

This activity is used to find {{UBIK}} instances during the execution of a workflow, by comparing a named property to a given value. Technically this activity creates a query for a single property on the fly and executes it.

==Example==
Load the MetaClass named ''PUMP'' and find all instances which have a ''POWER'' greater than 4 kilowatts:


{| class="wikitable" | width = "50%"
|-
! Argument!! Value
|- align="left"
| MetaClass|| <source lang = "vbnet">UBIKObject.Environment _
.GetSystemMetaClass(SystemObjects.METACLASS) _
.AllInstances("PUMP")</source>
|- align="left"
| PropertyName|| <source lang = "vbnet">"POWER"</source>
|- align="left"
| Operator|| <source lang = "vbnet">QuerySearchItemOperator.GreaterThan</source>
|- align="left"
| PropertyValue|| <source lang = "vbnet">4</source>
|- align="left"
| Index|| <source lang = "vbnet">-1</source>
|}

==See also==
* [[Workflow Designer]]
* [[GetObjectsByQuery (Activity)]]

[[Category:Workflows]] [[Category:Activities]]