use of com.uber.cadence.HistoryEvent in project cadence-client by uber-java.
the class StateMachines method cancelWorkflow.
private static void cancelWorkflow(RequestContext ctx, WorkflowData data, CancelWorkflowExecutionDecisionAttributes d, long decisionTaskCompletedEventId) {
WorkflowExecutionCanceledEventAttributes a = new WorkflowExecutionCanceledEventAttributes().setDetails(d.getDetails()).setDecisionTaskCompletedEventId(decisionTaskCompletedEventId);
HistoryEvent event = new HistoryEvent().setEventType(EventType.WorkflowExecutionCanceled).setWorkflowExecutionCanceledEventAttributes(a);
ctx.addEvent(event);
}
use of com.uber.cadence.HistoryEvent in project cadence-client by uber-java.
the class StateMachines method childWorkflowCompleted.
private static void childWorkflowCompleted(RequestContext ctx, ChildWorkflowData data, ChildWorkflowExecutionCompletedEventAttributes a, long notUsed) {
a.setInitiatedEventId(data.initiatedEventId).setStartedEventId(data.startedEventId);
HistoryEvent event = new HistoryEvent().setEventType(EventType.ChildWorkflowExecutionCompleted).setChildWorkflowExecutionCompletedEventAttributes(a);
ctx.addEvent(event);
}
use of com.uber.cadence.HistoryEvent in project cadence-client by uber-java.
the class StateMachines method continueAsNewWorkflow.
private static void continueAsNewWorkflow(RequestContext ctx, WorkflowData data, ContinueAsNewWorkflowExecutionDecisionAttributes d, long decisionTaskCompletedEventId) {
StartWorkflowExecutionRequest sr = ctx.getWorkflowMutableState().getStartRequest();
WorkflowExecutionContinuedAsNewEventAttributes a = new WorkflowExecutionContinuedAsNewEventAttributes();
a.setInput(d.getInput());
if (d.isSetExecutionStartToCloseTimeoutSeconds()) {
a.setExecutionStartToCloseTimeoutSeconds(d.getExecutionStartToCloseTimeoutSeconds());
} else {
a.setExecutionStartToCloseTimeoutSeconds(sr.getExecutionStartToCloseTimeoutSeconds());
}
if (d.isSetTaskList()) {
a.setTaskList(d.getTaskList());
} else {
a.setTaskList(sr.getTaskList());
}
if (d.isSetWorkflowType()) {
a.setWorkflowType(d.getWorkflowType());
} else {
a.setWorkflowType(sr.getWorkflowType());
}
if (d.isSetTaskStartToCloseTimeoutSeconds()) {
a.setTaskStartToCloseTimeoutSeconds(d.getTaskStartToCloseTimeoutSeconds());
} else {
a.setTaskStartToCloseTimeoutSeconds(sr.getTaskStartToCloseTimeoutSeconds());
}
a.setDecisionTaskCompletedEventId(decisionTaskCompletedEventId);
HistoryEvent event = new HistoryEvent().setEventType(EventType.WorkflowExecutionContinuedAsNew).setWorkflowExecutionContinuedAsNewEventAttributes(a);
ctx.addEvent(event);
}
use of com.uber.cadence.HistoryEvent in project cadence-client by uber-java.
the class StateMachines method childWorkflowFailed.
private static void childWorkflowFailed(RequestContext ctx, ChildWorkflowData data, ChildWorkflowExecutionFailedEventAttributes a, long notUsed) {
a.setInitiatedEventId(data.initiatedEventId);
a.setStartedEventId(data.startedEventId);
HistoryEvent event = new HistoryEvent().setEventType(EventType.ChildWorkflowExecutionFailed).setChildWorkflowExecutionFailedEventAttributes(a);
ctx.addEvent(event);
}
use of com.uber.cadence.HistoryEvent in project cadence-client by uber-java.
the class StateMachines method timeoutActivityTask.
private static void timeoutActivityTask(RequestContext ctx, ActivityTaskData data, TimeoutType timeoutType, long notUsed) {
ActivityTaskTimedOutEventAttributes a = new ActivityTaskTimedOutEventAttributes().setScheduledEventId(data.scheduledEventId).setDetails(data.heartbeatDetails).setTimeoutType(timeoutType).setStartedEventId(data.startedEventId);
HistoryEvent event = new HistoryEvent().setEventType(EventType.ActivityTaskTimedOut).setActivityTaskTimedOutEventAttributes(a);
ctx.addEvent(event);
}
Aggregations