230 references to Activity
System.Workflow.Activities (77)
ConstrainedGroup.cs (8)
221
ConditionedActivityGroup currentActivity = executionContext.
Activity
as ConditionedActivityGroup;
242
ConditionedActivityGroup cag = executionContext.
Activity
as ConditionedActivityGroup;
260
ConditionedActivityGroup currentActivity = executionContext.
Activity
as ConditionedActivityGroup;
464
childContext.
Activity
.RegisterForStatusChange(Activity.ClosedEvent, this);
467
childContext.ExecuteActivity(childContext.
Activity
);
499
ConditionedActivityGroup cag = context.
Activity
as ConditionedActivityGroup;
655
return childContext.
Activity
;
679
if (cag.GetActivityByName(activeContext.
Activity
.QualifiedName, true) != null)
Delay.cs (1)
354
Activity root = parentContext.
Activity
;
EventHandlers.cs (12)
131
switch (childContext.
Activity
.ExecutionStatus)
138
childContext.CancelActivity(childContext.
Activity
);
170
EventHandlersActivity activity = (EventHandlersActivity)executionContext.
Activity
as EventHandlersActivity;
189
EventHandlersActivity activity = (EventHandlersActivity)executionContext.
Activity
as EventHandlersActivity;
249
EventHandlersActivity eventHandlers = context.
Activity
as EventHandlersActivity;
271
childContext.
Activity
.RegisterForStatusChange(Activity.ClosedEvent, this);
272
childContext.ExecuteActivity(childContext.
Activity
);
319
EventHandlersActivity handlers = context.
Activity
as EventHandlersActivity;
320
if (context.
Activity
.ExecutionStatus != ActivityExecutionStatus.Executing)
397
EventHandlersActivity handlers = context.
Activity
as EventHandlersActivity;
410
childContext.
Activity
.RegisterForStatusChange(Activity.ClosedEvent, handlers);
411
childContext.ExecuteActivity(childContext.
Activity
);
EventSinkActivity.cs (1)
350
HandleExternalEventActivity activity = context.
Activity
as HandleExternalEventActivity;
Listen.cs (3)
136
ListenActivity listen = executionContext.
Activity
as ListenActivity;
153
ListenActivity listen = executionContext.
Activity
as ListenActivity;
262
ListenActivity parentActivity = context.
Activity
as ListenActivity;
LocalService\CorrelationTokenInvalidatedHandler.cs (1)
42
Activity activity = context.
Activity
;
Parallel.cs (2)
103
ParallelActivity parallel = executionContext.
Activity
as ParallelActivity;
154
ParallelActivity parallel = context.
Activity
as ParallelActivity;
Sequence.cs (1)
120
SequenceActivity sequenceActivity = context.
Activity
as SequenceActivity;
SetState.cs (1)
68
StateActivity parentState = StateMachineHelpers.FindEnclosingState(executionContext.
Activity
);
State.cs (24)
155
StateActivity state = (StateActivity)context.
Activity
;
175
StateActivity state = (StateActivity)context.
Activity
;
196
StateActivity state = (StateActivity)context.
Activity
;
239
StateActivity state = (StateActivity)context.
Activity
;
256
StateActivity state = (StateActivity)context.
Activity
;
278
Debug.Assert(executionContext.
Activity
== this);
285
if (existingContext.
Activity
.Parent == this)
289
if (existingContext.
Activity
.ExecutionStatus == ActivityExecutionStatus.Executing)
290
existingContext.CancelActivity(existingContext.
Activity
);
301
StateActivity state = (StateActivity)context.
Activity
;
319
StateActivity state = (StateActivity)context.
Activity
;
326
childContext.
Activity
.Closed += state.HandleChildActivityClosed;
327
childContext.ExecuteActivity(childContext.
Activity
);
336
StateActivity state = (StateActivity)context.
Activity
;
377
StateActivity state = (StateActivity)context.
Activity
;
420
throw new InvalidOperationException(SR.GetInvalidActivityStatus(context.
Activity
));
443
StateActivity state = (StateActivity)context.
Activity
;
470
StateActivity state = (StateActivity)context.
Activity
;
523
StateActivity state = (StateActivity)context.
Activity
;
531
StateActivity state = (StateActivity)context.
Activity
;
539
StateActivity state = (StateActivity)context.
Activity
;
556
StateActivity state = (StateActivity)context.
Activity
;
588
if (executionContext.
Activity
.ExecutionStatus != ActivityExecutionStatus.Executing)
599
StateActivity rootState = StateMachineHelpers.GetRootState(executionContext.
Activity
as StateActivity);
StateMachineAction.cs (2)
79
Debug.Assert(context.
Activity
.QualifiedName.Equals(this.StateName));
80
_state = (StateActivity)context.
Activity
;
StateMachineExecutionState.cs (1)
162
StateActivity state = (StateActivity)context.
Activity
;
StateMachineHelpers.cs (3)
56
return (context.
Activity
.Parent == null);
160
StateActivity state = context.
Activity
as StateActivity;
162
state = FindEnclosingState(context.
Activity
);
StateMachineSubscription.cs (4)
133
StateActivity rootState = StateMachineHelpers.GetRootState((StateActivity)context.
Activity
);
140
StateActivity rootState = StateMachineHelpers.GetRootState((StateActivity)context.
Activity
);
218
StateActivity rootState = StateMachineHelpers.GetRootState((StateActivity)context.
Activity
);
232
StateActivity rootState = StateMachineHelpers.GetRootState((StateActivity)context.
Activity
);
StateMachineSubscriptionManager.cs (2)
70
StateActivity state = (StateActivity)context.
Activity
;
182
StateActivity state = (StateActivity)context.
Activity
;
Task.cs (6)
535
base.RaiseGenericEvent(ReplicatorActivity.ChildInitializedEvent, this, new ReplicatorChildEventArgs(childStateInfo.InstanceData, templateExecutionContext.
Activity
));
545
templateExecutionContext.ExecuteActivity(templateExecutionContext.
Activity
);
546
templateExecutionContext.
Activity
.RegisterForStatusChange(Activity.ClosedEvent, new ReplicatorSubscriber(this, templateExecutionContext.ContextGuid));
687
switch (innerProvider.
Activity
.ExecutionStatus)
691
innerProvider.CancelActivity(innerProvider.
Activity
);
779
((ReplicatorActivity)context.
Activity
).HandleStatusChange(context, e, this);
WebServiceReceive.cs (1)
369
WebServiceInputActivity activity = context.
Activity
as WebServiceInputActivity;
While.cs (4)
105
if (childContext.
Activity
.ExecutionStatus == ActivityExecutionStatus.Executing)
106
childContext.CancelActivity(childContext.
Activity
);
125
innerContext.
Activity
.RegisterForStatusChange(Activity.ClosedEvent, this);
126
innerContext.ExecuteActivity(innerContext.
Activity
);
System.Workflow.ComponentModel (152)
AuthoringOM\Activity.cs (2)
1548
if (this.GetActivityByName(childContext.
Activity
.QualifiedName, true) != null)
1741
UninitializeCompletedContext(resurrectedContext.
Activity
, resurrectedContext);
AuthoringOM\ActivityExecutionContext.cs (10)
406
this.
Activity
.SetValue(LockAcquiredCallbackProperty, new ActivityExecutorDelegateInfo<EventArgs>(true, locksAcquiredCallback, this.
Activity
.ContextActivity));
407
return AcquireLocks(this.
Activity
);
466
this.
Activity
.RemoveProperty(LockAcquiredCallbackProperty);
471
ICollection<string> handles = GetAllSynchronizationHandles(this.
Activity
);
476
Activity parent =
Activity
.Parent;
508
else if (grantedLocks[handle].Holder != this.
Activity
)
510
grantedLocks[handle].WaitList.Remove(this.
Activity
);
545
waitingActivityCallback.InvokeDelegate(this.
Activity
.ContextActivity, EventArgs.Empty, false, transactional);
641
if (activity.Enabled && activity.Parent == this.currentActivity.WorkflowCoreRuntime.CurrentActivity && (allowContextVariance || activity.Equals(this.
Activity
.GetActivityByName(activity.QualifiedName, true))))
AuthoringOM\ActivityExecutionContextCollection.cs (39)
32
IList<Activity> activeContexts = (IList<Activity>)this.ownerContext.
Activity
.ContextActivity.GetValue(Activity.ActiveExecutionContextsProperty);
68
((IDependencyObjectAccessor)copiedActivity).InitializeInstanceForRuntime(this.ownerContext.
Activity
.WorkflowCoreRuntime);
103
IList<Activity> activeContexts = (IList<Activity>)this.ownerContext.
Activity
.ContextActivity.GetValue(Activity.ActiveExecutionContextsProperty);
107
this.ownerContext.
Activity
.ContextActivity.SetValue(Activity.ActiveExecutionContextsProperty, activeContexts);
119
this.ownerContext.
Activity
.WorkflowCoreRuntime.RegisterContextActivity(copiedActivity);
124
newExecutionContext.InitializeActivity(newExecutionContext.
Activity
);
157
if (childContext.
Activity
== null)
160
if (childContext.
Activity
.ContextActivity == null)
166
if (childContext.
Activity
.ContextActivity.ExecutionStatus != ActivityExecutionStatus.Closed && childContext.
Activity
.ContextActivity.ExecutionStatus != ActivityExecutionStatus.Initialized)
170
ActivityExecutionContextInfo childContextInfo = childContext.
Activity
.ContextActivity.GetValue(Activity.ActivityExecutionContextInfoProperty) as ActivityExecutionContextInfo;
171
IList<Activity> activeContexts = (IList<Activity>)this.ownerContext.
Activity
.ContextActivity.GetValue(Activity.ActiveExecutionContextsProperty);
172
if (activeContexts == null || !activeContexts.Contains(childContext.
Activity
.ContextActivity))
176
bool needsCompensation = childContext.
Activity
.NeedsCompensation;
180
List<ActivityExecutionContextInfo> completedContexts = this.ownerContext.
Activity
.ContextActivity.GetValue(Activity.CompletedExecutionContextsProperty) as List<ActivityExecutionContextInfo>;
184
this.ownerContext.
Activity
.ContextActivity.SetValue(Activity.CompletedExecutionContextsProperty, completedContexts);
192
childContextInfo.SetCompletedOrderId(this.ownerContext.
Activity
.IncrementCompletedOrderId());
196
this.ownerContext.
Activity
.WorkflowCoreRuntime.SaveContextActivity(childContext.
Activity
);
200
activeContexts.Remove(childContext.
Activity
.ContextActivity);
206
if (childContext.
Activity
.ContextActivity.CanUninitializeNow && childContext.
Activity
.ContextActivity.ExecutionResult != ActivityExecutionResult.Uninitialized)
208
childContext.
Activity
.ContextActivity.Uninitialize(this.ownerContext.
Activity
.RootActivity.WorkflowCoreRuntime);
209
childContext.
Activity
.ContextActivity.SetValue(Activity.ExecutionResultProperty, ActivityExecutionResult.Uninitialized);
213
this.ownerContext.
Activity
.WorkflowCoreRuntime.UnregisterContextActivity(childContext.
Activity
);
217
childContext.
Activity
.Dispose();
236
if (context.
Activity
.ContextActivity.QualifiedName == activity.QualifiedName)
256
List<ActivityExecutionContextInfo> completedContexts = this.ownerContext.
Activity
.ContextActivity.GetValue(Activity.CompletedExecutionContextsProperty) as List<ActivityExecutionContextInfo>;
274
IList<ActivityExecutionContextInfo> completedContexts = this.ownerContext.
Activity
.ContextActivity.GetValue(Activity.CompletedExecutionContextsProperty) as IList<ActivityExecutionContextInfo>;
315
List<ActivityExecutionContextInfo> completedContexts = this.ownerContext.
Activity
.ContextActivity.GetValue(Activity.CompletedExecutionContextsProperty) as List<ActivityExecutionContextInfo>;
327
IList<ActivityExecutionContextInfo> completedContexts = this.ownerContext.
Activity
.ContextActivity.GetValue(Activity.CompletedExecutionContextsProperty) as IList<ActivityExecutionContextInfo>;
332
Activity revokedActivity = this.ownerContext.WorkflowCoreRuntime.LoadContextActivity(contextInfo, this.ownerContext.
Activity
.ContextActivity.GetActivityByName(contextInfo.ActivityQualifiedName));
333
((IDependencyObjectAccessor)revokedActivity).InitializeInstanceForRuntime(this.ownerContext.
Activity
.WorkflowCoreRuntime);
336
IList<Activity> activeContexts = (IList<Activity>)this.ownerContext.
Activity
.ContextActivity.GetValue(Activity.ActiveExecutionContextsProperty);
340
this.ownerContext.
Activity
.ContextActivity.SetValue(Activity.ActiveExecutionContextsProperty, activeContexts);
345
this.ownerContext.
Activity
.WorkflowCoreRuntime.RegisterContextActivity(revokedActivity);
350
System.Workflow.Runtime.WorkflowTrace.Runtime.TraceEvent(TraceEventType.Information, 0, "Revoking context {0}:{1}", revokedContext.ContextId, revokedContext.
Activity
.ContextActivity.QualifiedName);
AuthoringOM\ActivityExecutor.cs (3)
96
CompositeActivity compositeActivity = executionContext.
Activity
as CompositeActivity;
110
CompositeActivity compositeActivity = executionContext.
Activity
as CompositeActivity;
122
CompositeActivity compositeActivity = executionContext.
Activity
as CompositeActivity;
AuthoringOM\Behaviors\Compensate.cs (12)
98
Activity commonParentActivity = context.
Activity
;
112
return context.
Activity
.ExecutionStatus;
122
if (targetActivity.GetActivityByName(activeContext.
Activity
.QualifiedName, true) != null)
124
if (activeContext.
Activity
.ExecutionStatus == ActivityExecutionStatus.Compensating ||
125
activeContext.
Activity
.ExecutionStatus == ActivityExecutionStatus.Faulting ||
126
activeContext.
Activity
.ExecutionStatus == ActivityExecutionStatus.Canceling
128
return context.
Activity
.ExecutionStatus;
140
if (revokedExecutionContext.
Activity
is ICompensatableActivity)
142
revokedExecutionContext.
Activity
.RegisterForStatusChange(Activity.ClosedEvent, this);
143
revokedExecutionContext.CompensateActivity(revokedExecutionContext.
Activity
);
145
return context.
Activity
.ExecutionStatus;
153
return context.
Activity
.ExecutionStatus;
AuthoringOM\Filters\ActivityExecutionFilter.cs (9)
19
NextDynamicChangeExecutorInChain(executionContext.
Activity
).OnActivityAdded(executionContext, addedActivity);
28
NextDynamicChangeExecutorInChain(executionContext.
Activity
).OnActivityRemoved(executionContext, removedActivity);
35
NextDynamicChangeExecutorInChain(executionContext.
Activity
).OnWorkflowChangesCompleted(executionContext);
48
return NextActivityExecutorInChain(executionContext.
Activity
).Execute(activity, executionContext);
62
ActivityExecutor nextActivityExecutor = NextActivityExecutorInChain(executionContext.
Activity
);
63
if (!(nextActivityExecutor is ActivityExecutionFilter) && executionContext.
Activity
.HasPrimaryClosed)
79
ActivityExecutor nextActivityExecutor = NextActivityExecutorInChain(executionContext.
Activity
);
80
if (!(nextActivityExecutor is ActivityExecutionFilter) && executionContext.
Activity
.HasPrimaryClosed)
92
return NextActivityExecutorInChain(executionContext.
Activity
).Compensate(activity, executionContext);
AuthoringOM\Filters\CompensationHandlingFilter.cs (33)
21
executionContext.
Activity
.HoldLockOnStatusChange(this);
34
if (e.Activity == context.
Activity
)
36
if (context.
Activity
.HasPrimaryClosed && !(bool)context.
Activity
.GetValue(CompensateProcessedProperty))
38
context.
Activity
.SetValue(CompensateProcessedProperty, true);
39
if (context.
Activity
.ExecutionResult == ActivityExecutionResult.Compensated)
42
Activity compensationHandler = GetCompensationHandler(context.
Activity
);
54
if (!CompensationUtils.TryCompensateLastCompletedChildActivity(context, context.
Activity
, this))
57
context.
Activity
.ReleaseLockOnStatusChange(this);
64
context.
Activity
.ReleaseLockOnStatusChange(this);
74
context.
Activity
.ReleaseLockOnStatusChange(this);
81
if (!CompensationUtils.TryCompensateLastCompletedChildActivity(context, context.
Activity
, this))
84
context.
Activity
.ReleaseLockOnStatusChange(this);
196
if (revokedExecutionContext.
Activity
is ICompensatableActivity)
198
revokedExecutionContext.
Activity
.RegisterForStatusChange(Activity.StatusChangedEvent, statusChangeHandler);
199
revokedExecutionContext.CompensateActivity(revokedExecutionContext.
Activity
);
202
else if (revokedExecutionContext.
Activity
is CompositeActivity)
205
Activity compensatableChild = GetLastCompensatableChild(revokedExecutionContext.
Activity
as CompositeActivity);
213
return TryCompensateLastCompletedChildActivity(revokedExecutionContext, revokedExecutionContext.
Activity
, statusChangeHandler, false);
218
if (lastCompensatableTarget.TargetExecutionContext.
Activity
is CompositeActivity)
221
Activity compensatableChild = GetLastCompensatableChild(lastCompensatableTarget.TargetExecutionContext.
Activity
as CompositeActivity);
229
return TryCompensateLastCompletedChildActivity(lastCompensatableTarget.TargetExecutionContext, lastCompensatableTarget.TargetExecutionContext.
Activity
, statusChangeHandler, false);
242
if (targetActivity.GetActivityByName(childContext.
Activity
.QualifiedName, true) != null)
244
if (childContext.
Activity
.ExecutionStatus == ActivityExecutionStatus.Closed)
245
CompleteRevokedExecutionContext(childContext.
Activity
, childContext);
330
if (targetActivity.GetActivityByName(activeContext.
Activity
.QualifiedName, true) != null)
333
if (immediateCompensation && IsActivityInBackWorkBranch(targetActivity, activeContext.
Activity
))
336
if (activeContext.
Activity
is ICompensatableActivity && (activeContext.
Activity
.ExecutionStatus == ActivityExecutionStatus.Compensating || activeContext.
Activity
.ExecutionStatus == ActivityExecutionStatus.Faulting || activeContext.
Activity
.ExecutionStatus == ActivityExecutionStatus.Canceling))
338
else if (activeContext.
Activity
is CompositeActivity)
340
Activity[] activities = GetCompensatableChildren(activeContext.
Activity
as CompositeActivity);
AuthoringOM\Filters\FaultHandlingFilter.cs (20)
26
executionContext.
Activity
.HoldLockOnStatusChange(this);
36
Activity handlersActivity = FaultAndCancellationHandlingFilter.GetFaultHandlers(executionContext.
Activity
);
46
handlersActivity = FaultAndCancellationHandlingFilter.GetCancellationHandler(executionContext.
Activity
);
73
if (e.Activity == context.
Activity
)
75
if (context.
Activity
.HasPrimaryClosed &&
76
!(bool)context.
Activity
.GetValue(FaultAndCancellationHandlingFilter.FaultProcessedProperty))
78
context.
Activity
.SetValue(FaultAndCancellationHandlingFilter.FaultProcessedProperty, true);
80
if (context.
Activity
.WasExecuting &&
81
context.
Activity
.ExecutionResult == ActivityExecutionResult.Faulted &&
82
context.
Activity
.GetValue(ActivityExecutionContext.CurrentExceptionProperty) != null)
85
CompositeActivity exceptionHandlersActivity = FaultAndCancellationHandlingFilter.GetFaultHandlers(context.
Activity
);
97
if (!CompensationUtils.TryCompensateLastCompletedChildActivity(context, context.
Activity
, this))
101
else if (context.
Activity
.ExecutionResult == ActivityExecutionResult.Canceled)
104
Activity cancelHandler = FaultAndCancellationHandlingFilter.GetCancellationHandler(context.
Activity
);
114
if (!CompensationUtils.TryCompensateLastCompletedChildActivity(context, context.
Activity
, this))
131
if (context.
Activity
.GetValue(ActivityExecutionContext.CurrentExceptionProperty) != null)
135
if (!CompensationUtils.TryCompensateLastCompletedChildActivity(context, context.
Activity
, this))
147
if (!CompensationUtils.TryCompensateLastCompletedChildActivity(context, context.
Activity
, this))
156
context.
Activity
.ReleaseLockOnStatusChange(this);
160
context.
Activity
.RemoveProperty(FaultAndCancellationHandlingFilter.FaultProcessedProperty);
AuthoringOM\Filters\SynchronizationFilter.cs (7)
39
return ((ActivityExecutor)NextActivityExecutorInChain(context.
Activity
)).Execute(context.
Activity
, context);
47
if (context.
Activity
.HasPrimaryClosed && context.
Activity
.LockCountOnStatusChange == 1)
51
context.
Activity
.UnregisterForStatusChange(Activity.LockCountOnStatusChangeChangedEvent, this);
52
context.
Activity
.ReleaseLockOnStatusChange(this);
65
if (context.
Activity
.ExecutionStatus == ActivityExecutionStatus.Executing)
AuthoringOM\Filters\TransactionFilter.cs (14)
60
if (context.
Activity
.HasPrimaryClosed && context.
Activity
.LockCountOnStatusChange == 1)
63
Exception exception = (Exception)context.
Activity
.GetValue(ActivityExecutionContext.CurrentExceptionProperty);
66
WorkflowTransactionOptions transactionOptions = TransactedContextFilter.GetTransactionOptions(context.
Activity
);
76
context.
Activity
.UnregisterForStatusChange(Activity.LockCountOnStatusChangeChangedEvent, this);
77
context.
Activity
.ReleaseLockOnStatusChange(this);
87
context.
Activity
.UnregisterForStatusChange(Activity.LockCountOnStatusChangeChangedEvent, this);
88
context.
Activity
.ReleaseLockOnStatusChange(this);
94
context.
Activity
.RegisterForStatusChange(Activity.LockCountOnStatusChangeChangedEvent, this);
115
context.
Activity
.SetValueCommon(ActivityExecutionContext.CurrentExceptionProperty, args.Exception, ActivityExecutionContext.CurrentExceptionProperty.DefaultMetadata, false);
119
context.
Activity
.UnregisterForStatusChange(Activity.LockCountOnStatusChangeChangedEvent, this);
120
context.
Activity
.ReleaseLockOnStatusChange(this);
132
if (context.
Activity
.ExecutionStatus == ActivityExecutionStatus.Executing)
134
ActivityExecutionStatus newStatus = TransactedContextFilter.ExecuteActivity(context.
Activity
, context, true);
AuthoringOM\ScheduleChanges.cs (3)
414
addedActivity.OnActivityExecutionContextLoad(executionContext.
Activity
.RootActivity.WorkflowCoreRuntime);
427
removedActivityAction.OriginalRemovedActivity.Uninitialize(executionContext.
Activity
.RootActivity.WorkflowCoreRuntime);
430
removedActivityAction.OriginalRemovedActivity.OnActivityExecutionContextUnload(executionContext.
Activity
.RootActivity.WorkflowCoreRuntime);
System.Workflow.Runtime (1)
DebugEngine\DebugController.cs (1)
926
Activity instanceActivity = executionContext.
Activity
;