IWriteMetadataPlugin - OnFieldChangeCompare
Checks whether a certain metadata field value is empty or not empty when another field is changed. Optionally you can specify that the compare should only happen when the metadata field changed from a certain value to a certain value. If the value is not what it is supposed to be a ValueEmptyException or ValueNotEmptyException is raised.
Plugin Configuration
The following workset fields need to be configured:
| Field Name | Field Level |
|---|---|
| The name of the field specified in the ConditionMetadataField parameter | The level of the field specified in the ConditionMetadataFieldLevel parameter |
| The name of the field specified in the CompareMetadataField parameter | The level of the field specified in the CompareMetadataFieldLevel parameter |
The following parameters can be configured:
| Parameter | Required | Default value | Allowed values | Description |
|---|---|---|---|---|
| ConditionMetadataField | Yes | The metadata field that needs to be checked for changes. Only string fields are supported, number and date fields are not. | ||
| ConditionMetadataFieldLevel | No | lng | logical, version, lng | The metadata field level that needs to be checked for changes |
| ConditionMetadataFieldValueType | No | value | value, element | The metadata field value type |
| ConditionMetadataFieldFromValue | No | The current database value of the metadata field should match one of the given values before the Compare will happen. Multiple values can be comma-space separated. If not provided, this means the database value can be anything. | ||
| ConditionMetadataFieldToValue | No | The current value of the metadata field should match one of the given values before the Compare will happen. Multiple values can be comma-space separated. If not provided, this means the database value can be anything. | ||
| CompareMetadataField | Yes | The metadata field to compare for empty or not empty. Can be any type of field. | ||
| CompareMetadataFieldLevel | No | lng | logical, version, lng | The level of the metadata field to compare. |
| CompareMetadataFieldOperator | No | notempty | empty, notempty | Whether to check the compare field for empty or not empty. |
plugin name="CHECKREVIEWERFILLEDIN" example
<plugin name="CHECKREVIEWERFILLEDIN" handler="OnFieldChangeCompare"
ishcondition="CurrentAction in ('Create', 'Update', 'Checkin', 'SetMetadata', 'CheckOut', 'UndoCheckOut') and (ISHLevel='lng')">
<description>Checks that the 'Reviewer' is filled in when the 'FSTATUS' field is changed from 'Draft' to 'To be Reviewed'</description>
<workingset>
<ishfields>
<ishfield name="FSTATUS" level="lng" />
<ishfield name="FREVIEWER" level="lng" />
</ishfields>
</workingset>
<initialize>
<parameters>
<parameter name="ConditionMetadataField">FSTATUS</parameter>
<parameter name="ConditionMetadataFieldLevel">lng</parameter>
<parameter name="ConditionMetadataFieldValueType">element</parameter>
<parameter name="ConditionMetadataFieldFromValue">VSTATUSDRAFT</parameter>
<parameter name="ConditionMetadataFieldToValue">VSTATUSTOBEREVIEWED</parameter>
<parameter name="CompareMetadataField">FREVIEWER</parameter>
<parameter name="CompareMetadataFieldLevel">lng</parameter>
<parameter name="CompareMetadataFieldOperator">notempty</parameter>
</parameters>
</initialize>
</plugin>