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