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

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠