Filtering Notes
At runtime, event messages are filtered based on the filter as specified in the SubscribeEvent request. However, in case of standard events, filtering can be a problem for two reasons:
- In case of change or delete events, the event being sent does not contain the complete object including its subcomponents. For delete events, only the identifying attributes from the top-level component are included. For change events, only changed (or created or deleted) components instances and their parent(s) if any are included.
- In case of delete events, the corresponding object or component instance is unavailable, so filtering cannot be done unless only identifying attributes are involved.
For example, when filtering on OrderLine.item = “X”, we cannot apply the filter in case of a delete or change on the Order (header).
For PublishEvent and ShowAndPublishStandardEvent the filtering is done as follows:
- For eventAction ‘delete’, no filter is applied.
- For eventAction ‘change’:
- For PublishEvent no filter is applied.
- For ShowAndPublishStandardEvent, no filter is applied if actionType ‘delete’ is used on any component instance. If actionType ‘delete’ is not used, filtering is done.
- For eventAction ‘create’, the filter is always applied.
If the filter is not applied, the event is always published if a subscription exists. In those cases the event consumer may receive irrelevant events.