use of com.uber.cadence.HistoryEvent in project cadence-client by uber-java.
the class StateMachines method completeActivityTaskByTaskToken.
private static void completeActivityTaskByTaskToken(RequestContext ctx, ActivityTaskData data, RespondActivityTaskCompletedRequest request) {
ActivityTaskCompletedEventAttributes a = new ActivityTaskCompletedEventAttributes().setIdentity(request.getIdentity()).setScheduledEventId(data.scheduledEventId).setResult(request.getResult()).setIdentity(request.getIdentity()).setStartedEventId(data.startedEventId);
HistoryEvent event = new HistoryEvent().setEventType(EventType.ActivityTaskCompleted).setActivityTaskCompletedEventAttributes(a);
ctx.addEvent(event);
}
use of com.uber.cadence.HistoryEvent in project cadence-client by uber-java.
the class StateMachines method startWorkflow.
private static void startWorkflow(RequestContext ctx, WorkflowData data, StartWorkflowExecutionRequest request, long notUsed) {
WorkflowExecutionStartedEventAttributes a = new WorkflowExecutionStartedEventAttributes().setIdentity(request.getIdentity()).setTaskStartToCloseTimeoutSeconds(request.getTaskStartToCloseTimeoutSeconds()).setWorkflowType(request.getWorkflowType()).setTaskList(request.getTaskList()).setExecutionStartToCloseTimeoutSeconds(request.getExecutionStartToCloseTimeoutSeconds()).setInput(request.getInput());
HistoryEvent event = new HistoryEvent().setEventType(EventType.WorkflowExecutionStarted).setWorkflowExecutionStartedEventAttributes(a);
ctx.addEvent(event);
}
use of com.uber.cadence.HistoryEvent in project cadence-client by uber-java.
the class StateMachines method completeActivityTaskById.
private static void completeActivityTaskById(RequestContext ctx, ActivityTaskData data, RespondActivityTaskCompletedByIDRequest request) {
ActivityTaskCompletedEventAttributes a = new ActivityTaskCompletedEventAttributes().setIdentity(request.getIdentity()).setScheduledEventId(data.scheduledEventId).setResult(request.getResult()).setIdentity(request.getIdentity()).setStartedEventId(data.startedEventId);
HistoryEvent event = new HistoryEvent().setEventType(EventType.ActivityTaskCompleted).setActivityTaskCompletedEventAttributes(a);
ctx.addEvent(event);
}
use of com.uber.cadence.HistoryEvent in project cadence-client by uber-java.
the class StateMachines method cancelTimer.
private static void cancelTimer(RequestContext ctx, TimerData data, CancelTimerDecisionAttributes d, long decisionTaskCompletedEventId) {
TimerCanceledEventAttributes a = new TimerCanceledEventAttributes().setDecisionTaskCompletedEventId(decisionTaskCompletedEventId).setTimerId(d.getTimerId()).setStartedEventId(data.startedEventId);
HistoryEvent event = new HistoryEvent().setEventType(EventType.TimerCanceled).setTimerCanceledEventAttributes(a);
ctx.addEvent(event);
}
use of com.uber.cadence.HistoryEvent in project cadence-client by uber-java.
the class StateMachines method failActivityTaskByTaskToken.
private static void failActivityTaskByTaskToken(RequestContext ctx, ActivityTaskData data, RespondActivityTaskFailedRequest request) {
ActivityTaskFailedEventAttributes a = new ActivityTaskFailedEventAttributes().setIdentity(request.getIdentity()).setScheduledEventId(data.scheduledEventId).setDetails(request.getDetails()).setReason(request.getReason()).setIdentity(request.getIdentity()).setStartedEventId(data.startedEventId);
HistoryEvent event = new HistoryEvent().setEventType(EventType.ActivityTaskFailed).setActivityTaskFailedEventAttributes(a);
ctx.addEvent(event);
}
Aggregations