diff --git a/Elsa.sln b/Elsa.sln
index be7573b3c..b379ef294 100644
--- a/Elsa.sln
+++ b/Elsa.sln
@@ -33,8 +33,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "activities", "activities",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Activities.Email", "src\activities\Elsa.Activities.Email\Elsa.Activities.Email.csproj", "{D20FCB88-9DCA-49EA-9CC2-5B94DD935D30}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Activities.Timers", "src\activities\Elsa.Activities.Timers\Elsa.Activities.Timers.csproj", "{E4B71DC4-3E73-49C3-9B4E-CA13909F222D}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Activities.MassTransit", "src\activities\Elsa.Activities.MassTransit\Elsa.Activities.MassTransit.csproj", "{C4939482-9447-47D1-B6AF-E9F8C6323841}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{5E5E1E84-DDBC-40D6-B891-0D563A15A44A}"
@@ -174,6 +172,7 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Activities.Timers.Hangfire", "src\activities\Elsa.Activities.Timers.Hangfire\Elsa.Activities.Timers.Hangfire.csproj", "{34FB968B-A147-4811-823D-D206FD0027AD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Samples.Timers.Hangfire", "src\samples\worker\Elsa.Samples.Timers.Hangfire\Elsa.Samples.Timers.Hangfire.csproj", "{7BDF193D-CD69-4D47-B7BF-A8A1D93EBCB9}"
+EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Activities.Entity", "src\activities\Elsa.Activities.Entity\Elsa.Activities.Entity.csproj", "{A0A8431F-3A2F-433A-BB0D-EB9627DFA739}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elsa.Samples.EntityChanged", "src\samples\console\Elsa.Samples.EntityChanged\Elsa.Samples.EntityChanged.csproj", "{A3149FE4-FD39-4DC2-AA9F-208C7216BC03}"
@@ -184,6 +183,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.DistributedLocking.Red
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.DistributedLocking.SqlServer", "src\locking\Elsa.DistributedLocking.SqlServer\Elsa.DistributedLocking.SqlServer.csproj", "{78F2A9DC-3092-4371-ABFE-87C5DA4DE351}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Activities.Timers", "src\activities\Elsa.Activities.Timers\Elsa.Activities.Timers.csproj", "{74E83393-50AF-41E3-A1C8-97202673CD85}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -210,10 +211,6 @@ Global
{D20FCB88-9DCA-49EA-9CC2-5B94DD935D30}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D20FCB88-9DCA-49EA-9CC2-5B94DD935D30}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D20FCB88-9DCA-49EA-9CC2-5B94DD935D30}.Release|Any CPU.Build.0 = Release|Any CPU
- {E4B71DC4-3E73-49C3-9B4E-CA13909F222D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E4B71DC4-3E73-49C3-9B4E-CA13909F222D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E4B71DC4-3E73-49C3-9B4E-CA13909F222D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E4B71DC4-3E73-49C3-9B4E-CA13909F222D}.Release|Any CPU.Build.0 = Release|Any CPU
{C4939482-9447-47D1-B6AF-E9F8C6323841}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4939482-9447-47D1-B6AF-E9F8C6323841}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4939482-9447-47D1-B6AF-E9F8C6323841}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -442,6 +439,10 @@ Global
{78F2A9DC-3092-4371-ABFE-87C5DA4DE351}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78F2A9DC-3092-4371-ABFE-87C5DA4DE351}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78F2A9DC-3092-4371-ABFE-87C5DA4DE351}.Release|Any CPU.Build.0 = Release|Any CPU
+ {74E83393-50AF-41E3-A1C8-97202673CD85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {74E83393-50AF-41E3-A1C8-97202673CD85}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {74E83393-50AF-41E3-A1C8-97202673CD85}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {74E83393-50AF-41E3-A1C8-97202673CD85}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -454,7 +455,6 @@ Global
{1D63E1B4-2386-4BEC-9090-C3F3CBF25703} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{B43B546E-23F3-46E8-ACB7-D04F05CDA180} = {DA71CDAA-8DD3-4D5F-9FBD-8E4B37A2D925}
{D20FCB88-9DCA-49EA-9CC2-5B94DD935D30} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
- {E4B71DC4-3E73-49C3-9B4E-CA13909F222D} = {37D2E628-5CC1-4C8E-8C02-3B0A29E2ACAA}
{C4939482-9447-47D1-B6AF-E9F8C6323841} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
{5E5E1E84-DDBC-40D6-B891-0D563A15A44A} = {DA71CDAA-8DD3-4D5F-9FBD-8E4B37A2D925}
{823F80B6-E241-43F7-83BD-29FBB58A77F9} = {B43B546E-23F3-46E8-ACB7-D04F05CDA180}
@@ -528,6 +528,7 @@ Global
{C3842132-35BC-4F6D-85CC-7098887F4307} = {7CD5C8D5-EC78-4A99-A514-F01CA7197AC8}
{C90CD39C-8CDD-4BCB-AB6A-CF981D468DD2} = {7CD5C8D5-EC78-4A99-A514-F01CA7197AC8}
{78F2A9DC-3092-4371-ABFE-87C5DA4DE351} = {7CD5C8D5-EC78-4A99-A514-F01CA7197AC8}
+ {74E83393-50AF-41E3-A1C8-97202673CD85} = {37D2E628-5CC1-4C8E-8C02-3B0A29E2ACAA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8B0975FD-7050-48B0-88C5-48C33378E158}
diff --git a/src/activities/Elsa.Activities.Timers.Hangfire/Elsa.Activities.Timers.Hangfire.csproj b/src/activities/Elsa.Activities.Timers.Hangfire/Elsa.Activities.Timers.Hangfire.csproj
index 39b013bb9..ffba7575e 100644
--- a/src/activities/Elsa.Activities.Timers.Hangfire/Elsa.Activities.Timers.Hangfire.csproj
+++ b/src/activities/Elsa.Activities.Timers.Hangfire/Elsa.Activities.Timers.Hangfire.csproj
@@ -7,7 +7,7 @@
netstandard2.0
Elsa is a set of workflow libraries and tools that enable lean and mean workflowing capabilities in any .NET Core application.
- This package provides Hangfire timer provider.
+ This package provides a Hangfire timer provider.
elsa, workflows, timers, background tasks
diff --git a/src/activities/Elsa.Activities.Timers.Hangfire/Jobs/RunHangfireWorkflowJob.cs b/src/activities/Elsa.Activities.Timers.Hangfire/Jobs/RunHangfireWorkflowJob.cs
index 06832ef7e..494c46395 100644
--- a/src/activities/Elsa.Activities.Timers.Hangfire/Jobs/RunHangfireWorkflowJob.cs
+++ b/src/activities/Elsa.Activities.Timers.Hangfire/Jobs/RunHangfireWorkflowJob.cs
@@ -5,6 +5,7 @@ using Elsa.Activities.Timers.Hangfire.Models;
using Elsa.Activities.Timers.Services;
using Elsa.Models;
using Elsa.Persistence;
+using Elsa.Persistence.Specifications;
using Elsa.Services;
using Hangfire;
@@ -42,7 +43,7 @@ namespace Elsa.Activities.Timers.Hangfire.Jobs
if (data.WorkflowInstanceId == null)
{
- if (workflowBlueprint.IsSingleton == false || await _workflowInstanceManager.GetWorkflowIsAlreadyExecutingAsync(data.TenantId, data.WorkflowDefinitionId) == false)
+ if (workflowBlueprint.IsSingleton == false || await GetWorkflowIsAlreadyExecutingAsync(data.TenantId, data.WorkflowDefinitionId) == false)
{
await _workflowRunner.RunWorkflowAsync(workflowBlueprint, data.ActivityId);
}
@@ -63,7 +64,7 @@ namespace Elsa.Activities.Timers.Hangfire.Jobs
}
// If it is a RecurringJob and the instance is null, the timer activity is a start trigger.
- if (data.IsRecurringJob && (workflowInstance == null || workflowInstance.Status is not (WorkflowStatus.Finished or WorkflowStatus.Cancelled)))
+ if (data.IsRecurringJob && (workflowInstance == null || workflowInstance.WorkflowStatus is not (WorkflowStatus.Finished or WorkflowStatus.Cancelled)))
{
var backgroundJobClient = _serviceProvider.GetRequiredService();
var crontabParer = _serviceProvider.GetRequiredService();
@@ -71,6 +72,13 @@ namespace Elsa.Activities.Timers.Hangfire.Jobs
backgroundJobClient.ScheduleWorkflow(data, crontabParer.GetNextOccurrence(data.CronExpression!).ToDateTimeOffset());
}
}
+
+ private async Task GetWorkflowIsAlreadyExecutingAsync(string? tenantId, string workflowDefinitionId)
+ {
+ var specification = new TenantSpecification(tenantId).WithWorkflowDefinition(workflowDefinitionId).And(new WorkflowIsAlreadyExecutingSpecification());
+ var count = await _workflowInstanceManager.CountAsync(specification);
+ return count > 0;
+ }
private async Task GetWorkflowInstanceAsync(string workflowInstanceId)
{
@@ -78,7 +86,7 @@ namespace Elsa.Activities.Timers.Hangfire.Jobs
for (var i = 0; i < TimerConsts.MaxRetrayGetWorkflow && workflowInstance == null; i++)
{
- workflowInstance = await _workflowInstanceManager.GetByIdAsync(workflowInstanceId);
+ workflowInstance = await _workflowInstanceManager.FindByIdAsync(workflowInstanceId);
if (workflowInstance == null)
{
diff --git a/src/activities/Elsa.Activities.Timers.Hangfire/Services/HangfireWorkflowScheduler.cs b/src/activities/Elsa.Activities.Timers.Hangfire/Services/HangfireWorkflowScheduler.cs
index 515987a41..08576ee52 100644
--- a/src/activities/Elsa.Activities.Timers.Hangfire/Services/HangfireWorkflowScheduler.cs
+++ b/src/activities/Elsa.Activities.Timers.Hangfire/Services/HangfireWorkflowScheduler.cs
@@ -65,7 +65,7 @@ namespace Elsa.Activities.Timers.Hangfire.Services
_backgroundJobClient.UnscheduleJobWhenAlreadyExists(
CreateData(workflowExecutionContext.WorkflowBlueprint,
activityId: activityId,
- workflowInstanceId: workflowExecutionContext.WorkflowInstance.WorkflowInstanceId)
+ workflowInstanceId: workflowExecutionContext.WorkflowInstance.Id)
);
return Task.CompletedTask;
diff --git a/src/activities/Elsa.Activities.Timers.Quartz/Elsa.Activities.Timers.Quartz.csproj b/src/activities/Elsa.Activities.Timers.Quartz/Elsa.Activities.Timers.Quartz.csproj
index 9508b204c..7e18914d0 100644
--- a/src/activities/Elsa.Activities.Timers.Quartz/Elsa.Activities.Timers.Quartz.csproj
+++ b/src/activities/Elsa.Activities.Timers.Quartz/Elsa.Activities.Timers.Quartz.csproj
@@ -7,7 +7,7 @@
netstandard2.0
Elsa is a set of workflow libraries and tools that enable lean and mean workflowing capabilities in any .NET Core application.
- This package provides Quartz timer provider.
+ This package provides a Quartz timer provider.
diff --git a/src/activities/Elsa.Activities.Timers.Quartz/Jobs/RunQuartzWorkflowJob.cs b/src/activities/Elsa.Activities.Timers.Quartz/Jobs/RunQuartzWorkflowJob.cs
index dcc10c2b4..3bcb6b97a 100644
--- a/src/activities/Elsa.Activities.Timers.Quartz/Jobs/RunQuartzWorkflowJob.cs
+++ b/src/activities/Elsa.Activities.Timers.Quartz/Jobs/RunQuartzWorkflowJob.cs
@@ -14,14 +14,14 @@ namespace Elsa.Activities.Timers.Quartz.Jobs
{
private readonly IWorkflowRunner _workflowRunner;
private readonly IWorkflowRegistry _workflowRegistry;
- private readonly IWorkflowInstanceStore _workflowInstanceManager;
+ private readonly IWorkflowInstanceStore _workflowInstanceStore;
private readonly ILogger _logger;
public RunQuartzWorkflowJob(IWorkflowRunner workflowRunner, IWorkflowRegistry workflowRegistry, IWorkflowInstanceStore workflowInstanceStore, ILogger logger)
{
_workflowRunner = workflowRunner;
_workflowRegistry = workflowRegistry;
- _workflowInstanceManager = workflowInstanceStore;
+ _workflowInstanceStore = workflowInstanceStore;
_logger = logger;
}
@@ -39,7 +39,7 @@ namespace Elsa.Activities.Timers.Quartz.Jobs
{
if (workflowBlueprint.IsSingleton)
{
- var hasExecutingWorkflow = (await _workflowInstanceManager.FindAsync(new WorkflowIsAlreadyExecutingSpecification().WithTenant(tenantId).WithWorkflowDefinition(workflowDefinitionId), cancellationToken)) != null;
+ var hasExecutingWorkflow = (await _workflowInstanceStore.FindAsync(new WorkflowIsAlreadyExecutingSpecification().WithTenant(tenantId).WithWorkflowDefinition(workflowDefinitionId), cancellationToken)) != null;
if (hasExecutingWorkflow)
return;
@@ -49,11 +49,11 @@ namespace Elsa.Activities.Timers.Quartz.Jobs
}
else
{
- var workflowInstance = await _workflowInstanceManager.FindByIdAsync(workflowInstanceId, cancellationToken);
+ var workflowInstance = await _workflowInstanceStore.FindByIdAsync(workflowInstanceId, cancellationToken);
if (workflowInstance == null)
{
- _logger.LogError("Could not run Workflow instance with ID {WorkflowInstanceId} because it is not in the database", data.WorkflowInstanceId);
+ _logger.LogError("Could not run Workflow instance with ID {WorkflowInstanceId} because it is not in the database", workflowInstanceId);
return;
}
@@ -67,7 +67,7 @@ namespace Elsa.Activities.Timers.Quartz.Jobs
for (var i = 0; i < TimerConsts.MaxRetrayGetWorkflow && workflowInstance == null; i++)
{
- workflowInstance = await _workflowInstanceManager.GetByIdAsync(workflowInstanceId, cancellationToken);
+ workflowInstance = await _workflowInstanceStore.FindByIdAsync(workflowInstanceId, cancellationToken);
if (workflowInstance == null)
{
diff --git a/src/activities/Elsa.Activities.Timers.Quartz/Services/QuartzWorkflowScheduler.cs b/src/activities/Elsa.Activities.Timers.Quartz/Services/QuartzWorkflowScheduler.cs
index 46564f21a..f13dd40cd 100644
--- a/src/activities/Elsa.Activities.Timers.Quartz/Services/QuartzWorkflowScheduler.cs
+++ b/src/activities/Elsa.Activities.Timers.Quartz/Services/QuartzWorkflowScheduler.cs
@@ -58,7 +58,7 @@ namespace Elsa.Activities.Timers.Quartz.Services
var scheduler = await _schedulerFactory.GetScheduler(cancellationToken);
var trigger = CreateTriggerKey(tenantId: workflowExecutionContext.WorkflowBlueprint.TenantId,
workflowDefinitionId: workflowExecutionContext.WorkflowBlueprint.Id,
- workflowInstanceId: workflowExecutionContext.WorkflowInstance.WorkflowInstanceId,
+ workflowInstanceId: workflowExecutionContext.WorkflowInstance.Id,
activityId: activityId);
var existingTrigger = await scheduler.GetTrigger(trigger, cancellationToken);
diff --git a/src/activities/Elsa.Activities.Timers/Activities/Cron/Cron.cs b/src/activities/Elsa.Activities.Timers/Activities/Cron/Cron.cs
index a7ce54a27..c0023aa97 100644
--- a/src/activities/Elsa.Activities.Timers/Activities/Cron/Cron.cs
+++ b/src/activities/Elsa.Activities.Timers/Activities/Cron/Cron.cs
@@ -24,7 +24,7 @@ namespace Elsa.Activities.Timers
private readonly IWorkflowScheduler _workflowScheduler;
private readonly ICrontabParser _crontabParser;
- public Cron(IWorkflowInstanceStore workflowInstanceStore, IWorkflowScheduler workflowScheduler, IClock clock)
+ public Cron(IWorkflowInstanceStore workflowInstanceStore, IWorkflowScheduler workflowScheduler, ICrontabParser crontabParser, IClock clock)
{
_clock = clock;
_workflowInstanceStore = workflowInstanceStore;
diff --git a/src/activities/Elsa.Activities.Timers/Elsa.Activities.Timers.csproj b/src/activities/Elsa.Activities.Timers/Elsa.Activities.Timers.csproj
index 9eb98db33..8eb959912 100644
--- a/src/activities/Elsa.Activities.Timers/Elsa.Activities.Timers.csproj
+++ b/src/activities/Elsa.Activities.Timers/Elsa.Activities.Timers.csproj
@@ -7,11 +7,6 @@
netstandard2.0
Elsa is a set of workflow libraries and tools that enable lean and mean workflowing capabilities in any .NET Core application.
-
- 2020
- https://github.com/elsa-workflows/elsa-core
- https://github.com/elsa-workflows/elsa-core
- GitHub
This package provides the following Timer activities:
* CronEvent
diff --git a/src/core/Elsa.Abstractions/Persistence/IStore.cs b/src/core/Elsa.Abstractions/Persistence/IStore.cs
index e655a51ac..7a7b1bb96 100644
--- a/src/core/Elsa.Abstractions/Persistence/IStore.cs
+++ b/src/core/Elsa.Abstractions/Persistence/IStore.cs
@@ -12,7 +12,7 @@ namespace Elsa.Persistence
Task DeleteAsync(T entity, CancellationToken cancellationToken = default);
Task DeleteManyAsync(ISpecification specification, CancellationToken cancellationToken = default);
Task> FindManyAsync(ISpecification specification, IOrderBy? orderBy = default, IPaging? paging = default, CancellationToken cancellationToken = default);
- Task CountAsync(ISpecification specification, IOrderBy? orderBy = default, CancellationToken cancellationToken = default);
+ Task CountAsync(ISpecification specification, CancellationToken cancellationToken = default);
Task FindAsync(ISpecification specification, CancellationToken cancellationToken = default);
}
}
\ No newline at end of file
diff --git a/src/core/Elsa.Core/Persistence/Decorators/EventPublishingWorkflowInstanceStore.cs b/src/core/Elsa.Core/Persistence/Decorators/EventPublishingWorkflowInstanceStore.cs
index 8c9a8314f..6bbecebab 100644
--- a/src/core/Elsa.Core/Persistence/Decorators/EventPublishingWorkflowInstanceStore.cs
+++ b/src/core/Elsa.Core/Persistence/Decorators/EventPublishingWorkflowInstanceStore.cs
@@ -45,8 +45,7 @@ namespace Elsa.Persistence.Decorators
public Task> FindManyAsync(ISpecification specification, IOrderBy? orderBy = default, IPaging? paging = default, CancellationToken cancellationToken = default) =>
_store.FindManyAsync(specification, orderBy, paging, cancellationToken);
- public Task CountAsync(ISpecification specification, IOrderBy? orderBy = default, CancellationToken cancellationToken = default) =>
- _store.CountAsync(specification, orderBy, cancellationToken);
+ public Task CountAsync(ISpecification specification, CancellationToken cancellationToken = default) => _store.CountAsync(specification, cancellationToken);
public Task FindAsync(ISpecification specification, CancellationToken cancellationToken = default) => _store.FindAsync(specification, cancellationToken);
}
diff --git a/src/core/Elsa.Core/Persistence/Decorators/InitializingWorkflowDefinitionStore.cs b/src/core/Elsa.Core/Persistence/Decorators/InitializingWorkflowDefinitionStore.cs
index 7e32ae167..1b5d16619 100644
--- a/src/core/Elsa.Core/Persistence/Decorators/InitializingWorkflowDefinitionStore.cs
+++ b/src/core/Elsa.Core/Persistence/Decorators/InitializingWorkflowDefinitionStore.cs
@@ -34,8 +34,7 @@ namespace Elsa.Persistence.Decorators
CancellationToken cancellationToken) =>
_store.FindManyAsync(specification, orderBy, paging, cancellationToken);
- public Task CountAsync(ISpecification specification, IOrderBy? orderBy, CancellationToken cancellationToken) =>
- _store.CountAsync(specification, orderBy, cancellationToken);
+ public Task CountAsync(ISpecification specification, CancellationToken cancellationToken) => _store.CountAsync(specification, cancellationToken);
public Task FindAsync(ISpecification specification, CancellationToken cancellationToken) => _store.FindAsync(specification, cancellationToken);
diff --git a/src/core/Elsa.Core/Persistence/InMemory/InMemoryStore.cs b/src/core/Elsa.Core/Persistence/InMemory/InMemoryStore.cs
index 94ea1a056..40a70381c 100644
--- a/src/core/Elsa.Core/Persistence/InMemory/InMemoryStore.cs
+++ b/src/core/Elsa.Core/Persistence/InMemory/InMemoryStore.cs
@@ -53,9 +53,9 @@ namespace Elsa.Persistence.InMemory
return Task.FromResult>(query.ToList());
}
- public Task CountAsync(ISpecification specification, IOrderBy? orderBy = default, CancellationToken cancellationToken = default)
+ public Task CountAsync(ISpecification specification, CancellationToken cancellationToken = default)
{
- var query = Entities.Values.AsQueryable().Apply(specification).Apply(orderBy);
+ var query = Entities.Values.AsQueryable().Apply(specification);
return Task.FromResult(query.Count());
}
diff --git a/src/persistence/Elsa.Persistence.MongoDb/Stores/MongoDbStore.cs b/src/persistence/Elsa.Persistence.MongoDb/Stores/MongoDbStore.cs
index 50f9aeba6..d2312d692 100644
--- a/src/persistence/Elsa.Persistence.MongoDb/Stores/MongoDbStore.cs
+++ b/src/persistence/Elsa.Persistence.MongoDb/Stores/MongoDbStore.cs
@@ -46,8 +46,8 @@ namespace Elsa.Persistence.MongoDb.Stores
public async Task> FindManyAsync(ISpecification specification, IOrderBy? orderBy = default, IPaging? paging = default, CancellationToken cancellationToken = default) =>
await Collection.AsQueryable().Apply(specification).Apply(orderBy).Apply(paging).ToListAsync(cancellationToken);
- public async Task CountAsync(ISpecification specification, IOrderBy? orderBy = default, CancellationToken cancellationToken = default) =>
- await Collection.AsQueryable().Apply(specification).Apply(orderBy).CountAsync(cancellationToken);
+ public async Task CountAsync(ISpecification specification, CancellationToken cancellationToken = default) =>
+ await Collection.AsQueryable().Apply(specification).CountAsync(cancellationToken);
public async Task FindAsync(ISpecification specification, CancellationToken cancellationToken = default) => await Collection.AsQueryable().Where(specification.ToExpression()).FirstOrDefaultAsync(cancellationToken);
diff --git a/src/persistence/Elsa.Persistence.YesSql/Stores/YesSqlStore.cs b/src/persistence/Elsa.Persistence.YesSql/Stores/YesSqlStore.cs
index c57b62d4f..e59e72b1f 100644
--- a/src/persistence/Elsa.Persistence.YesSql/Stores/YesSqlStore.cs
+++ b/src/persistence/Elsa.Persistence.YesSql/Stores/YesSqlStore.cs
@@ -66,7 +66,7 @@ namespace Elsa.Persistence.YesSql.Stores
return documents.Count;
}
- public async Task CountAsync(ISpecification specification, IOrderBy? orderBy = default, CancellationToken cancellationToken = default) => await Query(specification, orderBy).CountAsync();
+ public async Task CountAsync(ISpecification specification, CancellationToken cancellationToken = default) => await Query(specification).CountAsync();
public async Task FindAsync(ISpecification specification, CancellationToken cancellationToken = default)
{
diff --git a/src/samples/console/Elsa.Samples.HelloWorldConsole/Program.cs b/src/samples/console/Elsa.Samples.HelloWorldConsole/Program.cs
index 95d6bb910..9bd792553 100644
--- a/src/samples/console/Elsa.Samples.HelloWorldConsole/Program.cs
+++ b/src/samples/console/Elsa.Samples.HelloWorldConsole/Program.cs
@@ -38,9 +38,7 @@ namespace Elsa.Samples.HelloWorldConsole
OrderBySpecification.OrderByDescending(x => x.CreatedAt),
Paging.Page(1, 2));
- var count = await store.CountAsync(
- new WorkflowInstanceDefinitionIdSpecification(nameof(HelloWorld)),
- OrderBySpecification.OrderByDescending(x => x.CreatedAt));
+ var count = await store.CountAsync(new WorkflowInstanceDefinitionIdSpecification(nameof(HelloWorld)));
Console.WriteLine(count);
diff --git a/src/samples/worker/Elsa.Samples.Timers.Hangfire/RecurringTaskWorkflow.cs b/src/samples/worker/Elsa.Samples.Timers.Hangfire/RecurringTaskWorkflow.cs
index 2bd3840ce..27d303054 100644
--- a/src/samples/worker/Elsa.Samples.Timers.Hangfire/RecurringTaskWorkflow.cs
+++ b/src/samples/worker/Elsa.Samples.Timers.Hangfire/RecurringTaskWorkflow.cs
@@ -19,9 +19,9 @@ namespace Elsa.Samples.Timers
workflow
.AsSingleton()
.Timer(Duration.FromSeconds(30))
- .WriteLine(context => $"{context.WorkflowExecutionContext.WorkflowInstance.WorkflowInstanceId} triggered by timer at {_clock.GetCurrentInstant()}.")
+ .WriteLine(context => $"{context.WorkflowExecutionContext.WorkflowInstance.Id} triggered by timer at {_clock.GetCurrentInstant()}.")
.Timer(Duration.FromSeconds(30))
- .WriteLine(context => $"{context.WorkflowExecutionContext.WorkflowInstance.WorkflowInstanceId} resumed by timer at {_clock.GetCurrentInstant()}.");
+ .WriteLine(context => $"{context.WorkflowExecutionContext.WorkflowInstance.Id} resumed by timer at {_clock.GetCurrentInstant()}.");
}
}
}
\ No newline at end of file
diff --git a/src/samples/worker/Elsa.Samples.WhileLoopWorker/Program.cs b/src/samples/worker/Elsa.Samples.WhileLoopWorker/Program.cs
index 2232f1c9d..70dd727a3 100644
--- a/src/samples/worker/Elsa.Samples.WhileLoopWorker/Program.cs
+++ b/src/samples/worker/Elsa.Samples.WhileLoopWorker/Program.cs
@@ -1,8 +1,8 @@
+using Elsa.Activities.Timers;
using Elsa.Samples.WhileLoopWorker.Services;
using Elsa.Samples.WhileLoopWorker.Workflows;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
-using Elsa.Persistence.InMemory;
using Elsa.Persistence.YesSql.Extensions;
using Elsa.Samples.WhileLoopWorker.Activities;