< Summary

Line coverage
84%
Covered lines: 294
Uncovered lines: 54
Coverable lines: 348
Total lines: 1058
Line coverage: 84.4%
Branch coverage
77%
Covered branches: 108
Total branches: 140
Branch coverage: 77.1%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: CanCancelActivity()100%22100%
File 1: WithdrawScheduledWork()100%11100%
File 1: CancelActivityAsync()50%2290.9%
File 1: CancelChildActivitiesAsync()50%2266.66%
File 2: CompleteActivityAsync()75%131281.81%
File 2: CompleteActivityWithOutcomesAsync(...)100%11100%
File 2: CompleteCompositeAsync()100%210%
File 3: .ctor(...)100%44100%
File 3: get_Id()100%11100%
File 3: get_StartedAt()100%11100%
File 3: get_Tag()100%11100%
File 3: get_CompletedAt()100%11100%
File 3: get_IsCompleted()100%22100%
File 3: get_IsExecuting()100%11100%
File 3: get_AggregateFaultCount()100%11100%
File 3: get_WorkflowExecutionContext()100%11100%
File 3: get_ParentActivityExecutionContext()100%11100%
File 3: set_ParentActivityExecutionContext(...)100%22100%
File 3: get_SchedulingActivityExecutionId()100%11100%
File 3: get_SchedulingActivityId()100%11100%
File 3: get_SchedulingWorkflowInstanceId()100%11100%
File 3: get_CallStackDepth()100%11100%
File 3: get_ExpressionExecutionContext()100%11100%
File 3: get_Variables()83.33%1212100%
File 3: get_DynamicVariables()100%11100%
File 3: get_Activity()100%11100%
File 3: get_ActivityDescriptor()100%11100%
File 3: get_CancellationToken()100%11100%
File 3: get_Status()100%11100%
File 3: set_Status(...)100%22100%
File 3: EnterExecution()100%11100%
File 3: TransitionTo(...)100%11100%
File 3: get_Exception()100%11100%
File 3: set_Exception(...)100%11100%
File 3: get_Properties()100%11100%
File 3: get_TransientProperties()100%11100%
File 3: get_Metadata()100%11100%
File 3: get_ActivityNode()100%11100%
File 3: get_NodeId()100%11100%
File 3: get_Children()100%11100%
File 3: get_Bookmarks()100%11100%
File 3: get_NewBookmarks()100%11100%
File 3: get_ExecutionCount()100%210%
File 3: get_WorkflowInput()100%11100%
File 3: get_ActivityInput()100%11100%
File 3: get_JournalData()100%11100%
File 3: get_ActivityState()100%11100%
File 3: get_IsDirty()100%11100%
File 3: ScheduleActivityAsync(...)100%22100%
File 3: ScheduleActivityAsync()100%11100%
File 3: ScheduleActivityAsync()100%11100%
File 3: ScheduleActivityAsync()100%210%
File 3: ScheduleActivitiesAsync()100%210%
File 3: ScheduleActivities(...)50%22100%
File 3: ScheduleActivities()100%22100%
File 3: CreateBookmarks(...)100%22100%
File 3: AddBookmarks(...)100%210%
File 3: AddBookmark(...)100%11100%
File 3: CreateBookmark(...)100%210%
File 3: CreateBookmark(...)100%11100%
File 3: CreateBookmark(...)100%210%
File 3: CreateBookmark(...)100%11100%
File 3: CreateBookmark(...)100%2424100%
File 3: ClearBookmarks()100%11100%
File 3: GetProperty(...)100%22100%
File 3: GetProperty(...)100%22100%
File 3: SetProperty(...)100%11100%
File 3: UpdateProperty(...)100%11100%
File 3: RemoveProperty(...)100%210%
File 3: GetMetadata(...)0%620%
File 3: GetMetadata(...)100%22100%
File 3: SetMetadata(...)100%11100%
File 3: UpdateMetadata(...)100%210%
File 3: RemoveMetadata(...)100%210%
File 3: GetRequiredService()100%11100%
File 3: GetRequiredService(...)100%11100%
File 3: GetOrCreateService()100%210%
File 3: GetOrCreateService(...)100%210%
File 3: GetService()100%11100%
File 3: GetServices()100%11100%
File 3: GetService(...)100%210%
File 3: Get(...)100%22100%
File 3: Get(...)0%620%
File 3: Get(...)100%22100%
File 3: Get(...)50%22100%
File 3: Get(...)100%22100%
File 3: TryGet(...)75%4477.77%
File 3: Set(...)100%11100%
File 3: Set(...)100%11100%
File 3: Set(...)57.14%382876.31%
File 3: GetOutputValueType(...)0%4260%
File 3: ClearCompletionCallbacks()100%11100%
File 3: Taint()100%22100%
File 3: ClearTaint()100%22100%
File 3: IncrementExecutionCount()100%11100%
File 3: GetMemoryBlock(...)100%22100%
File 3: System.IDisposable.Dispose()100%210%
File 4: AddExecutionLogEntry(...)100%44100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Contexts/ActivityExecutionContext.Cancel.cs

#LineLine coverage
 1using Elsa.Extensions;
 2using Elsa.Mediator.Contracts;
 3using Elsa.Workflows.Notifications;
 4using Elsa.Workflows.Signals;
 5
 6namespace Elsa.Workflows;
 7
 8public partial class ActivityExecutionContext
 9{
 10    private readonly INotificationSender _publisher;
 11
 12    private bool CanCancelActivity()
 13    {
 273114        return Status is not ActivityStatus.Canceled and not ActivityStatus.Completed;
 15    }
 16
 17    /// <summary>
 18    /// Withdraws work that the engine has not invoked yet and that this activity's cancellation makes obsolete: the
 19    /// work item that would have started this activity, and the work items this activity scheduled for children whose
 20    /// execution contexts do not exist yet. Without this, a container could tear a branch down and still have an
 21    /// activity from that branch execute afterwards, side effects and all.
 22    /// </summary>
 23    /// <remarks>
 24    /// The work items are removed from the scheduler rather than left to be dequeued and discarded, because the
 25    /// scheduler is not write-only: containers such as <c>Flowchart</c> ask it whether they still have pending work,
 26    /// and a withdrawn item left in the queue would keep answering yes.
 27    /// </remarks>
 28    internal void WithdrawScheduledWork()
 29    {
 3030        WorkflowExecutionContext.Scheduler.RemoveWhere(workItem => workItem.ExistingActivityExecutionContext == this || 
 1131    }
 32
 33    private async Task CancelActivityAsync()
 34    {
 635        if(!CanCancelActivity())
 036            return;
 37
 638        WithdrawScheduledWork();
 639        TransitionTo(ActivityStatus.Canceled);
 640        ClearBookmarks();
 641        ClearCompletionCallbacks();
 1142        WorkflowExecutionContext.Bookmarks.RemoveWhere(x => x.ActivityNodeId == NodeId);
 643        AddExecutionLogEntry("Canceled");
 644        await this.SendSignalAsync(new CancelSignal());
 645        await CancelChildActivitiesAsync();
 46
 47        // ReSharper disable once MethodSupportsCancellation
 648        await _publisher.SendAsync(new ActivityCancelled(this));
 649    }
 50
 51    private async Task CancelChildActivitiesAsync()
 52    {
 3253        var childContexts = WorkflowExecutionContext.ActivityExecutionContexts.Where(x => x.ParentActivityExecutionConte
 54
 1255        foreach (var childContext in childContexts)
 056            await childContext.CancelActivityAsync();
 657    }
 58}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Contexts/ActivityExecutionContext.Complete.cs

#LineLine coverage
 1using Elsa.Extensions;
 2using Elsa.Mediator.Contracts;
 3using Elsa.Workflows.Activities.Flowchart.Models;
 4using Elsa.Workflows.Signals;
 5
 6namespace Elsa.Workflows;
 7
 8public partial class ActivityExecutionContext
 9{
 10    /// <summary>
 11    /// Complete the current activity. This should only be called by activities that explicitly suppress automatic-compl
 12    /// </summary>
 13    public async ValueTask CompleteActivityAsync(object? result = null)
 14    {
 345515        var outcomes = result as Outcomes;
 16
 17        // If the activity is executing in the background, simply capture the result and return.
 345518        if (this.GetIsBackgroundExecution())
 19        {
 020            if (outcomes != null)
 021                this.SetBackgroundOutcomes(outcomes.Names);
 22            else
 023                this.SetBackgroundCompletion();
 024            return;
 25        }
 26
 27        // If the activity is not running, do nothing.
 345528        if (Status != ActivityStatus.Running)
 729            return;
 30
 31        // Cancel any non-completed child activities.
 617332        var childContexts = Children.Where(x => x.CanCancelActivity()).ToList();
 33
 690834        foreach (var childContext in childContexts)
 635            await childContext.CancelActivityAsync();
 36
 37        // Mark the activity as complete.
 344838        TransitionTo(ActivityStatus.Completed);
 39
 40        // Record the outcomes, if any.
 344841        if (outcomes != null)
 10542            JournalData["Outcomes"] = outcomes.Names;
 43
 44        // Add an execution log entry.
 344845        AddExecutionLogEntry("Completed");
 46
 47        // Send a signal.
 344848        await this.SendSignalAsync(new ActivityCompleted(result));
 49
 50        // Clear bookmarks.
 344851        ClearBookmarks();
 348152        WorkflowExecutionContext.Bookmarks.RemoveWhere(x => x.ActivityInstanceId == Id);
 53
 54        // Remove completion callbacks.
 344855        ClearCompletionCallbacks();
 56
 57        // Remove all associated variables, unless this is the root context - in which case we want to keep the variable
 344858        if (ParentActivityExecutionContext != null)
 59        {
 278660            var variablePersistenceManager = GetRequiredService<IVariablePersistenceManager>();
 278661            await variablePersistenceManager.DeleteVariablesAsync(this);
 62        }
 63
 64        // Update the completed at timestamp.
 344865        CompletedAt = WorkflowExecutionContext.SystemClock.UtcNow;
 345566    }
 67
 68    /// <summary>
 69    /// Complete the current activity with the specified outcomes.
 70    /// </summary>
 71    public ValueTask CompleteActivityWithOutcomesAsync(params string[] outcomes)
 72    {
 10073        return CompleteActivityAsync(new Outcomes(outcomes));
 74    }
 75
 76    /// <summary>
 77    /// Complete the current composite activity with the specified outcome.
 78    /// </summary>
 79    public async ValueTask CompleteCompositeAsync(params string[] outcomes)
 80    {
 081        await this.SendSignalAsync(new CompleteCompositeSignal(new Outcomes(outcomes)));
 082    }
 83}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Contexts/ActivityExecutionContext.cs

#LineLine coverage
 1using System.Runtime.CompilerServices;
 2using Elsa.Common;
 3using Elsa.Expressions.Helpers;
 4using Elsa.Expressions.Models;
 5using Elsa.Extensions;
 6using Elsa.Mediator.Contracts;
 7using Elsa.Workflows.Exceptions;
 8using Elsa.Workflows.Memory;
 9using Elsa.Workflows.Models;
 10using Elsa.Workflows.Options;
 11using JetBrains.Annotations;
 12
 13namespace Elsa.Workflows;
 14
 15/// <summary>
 16/// Represents the context of an activity execution.
 17/// </summary>
 18[PublicAPI]
 19public partial class ActivityExecutionContext : IExecutionContext, IDisposable
 20{
 21    private readonly ISystemClock _systemClock;
 22    private ActivityStatus _status;
 23    private Exception? _exception;
 24    private long _executionCount;
 25    private ActivityExecutionContext? _parentActivityExecutionContext;
 26
 27    // Bookmarks created during the lifetime of this activity.
 407728    private List<Bookmark> _newBookmarks = [];
 29
 30    /// <summary>
 31    /// Initializes a new instance of the <see cref="ActivityExecutionContext"/> class.
 32    /// </summary>
 407733    public ActivityExecutionContext(
 407734        string id,
 407735        WorkflowExecutionContext workflowExecutionContext,
 407736        ActivityExecutionContext? parentActivityExecutionContext,
 407737        IActivity activity,
 407738        ActivityDescriptor activityDescriptor,
 407739        DateTimeOffset startedAt,
 407740        object? tag,
 407741        ISystemClock systemClock,
 407742        CancellationToken cancellationToken)
 43    {
 407744        _systemClock = systemClock;
 407745        Properties = new ChangeTrackingDictionary<string, object>(Taint);
 407746        Metadata = new ChangeTrackingDictionary<string, object>(Taint);
 407747        ActivityState = new ChangeTrackingDictionary<string, object>(Taint);
 407748        ActivityInput = new ChangeTrackingDictionary<string, object>(Taint);
 407749        WorkflowExecutionContext = workflowExecutionContext;
 407750        ParentActivityExecutionContext = parentActivityExecutionContext;
 407751        var expressionExecutionContextProps = ExpressionExecutionContextExtensions.CreateActivityExecutionContextPropert
 407752        expressionExecutionContextProps[ExpressionExecutionContextExtensions.ActivityKey] = activity;
 407753        ExpressionExecutionContext = new(workflowExecutionContext.ServiceProvider, new(), parentActivityExecutionContext
 407754        Activity = activity;
 407755        ActivityDescriptor = activityDescriptor;
 407756        StartedAt = startedAt;
 407757        Status = ActivityStatus.Pending;
 407758        Tag = tag;
 407759        CancellationToken = cancellationToken;
 407760        Id = id;
 407761        _publisher = GetRequiredService<INotificationSender>();
 407762    }
 63
 64    /// <summary>
 65    /// The ID of the current activity execution context.
 66    /// </summary>
 4730967    public string Id { get; set; }
 68
 69    /// <summary>
 70    /// The time at which the activity execution context was created.
 71    /// </summary>
 835972    public DateTimeOffset StartedAt { get; set; }
 73
 74    /// <summary>
 75    /// An optional tag to associate with the activity execution.
 76    /// </summary>
 777177    public object? Tag { get; set; }
 78
 79    /// <summary>
 80    /// The time at which the activity execution context was completed.
 81    /// </summary>
 772582    public DateTimeOffset? CompletedAt { get; set; }
 83
 84    /// <summary>
 85    /// Returns true if the activity execution context has completed.
 86    /// </summary>
 1358987    public bool IsCompleted => Status is ActivityStatus.Completed or ActivityStatus.Canceled;
 88
 89    /// <summary>
 90    /// Gets or sets a value indicating whether the activity is actively executing.
 91    /// </summary>
 92    /// <remarks>
 93    /// This flag is set to <c>true</c> immediately before the activity begins execution
 94    /// and is set to <c>false</c> once the execution is completed.
 95    /// It can be used to determine if an activity was in-progress in case of unexpected
 96    /// application termination, allowing the system to retry execution upon restarting.
 97    /// </remarks>
 751398    public bool IsExecuting { get; set; }
 99
 100    /// <summary>
 101    /// The number of faults encountered during the execution of the activity and its descendants.
 102    /// </summary>
 4455103    public int AggregateFaultCount { get; set; }
 104
 105    /// <summary>
 106    /// The workflow execution context.
 107    /// </summary>
 171595108    public WorkflowExecutionContext WorkflowExecutionContext { get; }
 109
 110    /// <summary>
 111    /// The parent activity execution context, if any.
 112    /// This represents the structural container activity (e.g., Flowchart contains all its children).
 113    /// </summary>
 114    public ActivityExecutionContext? ParentActivityExecutionContext
 115    {
 62913116        get => _parentActivityExecutionContext;
 117        internal set
 118        {
 4174119            _parentActivityExecutionContext = value;
 4174120            _parentActivityExecutionContext?.Children.Add(this);
 3003121        }
 122    }
 123
 124    /// <summary>
 125    /// The ID of the activity execution context that scheduled this activity execution.
 126    /// This represents the temporal/execution predecessor that directly triggered execution of this activity,
 127    /// distinct from <see cref="ParentActivityExecutionContext"/> which represents the structural container.
 128    /// For example, in a Flowchart, Activity B might complete and schedule Activity C, making B the scheduling activity
 129    /// </summary>
 7570130    public string? SchedulingActivityExecutionId { get; set; }
 131
 132    /// <summary>
 133    /// The ID of the activity that scheduled this activity execution (denormalized for convenience).
 134    /// This is the Activity.Id from the activity execution context identified by <see cref="SchedulingActivityExecution
 135    /// </summary>
 6313136    public string? SchedulingActivityId { get; set; }
 137
 138    /// <summary>
 139    /// The workflow instance ID of the workflow that scheduled this activity execution.
 140    /// This is set when crossing workflow boundaries (e.g., via ExecuteWorkflow or DispatchWorkflow).
 141    /// For activities within the same workflow instance, this will be null.
 142    /// </summary>
 7539143    public string? SchedulingWorkflowInstanceId { get; set; }
 144
 145    /// <summary>
 146    /// The depth of this activity in the call stack (0 for root activities).
 147    /// </summary>
 9999148    public int CallStackDepth { get; set; }
 149
 150    /// <summary>
 151    /// The expression execution context.
 152    /// </summary>
 49488153    public ExpressionExecutionContext ExpressionExecutionContext { get; }
 154
 155    /// <inheritdoc />
 156    public IEnumerable<Variable> Variables
 157    {
 158        get
 159        {
 6440160            var containerVariables = (Activity as IVariableContainer)?.Variables ?? Enumerable.Empty<Variable>();
 6440161            var dynamicVariables = DynamicVariables;
 6440162            var mergedVariables = new Dictionary<string, Variable>();
 163
 13160164            foreach (var containerVariable in containerVariables)
 165            {
 140166                var name = !string.IsNullOrEmpty(containerVariable.Name) ? containerVariable.Name : containerVariable.Id
 140167                mergedVariables[name] = containerVariable;
 168            }
 169
 13362170            foreach (var dynamicVariable in dynamicVariables)
 171            {
 241172                var name = !string.IsNullOrEmpty(dynamicVariable.Name) ? dynamicVariable.Name : dynamicVariable.Id;
 241173                mergedVariables[name] = dynamicVariable;
 174            }
 6440175            return mergedVariables.Values;
 176        }
 177    }
 178
 179    /// <summary>
 180    /// A list of variables that are dynamically added to the activity execution context.
 181    /// </summary>
 11564182    public ICollection<Variable> DynamicVariables { get; set; } = new List<Variable>();
 183
 184    /// <summary>
 185    /// The currently executing activity.
 186    /// </summary>
 202689187    public IActivity Activity { get; set; }
 188
 189    /// <summary>
 190    /// The activity descriptor.
 191    /// </summary>
 26319192    public ActivityDescriptor ActivityDescriptor { get; }
 193
 194    /// <summary>
 195    /// A cancellation token to use when invoking asynchronous operations.
 196    /// </summary>
 35022197    public CancellationToken CancellationToken { get; }
 198
 199    /// <summary>
 200    /// The current status of the activity.
 201    /// </summary>
 202    public ActivityStatus Status
 203    {
 50633204        get => _status;
 205        private set
 206        {
 11537207            if (value == _status)
 4115208                return;
 209
 7422210            _status = value;
 7422211            Taint();
 7422212        }
 213    }
 214
 215    public IDisposable EnterExecution()
 216    {
 3351217        return new WorkflowExecutionState(this);
 218    }
 219
 220    /// <summary>
 221    /// Sets the current status of the activity.
 222    /// </summary>
 223    public void TransitionTo(ActivityStatus status)
 224    {
 7460225        Status = status;
 7460226    }
 227
 228    /// <summary>
 229    /// Gets or sets the exception that occurred during the activity execution, if any.
 230    /// </summary>
 231    public Exception? Exception
 232    {
 3471233        get => _exception;
 234        set
 235        {
 39236            _exception = value;
 39237            Taint();
 39238        }
 239    }
 240
 241    /// <inheritdoc />
 13738242    public IDictionary<string, object> Properties { get; private set; }
 243
 244    /// <summary>
 245    /// A transient dictionary of values that can be associated with this activity execution context.
 246    /// These properties only exist while the activity executes and are not persisted.
 247    /// </summary>
 45188248    public IDictionary<object, object> TransientProperties { get; set; } = new Dictionary<object, object>();
 249
 250    /// <summary>
 251    /// A dictionary of metadata about this execution. In contrast to <see cref="Properties"/>, this metadata is never p
 252    /// </summary>
 8416253    public IDictionary<string, object> Metadata { get; private set; }
 254
 255    /// <summary>
 256    /// Returns the <see cref="ActivityNode"/> metadata about the current activity.
 257    /// </summary>
 32556258    public ActivityNode ActivityNode => WorkflowExecutionContext.FindNodeByActivity(Activity)!;
 259
 260    /// <summary>
 261    /// Returns the global node ID for the current activity within the graph.
 262    /// </summary>
 263    /// <remarks>As of tool version 3.0, all activity IDs are already unique, so there's no need to construct a hierarch
 11266264    public string NodeId => ActivityNode.NodeId;
 265
 15042266    public ISet<ActivityExecutionContext> Children { get; } = new HashSet<ActivityExecutionContext>();
 267
 268    /// <summary>
 269    /// A list of bookmarks associated with the current activity.
 270    /// </summary>
 3643271    public IEnumerable<Bookmark> Bookmarks => WorkflowExecutionContext.Bookmarks.Where(x => x.ActivityInstanceId == Id);
 272
 273    /// <summary>
 274    /// A collection of bookmarks created during the execution of the activity.
 275    /// </summary>
 718276    public IEnumerable<Bookmark> NewBookmarks => _newBookmarks.AsReadOnly();
 277
 278    /// <summary>
 279    /// The number of times this <see cref="ActivityExecutionContext"/> has executed.
 280    /// </summary>
 0281    public long ExecutionCount => _executionCount;
 282
 283    /// <summary>
 284    /// A dictionary of received inputs for the current workflow.
 285    /// </summary>
 292286    public IDictionary<string, object> WorkflowInput => WorkflowExecutionContext.Input;
 287
 288    /// <summary>
 289    /// A dictionary of inputs for the current activity.
 290    /// </summary>
 8284291    public IDictionary<string, object> ActivityInput { get; private set; }
 292
 293    /// <summary>
 294    /// Journal data will be added to the workflow execution log for the "Executed" event.
 295    /// </summary>
 296    // ReSharper disable once CollectionNeverQueried.Global
 7695297    public IDictionary<string, object> JournalData { get; } = new Dictionary<string, object>();
 298
 299    /// <summary>
 300    /// Stores the evaluated inputs, serialized, for the current activity for historical purposes.
 301    /// </summary>
 10530302    public IDictionary<string, object> ActivityState { get; }
 303
 304    /// <summary>
 305    /// Indicates whether the state of the current activity execution context has been modified.
 306    /// </summary>
 35264307    public bool IsDirty { get; private set; }
 308
 309    /// <summary>
 310    /// Schedules the specified activity to be executed.
 311    /// </summary>
 312    /// <param name="activity">The activity to schedule.</param>
 313    /// <param name="completionCallback">An optional callback to invoke when the activity completes.</param>
 314    /// <param name="tag">An optional tag to associate with the activity execution.</param>
 315    /// <param name="variables">An optional list of variables to declare with the activity execution.</param>
 316    public ValueTask ScheduleActivityAsync(IActivity? activity, ActivityCompletionCallback? completionCallback, object? 
 317    {
 2158318        var options = new ScheduleWorkOptions
 2158319        {
 2158320            CompletionCallback = completionCallback,
 2158321            Tag = tag,
 2158322            Variables = variables?.ToList()
 2158323        };
 2158324        return ScheduleActivityAsync(activity, options);
 325    }
 326
 327    /// <summary>
 328    /// Schedules the specified activity to be executed.
 329    /// </summary>
 330    /// <param name="activity">The activity to schedule.</param>
 331    /// <param name="options">The options used to schedule the activity.</param>
 332    public async ValueTask ScheduleActivityAsync(IActivity? activity, ScheduleWorkOptions? options = null)
 333    {
 3080334        await ScheduleActivityAsync(activity, this, options);
 3080335    }
 336
 337    /// <summary>
 338    /// Schedules the specified activity to be executed.
 339    /// </summary>
 340    /// <param name="activity">The activity to schedule.</param>
 341    /// <param name="owner">The activity execution context that owns the scheduled activity.</param>
 342    /// <param name="options">The options used to schedule the activity.</param>
 343    public async ValueTask ScheduleActivityAsync(IActivity? activity, ActivityExecutionContext? owner, ScheduleWorkOptio
 344    {
 3080345        var schedulerStrategy = GetRequiredService<IActivityExecutionContextSchedulerStrategy>();
 3080346        await schedulerStrategy.ScheduleActivityAsync(this, activity, owner, options);
 3080347    }
 348
 349    /// <summary>
 350    /// Schedules the specified activity to be executed.
 351    /// </summary>
 352    /// <param name="activityNode">The activity node to schedule.</param>
 353    /// <param name="owner">The activity execution context that owns the scheduled activity.</param>
 354    /// <param name="options">The options used to schedule the activity.</param>
 355    public async Task ScheduleActivityAsync(ActivityNode? activityNode, ActivityExecutionContext? owner = null, Schedule
 356    {
 0357        var schedulerStrategy = GetRequiredService<IActivityExecutionContextSchedulerStrategy>();
 0358        await schedulerStrategy.ScheduleActivityAsync(this, activityNode, owner, options);
 0359    }
 360
 361    /// <summary>
 362    /// Schedules the specified activities to be executed.
 363    /// </summary>
 364    /// <param name="activities">The activities to schedule.</param>
 0365    public async ValueTask ScheduleActivitiesAsync(params IActivity?[] activities) => await ScheduleActivities(activitie
 366
 367    /// <summary>
 368    /// Schedules the specified activities to be executed.
 369    /// </summary>
 370    /// <param name="activities">The activities to schedule.</param>
 371    /// <param name="completionCallback">The callback to invoke when the activities complete.</param>
 372    /// <param name="tag">An optional tag to associate with the activity execution.</param>
 373    /// <param name="variables">An optional list of variables to declare with the activity execution.</param>
 374    public ValueTask ScheduleActivities(IEnumerable<IActivity?> activities, ActivityCompletionCallback? completionCallba
 375    {
 8376        var options = new ScheduleWorkOptions
 8377        {
 8378            CompletionCallback = completionCallback,
 8379            Tag = tag,
 8380            Variables = variables?.ToList()
 8381        };
 8382        return ScheduleActivities(activities, options);
 383    }
 384
 385    /// <summary>
 386    /// Schedules the specified activities to be executed.
 387    /// </summary>
 388    /// <param name="activities">The activities to schedule.</param>
 389    /// <param name="options">The options used to schedule the activities.</param>
 390    public async ValueTask ScheduleActivities(IEnumerable<IActivity?> activities, ScheduleWorkOptions? options = null)
 391    {
 48392        foreach (var activity in activities)
 16393            await ScheduleActivityAsync(activity, options);
 8394    }
 395
 396    /// <summary>
 397    /// Creates a bookmark for each payload.
 398    /// </summary>
 399    /// <param name="payloads">The payloads to create bookmarks for.</param>
 400    /// <param name="callback">An optional callback that is invoked when the bookmark is resumed.</param>
 401    /// <param name="includeActivityInstanceId">Whether or not the activity instance ID should be included in the bookma
 402    /// <param name="bookmarkName">An optional name to use for the bookmark. Defaults to the activity type.</param>
 403    public void CreateBookmarks(IEnumerable<object> payloads, ExecuteActivityDelegate? callback = null, bool includeActi
 404    {
 28405        foreach (var payload in payloads)
 7406            CreateBookmark(new()
 7407            {
 7408                Stimulus = payload,
 7409                Callback = callback,
 7410                BookmarkName = bookmarkName,
 7411                IncludeActivityInstanceId = includeActivityInstanceId
 7412            });
 7413    }
 414
 415    /// <summary>
 416    /// Adds each bookmark to the list of bookmarks.
 417    /// </summary>
 418    /// <param name="bookmarks">The bookmarks to add.</param>
 419    public void AddBookmarks(IEnumerable<Bookmark> bookmarks)
 420    {
 0421        WorkflowExecutionContext.Bookmarks.AddRange(bookmarks);
 0422        Taint();
 0423    }
 424
 425    /// <summary>
 426    /// Adds a bookmark to the list of bookmarks.
 427    /// </summary>
 428    /// <param name="bookmark">The bookmark to add.</param>
 429    public void AddBookmark(Bookmark bookmark)
 430    {
 81431        _newBookmarks.Add(bookmark);
 81432        WorkflowExecutionContext.Bookmarks.Add(bookmark);
 81433        Taint();
 81434    }
 435
 436    /// <summary>
 437    /// Creates a bookmark so that this activity can be resumed at a later time.
 438    /// </summary>
 439    /// <param name="callback">An optional callback that is invoked when the bookmark is resumed.</param>
 440    /// <param name="metadata">Custom properties to associate with the bookmark.</param>
 441    /// <returns>The created bookmark.</returns>
 442    public Bookmark CreateBookmark(ExecuteActivityDelegate callback, IDictionary<string, string>? metadata = null)
 443    {
 0444        return CreateBookmark(new()
 0445        {
 0446            Callback = callback,
 0447            Metadata = metadata
 0448        });
 449    }
 450
 451    /// <summary>
 452    /// Creates a bookmark so that this activity can be resumed at a later time.
 453    /// </summary>
 454    /// <param name="stimulus">The payload to associate with the bookmark.</param>
 455    /// <param name="callback">An optional callback that is invoked when the bookmark is resumed.</param>
 456    /// <param name="includeActivityInstanceId">Whether or not the activity instance ID should be included in the bookma
 457    /// <param name="customProperties">Custom properties to associate with the bookmark.</param>
 458    /// <returns>The created bookmark.</returns>
 459    public Bookmark CreateBookmark(object stimulus, ExecuteActivityDelegate? callback, bool includeActivityInstanceId = 
 460    {
 1461        return CreateBookmark(new()
 1462        {
 1463            Stimulus = stimulus,
 1464            Callback = callback,
 1465            IncludeActivityInstanceId = includeActivityInstanceId,
 1466            Metadata = customProperties
 1467        });
 468    }
 469
 470    /// <summary>
 471    /// Creates a bookmark for the current activity execution context.
 472    /// </summary>
 473    /// <param name="stimulus">The payload to associate with the bookmark.</param>
 474    /// <param name="includeActivityInstanceId">Specifies whether to include the activity instance ID in the bookmark in
 475    /// <param name="customProperties">Additional custom properties to associate with the bookmark. Defaults to null.</p
 476    /// <returns>The created bookmark.</returns>
 477    public Bookmark CreateBookmark(object stimulus, bool includeActivityInstanceId, IDictionary<string, string>? customP
 478    {
 0479        return CreateBookmark(new()
 0480        {
 0481            Stimulus = stimulus,
 0482            IncludeActivityInstanceId = includeActivityInstanceId,
 0483            Metadata = customProperties
 0484        });
 485    }
 486
 487    /// <summary>
 488    /// Creates a bookmark so that this activity can be resumed at a later time.
 489    /// </summary>
 490    /// <param name="stimulus">The payload to associate with the bookmark.</param>
 491    /// <param name="metadata">Custom properties to associate with the bookmark.</param>
 492    /// <returns>The created bookmark.</returns>
 493    public Bookmark CreateBookmark(object stimulus, IDictionary<string, string>? metadata = null)
 494    {
 16495        return CreateBookmark(new()
 16496        {
 16497            Stimulus = stimulus,
 16498            Metadata = metadata
 16499        });
 500    }
 501
 502    /// <summary>
 503    /// Creates a bookmark so that this activity can be resumed at a later time.
 504    /// Creating a bookmark will automatically suspend the workflow after all pending activities have executed.
 505    /// </summary>
 506    public Bookmark CreateBookmark(CreateBookmarkArgs? options = null)
 507    {
 81508        var payload = options?.Stimulus;
 81509        var callback = options?.Callback;
 81510        var bookmarkName = options?.BookmarkName ?? Activity.Type;
 81511        var bookmarkHasher = GetRequiredService<IStimulusHasher>();
 81512        var identityGenerator = GetRequiredService<IIdentityGenerator>();
 81513        var includeActivityInstanceId = options?.IncludeActivityInstanceId ?? true;
 81514        var hash = bookmarkHasher.Hash(bookmarkName, payload, includeActivityInstanceId ? Id : null);
 81515        var bookmarkId = options?.BookmarkId ?? identityGenerator.GenerateId();
 516
 81517        var bookmark = new Bookmark(
 81518            bookmarkId,
 81519            bookmarkName,
 81520            hash,
 81521            payload,
 81522            Activity.Id,
 81523            ActivityNode.NodeId,
 81524            Id,
 81525            _systemClock.UtcNow,
 81526            options?.AutoBurn ?? true,
 81527            callback?.Method.Name,
 81528            options?.AutoComplete ?? true,
 81529            options?.Metadata);
 530
 81531        AddBookmark(bookmark);
 81532        return bookmark;
 533    }
 534
 535    /// <summary>
 536    /// Clear all bookmarks.
 537    /// </summary>
 538    public void ClearBookmarks()
 539    {
 3459540        _newBookmarks.Clear();
 3534541        WorkflowExecutionContext.Bookmarks.RemoveWhere(x => x.ActivityInstanceId == Id);
 3459542        Taint();
 3459543    }
 544
 545    /// <summary>
 546    /// Returns a property value associated with the current activity context.
 547    /// </summary>
 1692548    public T? GetProperty<T>(string key) => Properties.TryGetValue<T?>(key, out var value) ? value : default;
 549
 550    /// <summary>
 551    /// Returns a property value associated with the current activity context.
 552    /// </summary>
 553    public T GetProperty<T>(string key, Func<T> defaultValue)
 554    {
 136555        if (Properties.TryGetValue<T?>(key, out var value))
 102556            return value!;
 557
 34558        value = defaultValue();
 34559        Properties[key] = value!;
 560
 34561        return value!;
 562    }
 563
 564    /// <summary>
 565    /// Stores a property associated with the current activity context.
 566    /// </summary>
 176567    public void SetProperty<T>(string key, T? value) => Properties[key] = value!;
 568
 569    /// <summary>
 570    /// Updates a property associated with the current activity context.
 571    /// </summary>
 572    public T UpdateProperty<T>(string key, Func<T?, T> updater) where T : notnull
 573    {
 392574        var value = GetProperty<T?>(key);
 392575        value = updater(value);
 392576        Properties[key] = value;
 392577        return value;
 578    }
 579
 580    /// <summary>
 581    /// Removes a property associated with the current activity context.
 582    /// </summary>
 583    /// <param name="key">The property key.</param>
 0584    public void RemoveProperty(string key) => Properties.Remove(key);
 585
 586    /// <summary>
 587    /// Returns a metadata value associated with the current activity context.
 588    /// </summary>
 0589    public T? GetMetadata<T>(string key) => Metadata.TryGetValue<T?>(key, out var value) ? value : default;
 590
 591    /// <summary>
 592    /// Returns a metadata value associated with the current activity context.
 593    /// </summary>
 594    public T GetMetadata<T>(string key, Func<T> defaultValue)
 595    {
 30596        if (Metadata.TryGetValue<T?>(key, out var value))
 13597            return value!;
 598
 17599        value = defaultValue();
 17600        Metadata[key] = value!;
 601
 17602        return value!;
 603    }
 604
 605    /// <summary>
 606    /// Stores a metadata value associated with the current activity context.
 607    /// </summary>
 4608    public void SetMetadata<T>(string key, T? value) => Metadata[key] = value!;
 609
 610    /// <summary>
 611    /// Updates a metadata value associated with the current activity context.
 612    /// </summary>
 613    public T UpdateMetadata<T>(string key, Func<T?, T> updater) where T : notnull
 614    {
 0615        var value = GetMetadata<T?>(key);
 0616        value = updater(value);
 0617        Metadata[key] = value;
 0618        return value;
 619    }
 620
 621    /// <summary>
 622    /// Removes a metadata value associated with the current activity context.
 623    /// </summary>
 624    /// <param name="key">The metadata key.</param>
 0625    public void RemoveMetadata(string key) => Metadata.Remove(key);
 626
 627    /// <summary>
 628    /// Resolves a required service using the service provider.
 629    /// </summary>
 630    /// <typeparam name="T">The service type.</typeparam>
 631    /// <returns>The resolved service.</returns>
 34073632    public T GetRequiredService<T>() where T : notnull => WorkflowExecutionContext.GetRequiredService<T>();
 633
 634    /// <summary>
 635    /// Resolves a required service using the service provider.
 636    /// </summary>
 637    /// <param name="serviceType">The service type.</param>
 638    /// <returns>The resolved service.</returns>
 3049639    public object GetRequiredService(Type serviceType) => WorkflowExecutionContext.GetRequiredService(serviceType);
 640
 641    /// <summary>
 642    /// Resolves a service using the service provider. If not found, a new instance is created.
 643    /// </summary>
 644    /// <typeparam name="T">The service type.</typeparam>
 645    /// <returns>The resolved service.</returns>
 0646    public T GetOrCreateService<T>() where T : notnull => WorkflowExecutionContext.GetOrCreateService<T>();
 647
 648    /// <summary>
 649    /// Resolves a service using the service provider. If not found, a new instance is created.
 650    /// </summary>
 651    /// <param name="serviceType">The service type.</param>
 652    /// <returns>The resolved service.</returns>
 0653    public object GetOrCreateService(Type serviceType) => WorkflowExecutionContext.GetOrCreateService(serviceType);
 654
 655    /// <summary>
 656    /// Resolves a service using the service provider.
 657    /// </summary>
 658    /// <typeparam name="T">The service type.</typeparam>
 659    /// <returns>The resolved service.</returns>
 611660    public T? GetService<T>() where T : notnull => WorkflowExecutionContext.GetService<T>();
 661
 662    /// <summary>
 663    /// Resolves all services of the specified type using the service provider.
 664    /// </summary>
 665    /// <typeparam name="T">The service type.</typeparam>
 666    /// <returns>The resolved services.</returns>
 263667    public IEnumerable<T> GetServices<T>() where T : notnull => WorkflowExecutionContext.GetServices<T>();
 668
 669    /// <summary>
 670    /// Resolves a service using the service provider.
 671    /// </summary>
 672    /// <param name="serviceType">The service type.</param>
 673    /// <returns>The resolved service.</returns>
 0674    public object? GetService(Type serviceType) => WorkflowExecutionContext.GetService(serviceType);
 675
 676    /// <summary>
 677    /// Gets the value of the specified input.
 678    /// </summary>
 679    /// <param name="input">The input.</param>
 680    /// <typeparam name="T">The type of the input.</typeparam>
 681    /// <returns>The input value.</returns>
 3154682    public T? Get<T>(Input<T>? input) => input == null ? default : Get<T>(input.MemoryBlockReference());
 683
 684    /// <summary>
 685    /// Gets the value of the specified output.
 686    /// </summary>
 687    /// <param name="output">The output.</param>
 688    /// <typeparam name="T">The type of the output.</typeparam>
 689    /// <returns>The output value.</returns>
 0690    public T? Get<T>(Output<T>? output) => output == null ? default : Get<T>(output.MemoryBlockReference());
 691
 692    /// <summary>
 693    /// Gets the value of the specified output.
 694    /// </summary>
 695    /// <param name="output">The output.</param>
 696    /// <returns>The output value.</returns>
 6697    public object? Get(Output? output) => output == null ? null : Get(output.MemoryBlockReference());
 698
 699    /// <summary>
 700    /// Gets the value of the specified memory block.
 701    /// </summary>
 702    /// <param name="blockReference">The memory block reference.</param>
 703    /// <returns>The memory block value.</returns>
 704    /// <exception cref="InvalidOperationException">The memory block does not exist.</exception>
 705    public object? Get(MemoryBlockReference blockReference)
 706    {
 2283707        return !TryGet(blockReference, out var value)
 2283708            ? throw new InvalidOperationException($"The memory block '{blockReference}' does not exist.")
 2283709            : value;
 710    }
 711
 712    /// <summary>
 713    /// Gets the value of the specified memory block.
 714    /// </summary>
 715    /// <param name="blockReference">The memory block reference.</param>
 716    /// <typeparam name="T">The type of the memory block.</typeparam>
 717    /// <returns>The memory block value.</returns>
 718    public T? Get<T>(MemoryBlockReference blockReference)
 719    {
 2156720        var value = Get(blockReference);
 2156721        return value != null ? value.ConvertTo<T>() : default;
 722    }
 723
 724    /// <summary>
 725    /// Tries to get the value of the specified memory block.
 726    /// </summary>
 727    /// <param name="blockReference">The memory block reference.</param>
 728    /// <param name="value">The memory block value.</param>
 729    /// <returns>True if the memory block exists, false otherwise.</returns>
 730    public bool TryGet(MemoryBlockReference blockReference, out object? value)
 731    {
 732        // First, try to get the value from the memory register
 2464733        var memoryBlock = GetMemoryBlock(blockReference);
 734
 2464735        if (memoryBlock != null)
 736        {
 2461737            value = memoryBlock.Value;
 2461738            return true;
 739        }
 740
 741        // Handle Literal references as a fallback - they can hold their value directly
 3742        if (blockReference is Literal literal)
 743        {
 3744            value = literal.Value;
 3745            return true;
 746        }
 747
 0748        value = null;
 0749        return false;
 750    }
 751
 752    /// <summary>
 753    /// Sets a value at the specified memory block.
 754    /// </summary>
 755    /// <param name="blockReference">The memory block reference.</param>
 756    /// <param name="value">The value to set.</param>
 757    /// <param name="configure">An optional callback that can be used to configure the memory block.</param>
 8758    public void Set(MemoryBlockReference blockReference, object? value, Action<MemoryBlock>? configure = null) => Expres
 759
 760    /// <summary>
 761    /// Sets a value at the specified output.
 762    /// </summary>
 763    /// <param name="output">The output.</param>
 764    /// <param name="value">The value to set.</param>
 765    /// <param name="outputName">The name of the output.</param>
 766    /// <typeparam name="T">The type of the output.</typeparam>
 1698767    public void Set<T>(Output<T>? output, T? value, [CallerArgumentExpression("output")] string? outputName = null) => S
 768
 769    /// <summary>
 770    /// Sets a value at the specified output.
 771    /// </summary>
 772    /// <param name="output">The output.</param>
 773    /// <param name="value">The value to set.</param>
 774    /// <param name="outputName">The name of the output.</param>
 775    public void Set(Output? output, object? value, [CallerArgumentExpression("output")] string? outputName = null)
 776    {
 1730777        if (output?.Converter == null)
 778        {
 779            // Store the value in the expression execution memory block.
 1722780            ExpressionExecutionContext.Set(output, value);
 781
 782            // Also store the value in the workflow execution transient activity output register.
 1722783            WorkflowExecutionContext.RecordActivityOutput(this, outputName, value);
 1722784            return;
 785        }
 786
 16787        var descriptor = ActivityDescriptor.Outputs.FirstOrDefault(x => x.PropertyInfo?.Name == outputName);
 8788        descriptor ??= ActivityDescriptor.Outputs.FirstOrDefault(x => x.ValueGetter != null && ReferenceEquals(x.ValueGe
 8789        var resolvedOutputName = descriptor?.Name ?? outputName ?? ActivityOutputRegister.DefaultOutputName;
 8790        var sourceType = descriptor?.Type ?? GetOutputValueType(output.GetType()) ?? typeof(object);
 791
 792        // The activity output register always retains the activity's native value.
 8793        WorkflowExecutionContext.RecordActivityOutput(this, outputName, value);
 794
 8795        var destinationResolver = GetRequiredService<IOutputBindingDestinationResolver>();
 8796        var destination = destinationResolver.Resolve(this, output);
 797
 8798        if (destination == null)
 799        {
 0800            throw new OutputConversionException(
 0801                output.Converter.Id,
 0802                OutputConversionFailureStage.Resolution,
 0803                Activity.Id,
 0804                Activity.Type,
 0805                resolvedOutputName,
 0806                output.MemoryBlockReference().Id,
 0807                sourceType,
 0808                null);
 809        }
 810
 8811        if (value == null)
 812        {
 2813            if (!destination.AllowsNull)
 814            {
 1815                throw new OutputConversionException(
 1816                    output.Converter.Id,
 1817                    OutputConversionFailureStage.ResultValidation,
 1818                    Activity.Id,
 1819                    Activity.Type,
 1820                    resolvedOutputName,
 1821                    destination.Id,
 1822                    sourceType,
 1823                    destination.Type);
 824            }
 825
 1826            ExpressionExecutionContext.SetBoundValue(output, null);
 1827            return;
 828        }
 829
 6830        var converterInvoker = GetRequiredService<IOutputConverterInvoker>();
 6831        var convertedValue = converterInvoker.Invoke(this, output, resolvedOutputName, sourceType, value, destination);
 4832        ExpressionExecutionContext.SetBoundValue(output, convertedValue);
 4833    }
 834
 835    private static Type? GetOutputValueType(Type outputType)
 836    {
 0837        for (var currentType = outputType; currentType != null; currentType = currentType.BaseType)
 838        {
 0839            if (currentType.IsGenericType && currentType.GetGenericTypeDefinition() == typeof(Output<>))
 0840                return currentType.GenericTypeArguments[0];
 841        }
 842
 0843        return null;
 844    }
 845
 846    /// <summary>
 847    /// Removes all completion callbacks for the current activity.
 848    /// </summary>
 849    public void ClearCompletionCallbacks()
 850    {
 5065851        var entriesToRemove = WorkflowExecutionContext.CompletionCallbacks.Where(x => x.Owner == this).ToList();
 3459852        WorkflowExecutionContext.RemoveCompletionCallbacks(entriesToRemove);
 3459853    }
 854
 855    public void Taint()
 856    {
 17509857        if (!IsDirty)
 3995858            IsDirty = true;
 17509859    }
 860
 861    public void ClearTaint()
 862    {
 3440863        if (IsDirty)
 3440864            IsDirty = false;
 3440865    }
 866
 867    internal void IncrementExecutionCount()
 868    {
 3337869        _executionCount++;
 3337870    }
 871
 872    private MemoryBlock? GetMemoryBlock(MemoryBlockReference locationBlockReference)
 873    {
 2464874        return ExpressionExecutionContext.TryGetBlock(locationBlockReference, out var memoryBlock) ? memoryBlock : null;
 875    }
 876
 877    void IDisposable.Dispose()
 878    {
 0879    }
 880}

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Contexts/ActivityExecutionContext.ExecutionLogEntry.cs

#LineLine coverage
 1using Elsa.Extensions;
 2using Elsa.Workflows.Models;
 3
 4namespace Elsa.Workflows;
 5
 6public partial class ActivityExecutionContext
 7{
 8    /// <summary>
 9    /// Adds a new <see cref="WorkflowExecutionLogEntry"/> to the execution log of the current <see cref="Workflows.Work
 10    /// </summary>
 11    /// <param name="eventName">The name of the event.</param>
 12    /// <param name="message">The message of the event.</param>
 13    /// <param name="source">The source of the activity. For example, the source file name and line number in case of co
 14    /// <param name="payload">Any contextual data related to this event.</param>
 15    /// <returns>Returns the created <see cref="WorkflowExecutionLogEntry"/>.</returns>
 16    public WorkflowExecutionLogEntry AddExecutionLogEntry(string eventName, string? message = null, string? source = nul
 17    {
 687918        var logEntry = new WorkflowExecutionLogEntry(
 687919            Id,
 687920            ParentActivityExecutionContext?.Id,
 687921            Activity.Id,
 687922            Activity.Type,
 687923            Activity.Version,
 687924            Activity.Name,
 687925            NodeId,
 687926            null,
 687927            _systemClock.UtcNow,
 687928            WorkflowExecutionContext.ExecutionLogSequence++,
 687929            eventName,
 687930            message,
 687931            source ?? Activity.GetSource(),
 687932            payload);
 33
 687934        WorkflowExecutionContext.ExecutionLog.Add(logEntry);
 687935        return logEntry;
 36    }
 37}

Methods/Properties

CanCancelActivity()
WithdrawScheduledWork()
CancelActivityAsync()
CancelChildActivitiesAsync()
CompleteActivityAsync()
CompleteActivityWithOutcomesAsync(System.String[])
CompleteCompositeAsync()
.ctor(System.String,Elsa.Workflows.WorkflowExecutionContext,Elsa.Workflows.ActivityExecutionContext,Elsa.Workflows.IActivity,Elsa.Workflows.Models.ActivityDescriptor,System.DateTimeOffset,System.Object,Elsa.Common.ISystemClock,System.Threading.CancellationToken)
get_Id()
get_StartedAt()
get_Tag()
get_CompletedAt()
get_IsCompleted()
get_IsExecuting()
get_AggregateFaultCount()
get_WorkflowExecutionContext()
get_ParentActivityExecutionContext()
set_ParentActivityExecutionContext(Elsa.Workflows.ActivityExecutionContext)
get_SchedulingActivityExecutionId()
get_SchedulingActivityId()
get_SchedulingWorkflowInstanceId()
get_CallStackDepth()
get_ExpressionExecutionContext()
get_Variables()
get_DynamicVariables()
get_Activity()
get_ActivityDescriptor()
get_CancellationToken()
get_Status()
set_Status(Elsa.Workflows.ActivityStatus)
EnterExecution()
TransitionTo(Elsa.Workflows.ActivityStatus)
get_Exception()
set_Exception(System.Exception)
get_Properties()
get_TransientProperties()
get_Metadata()
get_ActivityNode()
get_NodeId()
get_Children()
get_Bookmarks()
get_NewBookmarks()
get_ExecutionCount()
get_WorkflowInput()
get_ActivityInput()
get_JournalData()
get_ActivityState()
get_IsDirty()
ScheduleActivityAsync(Elsa.Workflows.IActivity,Elsa.Workflows.ActivityCompletionCallback,System.Object,System.Collections.Generic.IEnumerable`1<Elsa.Workflows.Memory.Variable>)
ScheduleActivityAsync()
ScheduleActivityAsync()
ScheduleActivityAsync()
ScheduleActivitiesAsync()
ScheduleActivities(System.Collections.Generic.IEnumerable`1<Elsa.Workflows.IActivity>,Elsa.Workflows.ActivityCompletionCallback,System.Object,System.Collections.Generic.IEnumerable`1<Elsa.Workflows.Memory.Variable>)
ScheduleActivities()
CreateBookmarks(System.Collections.Generic.IEnumerable`1<System.Object>,Elsa.Workflows.ExecuteActivityDelegate,System.Boolean,System.String)
AddBookmarks(System.Collections.Generic.IEnumerable`1<Elsa.Workflows.Models.Bookmark>)
AddBookmark(Elsa.Workflows.Models.Bookmark)
CreateBookmark(Elsa.Workflows.ExecuteActivityDelegate,System.Collections.Generic.IDictionary`2<System.String,System.String>)
CreateBookmark(System.Object,Elsa.Workflows.ExecuteActivityDelegate,System.Boolean,System.Collections.Generic.IDictionary`2<System.String,System.String>)
CreateBookmark(System.Object,System.Boolean,System.Collections.Generic.IDictionary`2<System.String,System.String>)
CreateBookmark(System.Object,System.Collections.Generic.IDictionary`2<System.String,System.String>)
CreateBookmark(Elsa.Workflows.Models.CreateBookmarkArgs)
ClearBookmarks()
GetProperty(System.String)
GetProperty(System.String,System.Func`1<T>)
SetProperty(System.String,T)
UpdateProperty(System.String,System.Func`2<T,T>)
RemoveProperty(System.String)
GetMetadata(System.String)
GetMetadata(System.String,System.Func`1<T>)
SetMetadata(System.String,T)
UpdateMetadata(System.String,System.Func`2<T,T>)
RemoveMetadata(System.String)
GetRequiredService()
GetRequiredService(System.Type)
GetOrCreateService()
GetOrCreateService(System.Type)
GetService()
GetServices()
GetService(System.Type)
Get(Elsa.Workflows.Models.Input`1<T>)
Get(Elsa.Workflows.Models.Output`1<T>)
Get(Elsa.Workflows.Models.Output)
Get(Elsa.Expressions.Models.MemoryBlockReference)
Get(Elsa.Expressions.Models.MemoryBlockReference)
TryGet(Elsa.Expressions.Models.MemoryBlockReference,System.Object&)
Set(Elsa.Expressions.Models.MemoryBlockReference,System.Object,System.Action`1<Elsa.Expressions.Models.MemoryBlock>)
Set(Elsa.Workflows.Models.Output`1<T>,T,System.String)
Set(Elsa.Workflows.Models.Output,System.Object,System.String)
GetOutputValueType(System.Type)
ClearCompletionCallbacks()
Taint()
ClearTaint()
IncrementExecutionCount()
GetMemoryBlock(Elsa.Expressions.Models.MemoryBlockReference)
System.IDisposable.Dispose()
AddExecutionLogEntry(System.String,System.String,System.String,System.Object)