/// <summary> /// returns JobStatus for given job id, /// returns the current status if the jobid found in this workflow. /// </summary> /// <param name="workflowId">JobId</param> /// <returns></returns> public JobStatus GetStatus(JobId workflowId) { if (workflowId.Equals(Current.Id)) { return(_workflowThread.GetStatus(workflowId.ToString())); } if (_currentJobId != null && workflowId.Equals(_currentJobId)) { return(JobStatus.Running); } var key = workflowId.ToString(); if (_jobStatus.ContainsKey(key)) { return(_jobStatus[key]); } if (!_workflow.Exists(j => j.Id.Equals(workflowId))) { throw new KeyNotFoundException("job id : " + workflowId.Id); } return(JobStatus.NotStarted); }
public override bool Equals(object o) { if (!(o is FileInfo)) { return(false); } var v = o as FileInfo; if (!StartTime.Equals(v.StartTime)) { return(false); } if (!EndTime.Equals(v.EndTime)) { return(false); } if (!PrintState.Equals(v.PrintState)) { return(false); } if (!JobId.Equals(v.JobId)) { return(false); } if (!Name.Equals(v.Name)) { return(false); } return(true); }
public override bool Equals(object obj) { return(obj is JobResponse that && JobId.Equals(that.JobId) && JobReference.Equals(that.JobReference) && Signers.Equals(that.Signers) && StatusUrl.Equals(that.StatusUrl)); }
/// <summary> /// get JobResult for given jobid. /// </summary> /// <param name="workflowId">JobId</param> /// <returns></returns> public JobResult GetResult(JobId workflowId) { if (workflowId.Equals(Current.Id)) { return(_workflowThread.GetResult(workflowId.ToString())); } throw new KeyNotFoundException("job id : " + workflowId.Id); }
public bool Equals(ActiveJob other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(JobId.Equals(other.JobId)); }
/// <summary> /// get JobResult for given jobid. /// </summary> /// <param name="workflowId">JobId</param> /// <returns></returns> public JobResult GetResult(JobId workflowId) { if (workflowId.Equals(Current.Id)) { if (_workflowThread.WaitForAll()) { _result = new JobResult(_workflowThread.GetStatus()); } return(_result); } if (_jobStatus.ContainsKey(workflowId.ToString())) { return(_jobStatus[workflowId.ToString()]); } return(null); }
/// <summary> /// returns JobStatus for given job id, /// returns the current status if the jobid found in this workflow. /// </summary> /// <param name="workflowId">JobId</param> /// <returns></returns> public JobStatus GetStatus(JobId workflowId) { if (workflowId.Equals(Current.Id)) { return(_workflowThread.GetStatus()); } if (_jobStatus.ContainsKey(workflowId.ToString())) { return(_jobStatus[workflowId.ToString()].Status); } if (!_workflow.Exists(j => j.Id.Equals(workflowId))) { throw new KeyNotFoundException("JobId"); } return(JobStatus.NotStarted); }