Skip to content

Commit

Permalink
Merge branch 'patch/3.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmskywalker committed Feb 7, 2025
2 parents 466f6e6 + 0dcc15c commit 484a126
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/modules/Elsa.Hangfire/Jobs/ExecuteBackgroundActivityJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@ public async Task ExecuteAsync(ScheduledBackgroundActivity scheduledBackgroundAc
using var scope = tenantAccessor.PushContext(tenant);
await backgroundActivityInvoker.ExecuteAsync(scheduledBackgroundActivity, cancellationToken);
}

/// <summary>
/// Executes the job.
/// </summary>
[Obsolete("Use the other overload.")]
[UsedImplicitly]
public async Task ExecuteAsync(ScheduledBackgroundActivity scheduledBackgroundActivity, CancellationToken cancellationToken = default)
{
await backgroundActivityInvoker.ExecuteAsync(scheduledBackgroundActivity, cancellationToken);
}
}
16 changes: 16 additions & 0 deletions src/modules/Elsa.Hangfire/Jobs/ResumeWorkflowJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Elsa.Workflows.Runtime;
using Elsa.Workflows.Runtime.Messages;
using Hangfire;
using JetBrains.Annotations;

namespace Elsa.Hangfire.Jobs;

Expand Down Expand Up @@ -34,4 +35,19 @@ public async Task ExecuteAsync(string taskName, ScheduleExistingWorkflowInstance
};
await client.RunInstanceAsync(runRequest, cancellationToken);
}

[Obsolete("Use the other overload.")]
[UsedImplicitly]
public async Task ExecuteAsync(string taskName, ScheduleExistingWorkflowInstanceRequest request, CancellationToken cancellationToken)
{
var client = await workflowRuntime.CreateClientAsync(request.WorkflowInstanceId, cancellationToken);
var runRequest = new RunWorkflowInstanceRequest
{
BookmarkId = request.BookmarkId,
ActivityHandle = request.ActivityHandle,
Input = request.Input,
Properties = request.Properties
};
await client.RunInstanceAsync(runRequest, cancellationToken);
}
}
18 changes: 18 additions & 0 deletions src/modules/Elsa.Hangfire/Jobs/RunWorkflowJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Elsa.Workflows.Runtime;
using Elsa.Workflows.Runtime.Messages;
using Hangfire;
using JetBrains.Annotations;

namespace Elsa.Hangfire.Jobs;

Expand Down Expand Up @@ -36,4 +37,21 @@ public async Task ExecuteAsync(string taskName, ScheduleNewWorkflowInstanceReque
};
await client.CreateAndRunInstanceAsync(createAndRunRequest, cancellationToken);
}

[Obsolete("Use the other overload.")]
[UsedImplicitly]
public async Task ExecuteAsync(string taskName, ScheduleNewWorkflowInstanceRequest request, CancellationToken cancellationToken)
{
var client = await workflowRuntime.CreateClientAsync(cancellationToken);
var createAndRunRequest = new CreateAndRunWorkflowInstanceRequest
{
WorkflowDefinitionHandle = request.WorkflowDefinitionHandle,
TriggerActivityId = request.TriggerActivityId,
CorrelationId = request.CorrelationId,
Input = request.Input,
Properties = request.Properties,
ParentId = request.ParentId
};
await client.CreateAndRunInstanceAsync(createAndRunRequest, cancellationToken);
}
}

0 comments on commit 484a126

Please sign in to comment.