IWriteMetadataPlugin - OnMultiFieldChangeSendEvent
Sends an event when one of the fields of the ConditionChangedMetadata parameter is changed and other conditions are met.
Plugin Configuration
The following workset fields need to be configured:
| Fields |
|---|
The names and levels of the fields specified in the ConditionChangedMetadata, ConditionOriginalMetadata, ConditionCurrentMetadata and RequestedMetadata parameters |
The following parameters can be configured:
| Parameter | Required | Default value | Allowed values | Description |
|---|---|---|---|---|
| ConditionChangedMetadata | Yes | ishFields metadata XML structure | Defines the database fields that need to be checked for changes. String, multistring, number and date fields are supported. | |
| ConditionOriginalMetadata | No | ishFields metadata XML structure | Defines the database fields which original database values (the values before change) should match one of the given values before SendEvent happens. Multiple values can be comma-space separated. When nothing is provided, the database value can be anything. Only string fields are supported. | |
| ConditionCurrentMetadata | No | ishFields metadata XML structure | Defines the database fields which current database values should match one of the given values before SendEvent happens. Multiple values can be comma-space separated. When nothing is provided, the database value can be anything. Only string fields are supported. | |
| EventType | Yes | The event type indicates which handler executes the background task. The value must match the event type of the handler specified in the Background Task Configuration XML. | ||
| RequiredMetadata | 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.VERSION,DOC-LANGUAGEandFRESOLUTIONare sent by default if their values are available.- Fields provided in the
RequiredMetadataparameter
- An
ishchangespart with the original and current values of the changed fields that were specified in theConditionChangedMetadataparameter.
<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>
<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>
<ishfieldchange name="[ConditionMetadataField]" level="[ConditionMetadataFieldLevel]" ishvaluetype="[ConditionMetadataFieldValueType]">[ConditionMetadataField Original Value]</ishfieldchange>
</ishchange>
</ishchanges>
</ishobject>
where the [] marked parts are replaced by their actual values.
For this plugin that will only execute when one or more of the fields
FISHDITADLVRREMOTESTATUS, FISHPRODUCTFAMILYNAME or FISHPRODUCTRELEASENAME are changed and the FISHPUBSTATUS field element value is VPUBSTATUSPUBLISHEDDRAFT or VPUBSTATUSPUBLISHEDRELEASECANDIDATE (note the condition on ISHLevel):
<plugin name="ISHDITADELIVERYUPDATEPUBLICATIONMETADATA" handler="OnMultiFieldChangeSendEvent" ishcondition="ISHLevel='lng'">
<description>Raises an event when the one or more of the fields FISHDITADLVRREMOTESTATUS, FISHPRODUCTFAMILYNAME or FISHPRODUCTRELEASENAME are changed and the FISHPUBSTATUS field element value is VPUBSTATUSPUBLISHEDDRAFT or VPUBSTATUSPUBLISHEDRELEASECANDIDATE</description>
<workingset>
<ishfields>
<ishfield name="FISHDITADLVRREMOTESTATUS" level="lng" />
<ishfield name="FISHPRODUCTFAMILYNAME" level="lng" />
<ishfield name="FISHPRODUCTRELEASENAME" level="lng" />
<ishfield name="FISHPUBSTATUS" level="logical" />
</ishfields>
</workingset>
<initialize>
<parameters>
<parameter name="ConditionChangedMetadata">
<ishfields>
<ishfield name="FISHDITADLVRREMOTESTATUS" level="lng" ishvaluetype="element"/>
<ishfield name="FISHPUBSTATUS" level="lng" ishvaluetype="element"/>
</ishfields>
</parameter>
<parameter name="ConditionCurrentMetadata">
<ishfields>
<ishfield name="FISHPUBSTATUS" level="lng" ishvaluetype="element">VPUBSTATUSPUBLISHEDDRAFT, VPUBSTATUSPUBLISHEDRELEASECANDIDATE</ishfield>
</ishfields>
</parameter>
<parameter name="EventType">DITADELIVERYUPDATEPUBLICATIONMETADATA</parameter>
<parameter name="RequestedMetadata">
<ishfields>
<ishfield name="FISHDITADLVRREMOTESTATUS" level="lng" ishvaluetype="element"/>
<ishfield name="FISHPUBSTATUS" level="lng" ishvaluetype="element"/>
</ishfields>
</parameter>
</parameters>
</initialize>
</plugin> The event data will look like this (note that only changed fields are included into the ishchanges element):
<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="FISHDITADLVRREMOTESTATUS" level="logical">VDITADLVRREMOTESTATUSONLINE</ishfield>
<ishfield name="FISHPUBSTATUS" level="logical">VPUBSTATUSPUBLISHEDRELEASECANDIDATE</ishfield>
</ishfields>
<ishchanges>
<ishchange sequence="2">
<ishfieldchange name="FISHDITADLVRREMOTESTATUS" level="lng" ishvaluetype="element">VDITADLVRREMOTESTATUSONLINE</ishfieldchange>
</ishchange>
<ishchange sequence="1">
<ishfieldchange name="FISHDITADLVRREMOTESTATUS" level="lng" ishvaluetype="element">VDITADLVRREMOTESTATUSOFFLINE</ishfieldchange>
</ishchange>
</ishchanges>
</ishobject>