Class XperiflowJob
Represents a Xperiflow job with the ability to monitor and retrieve job metadata. This class provides access to job information with automatic refresh capabilities to ensure the most current job status and details are always available.
Namespace: Workspace.XBR.Xperiflow.Conduit.Job
Assembly: Xperiflow.dll
public class XperiflowJob
Properties
JobId
Gets or sets the unique identifier for the job.
public int JobId { get; }
ActivityType
Gets or sets the type of activity associated with the job.
public string ActivityType { get; }
ActivitySource
Gets or sets the source of the activity for the job.
public string ActivitySource { get; }
ActivityStatus
Gets or sets the current status of the job activity.
public XperiflowActivityStatus ActivityStatus { get; }
Parameters
Gets or sets the parameters of the job.
public JObject Parameters { get; }
CreationTime
Gets or sets the creation time of the job.
public DateTime CreationTime { get; }
QueuedTime
Gets or sets the queued time of the job.
public DateTime? QueuedTime { get; }
StartTime
Gets or sets the start time of the job.
public DateTime? StartTime { get; }
EndTime
Gets or sets the end time of the job.
public DateTime? EndTime { get; }
LastActivityTime
Gets or sets the last activity time of the job.
public DateTime? LastActivityTime { get; }
PercentComplete
Gets or sets the percent complete of the job.
public double PercentComplete { get; }
TotalTasks
Gets or sets the total tasks of the job.
public int TotalTasks { get; }
CompletedTasks
Gets or sets the completed tasks of the job.
public int CompletedTasks { get; }
ServerName
Gets or sets the server name of the job.
public string? ServerName { get; }
AppName
Gets or sets the app name of the job.
public string? AppName { get; }
ProjectId
Gets or sets the project id of the job.
public int ProjectId { get; }
CompletedRuntimeDuration
Computes the completed runtime duration of the job. This is the time take from EndTime to StartTime.
public TimeSpan? CompletedRuntimeDuration { get; }
ReportedRuntimeDuration
Computes the reported runtime duration of the job where "reported" is determined by the LastActivityTime. This is the time delta between StartTime and LastActivityTime.
public TimeSpan? ReportedRuntimeDuration { get; }
RuntimeDuration
Computes the current runtime duration of the job. This is the time delta between StartTime and the current time (if the job has not ended). Otherwise, it is the time delta between StartTime and EndTime.
public TimeSpan? RuntimeDuration { get; }
Methods
WaitForCompletionAsync(TimeSpan, CancellationToken)
Waits for the job to complete (successfully or unsuccessfully). If the job does not complete within the timeout, a job cancellation request will be sent.
public Task WaitForCompletionAsync(TimeSpan timeout = default, CancellationToken cancellationToken = default)
Remarks
Timeout Behavior: The timeout period begins counting down from the moment this method is invoked, regardless of whether the job has actually started executing. This is particularly important for scheduled jobs that may not begin execution until a future time.
Scheduled Job Considerations: When working with scheduled jobs, exercise caution when using this method. If a job is scheduled to run in the future (e.g., 2 hours from now), but you call this method with a 1-hour timeout, the method will timeout and cancel the job before it even begins execution. Always ensure your timeout value accounts for both the scheduling delay and the expected execution time.
Example Scenarios:
Returns
System.Threading.Tasks.Task
The job metadata.
Parameters
| Type | Name | Description |
|---|---|---|
System.TimeSpan | timeout | The duration to wait for the job to complete. If the job does not complete within the timeout, a job cancellation request will be sent. Default is 24 hours. Important: The timeout starts immediately when this method is called, not when the job actually begins execution. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Exceptions
OneStream.Shared.Common.XFException
Thrown when the job metadata cannot be retrieved or refreshed
OneStream.Shared.Common.XFException
Thrown when the job is cancelled due to timeout or cancellation token
CancelAsync(CancellationToken)
Cancels the job. The job may take some time to cancel depending on the job type, and the number of tasks it has.
public Task CancelAsync(CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task
Parameters
| Type | Name |
|---|---|
System.Threading.CancellationToken | cancellationToken |
Inherited Members
System.Object.Equals(System.Object)System.Object.Equals(System.Object,System.Object)System.Object.GetHashCodeSystem.Object.GetTypeSystem.Object.MemberwiseCloneSystem.Object.ReferenceEquals(System.Object,System.Object)System.Object.ToString