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;
            }
        };
    }

沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南