Exemplo n.º 1
0
 @EndSaga
 @SagaEventHandler(associationProperty = "todoId")
 public void onToDoItemCompleted(ToDoItemCompletedEvent event) {
   if (deadline != null) {
     eventScheduler.cancelSchedule(deadline);
   }
 }
Exemplo n.º 2
0
 @StartSaga
 @SagaEventHandler(associationProperty = "todoId")
 public void onToDoItemCreated(ToDoItemCreatedEvent event) {
   deadline =
       eventScheduler.schedule(
           Duration.standardSeconds(2), new ToDoItemDeadlineExpiredEvent(event.getTodoId()));
 }