Documentation Center

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 NameField Level
The name of the field specified in the ConditionMetadataField parameterThe level of the field specified in the ConditionMetadataFieldLevel parameter
The name of the field specified in the CompareMetadataField parameterThe level of the field specified in the CompareMetadataFieldLevel parameter
The following parameters can be configured:
ParameterRequiredDefault valueAllowed valuesDescription
ConditionMetadataFieldYes  The metadata field that needs to be checked for changes. Only string fields are supported, number and date fields are not.
ConditionMetadataFieldLevelNolnglogical, version, lngThe metadata field level that needs to be checked for changes
ConditionMetadataFieldValueTypeNovaluevalue, elementThe metadata field value type
ConditionMetadataFieldFromValueNo  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.
ConditionMetadataFieldToValueNo  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.
CompareMetadataFieldYes  The metadata field to compare for empty or not empty. Can be any type of field.
CompareMetadataFieldLevelNolnglogical, version, lngThe level of the metadata field to compare.
CompareMetadataFieldOperatorNonotemptyempty, notemptyWhether 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>