AxonFramework/AxonFramework — pull request #128 by treo (2014-10-23 08:52:00+00:00)
Title: Handle incomplete events for event sourced aggregates

(See https://groups.google.com/forum/#!topic/axonframework/CVW48ZdM8LU for more context)

In event sourced aggregates it is not uncommon that its constructor is a command handler which has to apply an event in order to set up its state. As the aggregate identifier can not be set prior to handling the event, there is a need for a work around which first applies the event and registers it afterwards.

This workaround resulted in slightly different events being applied and saved. If, for example, the timestamp of the event was used in the aggregate creation, this results in different state of the aggregate.

In this pull request I have extended the work around such that it now tries to save the originally applied event. As this event is incomplete, it provides the additional information (i.e. the aggregate identifier).