Skip to content

Commit 92c4ca6

Browse files
committed
samples docs
1 parent 4cab84e commit 92c4ca6

File tree

4 files changed

+52
-14
lines changed

4 files changed

+52
-14
lines changed

ReleaseNotes/1.2.8.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Workflow Core 1.2.8
2+
3+
* Added .Schedule() API, to future date a block of steps to run in parallel to the rest of the workflow.
4+
5+
This following example will execute the block of steps after 3 days
6+
```c#
7+
builder
8+
.StartWith<HelloWorld>()
9+
.Schedule(data => TimeSpan.FromDays(3)).Do(block =>
10+
block.StartWith<DoSomething>()
11+
.Then<DoSomethingElse>())
12+
.Then<GoodbyeWorld>();
13+
```
14+
15+
* Added inline action steps API
16+
17+
```c#
18+
builder
19+
.StartWith(context => Console.WriteLine("Hello!"))
20+
.Then(context => Console.WriteLine("Bye!"));
21+
```
22+
23+
* Discontinued support for .NET 4.5.2 (.NET 4.6 is .NET Standard 1.3 compatible)

WorkflowCore.sln

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26228.4
4+
VisualStudioVersion = 15.0.26430.12
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{EF47161E-E399-451C-BDE8-E92AAD3BD761}"
77
EndProject
@@ -88,6 +88,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkflowCore.Sample13", "sr
8888
EndProject
8989
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkflowCore.Providers.Azure", "src\providers\WorkflowCore.Providers.Azure\WorkflowCore.Providers.Azure.csproj", "{A2374B7C-4198-40B3-B8FE-FAC3DB3F2539}"
9090
EndProject
91+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReleaseNotes", "ReleaseNotes", "{38ECB00C-3F3B-4442-8408-ACE3B37FFAA8}"
92+
EndProject
9193
Global
9294
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9395
Debug|Any CPU = Debug|Any CPU

src/WorkflowCore/Interface/IStepBuilder.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,25 @@ public interface IStepBuilder<TData, TStepBody>
119119
/// <returns></returns>
120120
IStepBuilder<TData, Delay> Delay(Expression<Func<TData, TimeSpan>> period);
121121

122+
/// <summary>
123+
/// Execute a block of steps, once for each item in a collection in a parallel foreach
124+
/// </summary>
125+
/// <param name="collection"></param>
126+
/// <returns></returns>
122127
IContainerStepBuilder<TData, Foreach, Foreach> ForEach(Expression<Func<TData, IEnumerable>> collection);
123128

129+
/// <summary>
130+
/// Repeat a block of steps until a condition becomes true
131+
/// </summary>
132+
/// <param name="condition"></param>
133+
/// <returns></returns>
124134
IContainerStepBuilder<TData, While, While> While(Expression<Func<TData, bool>> condition);
125135

136+
/// <summary>
137+
/// Execute a block of steps if a condition is true
138+
/// </summary>
139+
/// <param name="condition"></param>
140+
/// <returns></returns>
126141
IContainerStepBuilder<TData, If, If> If(Expression<Func<TData, bool>> condition);
127142

128143
/// <summary>
@@ -132,8 +147,17 @@ public interface IStepBuilder<TData, TStepBody>
132147
/// <returns></returns>
133148
IContainerStepBuilder<TData, When, OutcomeSwitch> When(Expression<Func<TData, object>> outcomeValue, string label = null);
134149

150+
/// <summary>
151+
/// Execute multiple blocks of steps in parallel
152+
/// </summary>
153+
/// <returns></returns>
135154
IParallelStepBuilder<TData, Sequence> Parallel();
136155

156+
/// <summary>
157+
/// Schedule a block of steps to execute in parallel sometime in the future
158+
/// </summary>
159+
/// <param name="time"></param>
160+
/// <returns></returns>
137161
IContainerStepBuilder<TData, Schedule, TStepBody> Schedule(Expression<Func<TData, TimeSpan>> time);
138162
}
139163
}

src/samples/WorkflowCore.Sample09/README.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ builder
99
.ForEach(data => new List<int>() { 1, 2, 3, 4 })
1010
.Do(x => x
1111
.StartWith<DisplayContext>()
12+
.Input(step => step.Item, (data, context) => context.Item)
1213
.Then<DoSomething>())
1314
.Then<SayGoodbye>();
1415
```
@@ -21,20 +22,8 @@ builder
2122
.ForEach(data => data.MyCollection)
2223
.Do(x => x
2324
.StartWith<DisplayContext>()
25+
.Input(step => step.Item, (data, context) => context.Item)
2426
.Then<DoSomething>())
2527
.Then<SayGoodbye>();
2628

2729
```
28-
29-
Access the iteration item from the step execution context
30-
31-
```c#
32-
public class DisplayContext : StepBody
33-
{
34-
public override ExecutionResult Run(IStepExecutionContext context)
35-
{
36-
Console.WriteLine($"Working on item {context.Item}");
37-
return ExecutionResult.Next();
38-
}
39-
}
40-
```

0 commit comments

Comments
 (0)