IWriteMetadataPlugin - OnFieldChangeSendStateTransitionEvent
Sends an STATETRANSITION event when a certain metadata field is changed. Optionally you can specify that the event should only be sent when the metadata field has changed from a certain value to a certain value. This plugin differs from the OnFieldChangeSendEvent in the sense that the eventname is fixed to '[STATETRANSITION]_[FSTATUS Original Value]_[FSTATUS Current Value]' and that the eventdata contains a 'Transitions' XML instead of an 'ishobject' XML. The 'Transitions' event data XML is the XML that is expected by the component(=cNotification IEventHandler plugin) that can be used for sending emails.
Plugin Configuration
| Field Name | Field Level |
|---|---|
| FSTATUS | lng |
| The name of the field specified in the ConditionMetadataField parameter | The level of the field specified in the ConditionMetadataFieldLevel parameter |
| 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 the SendEvent 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 SendEvent will happen. Multiple values can be comma-space separated. If not provided, this means the database value can be anything. |
Event data
<Transitions>
<FromStatus ref='[FSTATUS Original Value]'/>
<ToStatus ref='[FSTATUS Current Value]'/>
<Lngref>[Language Card Id]</Lngref>
</Transitions>
were 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.
<plugin name="ISHSYSSENDSTATETRANSITIONEVENT" handler="OnFieldChangeSendStateTransitionEvent" ishcondition="ISHLevel='lng'">
<description>Raises an event when the FSTATUS field is changed from 'Draft' or 'Translated' to 'To be reviewed' or 'Released'</description>
<workingset>
<ishfields>
<ishfield name="FSTATUS" 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, VSTATUSTRANSLATED</parameter>
<parameter name="ConditionMetadataFieldToValue">VSTATUSTOBEREVIEWED, VSTATUSRELEASED</parameter>
</parameters>
</initialize>
</plugin> the eventname will be 'STATETRANSITION_VSTATUSDRAFT_VSTATUSTOBEREVIEWED' (if the previous value was 'Draft' and the current is 'To be reviewed') and the eventdata will look like this:
<Transitions>
<FromStatus ref='VSTATUSDRAFT'/>
<ToStatus ref='VSTATUSTOBEREVIEWED'/>
<Lngref>123458</Lngref>
</Transitions>