Skip to main content

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

Declaration
public class XperiflowJob

Properties

JobId

Gets or sets the unique identifier for the job.

Declaration
public int JobId { get; }

ActivityType

Gets or sets the type of activity associated with the job.

Declaration
public string ActivityType { get; }

ActivitySource

Gets or sets the source of the activity for the job.

Declaration
public string ActivitySource { get; }

ActivityStatus

Gets or sets the current status of the job activity.

Declaration
public XperiflowActivityStatus ActivityStatus { get; }

Parameters

Gets or sets the parameters of the job.

Declaration
public JObject Parameters { get; }

CreationTime

Gets or sets the creation time of the job.

Declaration
public DateTime CreationTime { get; }

QueuedTime

Gets or sets the queued time of the job.

Declaration
public DateTime? QueuedTime { get; }

StartTime

Gets or sets the start time of the job.

Declaration
public DateTime? StartTime { get; }

EndTime

Gets or sets the end time of the job.

Declaration
public DateTime? EndTime { get; }

LastActivityTime

Gets or sets the last activity time of the job.

Declaration
public DateTime? LastActivityTime { get; }

PercentComplete

Gets or sets the percent complete of the job.

Declaration
public double PercentComplete { get; }

TotalTasks

Gets or sets the total tasks of the job.

Declaration
public int TotalTasks { get; }

CompletedTasks

Gets or sets the completed tasks of the job.

Declaration
public int CompletedTasks { get; }

ServerName

Gets or sets the server name of the job.

Declaration
public string? ServerName { get; }

AppName

Gets or sets the app name of the job.

Declaration
public string? AppName { get; }

ProjectId

Gets or sets the project id of the job.

Declaration
public int ProjectId { get; }

CompletedRuntimeDuration

Computes the completed runtime duration of the job. This is the time take from EndTime to StartTime.

Declaration
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.

Declaration
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.

Declaration
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.

Declaration
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
TypeNameDescription
System.TimeSpantimeoutThe 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.CancellationTokencancellationTokenThe 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.

Declaration
public Task CancelAsync(CancellationToken cancellationToken = default)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Threading.CancellationTokencancellationToken

Inherited Members

  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object,System.Object)
  • System.Object.GetHashCode
  • System.Object.GetType
  • System.Object.MemberwiseClone
  • System.Object.ReferenceEquals(System.Object,System.Object)
  • System.Object.ToString

Was this page helpful?