Exemplo n.º 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();
 }
Exemplo n.º 2
0
 protected virtual void DefaultHandleTaskCompletion(Dictionary <string, object> updateData)
 {
     if (Status != TaskStatus.Enabled && Status != TaskStatus.Selected)
     {
         throw new Exception("Invalid task status");
     }
     if (updateData != null)
     {
         foreach (string gk in updateData.Keys)
         {
             TaskData[gk] = updateData[gk];
         }
     }
     Status = TaskStatus.Completed;
     ScriptRuntime.ExecuteTaskScriptBlock(this, "AfterComplete", Context);
 }