unrelate/1—remove a relation of a related event to a source event
The unrelate/1 function removes a relation of a related event to a source event. The syntax for this function is as follows:
unrelate/1 arguments
Argument | Mode | Type | Description |
---|---|---|---|
$EVENT | Input | OBJECT | Specifies the event to be unrelated from a source event |
Use the unrelate/1 to remove the relation of $EVENT to the source event as specified in the mc_relation_source slot for $EVENT. The relation information is removed from the mc_event_relations slot of the source event. The mc_relation_source slot is not modified.
unrelate/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 rule 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.
In this scenario, the following rule will undo the relation a trouble ticket event has with its source, when the trouble ticket event is not open anymore:
when $E.status != OPEN { unrelate($E); }
END