suppressStandardPublisher()
This method cannot be used for BOD-type business objects.
In the implementation for the SubscribeEvent method, the business object developer can indicate if standard events originate from the application instead of from the audit trail. This is done through a helper method called suppressStandardPublisher(), which can be used in the on execute hook for the SubscribeEvent method.
The suppressStandardPublisher() can be called without parameters or with one or more strings containing standard event actions (“create”, “change” or “delete”). The sequence of the arguments does not matter.
For example:
- When specifying suppressStandardPublisher(), all events must be sent from the LN application, and the publisher will not pick up standard events from the audit trail.
- When specifying suppressStandardPublisher(“change”, “delete”), events having eventAction ‘change’ or ‘delete’ must be sent from the LN application, and a standard publisher process will only read from the audit trail if the subscription request contains the ‘create’ eventAction.
Specifying suppressStandardPublisher(“create”, “change”, “delete”) has the same effect as specifying suppressStandardPublisher().
Using suppressStandardPublisher() in the on execute hook for SubscribeEvent is only useful if io.default is set to true (see section On Execute Method Hook). Otherwise the default process is not executed, so no publisher is started either.
Example of an on execute hook to be used when the standard publisher process must only handle ‘create’ and ‘delete’ events, while ‘change’ events are generated from the application:
suppressStandardPublisher(“change”)
io.default = true
return(0) | OK
This hook can be used if the top-level component of the business object is mapped to an LN database table, but it has subcomponents that are not directly related to tables.