Skip to content

Commit 129aef8

Browse files
committed
docs
1 parent 4bf445a commit 129aef8

File tree

3 files changed

+53
-5
lines changed

3 files changed

+53
-5
lines changed

ReleaseNotes/1.4.0.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Full details of the capabilities of expression language can be found [here](htt
7272
"Value1": "data.Value1",
7373
"Value2": "data.Value2"
7474
},
75-
"Outputs": {
75+
"Outputs": {
7676
"Answer": "step.Result"
7777
}
7878
},
@@ -251,3 +251,52 @@ The `.Parallel` can be implemented as follows
251251
]
252252
}
253253
```
254+
255+
### Schedule
256+
257+
The `.Schedule` can be implemented as follows
258+
259+
```json
260+
{
261+
"Id": "MyScheduleStep",
262+
"StepType": "WorkflowCore.Primitives.Schedule, WorkflowCore",
263+
"Inputs": { "Interval": "<<expression to evaluate>>" },
264+
"Do": [[
265+
{
266+
"Id": "do1",
267+
"StepType": "MyApp.DoSomething1, MyApp",
268+
"NextStepId": "do2"
269+
},
270+
{
271+
"Id": "do2",
272+
"StepType": "MyApp.DoSomething2, MyApp"
273+
}
274+
]]
275+
}
276+
```
277+
278+
### Recur
279+
280+
The `.Recur` can be implemented as follows
281+
282+
```json
283+
{
284+
"Id": "MyScheduleStep",
285+
"StepType": "WorkflowCore.Primitives.Recur, WorkflowCore",
286+
"Inputs": {
287+
"Interval": "<<expression to evaluate>>",
288+
"StopCondition": "<<expression to evaluate>>"
289+
},
290+
"Do": [[
291+
{
292+
"Id": "do1",
293+
"StepType": "MyApp.DoSomething1, MyApp",
294+
"NextStepId": "do2"
295+
},
296+
{
297+
"Id": "do2",
298+
"StepType": "MyApp.DoSomething2, MyApp"
299+
}
300+
]]
301+
}
302+
```

src/WorkflowCore/Primitives/Schedule.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ namespace WorkflowCore.Primitives
77
{
88
public class Schedule : ContainerStepBody
99
{
10-
public TimeSpan Period { get; set; }
10+
public TimeSpan Interval { get; set; }
1111

1212
public override ExecutionResult Run(IStepExecutionContext context)
1313
{
1414
if (context.PersistenceData == null)
1515
{
16-
return ExecutionResult.Sleep(Period, new SchedulePersistenceData() { Elapsed = false });
16+
return ExecutionResult.Sleep(Interval, new SchedulePersistenceData() { Elapsed = false });
1717
}
1818

1919
if (context.PersistenceData is SchedulePersistenceData)

src/WorkflowCore/Services/FluentBuilders/StepBuilder.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ public IParallelStepBuilder<TData, Sequence> Parallel()
348348
public IContainerStepBuilder<TData, Schedule, TStepBody> Schedule(Expression<Func<TData, TimeSpan>> time)
349349
{
350350
var newStep = new WorkflowStep<Schedule>();
351-
352-
Expression<Func<Schedule, TimeSpan>> inputExpr = (x => x.Period);
351+
Expression<Func<Schedule, TimeSpan>> inputExpr = (x => x.Interval);
353352

354353
var mapping = new DataMapping()
355354
{

0 commit comments

Comments
 (0)