Klerk Context
interface KlerkContext
The EventProducer is used to process events where the subsequent events are dependent on the results of the previous events. The processing happens in a transaction, i.e. if any of the events are rejected, all events will be rejected.
When processed, init() is first called and thereafter produceNextEvent() will be called until it returns null.
It is important that the EventProducer produces the same events no matter how many times init() and subsequently produceNextEvent() has been called. This means that init() should be idempotent (except for timestamps). It is recommended to have unit tests making sure that the implementation is idempotent.