Skip to content

Commit 9b94d82

Browse files
committed
Add Criterion, onSuccess, onFailure models
1 parent 6d3b8b2 commit 9b94d82

File tree

5 files changed

+153
-24
lines changed

5 files changed

+153
-24
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.apiflows.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
5+
public class Criterion {
6+
7+
private String condition;
8+
private String context;
9+
private String type;
10+
11+
public String getCondition() {
12+
return condition;
13+
}
14+
15+
public void setCondition(String condition) {
16+
this.condition = condition;
17+
}
18+
19+
public String getContext() {
20+
return context;
21+
}
22+
23+
public void setContext(String context) {
24+
this.context = context;
25+
}
26+
27+
public String getType() {
28+
return type;
29+
}
30+
31+
public void setType(String type) {
32+
this.type = type;
33+
}
34+
}
35+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.apiflows.model;
2+
3+
import java.util.List;
4+
5+
public class FailureAction {
6+
7+
private String workflowId;
8+
private String stepId;
9+
private Long retryAfter;
10+
private Integer retryLimit;
11+
private List<Criterion> criteria;
12+
13+
public String getWorkflowId() {
14+
return workflowId;
15+
}
16+
17+
public void setWorkflowId(String workflowId) {
18+
this.workflowId = workflowId;
19+
}
20+
21+
public String getStepId() {
22+
return stepId;
23+
}
24+
25+
public void setStepId(String stepId) {
26+
this.stepId = stepId;
27+
}
28+
29+
public Long getRetryAfter() {
30+
return retryAfter;
31+
}
32+
33+
public void setRetryAfter(Long retryAfter) {
34+
this.retryAfter = retryAfter;
35+
}
36+
37+
public Integer getRetryLimit() {
38+
return retryLimit;
39+
}
40+
41+
public void setRetryLimit(Integer retryLimit) {
42+
this.retryLimit = retryLimit;
43+
}
44+
45+
public List<Criterion> getCriteria() {
46+
return criteria;
47+
}
48+
49+
public void setCriteria(List<Criterion> criteria) {
50+
this.criteria = criteria;
51+
}
52+
}

src/main/java/com/apiflows/model/Step.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.fasterxml.jackson.annotation.JsonProperty;
44
import io.swagger.v3.oas.models.Operation;
55

6+
import java.util.ArrayList;
67
import java.util.HashMap;
78
import java.util.List;
89
import java.util.Map;
@@ -17,9 +18,11 @@ public class Step {
1718
private Workflow workflow;
1819
private String description;
1920
private String dependsOn;
20-
private List<Parameter> parameters;
21-
private List<SuccessCriterion> successCriteria;
21+
private List<Parameter> parameters = new ArrayList<>();
22+
private List<Criterion> successCriteria = new ArrayList<>();
2223
private Map<String, String> outputs = new HashMap<>();
24+
private List<SuccessAction> onSuccess = new ArrayList<>();
25+
private List<FailureAction> onFailure = new ArrayList<>();
2326

2427
@JsonProperty("stepId")
2528
public String getStepId() {
@@ -98,11 +101,11 @@ public void setParameters(List<Parameter> parameters) {
98101
}
99102

100103
@JsonProperty("successCriteria")
101-
public List<SuccessCriterion> getSuccessCriteria() {
104+
public List<Criterion> getSuccessCriteria() {
102105
return successCriteria;
103106
}
104107

105-
public void setSuccessCriteria(List<SuccessCriterion> successCriteria) {
108+
public void setSuccessCriteria(List<Criterion> successCriteria) {
106109
this.successCriteria = successCriteria;
107110
}
108111

@@ -113,4 +116,20 @@ public Map<String, String> getOutputs() {
113116
public void setOutputs(Map<String, String> outputs) {
114117
this.outputs = outputs;
115118
}
119+
120+
public List<SuccessAction> getOnSuccess() {
121+
return onSuccess;
122+
}
123+
124+
public void setOnSuccess(List<SuccessAction> onSuccess) {
125+
this.onSuccess = onSuccess;
126+
}
127+
128+
public List<FailureAction> getOnFailure() {
129+
return onFailure;
130+
}
131+
132+
public void setOnFailure(List<FailureAction> onFailure) {
133+
this.onFailure = onFailure;
134+
}
116135
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.apiflows.model;
2+
3+
import java.util.List;
4+
5+
public class SuccessAction {
6+
7+
private String type;
8+
private String workflowId;
9+
private String stepId;
10+
private List<Criterion> criteria;
11+
12+
public String getType() {
13+
return type;
14+
}
15+
16+
public void setType(String type) {
17+
this.type = type;
18+
}
19+
20+
public String getWorkflowId() {
21+
return workflowId;
22+
}
23+
24+
public void setWorkflowId(String workflowId) {
25+
this.workflowId = workflowId;
26+
}
27+
28+
public String getStepId() {
29+
return stepId;
30+
}
31+
32+
public void setStepId(String stepId) {
33+
this.stepId = stepId;
34+
}
35+
36+
public List<Criterion> getCriteria() {
37+
return criteria;
38+
}
39+
40+
public void setCriteria(List<Criterion> criteria) {
41+
this.criteria = criteria;
42+
}
43+
}

src/main/java/com/apiflows/model/SuccessCriterion.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)