IWriteMetadataPlugin - OnFieldChangeSendEvent
Sends an event when a certain metadata field is changed. Optionally you can specify that the event should only be sent when the metadata field changed from a certain value to a certain value.
Plugin Configuration
The following workset fields need to be configured:
| Fields |
|---|
The name and level of the field specified in the ConditionMetadataField and ConditionMetadataFieldLevel parameters |
The names and levels of the fields specified in the RequestedMetadata 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 (= original value, so the value before change) should match one of the given values before SendEvent happens. Multiple values can be comma-space separated. No value provided means that the database value can be anything. | ||
| ConditionMetadataFieldToValue | No | The current value of the metadata field should match one of the given values before SendEvent happens. Multiple values can be comma-space separated. No value provided means that the database value can be anything. | ||
| EventType | Yes | The event type indicates which handler executes the background task. So, the value must match the event type of the handler specified in the Background Task Configuration XML. | ||
| RequestedMetadata | No | ishFields metadata XML structure | Defines the names and levels of the fields to pass as additional metadata of the event. |
Event data
The event data XML sent with the event contains:
- An
ishfieldspart with the current field values. - An
ishchangespart with the original and current values of the changed field that was specified in theConditionMetadataFieldparameter.
<ishobject ishref="GUID-9CE31359-BBB9-41D6-9848-E2E3874D4AF1" ishtype="ISHModule" ishlngref="253987" >
<ishfields>
<ishfield name="DOC-LANGUAGE" level="lng">en</ishfield>
<ishfield name="VERSION" level="version">1</ishfield>
<ishfield name="FRESOLUTION" level="lng"></ishfield>
</ishfields>
<ishchanges>
<ishchange sequence="2">
<ishfieldchange name="[ConditionMetadataField]" level="[ConditionMetadataFieldLevel]" ishvaluetype="[ConditionMetadataFieldValueType]">[ConditionMetadataField Current Value]</ishfieldchange>
</ishchange>
<ishchange sequence="1">
<ishfieldchange name="[ConditionMetadataField]" level="[ConditionMetadataFieldLevel]" ishvaluetype="[ConditionMetadataFieldValueType]">[ConditionMetadataField Original Value]</ishfieldchange>
</ishchange>
</ishchanges>
</ishobject>
where the [] marked parts are replaced by their actual values.
Note that the ishlngref and lng level fields are only present when the plugin finds language level fields.
Note that additional fields are only present if they were requested and added to the working set.
This plugin only executes when language level fields are changed (note the condition on
ISHLevel):
<plugin name="ISHSYSSENDSTATUSRELEASEDEVENT" handler="OnFieldChangeSendEvent" ishcondition="ISHLevel='lng'">
<description>Raises an event when the FSTATUS field is changed from 'Draft' or 'Reviewed' to 'Released'</description>
<workingset>
<ishfields>
<ishfield name="FSTATUS" level="lng" />
<ishfield name="FTITLE" level="logical" />
</ishfields>
</workingset>
<initialize>
<parameters>
<parameter name="ConditionMetadataField">FSTATUS</parameter>
<parameter name="ConditionMetadataFieldLevel">lng</parameter>
<parameter name="ConditionMetadataFieldValueType">element</parameter>
<parameter name="ConditionMetadataFieldFromValue">VSTATUSDRAFT, VSTATUSREVIEWED</parameter>
<parameter name="ConditionMetadataFieldToValue">VSTATUSRELEASED</parameter>
<parameter name="EventType">STATUS_RELEASED</parameter>
<parameter name="RequestedMetadata">
<ishfields>
<ishfield name="FTITLE" level="logical" />
</ishfields>
</parameter>
</parameters>
</initialize>
</plugin> For the above plugin the eventdata looks like this:
<ishobject ishref="GUID-9CE31359-BBB9-41D6-9848-E2E3874D4AF1" ishtype="ISHModule" ishlngref="253987" >
<ishfields>
<ishfield name="DOC-LANGUAGE" level="lng">en</ishfield>
<ishfield name="VERSION" level="version">1</ishfield>
<ishfield name="FRESOLUTION" level="lng"></ishfield>
<ishfield name="FTITLE" level="logical">Title example</ishfield>
</ishfields>
<ishchanges>
<ishchange sequence="2">
<ishfieldchange name="FSTATUS" level="lng" ishvaluetype="element">VSTATUSRELEASED</ishfieldchange>
</ishchange>
<ishchange sequence="1">
<ishfieldchange name="FSTATUS" level="lng" ishvaluetype="element">VSTATUSDRAFT</ishfieldchange>
</ishchange>
</ishchanges>
</ishobject>