@@ -117,16 +117,15 @@ functions:
117
117
states :
118
118
- name : Greet
119
119
type : operation
120
- actionMode : sequential
121
120
actions :
122
121
- functionRef :
123
122
refName : greetingFunction
124
123
arguments :
125
- name : " .greet.name"
124
+ name : " ${ .greet.name } "
126
125
actionDataFilter :
127
- dataResultsPath : " .payload.greeting"
126
+ results : " ${ .payload.greeting } "
128
127
stateDataFilter :
129
- output : " .greeting"
128
+ output : " ${ .greeting } "
130
129
end : true
131
130
` ` `
132
131
@@ -158,7 +157,6 @@ assertTrue(workflow.getStates().get(0) instanceof OperationState);
158
157
OperationState operationState = (OperationState ) workflow. getStates(). get(0 );
159
158
assertEquals(" Greet" , operationState. getName());
160
159
assertEquals(DefaultState . Type . OPERATION , operationState. getType());
161
-
162
160
...
163
161
```
164
162
@@ -167,20 +165,21 @@ assertEquals(DefaultState.Type.OPERATION, operationState.getType());
167
165
You can also programmatically create Workflow instances, for example:
168
166
169
167
``` java
170
- Workflow workflow = new Workflow (). withId(" test-workflow" ). withName(" test-workflow-name" ). withVersion(" 1.0" )
168
+ Workflow workflow = new Workflow ()
169
+ .withId(" test-workflow" )
170
+ .withName(" test-workflow-name" )
171
+ .withVersion(" 1.0" )
172
+ .withStart(new Start (). withStateName(" MyDelayState" ))
171
173
.withFunctions(new Functions (Arrays . asList(
172
174
new FunctionDefinition (). withName(" testFunction" )
173
175
.withOperation(" testSwaggerDef#testOperationId" )))
174
176
)
175
177
.withStates(Arrays . asList(
176
- new DelayState (). withName(" delayState" ). withType(DELAY )
177
- .withStart(
178
- new Start (). withKind(Start . Kind . DEFAULT )
179
- )
178
+ new DelayState (). withName(" MyDelayState" ). withType(DELAY )
179
+ .withTimeDelay(" PT1M" )
180
180
.withEnd(
181
- new End (). withKind( End . Kind . DEFAULT )
181
+ new End (). withTerminate( true )
182
182
)
183
- .withTimeDelay(" PT1M" )
184
183
)
185
184
);
186
185
```
@@ -218,16 +217,16 @@ boolean isValidWorkflow = workflowValidator.setSource("WORKFLOW_MODEL_JSON/YAML"
218
217
If you build your Workflow programmatically, you can validate it as well:
219
218
220
219
``` java
221
- Workflow workflow = new Workflow (). withId(" test-workflow" ). withVersion(" 1.0" )
220
+ Workflow workflow = new Workflow ()
221
+ .withId(" test-workflow" )
222
+ .withVersion(" 1.0" )
223
+ .withStart(new Start (). withStateName(" MyDelayState" ))
222
224
.withStates(Arrays . asList(
223
- new DelayState (). withName(" delayState" ). withType(DefaultState . Type . DELAY )
224
- .withStart(
225
- new Start (). withKind(Start . Kind . DEFAULT )
226
- )
225
+ new DelayState (). withName(" MyDelayState" ). withType(DefaultState . Type . DELAY )
226
+ .withTimeDelay(" PT1M" )
227
227
.withEnd(
228
- new End (). withKind( End . Kind . DEFAULT )
228
+ new End (). withTerminate( true )
229
229
)
230
- .withTimeDelay(" PT1M" )
231
230
));
232
231
);
233
232
0 commit comments