• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber / cadence-java-client / 1994

27 Sep 2023 06:06PM UTC coverage: 60.252% (+0.03%) from 60.226%
1994

push

buildkite

web-flow
fixed bug: Added alreadyStarted workflow case (#853)

If we get WorkflowExecutionAlreadyStartedError while starting workflow in new domain, then we don't require startWorkflowInNew domain again as well as not throw error. Hence, we will inform by giving status as "Workflow already started".

8 of 8 new or added lines in 2 files covered. (100.0%)

11340 of 18821 relevant lines covered (60.25%)

0.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.67
/src/main/java/com/uber/cadence/migration/MigrationActivitiesImpl.java
1
/*
2
 *  Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
 *
4
 *  Modifications copyright (C) 2017 Uber Technologies, Inc.
5
 *
6
 *  Licensed under the Apache License, Version 2.0 (the "License"). You may not
7
 *  use this file except in compliance with the License. A copy of the License is
8
 *  located at
9
 *
10
 *  http://aws.amazon.com/apache2.0
11
 *
12
 *  or in the "license" file accompanying this file. This file is distributed on
13
 *  an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14
 *  express or implied. See the License for the specific language governing
15
 *  permissions and limitations under the License.
16
 */
17

18
package com.uber.cadence.migration;
19

20
import com.uber.cadence.RequestCancelWorkflowExecutionRequest;
21
import com.uber.cadence.StartWorkflowExecutionRequest;
22
import com.uber.cadence.WorkflowExecutionAlreadyStartedError;
23
import com.uber.cadence.client.WorkflowClient;
24
import com.uber.cadence.workflow.Workflow;
25

26
public class MigrationActivitiesImpl implements MigrationActivities {
27
  private final WorkflowClient clientInCurrDomain, clientInNewDomain;
28

29
  public MigrationActivitiesImpl(
30
      WorkflowClient clientInCurrDomain, WorkflowClient clientInNewDomain) {
1✔
31
    this.clientInCurrDomain = clientInCurrDomain;
1✔
32
    this.clientInNewDomain = clientInNewDomain;
1✔
33
  }
1✔
34

35
  @Override
36
  public StartWorkflowInNewResponse startWorkflowInNewDomain(
37
      StartWorkflowExecutionRequest request) {
38
    try {
39
      return new StartWorkflowInNewResponse(
×
40
          clientInNewDomain.getService().StartWorkflowExecution(request),
×
41
          "New workflow starting successful");
42
    } catch (WorkflowExecutionAlreadyStartedError e) {
×
43
      return new StartWorkflowInNewResponse(null, "Workflow already started");
×
44
    } catch (Exception e) {
×
45
      throw Workflow.wrap(e);
×
46
    }
47
  }
48

49
  @Override
50
  public void cancelWorkflowInCurrentDomain(RequestCancelWorkflowExecutionRequest request) {
51
    try {
52
      clientInCurrDomain.getService().RequestCancelWorkflowExecution(request);
×
53
    } catch (Exception e) {
×
54
      throw Workflow.wrap(e);
×
55
    }
×
56
  }
×
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc