Beispiel #1
0
 public TaskAssignResponse(Task task, List<TaskFileMapping> inputFiles, string triggerInvokeTime)
 {
     Task = task;
     InputFiles = inputFiles;
     TriggerInvokeTime = triggerInvokeTime;
     CompositionData = SerializationUtil.Deserialize<CompositionData>(task.compositionData);
 }
Beispiel #2
0
 public TaskDataResponse(Task task)
 {
     Task = task;
     CompositionData = SerializationUtil.Deserialize<CompositionData>(task.compositionData);
 }
Beispiel #3
0
 /// <summary>
 /// Create a new Task object.
 /// </summary>
 /// <param name="guid">Initial value of the guid property.</param>
 /// <param name="compositionGuid">Initial value of the compositionGuid property.</param>
 /// <param name="compositionData">Initial value of the compositionData property.</param>
 /// <param name="state">Initial value of the state property.</param>
 /// <param name="userId">Initial value of the userId property.</param>
 /// <param name="creation">Initial value of the creation property.</param>
 /// <param name="triggerInvokeTime">Initial value of the triggerInvokeTime property.</param>
 public static Task CreateTask(global::System.String guid, global::System.String compositionGuid, global::System.String compositionData, global::System.SByte state, global::System.Int64 userId, global::System.DateTime creation, global::System.String triggerInvokeTime)
 {
     Task task = new Task();
     task.guid = guid;
     task.compositionGuid = compositionGuid;
     task.compositionData = compositionData;
     task.state = state;
     task.userId = userId;
     task.creation = creation;
     task.triggerInvokeTime = triggerInvokeTime;
     return task;
 }
Beispiel #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Task EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTask(Task task)
 {
     base.AddObject("Task", task);
 }
Beispiel #5
0
 public string Create(string compositionGuid, int userId, string triggerInvokeTime)
 {
     using (OOCEntities db = new OOCEntities())
     {
         IQueryable<Composition> result = from o in db.Composition
                                          where o.guid == compositionGuid
                                          select o;
         if (!result.Any())
         {
             throw new FaultException("COMPOSITION_NOT_EXISTS");
         }
         Composition composition = result.First();
         CompositionData compositionData = new CompositionData(composition);
         Task task = new Task()
         {
             guid = GuidUtil.newGuid(),
             compositionGuid = compositionGuid,
             compositionData = compositionData.Serialized,
             state = (sbyte)TaskState.Created,
             userId = userId,
             triggerInvokeTime = triggerInvokeTime,
             modelProgress = new ModelProgress().Serialized
         };
         db.Task.AddObject(task);
         db.SaveChanges();
         SyncCompositionInputFiles(task.guid);
         return task.guid;
     }
 }