Skip to content

Commit 690e7e2

Browse files
committed
Upgrade to Esla 3 previews
1 parent fce15ab commit 690e7e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+492
-66
lines changed

projects/elsa/build.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
dotnet build composite-activity
2+
dotnet build for-activity
3+
dotnet build foreach-activity
4+
dotnet build fork-activity
5+
dotnet build fork-activity-2
6+
dotnet build if-activity
7+
dotnet build readline-activity
8+
dotnet build sequence-activity
9+
dotnet build setname-activity
10+
dotnet build setvariable-activity
11+
dotnet build while-activity
12+
dotnet build workflow
13+
dotnet build workflow-2
14+
dotnet build workflow-3
15+
dotnet build workflow-4
16+
dotnet build workflow-5
17+
dotnet build writeline-activity

projects/elsa/composite-activity/Program.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
using System.Security.Cryptography;
2-
using Elsa.Expressions.Models;
32
using Elsa.Extensions;
3+
using Elsa.Workflows.Core;
44
using Elsa.Workflows.Core.Activities;
5-
using Elsa.Workflows.Core.Models;
6-
using Elsa.Workflows.Core.Services;
5+
using Elsa.Workflows.Core.Contracts;
6+
using Elsa.Workflows.Core.Memory;
77

88
var services = new ServiceCollection();
99
services.AddElsa();
1010

1111
var serviceProvider = services.BuildServiceProvider();
1212
var runner = serviceProvider.GetRequiredService<IWorkflowRunner>();
1313

14-
var magicNumber = new Variable<int>("magic-number");
14+
var magicNumber = new Variable<int>("magic-number", 0);
1515

1616
var workflow = new Sequence
1717
{
@@ -32,7 +32,6 @@
3232

3333
await runner.RunAsync(workflow);
3434

35-
3635
class GetRandom : Composite<int>
3736
{
3837
private readonly Variable<int> _random = new();
@@ -55,10 +54,10 @@ public GetRandom()
5554
};
5655
}
5756

58-
protected override void OnCompleted(ActivityExecutionContext context, ActivityExecutionContext childContext)
57+
protected override void OnCompleted(ActivityCompletedContext context)
5958
{
60-
var random = _random.Get<int>(context);
61-
context.Set(Result, random);
59+
var random = _random.Get<int>(context.ChildContext);
60+
context.ChildContext.Set(Result, random);
6261
}
6362
}
6463

projects/elsa/composite-activity/composite-activity.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<ImplicitUsings>true</ImplicitUsings>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Elsa" Version="3.0.0-preview.18" />
7+
<PackageReference Include="Elsa" Version="3.0.0-preview-preview-3.0.0-740-hotfix-1.771" />
88
</ItemGroup>
99
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.002.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "composite-activity", "composite-activity.csproj", "{87938C62-2C03-49C9-B20B-B2D249A2F4E3}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{87938C62-2C03-49C9-B20B-B2D249A2F4E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{87938C62-2C03-49C9-B20B-B2D249A2F4E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{87938C62-2C03-49C9-B20B-B2D249A2F4E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{87938C62-2C03-49C9-B20B-B2D249A2F4E3}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {A4DD1435-B4CF-4661-B065-9AF8006DE99B}
24+
EndGlobalSection
25+
EndGlobal

projects/elsa/for-activity/Program.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using Elsa.Expressions.Models;
22
using Elsa.Extensions;
33
using Elsa.Workflows.Core.Activities;
4+
using Elsa.Workflows.Core.Contracts;
5+
using Elsa.Workflows.Core.Memory;
46
using Elsa.Workflows.Core.Models;
57
using Elsa.Workflows.Core.Services;
68

@@ -10,7 +12,7 @@
1012
var serviceProvider = services.BuildServiceProvider();
1113
var runner = serviceProvider.GetRequiredService<IWorkflowRunner>();
1214

13-
var counter = new Variable<int>("counter");
15+
var counter = new Variable<int>("counter", 0);
1416
counter.Value = 1;
1517

1618
var workflow = new Sequence
@@ -20,7 +22,7 @@
2022
{
2123
new For(1, 10)
2224
{
23-
CurrentValue = new Output<MemoryBlockReference?>(counter),
25+
CurrentValue = new Output<object>(counter),
2426
Body = new Sequence
2527
{
2628
Activities =

projects/elsa/for-activity/for-activity.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<ImplicitUsings>true</ImplicitUsings>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Elsa" Version="3.0.0-preview.18" />
7+
<PackageReference Include="Elsa" Version="3.0.0-preview-preview-3.0.0-740-hotfix-1.771" />
88
</ItemGroup>
99
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.002.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "for-activity", "for-activity.csproj", "{395A446F-7329-4B18-A76E-B85D013C7A93}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{395A446F-7329-4B18-A76E-B85D013C7A93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{395A446F-7329-4B18-A76E-B85D013C7A93}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{395A446F-7329-4B18-A76E-B85D013C7A93}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{395A446F-7329-4B18-A76E-B85D013C7A93}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {4068C2BE-FEE8-4425-B0B2-466760C02F01}
24+
EndGlobalSection
25+
EndGlobal

projects/elsa/foreach-activity/Program.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
using Elsa.Expressions.Models;
21
using Elsa.Extensions;
32
using Elsa.Workflows.Core.Activities;
3+
using Elsa.Workflows.Core.Contracts;
4+
using Elsa.Workflows.Core.Memory;
45
using Elsa.Workflows.Core.Models;
5-
using Elsa.Workflows.Core.Services;
66

77
var services = new ServiceCollection();
88
services.AddElsa();
99

1010
var serviceProvider = services.BuildServiceProvider();
1111
var runner = serviceProvider.GetRequiredService<IWorkflowRunner>();
1212

13-
var counter = new Variable<int>("current");
13+
var counter = new Variable<int>("current", 0);
1414
var numbers = new[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" };
1515

1616
var workflow = new Sequence
1717
{
1818
Variables = { counter },
1919
Activities =
2020
{
21-
new ForEach(numbers)
21+
new ForEach()
2222
{
23+
Items = new Input<ICollection<object>>(numbers),
2324
CurrentValue = new Output<object>(counter),
2425
Body = new Sequence
2526
{

projects/elsa/foreach-activity/foreach-activity.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<ImplicitUsings>true</ImplicitUsings>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Elsa" Version="3.0.0-preview.18" />
7+
<PackageReference Include="Elsa" Version="3.0.0-preview-preview-3.0.0-740-hotfix-1.771" />
88
</ItemGroup>
99
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.002.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "foreach-activity", "foreach-activity.csproj", "{9ED18A15-FE53-441E-AE96-8F0CCDB89881}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{9ED18A15-FE53-441E-AE96-8F0CCDB89881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{9ED18A15-FE53-441E-AE96-8F0CCDB89881}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{9ED18A15-FE53-441E-AE96-8F0CCDB89881}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{9ED18A15-FE53-441E-AE96-8F0CCDB89881}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {3E633A85-02E5-4554-B406-43B08E0B7088}
24+
EndGlobalSection
25+
EndGlobal

0 commit comments

Comments
 (0)