Property Watchers can be used to evaluate the value of one property to determine the value of a second property. In this example if the Business License Number is not set, than the Is Business property is set to 0, meaning False. If the Business License Number has any value other than blank, then Is Business will be set to 1, or True. Having True/False, or binary, properties in your data model may simplify searches for performing queries and data analysis.
Note: The Data Browser does not support property watchers. This means that you will not be able to make changes or edits to the values by using the Data Browser.
The building feature has two properties: Business License Number (BusLicNum) and Is Business (isBusiness).
The Business License Number is a text property with the following settings:
A Property Watcher is created and is defined as follows:
Name: A descriptive name
Type: SynchItem - This type of watcher is used to establish relationships between different feature properties. If a match value is provided, the current property’s value must equal this value for the watcher to execute.
Feature: The name of the feature that will be updated
Property: The name of the property of the feature to be updated
Value Type - expressionEvaluator - Evaluates an expression specified in the Value column by using the MicroStation Expression Evaluator.
Value To Set - IIf(Building.RootFeatureProperties.BusLicNum+0 > 0,"1","0") This translates to: If the Business License Number is greater than 0, set the value to 1 otherwise set it to zero.
Process on Create: Enabled - This processes the watcher when the item is being created.
Redraw Watcher: Enabled - This redraws the item associated with the property being changed. It's used to change the enabled state of a dialog item and/or to reload the list of values.
The second property, Is Business is also a text string set as an integer. Since the value of this property is driven by the Business License Number, it can be set to Read Only. As well, there is no need for any Initial Values to be set.
A sample schema is attached for your testing and learning.
Property Watcher to set true or false.zip