@SagaAction public void onAnotherDomainEvent(AnotherDomainEvent event) { data.setData(event.getData()); spy.anotherEventHandled(); completeIfPossible(); }
private void completeIfPossible() { if (data.getAggregateId() != null && data.getData() != null) { spy.sagaCompleted(); markAsCompleted(); } }
@SagaAction public void onSampleDomainEvent(SampleDomainEvent event) { data.setAggregateId(event.getAggregateId()); spy.sampleEventHandled(); completeIfPossible(); }