| | | 1 | | using Elsa.Workflows; |
| | | 2 | | using Elsa.Workflows.Models; |
| | | 3 | | using Elsa.Workflows.Options; |
| | | 4 | | |
| | | 5 | | namespace Elsa.Testing.Shared; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Bypasses validation and schedules the activity immediately. |
| | | 9 | | /// </summary> |
| | | 10 | | public class FakeWorkflowExecutionContextSchedulerStrategy : IWorkflowExecutionContextSchedulerStrategy |
| | | 11 | | { |
| | | 12 | | /// <summary> |
| | | 13 | | /// Schedules an activity within the workflow execution context. |
| | | 14 | | /// </summary> |
| | | 15 | | /// <param name="context">The workflow execution context within which the activity will be scheduled.</param> |
| | | 16 | | /// <param name="activityNode">The activity node representing the activity to be scheduled.</param> |
| | | 17 | | /// <param name="owner">The execution context owning the activity execution.</param> |
| | | 18 | | /// <param name="options">Optional scheduling options for configuring the behavior of the scheduling process.</param |
| | | 19 | | /// <returns>Returns an <see cref="ActivityWorkItem"/> representing the scheduled activity work item.</returns> |
| | | 20 | | public ActivityWorkItem Schedule(WorkflowExecutionContext context, ActivityNode activityNode, ActivityExecutionConte |
| | | 21 | | { |
| | 0 | 22 | | var workItem = new ActivityWorkItem(activityNode.Activity, owner); |
| | 0 | 23 | | context.Scheduler.Schedule(workItem); |
| | 0 | 24 | | return workItem; |
| | | 25 | | } |
| | | 26 | | } |