This article describes how to concatenate the values of two properties to create a third. For example, you may want to capture an asset tag property that must be entered as nn-nnn. To accommodate this, Left and Right properties are defined which are filled-in at placement time. The Asset Tag property is then created from the Left and Right properties as shown in the following video:
We will look at three solutions:
1) Creating Left, Right and ASSET_TAG as XFM properties
2) Creating ASSET_TAG as an XFM property and Left and Right as form fields by defining them as operation properties
3) Using operation properties for registered spatial features.
Using Feature Properties
In the Geospatial Administrator, three properties are defined: Left, Right and ASSET_TAG. The Left and Right property fields are set up as 2 character and 3 character strings respectively. As well, the initial values are set as 00 and 000.
In order to populate the ASSET_TAG property, a property watcher needs to be defined. Property watchers allow one or more properties to watch for changes in a source property (Left and Right). Each time the value changes, it triggers the value of a related property (ASSET_TAG) to respond. Described in other words, a property watcher watches for a certain value in a source property (Left and Right) which then determines an associated pre-defined value in another property (ASSET_TAG).
A Synch Item Watcher is used to establish relationships between different feature properties. To set the ASSET_TAG as a concatenation between the Left and Right properties, the sync item watcher value type is set to concatstr and its value is specified as follows:
For this example, the value is My_Point:Left+'-'+My_Point:Right where:
With this property watcher in place, the resulting string for ASSET_TAG becomes leftValue-rightValue
Since ASSET_TAG is composed of Left and Right, the Right property will need a sync item watcher as well. The last modification made, is to set ASSET_TAG as a read only field.
NOTE: While this article deals with concatenating property values, the method described results in the Left and Right properties being written to the feature as XFM properties.
Using Operation Properties
While using feature properties may be perfectly fine for your project, an alternate method is to define Left and Right as operation properties. This creates form fields which are being used as place-holders for the Left and Right property values. This eliminates the Left and Right properties from being written to the feature as XFM properties.
To achieve this, the feature is created with the ASSET_TAG property set to read-only.
After inserting the placement metadata, Left and Right properties are added to the Operation node as shown.
As with the example above, you'll define a sync item property watcher, except in this case, the value to set will be defined as follows: operationName/PropertyName+'-'+operationName/PropertyName which translates to: My_Point/Left+'-'+My_Point/Right
NOTE the difference in the syntax used to define the concatstr:
Feature properties: featureName:PropertyName+'-'+featureName:PropertyName
Operation properties: operationName/PropertyName+'-'+operationName/PropertyName
When you insert placement metadata, the operations and methods are created from the XFM feature and its properties. Since you're adding operation properties after the fact, the Place and Edit dialogs will need to be edited manually to include the new operation properties. To do that, simply add two new Operation Items, one for Left and the other for Right.
The last action item is to update the Command Manager entry for your modified feature and to test the placement.
Registered Spatial Features
The technique of defining operation properties can also be used for Oracle and SQL registered spatial features. This eliminates the addition of extra properties in the database that add no value for modeling your project.
An example schema is attached for your learning.