IWriteMetadataPlugin - OnMultiFieldChangeSendEvent
Sends an event if 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 | none | 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 | none | ishFields metadata XML structure | Defines the database fields whose original database values (the values before change) should match with one of the given values before SendEvent happens. Multiple values can be comma-space separated. If nothing is provided, the database value can be anything. Only string fields are supported. |
ConditionCurrentMetadata | No | none | ishFields metadata XML structure | Defines the database fields whose current database values should match with one of the given values before SendEvent happens. Multiple values can be comma-space separated. If nothing is provided, the database value can be anything. Only string fields are supported. |
EventType | Yes | none | 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. | |
| No | none | ishFields metadata XML structure | Defines the names and levels of the fields to pass as additional metadata of the event. |
ForceLegacyDateTime | No | no | yes, no | Indicates whether to consider legacy Datetime format for date type fields or Zulu format. For example, with ForceLegacyDateTime set to no, dateTime is, say, 2023-12-31T23:12:31.789Z, otherwise dateTime is, say, 01/01/2024 01:12:31. |
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
parameterRequestedMetadata
- an
ishchangespart with the original and current values of the changed fields that were specified in theConditionChangedMetadataparameter
Example:
<ishobject ishref="GUID-9CE31359-BBB9-41D6-9848-E2E3874D4AF1" ishtype="ISHModule" ishlogicalref="253985" ishversionref="253986" 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 strings enclosed in [] are replaced by their actual values.
For this plugin that will only execute if 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 if 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-2EBEE68D-B742-4E19-855F-865020208E5C" ishtype="ISHPublication" ishlngref="22441833">
<ishfields>
<ishfield name="VERSION" level="version">1</ishfield>
<ishfield name="DOC-LANGUAGE" level="lng">en, fr</ishfield>
<ishfield name="FISHDITADLVRREMOTESTATUS" level="lng" ishvaluetype="element"></ishfield>
<ishfield name="FISHPUBSTATUS" level="lng" ishvaluetype="element">VPUBSTATUSPUBLISHEDDRAFT</ishfield>
<ishfield name="FISHPRODUCTFAMILYNAME" level="logical" ishvaluetype="value"></ishfield>
<ishfield name="FISHPRODUCTRELEASENAME" level="version" ishvaluetype="value"></ishfield>
</ishfields>
<ishchanges>
<ishchange sequence="2">
<ishfieldchange name="FISHPUBSTATUS" level="lng" ishvaluetype="element">VPUBSTATUSPUBLISHEDDRAFT</ishfieldchange>
</ishchange>
<ishchange sequence="1">
<ishfieldchange name="FISHPUBSTATUS" level="lng" ishvaluetype="element">VPUBSTATUSDEPLOYINGDRAFT</ishfieldchange>
</ishchange>
</ishchanges>
</ishobject>