Search in sources :

Example 31 with HistoryEvent

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);
}
Also used : ActivityTaskCompletedEventAttributes(com.uber.cadence.ActivityTaskCompletedEventAttributes) HistoryEvent(com.uber.cadence.HistoryEvent)

Example 32 with HistoryEvent

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);
}
Also used : ChildWorkflowExecutionStartedEventAttributes(com.uber.cadence.ChildWorkflowExecutionStartedEventAttributes) WorkflowExecutionStartedEventAttributes(com.uber.cadence.WorkflowExecutionStartedEventAttributes) HistoryEvent(com.uber.cadence.HistoryEvent)

Example 33 with HistoryEvent

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);
}
Also used : ActivityTaskCompletedEventAttributes(com.uber.cadence.ActivityTaskCompletedEventAttributes) HistoryEvent(com.uber.cadence.HistoryEvent)

Example 34 with HistoryEvent

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);
}
Also used : HistoryEvent(com.uber.cadence.HistoryEvent) TimerCanceledEventAttributes(com.uber.cadence.TimerCanceledEventAttributes)

Example 35 with HistoryEvent

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);
}
Also used : ActivityTaskFailedEventAttributes(com.uber.cadence.ActivityTaskFailedEventAttributes) HistoryEvent(com.uber.cadence.HistoryEvent)

Aggregations

HistoryEvent (com.uber.cadence.HistoryEvent)49 History (com.uber.cadence.History)5 WorkflowExecution (com.uber.cadence.WorkflowExecution)5 GetWorkflowExecutionHistoryRequest (com.uber.cadence.GetWorkflowExecutionHistoryRequest)4 GetWorkflowExecutionHistoryResponse (com.uber.cadence.GetWorkflowExecutionHistoryResponse)3 SignalExternalWorkflowExecutionInitiatedEventAttributes (com.uber.cadence.SignalExternalWorkflowExecutionInitiatedEventAttributes)3 ActivityTaskCompletedEventAttributes (com.uber.cadence.ActivityTaskCompletedEventAttributes)2 ActivityTaskFailedEventAttributes (com.uber.cadence.ActivityTaskFailedEventAttributes)2 ChildWorkflowExecutionTimedOutEventAttributes (com.uber.cadence.ChildWorkflowExecutionTimedOutEventAttributes)2 EntityNotExistsError (com.uber.cadence.EntityNotExistsError)2 PollForActivityTaskResponse (com.uber.cadence.PollForActivityTaskResponse)2 PollForDecisionTaskResponse (com.uber.cadence.PollForDecisionTaskResponse)2 SignalExternalWorkflowExecutionFailedEventAttributes (com.uber.cadence.SignalExternalWorkflowExecutionFailedEventAttributes)2 StartChildWorkflowExecutionInitiatedEventAttributes (com.uber.cadence.StartChildWorkflowExecutionInitiatedEventAttributes)2 StartWorkflowExecutionRequest (com.uber.cadence.StartWorkflowExecutionRequest)2 WorkflowExecutionContinuedAsNewEventAttributes (com.uber.cadence.WorkflowExecutionContinuedAsNewEventAttributes)2 WorkflowExecutionSignaledEventAttributes (com.uber.cadence.WorkflowExecutionSignaledEventAttributes)2 WorkflowExecutionStartedEventAttributes (com.uber.cadence.WorkflowExecutionStartedEventAttributes)2 TaskListId (com.uber.cadence.internal.testservice.TestWorkflowStore.TaskListId)2 ArrayList (java.util.ArrayList)2