Exemplo n.º 1
0
 internal void SetInitializedSubstate(ActivityExecutor executor)
 {
     this.substate = Substate.Initialized;
     if (executor.ShouldTrackActivityStateRecordsExecutingState && executor.ShouldTrackActivity(this.Activity.DisplayName))
     {
         executor.AddTrackingRecord(new ActivityStateRecord(executor.WorkflowInstanceId, this, this.state));
     }
     if ((this.Activity.RuntimeArguments.Count > 0) && TD.InArgumentBoundIsEnabled())
     {
         for (int i = 0; i < this.Activity.RuntimeArguments.Count; i++)
         {
             Location        location;
             RuntimeArgument argument = this.Activity.RuntimeArguments[i];
             if (ArgumentDirectionHelper.IsIn(argument.Direction) && this.environment.TryGetLocation(argument.Id, this.Activity, out location))
             {
                 string str = null;
                 if (location.Value == null)
                 {
                     str = "<Null>";
                 }
                 else
                 {
                     str = "'" + location.Value.ToString() + "'";
                 }
                 TD.InArgumentBound(argument.Name, this.Activity.GetType().ToString(), this.Activity.DisplayName, this.Id, str);
             }
         }
     }
 }
 private void TrackState(ActivityExecutor executor, ActivityInstanceState state, ref ActivityInfo activityInfo)
 {
     if (executor.ShouldTrackActivity(this.expressionActivity.DisplayName))
     {
         this.EnsureActivityInfo(ref activityInfo);
         executor.AddTrackingRecord(new ActivityStateRecord(executor.WorkflowInstanceId, activityInfo, state));
     }
 }
Exemplo n.º 3
0
        internal void TrackCore(CustomTrackingRecord record)
        {
            Fx.Assert(!_isDisposed, "not usable if disposed");
            Fx.Assert(record != null, "expect non-null record");

            if (_executor.ShouldTrack)
            {
                record.Activity   = new ActivityInfo(_instance);
                record.InstanceId = this.WorkflowInstanceId;
                _executor.AddTrackingRecord(record);
            }
        }
Exemplo n.º 4
0
 internal void FinalizeState(ActivityExecutor executor, bool faultActivity, bool skipTracking)
 {
     if (faultActivity)
     {
         this.TryCancelParent();
         this.state = ActivityInstanceState.Faulted;
     }
     if (this.state == ActivityInstanceState.Closed)
     {
         if ((executor.ShouldTrackActivityStateRecordsClosedState && !skipTracking) && executor.ShouldTrackActivity(this.Activity.DisplayName))
         {
             executor.AddTrackingRecord(new ActivityStateRecord(executor.WorkflowInstanceId, this, this.state));
         }
     }
     else if (executor.ShouldTrackActivityStateRecords && !skipTracking)
     {
         executor.AddTrackingRecord(new ActivityStateRecord(executor.WorkflowInstanceId, this, this.state));
     }
     if (TD.ActivityCompletedIsEnabled())
     {
         TD.ActivityCompleted(this.Activity.GetType().ToString(), this.Activity.DisplayName, this.Id, this.State.ToString());
     }
 }
 private void TrackState(ActivityExecutor executor, ActivityInstanceState state, ref ActivityInfo activityInfo)
 {
     if (executor.ShouldTrackActivity(this.expressionActivity.DisplayName))
     {
         this.EnsureActivityInfo(ref activityInfo);
         executor.AddTrackingRecord(new ActivityStateRecord(executor.WorkflowInstanceId, activityInfo, state));
     }
 }