Exemple #1
0
 /// <summary>
 /// Enable task.
 /// </summary>
 /// <param name="inputData"></param>
 public virtual void Enable(Dictionary <string, object> inputData)
 {
     if (Status != TaskStatus.Enabling)
     {
         throw new Exception("Invalid status!");
     }
     this.TaskData = new Dictionary <string, object>();
     ScriptRuntime.InitializeNewTask(this, inputData, Context);
     ScriptRuntime.ExecuteTaskScriptBlock(this, "BeforeEnable", Context);
     this.Status = TaskStatus.Enabled;
     EnabledDate = DateTime.Now;
     this.OnTaskEnabling();
 }
Exemple #2
0
 /// <summary>
 /// Enable task.
 /// </summary>
 /// <param name="inputData"></param>
 public virtual void Enable(Dictionary <string, object> inputData)
 {
     if (Status != TaskStatus.Enabling)
     {
         throw new Exception("Invalid status!");
     }
     this.TaskData = new Dictionary <string, object>();
     ScriptRuntime.InitializeNewTask(this, inputData, Context);
     this.Status = TaskStatus.Enabled;
     EnabledDate = DateTime.Now;
     this.OnTaskEnabling();
     if (this.Status == TaskStatus.Enabled)
     {
         Context.NotifyTaskEvent(new TaskEnabled {
             FromTaskInstanceId = this.InstanceId, ParentTaskInstanceId = this.ParentTaskInstanceId
         });
     }
 }