public TaskAssignResponse(Task task, List<TaskFileMapping> inputFiles, string triggerInvokeTime) { Task = task; InputFiles = inputFiles; TriggerInvokeTime = triggerInvokeTime; CompositionData = SerializationUtil.Deserialize<CompositionData>(task.compositionData); }
public TaskDataResponse(Task task) { Task = task; CompositionData = SerializationUtil.Deserialize<CompositionData>(task.compositionData); }
/// <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; }
/// <summary> /// Deprecated Method for adding a new object to the Task EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToTask(Task task) { base.AddObject("Task", task); }
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; } }