use of com.uber.cadence.ActivityTaskStartedEventAttributes in project cadence-client by uber-java.
the class StateMachines method startActivityTask.
private static void startActivityTask(RequestContext ctx, ActivityTaskData data, PollForActivityTaskRequest request, long notUsed) {
ActivityTaskStartedEventAttributes a = new ActivityTaskStartedEventAttributes().setIdentity(request.getIdentity()).setScheduledEventId(data.scheduledEventId);
HistoryEvent event = new HistoryEvent().setEventType(EventType.ActivityTaskStarted).setActivityTaskStartedEventAttributes(a);
long startedEventId = ctx.addEvent(event);
ctx.onCommit((historySize) -> {
data.startedEventId = startedEventId;
data.activityTask.setTaskToken(new ActivityId(ctx.getExecutionId(), data.activityTask.getActivityId()).toBytes());
data.activityTask.setStartedTimestamp(ctx.currentTimeInNanoseconds());
});
}
Aggregations