IWriteMetadataPlugin - OnFieldChangeMetadataBindingValidation
Executed when metadata is changed. It only validates the values of the fields defined in the FieldsToValidate parameter for which the values changed.
Plugin Configuration
The following workset fields need to be configured:
| Field Name | Field Level |
|---|---|
| The name of all the fields specified in the FieldsToValidate and FieldsFilter parameter | The level of all the fields specified in the FieldsToValidate and FieldsFilter parameter |
The following parameters can be configured:
| Parameter | Required | Default value | Allowed values | Description |
|---|---|---|---|---|
| FieldsToValidate | Yes | See Requested metadata xml. Only field names that are defined in the metadata binding section of the XML Extension Settings can be used. | Defines the names and levels of the fields to validate. For these fields the values are retrieved and validated. | |
| FieldsFilter | No | See Requested metadata xml. | Defines the names and levels of the fields to pass as filters. For these fields the values are retrieved and can be used to limit the number of results. |
This example configuration will validate the values of the FCONTINENTS, FCOUNTRIES and FCITIES fields on the logical level, depending on the metadata binding configuration. If an extra city "Paris" was added to the existing cities "New York, Seattle" and the values for the countries field (defined in the filter) only contains "United States", this plugin will give an error for the value "Paris".
<plugin name="VALIDATECHANGEDCONTINENTSCOUNTRIESCITIES" handler="OnFieldChangeMetadataBindingValidation">
<description>Checks whether the values given for the fields FCONTINENTS, FCOUNTRIES and FCITIES
are valid according to the metadata binding configuration. Only fields for which the values changed
are validated. The values of FCONTINENTS and FCOUNTRIES are passed as a filter, so only countries
that belong to the continents given in the filter and cities that belong to the countries given in
the filter are valid.
</description>
<workingset>
<ishfields>
<ishfield name="FCONTINENTS" level="logical" />
<ishfield name="FCOUNTRIES" level="logical" />
<ishfield name="FCITIES" level="logical" />
</ishfields>
</workingset>
<initialize>
<parameters>
<parameter name="FieldsToValidate">
<ishfields>
<ishfield name="FCONTINENTS" level="logical" ishvaluetype="element"/>
<ishfield name="FCOUNTRIES" level="logical" ishvaluetype="element"/>
<ishfield name="FCITIES" level="logical" ishvaluetype="element"/>
</ishfields>
</parameter>
<parameter name="FieldsFilter">
<ishfields>
<ishfield name="FCONTINENTS" level="logical" ishvaluetype="element"/>
<ishfield name="FCOUNTRIES" level="logical" ishvaluetype="element"/>
</ishfields>
</parameter>
</parameters>
</initialize>
</plugin>
The following configuration will validate the equipment "Laptop" for the field "FRMEQUIPMENTLIM" on the "version" level.
<plugin name="VALIDATECHANGED.SES.ReferenceLimited" handler="OnFieldChangeMetadataBindingValidation" ishcondition="ISHLevel='version'">
<description>
Checks whether the values given for the fields FRMEQUIPMENTLIM are valid.
</description>
<workingset>
<ishfields>
<ishfield name="FRMEQUIPMENTLIM" level="version" />
</ishfields>
</workingset>
<initialize>
<parameters>
<parameter name="FieldsToValidate">
<ishfields>
<ishfield name="FRMEQUIPMENTLIM" level="version" ishvaluetype="element" />
</ishfields>
</parameter>
</parameters>
</initialize>
</plugin>