Skip to content

Commit 4a79b8c

Browse files
rjrudinSameeraPriyathamTadikonda
authored andcommitted
DHFPROD-4492: Renamed runFlowWithoutProject to runFlow
And deprecated existing runFlow methods.
1 parent a5aed6a commit 4a79b8c

File tree

6 files changed

+30
-10
lines changed

6 files changed

+30
-10
lines changed

examples/dh-5-example/src/main/java/org/example/RunFlowWithoutProject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static void runFlow(FlowRunner flowRunner, String inputFilePath) {
3333
inputs.setInputFilePath(inputFilePath);
3434

3535
System.out.println("Running flow: " + flowName);
36-
RunFlowResponse response = flowRunner.runFlowWithoutProject(inputs);
36+
RunFlowResponse response = flowRunner.runFlow(inputs);
3737
flowRunner.awaitCompletion();
3838
System.out.println("Response: " + response);
3939
}

marklogic-data-hub/src/main/java/com/marklogic/hub/cli/client/RunFlowCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void run() {
4949
Pair<FlowInputs, String> pair = super.buildFlowInputs();
5050
System.out.println(pair.getRight());
5151

52-
RunFlowResponse response = flowRunner.runFlowWithoutProject(pair.getLeft());
52+
RunFlowResponse response = flowRunner.runFlow(pair.getLeft());
5353
flowRunner.awaitCompletion();
5454
System.out.println("\nOutput:");
5555
System.out.println(response.toJson());

marklogic-data-hub/src/main/java/com/marklogic/hub/flow/FlowRunner.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,75 +21,89 @@ public interface FlowRunner {
2121
* @param flowInputs
2222
* @return
2323
*/
24-
RunFlowResponse runFlowWithoutProject(FlowInputs flowInputs);
24+
RunFlowResponse runFlow(FlowInputs flowInputs);
2525

2626
/**
2727
* Runs the flow, with a specific set of steps, with all custom settings
2828
*
29+
* @deprecated Starting in 5.2.0, prefer runFlow(FlowInputs), which does not depend on Spring or project files on the filesystem
2930
* @param flow the flow to run
3031
* @param jobId the jobid to be used for the flow
3132
* @return a response object
3233
*/
34+
@Deprecated
3335
RunFlowResponse runFlow(String flow, String jobId);
3436

3537
/**
3638
* Runs the flow, with a specific set of steps, with all custom settings
3739
*
40+
* @deprecated Starting in 5.2.0, prefer runFlow(FlowInputs), which does not depend on Spring or project files on the filesystem
3841
* @param flow the flow to run
3942
* @param steps the steps in the flow to run
4043
* @param jobId the jobid to be used for the flow
4144
* @return a response object
4245
*/
46+
@Deprecated
4347
RunFlowResponse runFlow(String flow, List<String> steps, String jobId);
4448

4549
/**
4650
* Runs the flow, with a specific set of steps, with all custom settings
4751
*
52+
* @deprecated Starting in 5.2.0, prefer runFlow(FlowInputs), which does not depend on Spring or project files on the filesystem
4853
* @param flow the flow to run
4954
* @param jobId the jobid to be used for the flow
5055
* @param options the key/value options to be passed
5156
* @return a response object
5257
*/
58+
@Deprecated
5359
RunFlowResponse runFlow(String flow, String jobId, Map<String, Object> options);
5460

5561
/**
5662
* Runs the flow, with a specific set of steps, with all custom settings
5763
*
64+
* @deprecated Starting in 5.2.0, prefer runFlow(FlowInputs), which does not depend on Spring or project files on the filesystem
5865
* @param flow the flow to run
5966
* @param steps the steps in the flow to run
6067
* @param jobId the jobid to be used for the flow
6168
* @param options the key/value options to be passed
6269
* @return a response object
6370
*/
71+
@Deprecated
6472
RunFlowResponse runFlow(String flow, List<String> steps, String jobId, Map<String, Object> options);
6573

6674
/**
6775
* Runs the flow, with a specific set of steps, with all custom settings
6876
*
77+
* @deprecated Starting in 5.2.0, prefer runFlow(FlowInputs), which does not depend on Spring or project files on the filesystem
6978
* @param flow the flow to run
7079
* @param steps the steps in the flow to run
7180
* @param jobId the jobid to be used for the flow
7281
* @param options the key/value options to be passed
7382
* @param stepConfig the key/value config to override the running of the step
7483
* @return a response object
7584
*/
85+
@Deprecated
7686
RunFlowResponse runFlow(String flow, List<String> steps, String jobId, Map<String, Object> options, Map<String, Object> stepConfig);
7787

7888
/**
7989
* Runs the flow, with a specific set of steps, with all defaults from step
8090
*
91+
* @deprecated Starting in 5.2.0, prefer runFlow(FlowInputs), which does not depend on Spring or project files on the filesystem
8192
* @param flow the flow to run
8293
* @param steps the steps in the flow to run
8394
* @return a response object
8495
*/
96+
@Deprecated
8597
RunFlowResponse runFlow(String flow, List<String> steps);
8698

8799
/**
88100
* Runs the entire flow, with full defaults
89101
*
102+
* @deprecated Starting in 5.2.0, prefer runFlow(FlowInputs), which does not depend on Spring or project files on the filesystem
90103
* @param flow the flow to run
91104
* @return a response object
92105
*/
106+
@Deprecated
93107
RunFlowResponse runFlow(String flow);
94108

95109
/**

marklogic-data-hub/src/main/java/com/marklogic/hub/flow/impl/FlowRunnerImpl.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public FlowRunnerImpl(String host, String username, String password) {
8484
* project files from the filesystem.
8585
*
8686
* This constructor handles ensuring that step definitions are retrieved from MarkLogic as opposed to from the
87-
* filesystem. It is expected that the "runFlowWithoutProject" method will then be used, which ensures that flow
87+
* filesystem. It is expected that the "runFlow(FlowInputs)" method will then be used, which ensures that flow
8888
* artifacts are also retrieved from MarkLogic as opposed to from the filesystem.
8989
*
9090
* @param hubConfig
@@ -101,30 +101,37 @@ public FlowRunner onStatusChanged(FlowStatusListener listener) {
101101
return this;
102102
}
103103

104+
@Deprecated
104105
public RunFlowResponse runFlow(String flowName) {
105106
return runFlow(flowName, null, null, new HashMap<>(), new HashMap<>());
106107
}
107108

109+
@Deprecated
108110
public RunFlowResponse runFlow(String flowName, List<String> stepNums) {
109111
return runFlow(flowName, stepNums, null, new HashMap<>(), new HashMap<>());
110112
}
111113

114+
@Deprecated
112115
public RunFlowResponse runFlow(String flowName, String jobId) {
113116
return runFlow(flowName, null, jobId, new HashMap<>(), new HashMap<>());
114117
}
115118

119+
@Deprecated
116120
public RunFlowResponse runFlow(String flowName, List<String> stepNums, String jobId) {
117121
return runFlow(flowName, stepNums, jobId, new HashMap<>(), new HashMap<>());
118122
}
119123

124+
@Deprecated
120125
public RunFlowResponse runFlow(String flowName, String jobId, Map<String, Object> options) {
121126
return runFlow(flowName, null, jobId, options, new HashMap<>());
122127
}
123128

129+
@Deprecated
124130
public RunFlowResponse runFlow(String flowName, List<String> stepNums, String jobId, Map<String, Object> options) {
125131
return runFlow(flowName, stepNums, jobId, options, new HashMap<>());
126132
}
127133

134+
@Deprecated
128135
public RunFlowResponse runFlow(String flowName, List<String> stepNums, String jobId, Map<String, Object> options, Map<String, Object> stepConfig) {
129136
Flow flow = flowManager.getFlow(flowName);
130137
if (flow == null) {
@@ -141,7 +148,7 @@ public RunFlowResponse runFlow(String flowName, List<String> stepNums, String jo
141148
* @return
142149
*/
143150
@Override
144-
public RunFlowResponse runFlowWithoutProject(FlowInputs flowInputs) {
151+
public RunFlowResponse runFlow(FlowInputs flowInputs) {
145152
final String flowName = flowInputs.getFlowName();
146153
if (StringUtils.isEmpty(flowName)) {
147154
throw new IllegalArgumentException("Cannot run flow; no flow name provided");
@@ -156,7 +163,7 @@ public RunFlowResponse runFlowWithoutProject(FlowInputs flowInputs) {
156163
return runFlow(flow, flowInputs.getSteps(), flowInputs.getJobId(), flowInputs.getOptions(), flowInputs.getStepConfig());
157164
}
158165

159-
public RunFlowResponse runFlow(Flow flow, List<String> stepNums, String jobId, Map<String, Object> options, Map<String, Object> stepConfig) {
166+
protected RunFlowResponse runFlow(Flow flow, List<String> stepNums, String jobId, Map<String, Object> options, Map<String, Object> stepConfig) {
160167
if (options != null && options.containsKey("disableJobOutput")) {
161168
disableJobOutput = Boolean.parseBoolean(options.get("disableJobOutput").toString());
162169
} else {

marklogic-data-hub/src/test/java/com/marklogic/hub/flow/RunFlowRunnerTestsWithoutProjectTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.marklogic.hub.step.MarkLogicStepDefinitionProvider;
55
import com.marklogic.hub.step.StepDefinition;
66
import com.marklogic.hub.step.StepDefinitionProvider;
7-
import org.junit.jupiter.api.Test;
87

98
import java.util.Arrays;
109
import java.util.Map;
@@ -38,7 +37,7 @@ protected RunFlowResponse runFlow(String flowName, String commaDelimitedSteps, S
3837
makeInputFilePathsAbsoluteInFlow(flowName);
3938
verifyStepDefinitionsCanBeFound(flowRunner);
4039

41-
return flowRunner.runFlowWithoutProject(inputs);
40+
return flowRunner.runFlow(inputs);
4241
}
4342

4443
/**

marklogic-data-hub/src/test/java/com/marklogic/hub/mapping/RunMappingTestsWithoutProjectTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.marklogic.hub.flow.impl.FlowRunnerImpl;
77

88
/**
9-
* Extends MappingTest so that each of its tests can be run via the runFlowWithoutProject method.
9+
* Extends MappingTest so that each of its tests can be run via the runFlow(FlowInputs) method.
1010
*/
1111
public class RunMappingTestsWithoutProjectTest extends MappingTest {
1212

@@ -15,7 +15,7 @@ protected RunFlowResponse runFlow(String flowName, String... stepIds) {
1515
makeInputFilePathsAbsoluteInFlow(flowName);
1616
FlowRunner flowRunner = new FlowRunnerImpl(host, flowRunnerUser, flowRunnerPassword);
1717
FlowInputs inputs = new FlowInputs(flowName, stepIds);
18-
RunFlowResponse response = flowRunner.runFlowWithoutProject(inputs);
18+
RunFlowResponse response = flowRunner.runFlow(inputs);
1919
flowRunner.awaitCompletion();
2020
return response;
2121
}

0 commit comments

Comments
 (0)