Search in sources :

Example 1 with RequestCancelExternalWorkflowExecutionDecisionAttributes

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

the class WorkflowDecisionContext method requestCancelWorkflowExecution.

void requestCancelWorkflowExecution(WorkflowExecution execution) {
    RequestCancelExternalWorkflowExecutionDecisionAttributes attributes = new RequestCancelExternalWorkflowExecutionDecisionAttributes();
    String workflowId = execution.getWorkflowId();
    attributes.setWorkflowId(workflowId);
    attributes.setRunId(execution.getRunId());
    boolean childWorkflow = scheduledExternalWorkflows.containsKey(workflowId);
    // TODO: See if immediate cancellation needed
    decisions.requestCancelExternalWorkflowExecution(childWorkflow, attributes, null);
}
Also used : RequestCancelExternalWorkflowExecutionDecisionAttributes(com.uber.cadence.RequestCancelExternalWorkflowExecutionDecisionAttributes)

Example 2 with RequestCancelExternalWorkflowExecutionDecisionAttributes

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

the class ChildWorkflowDecisionStateMachine method createRequestCancelExternalWorkflowExecutionDecision.

private Decision createRequestCancelExternalWorkflowExecutionDecision() {
    RequestCancelExternalWorkflowExecutionDecisionAttributes tryCancel = new RequestCancelExternalWorkflowExecutionDecisionAttributes();
    tryCancel.setWorkflowId(startAttributes.getWorkflowId());
    tryCancel.setRunId(runId);
    Decision decision = new Decision();
    decision.setRequestCancelExternalWorkflowExecutionDecisionAttributes(tryCancel);
    decision.setDecisionType(DecisionType.RequestCancelExternalWorkflowExecution);
    return decision;
}
Also used : RequestCancelExternalWorkflowExecutionDecisionAttributes(com.uber.cadence.RequestCancelExternalWorkflowExecutionDecisionAttributes) Decision(com.uber.cadence.Decision)

Aggregations

RequestCancelExternalWorkflowExecutionDecisionAttributes (com.uber.cadence.RequestCancelExternalWorkflowExecutionDecisionAttributes)2 Decision (com.uber.cadence.Decision)1