Search in sources :

Example 1 with DecisionTaskCompletedEventAttributes

use of com.uber.cadence.DecisionTaskCompletedEventAttributes in project cadence-client by uber-java.

the class StateMachines method completeDecisionTask.

private static void completeDecisionTask(RequestContext ctx, DecisionTaskData data, RespondDecisionTaskCompletedRequest request, long notUsed) {
    DecisionTaskCompletedEventAttributes a = new DecisionTaskCompletedEventAttributes().setIdentity(request.getIdentity()).setScheduledEventId(data.scheduledEventId);
    HistoryEvent event = new HistoryEvent().setEventType(EventType.DecisionTaskCompleted).setDecisionTaskCompletedEventAttributes(a);
    ctx.addEvent(event);
    ctx.onCommit((historySize) -> data.attempt = 0);
}
Also used : DecisionTaskCompletedEventAttributes(com.uber.cadence.DecisionTaskCompletedEventAttributes) HistoryEvent(com.uber.cadence.HistoryEvent)

Aggregations

DecisionTaskCompletedEventAttributes (com.uber.cadence.DecisionTaskCompletedEventAttributes)1 HistoryEvent (com.uber.cadence.HistoryEvent)1