relate/1—establish the relation of an event to a source event
The relate/1 function establishes the relation of an event to a source event. The syntax for this function is as follows:
relate/1 arguments
Argument | Mode | Type | Description |
---|---|---|---|
$EVENT | Input | OBJECT | Specifies the event to be related to a source event |
Use the relate/1 function to establish a relation between event $EVENT and the source event set in its mc_relation_source slot. The type of relation is determined by the class of this event or its most specific superclass that has a defined type of relation. The result of this operation is that the type of relation and the mc_ueid slot of this event are added to the mc_event_relations slot of the source event.
For the relation to be established, the mc_relation_source slot of the related event must be set correctly. The agent that produces the related event usually sets the mc_relation_source slot. However, the fact that this slot has a non-empty value does not imply that this event is effectively related to the event indicated in this slot.
relate/1 example
This example involves establishing a relation for trouble tickets. If an event results in a trouble ticket being created at the Help Desk, the trouble ticketing system generates a corresponding trouble ticket event that is related to the source event with relation tt_HD.
Definition of the relation:
When a trouble ticket event is received, the following rule will relate it to its source event:
{ relate($E); }
END
This assumes that the HD_TROUBLE_TICKET event contains the mc_ueid slot of the source event in its mc_relation_source slot. The type of the relation is tt_HD.