Rename PostActivity to ScheduleActivity
This commit is contained in:
parent
4def8b8a10
commit
4ff2c228c4
|
|
@ -18,7 +18,7 @@ public class Composite : Activity
|
|||
|
||||
protected override void Execute(ActivityExecutionContext context)
|
||||
{
|
||||
context.PostActivity(Root, OnCompletedAsync);
|
||||
context.ScheduleActivity(Root, OnCompletedAsync);
|
||||
}
|
||||
|
||||
protected virtual ValueTask OnCompletedAsync(ActivityExecutionContext context, ActivityExecutionContext childContext) => ValueTask.CompletedTask;
|
||||
|
|
@ -46,7 +46,7 @@ public class Composite<T> : Activity<T>
|
|||
|
||||
protected override void Execute(ActivityExecutionContext context)
|
||||
{
|
||||
context.PostActivity(Root, OnCompletedAsync);
|
||||
context.ScheduleActivity(Root, OnCompletedAsync);
|
||||
}
|
||||
|
||||
protected virtual ValueTask OnCompletedAsync(ActivityExecutionContext context, ActivityExecutionContext childContext) => ValueTask.CompletedTask;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class For : Activity
|
|||
|
||||
if (loop)
|
||||
{
|
||||
context.PostActivity(iterateNode, OnChildComplete);
|
||||
context.ScheduleActivity(iterateNode, OnChildComplete);
|
||||
|
||||
// Update loop variable.
|
||||
CurrentValue.Set(context.ExpressionExecutionContext, currentValue);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class If : Activity<bool>
|
|||
var nextNode = result ? Then : Else;
|
||||
|
||||
if (nextNode != null)
|
||||
context.PostActivity(nextNode, OnChildCompletedAsync);
|
||||
context.ScheduleActivity(nextNode, OnChildCompletedAsync);
|
||||
|
||||
context.Set(Result, result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class ParallelForEach<T> : Activity
|
|||
};
|
||||
|
||||
// Schedule a body of work for each item.
|
||||
context.PostActivity(Body, OnChildCompleted, new[]{localVariable});
|
||||
context.ScheduleActivity(Body, OnChildCompleted, new[]{localVariable});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class Sequence : Container
|
|||
}
|
||||
|
||||
var nextActivity = childActivities.ElementAt(currentIndex);
|
||||
context.PostActivity(nextActivity, OnChildCompleted);
|
||||
context.ScheduleActivity(nextActivity, OnChildCompleted);
|
||||
context.UpdateProperty<int>(CurrentIndexProperty, x => x + 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ public class Switch : Activity
|
|||
if (matchingCase != null)
|
||||
{
|
||||
if (matchingCase.Activity != null)
|
||||
context.PostActivity(matchingCase.Activity);
|
||||
context.ScheduleActivity(matchingCase.Activity);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Default != null)
|
||||
context.PostActivity(Default);
|
||||
context.ScheduleActivity(Default);
|
||||
}
|
||||
|
||||
private async Task<SwitchCase?> FindMatchingCaseAsync(ExpressionExecutionContext context)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class While : Activity
|
|||
var loop = context.Get(Condition);
|
||||
|
||||
if (loop)
|
||||
context.PostActivity(Body, OnBodyCompleted);
|
||||
context.ScheduleActivity(Body, OnBodyCompleted);
|
||||
}
|
||||
|
||||
private async ValueTask OnBodyCompleted(ActivityExecutionContext context, ActivityExecutionContext childContext)
|
||||
|
|
@ -59,7 +59,7 @@ public class While : Activity
|
|||
var loop = await context.EvaluateAsync(Condition);
|
||||
|
||||
if (loop)
|
||||
context.PostActivity(Body, OnBodyCompleted);
|
||||
context.ScheduleActivity(Body, OnBodyCompleted);
|
||||
}
|
||||
|
||||
private void OnBreak(BreakSignal signal, SignalContext context)
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class ActivityExecutionContext
|
|||
/// </summary>
|
||||
public IDictionary<string, object?> JournalData { get; private set; } = new Dictionary<string, object?>();
|
||||
|
||||
public void PostActivity(IActivity? activity, ActivityCompletionCallback? completionCallback = default, IEnumerable<RegisterLocationReference>? locationReferences = default, object? tag = default)
|
||||
public void ScheduleActivity(IActivity? activity, ActivityCompletionCallback? completionCallback = default, IEnumerable<RegisterLocationReference>? locationReferences = default, object? tag = default)
|
||||
{
|
||||
if (activity == null)
|
||||
return;
|
||||
|
|
@ -78,7 +78,7 @@ public class ActivityExecutionContext
|
|||
WorkflowExecutionContext.Schedule(activity, this, completionCallback, locationReferences, tag);
|
||||
}
|
||||
|
||||
public void PostActivity(IActivity? activity, ActivityExecutionContext owner, ActivityCompletionCallback? completionCallback = default, IEnumerable<RegisterLocationReference>? locationReferences = default, object? tag = default)
|
||||
public void ScheduleActivity(IActivity? activity, ActivityExecutionContext owner, ActivityCompletionCallback? completionCallback = default, IEnumerable<RegisterLocationReference>? locationReferences = default, object? tag = default)
|
||||
{
|
||||
if (activity == null)
|
||||
return;
|
||||
|
|
@ -91,7 +91,7 @@ public class ActivityExecutionContext
|
|||
public void PostActivities(IEnumerable<IActivity?> activities, ActivityCompletionCallback? completionCallback = default)
|
||||
{
|
||||
foreach (var activity in activities)
|
||||
PostActivity(activity, completionCallback);
|
||||
ScheduleActivity(activity, completionCallback);
|
||||
}
|
||||
|
||||
public void CreateBookmarks(IEnumerable<object> bookmarkData, ExecuteActivityDelegate? callback = default)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class Flowchart : Container
|
|||
if (Start == null!)
|
||||
return;
|
||||
|
||||
context.PostActivity(Start, OnChildCompleted);
|
||||
context.ScheduleActivity(Start, OnChildCompleted);
|
||||
}
|
||||
|
||||
private ValueTask OnChildCompleted(ActivityExecutionContext context, ActivityExecutionContext childContext)
|
||||
|
|
|
|||
Loading…
Reference in a new issue