Will in-fly workflow execution fail if I update the workflow Implementation logic

0

We are using Java Flow framework for swf workflow and activities. The current workflow will execute two activities, now we will need to register a new activity, and update the workflow implementation to conditionally run another activity when the workflow input meet a certain condition, so there is no change to other two activities, no change to the workflow interface itself, but will only update the workflow implementation to invoke another activity, now my question is if we deploy the change, will the in-fly workflow execution that run on the old version failed or timed out because of the reply process. I am not sure if this falls into https://docs.aws.amazon.com/amazonswf/latest/awsflowguide/java-flow-making-changes-solutions.html#use-feature-flags, so the in-fly execution won't be impacted when deploy the changes to the workflow. Please see my below code before and after

// Before Change
@Workflow(dataConverter = ManualOperationSwfDataConverter.class)
@WorkflowRegistrationOptions(defaultExecutionStartToCloseTimeoutSeconds = MAX_WAIT_TIME_SECONDS,
        defaultTaskStartToCloseTimeoutSeconds = DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_SECONDS)
public interface MyWorkflowDefinition {
    @Execute(version = "1.0")
    void MyWorkflow(Input input);
}


    @Override
    @Asynchronous
    public void MyWorkflow(Input input) {
        new TryCatch() {
            @Override
            protected void doTry() {
           final Promise<Input> promise = client.runActivity1(input);
           final Promise<Void> result2 = client.runActivity2(promise);

            }

            @Override

            protected void doCatch(final Throwable e) throws Throwable {
                handleError(e);
                throw e;
            }
        };
    }

// After Change
@Workflow(dataConverter = ManualOperationSwfDataConverter.class)
@WorkflowRegistrationOptions(defaultExecutionStartToCloseTimeoutSeconds = MAX_WAIT_TIME_SECONDS,
        defaultTaskStartToCloseTimeoutSeconds = DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_SECONDS)
public interface MyWorkflowDefinition {
    @Execute(version = "1.0")
    void MyWorkflow(Input input);
}


    @Override
    @Asynchronous
    public void MyWorkflow(Input input) {
        new TryCatch() {
            @Override
            protected void doTry() {
            if (input.client == eligibleClient) {
                     final Promise<Input> promise1 = client.runActivity3(input);
                     final Promise<Input> promise2 = client.runActivity1(promise1);
                     final Promise<Void> result2 = client.runActivity2(promise2);
          }  else {
                 final Promise<Input> promise = client.runActivity1(input);
                final Promise<Void> result2 = client.runActivity2(promise);

       }

            }

            @Override

            protected void doCatch(final Throwable e) throws Throwable {
                handleError(e);
                throw e;
            }
        };
    }

Nessuna risposta

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande