Skip to main content

Class XperiflowActivityStatus

Represents the activity statuses that a Job or Task may be in at a given time. This class provides a type-safe way to work with job activity statuses and includes utility methods for categorizing statuses into different criteria groups.

Namespace: Workspace.XBR.Xperiflow.Conduit.Job

Assembly: Xperiflow.dll

Declaration
public class XperiflowActivityStatus : StringEnumeration, IComparable

Inheritance: System.Object -> Workspace.XBR.Xperiflow.Utilities.Text.StringEnumeration

Examples

// Create a job status from string value
var status = XperiflowActivityStatus.FromDisplayName("running");
Console.WriteLine($"Job is {status.DisplayName}"); // Output: Job is running

// Check if status indicates completion
if (XperiflowActivityStatus.StoppingCriteria.Contains(status))
{
Console.WriteLine("Job has reached a terminal state");
}

// Check if job can be rerun
if (XperiflowActivityStatus.RerunnableCriteria.Contains(status))
{
Console.WriteLine("Job can be rerun after error");
}

Remarks

This enumeration class is based on the Python ActivityStatus_ class and provides equivalent functionality for the C# Xperiflow orchestration system. Each status represents a specific state in the job lifecycle from initialization to completion.

Status Categories:

  • Initialization: INITIALIZED - The genesis state before database insertion

  • Queued States: QUEUED, CHECKING, WORKERQUEUED - Various queuing mechanisms

  • Running States: RUNNING, RUNNINGSUBTASKS - Active execution states

  • Paused States: PENDING_PAUSED, PAUSED - Temporary suspension states

  • Completion States: COMPLETED - Successful completion

  • Cancellation States: USERCANCELLED, SYSCANCELLED - User and system cancellations

  • Error States: SYSERROR, SYSERROR_RERUNNABLE - System errors with retry capability

Implements: System.IComparable

Properties

StoppingCriteria

Gets the collection of statuses that indicate a job has reached a terminal state. These statuses represent the end of the job lifecycle and no further processing will occur.

Declaration
public static IReadOnlyCollection<XperiflowActivityStatus> StoppingCriteria { get; }
Remarks

Jobs in these states have finished execution and will not transition to other states. Use this collection to determine when a job monitoring loop should terminate.

RerunnableCriteria

Gets the collection of statuses that indicate a job can be rerun after encountering an error. These statuses represent recoverable error conditions where the job may be retried.

Declaration
public static IReadOnlyCollection<XperiflowActivityStatus> RerunnableCriteria { get; }
Remarks

Jobs in these states encountered system errors but can potentially be restarted without manual intervention. This is useful for implementing automatic retry logic.

FailureCriteria

Gets the collection of statuses that indicate a job has failed or been cancelled. These statuses represent unsuccessful job completion scenarios.

Declaration
public static IReadOnlyCollection<XperiflowActivityStatus> FailureCriteria { get; }
Remarks

Jobs in these states did not complete successfully due to errors or cancellations. Use this collection to identify failed jobs that may require attention or cleanup.

QueuedCriteria

Gets the collection of statuses that indicate a job is waiting to be processed. These statuses represent various queuing mechanisms in the job processing pipeline.

Declaration
public static IReadOnlyCollection<XperiflowActivityStatus> QueuedCriteria { get; }
Remarks

Jobs in these states are waiting for resources or processing slots to become available. This is useful for monitoring job queue status and estimating wait times.

RunningCriteria

Gets the collection of statuses that indicate a job is actively executing. These statuses represent jobs that are currently being processed by the system.

Declaration
public static IReadOnlyCollection<XperiflowActivityStatus> RunningCriteria { get; }
Remarks

Jobs in these states are actively consuming system resources and making progress. This is useful for monitoring active job execution and resource utilization.

JobActivityOptions

Gets the collection of statuses that are valid for job activity operations. These statuses represent the core job lifecycle states that are typically used in job management and monitoring operations.

Declaration
public static IReadOnlyCollection<XperiflowActivityStatus> JobActivityOptions { get; }
Remarks

This collection represents the primary job activity statuses that are most commonly encountered in job management scenarios. It excludes initialization and paused states that are typically internal to the job processing system.

InStoppingCriteria

Gets a value indicating whether this activity status represents a terminal state. Terminal states represent the end of the job lifecycle with no further processing.

Declaration
public bool InStoppingCriteria { get; }
Remarks

This property provides a convenient way to check if a job has reached a terminal state without calling the IsStopping() method. Terminal states include: COMPLETED, SYSCANCELLED, USERCANCELLED, SYSERROR, SYSERROR_RERUNNABLE.

InRerunnableCriteria

Gets a value indicating whether this activity status can be rerun after encountering an error.

Declaration
public bool InRerunnableCriteria { get; }
Remarks

This property provides a convenient way to check if a job can be automatically retried without calling the IsRerunnable() method. Currently only SYSERROR_RERUNNABLE status allows for automatic retry.

InFailureCriteria

Gets a value indicating whether this activity status represents a failure or cancellation.

Declaration
public bool InFailureCriteria { get; }
Remarks

This property provides a convenient way to check if a job has failed without calling the IsFailure() method. Failure states include: SYSERROR, SYSCANCELLED, USERCANCELLED, SYSERROR_RERUNNABLE.

InQueuedCriteria

Gets a value indicating whether this activity status represents a queued state.

Declaration
public bool InQueuedCriteria { get; }
Remarks

This property provides a convenient way to check if a job is waiting to be processed without calling the IsQueued() method. Queued states include: QUEUED, CHECKING, WORKERQUEUED.

InRunningCriteria

Gets a value indicating whether this activity status represents an active execution state.

Declaration
public bool InRunningCriteria { get; }
Remarks

This property provides a convenient way to check if a job is actively executing without calling the IsRunning() method. Running states include: RUNNING, RUNNINGSUBTASKS.

InJobActivityOptions

Gets a value indicating whether this activity status is valid for job activity operations and reporting.

Declaration
public bool InJobActivityOptions { get; }
Remarks

This property provides a convenient way to check if a job status is suitable for reporting without calling the IsValidForReporting() method. Valid reporting states include: QUEUED, CHECKING, RUNNING, COMPLETED, USERCANCELLED, SYSCANCELLED, SYSERROR, SYSERROR_RERUNNABLE. This excludes initialization and paused states that are typically internal to the job processing system.

Fields

Initialized

Denotes a Task or Job is in an initialized state. This is the genesis state that Task will exist in until it is initially inserted into the database.

Declaration
public static readonly XperiflowActivityStatus Initialized

WorkerQueued

Denotes a Task or Job was sent to worker queue.

Declaration
public static readonly XperiflowActivityStatus WorkerQueued

Queued

Denotes a Task or Job is queued.

Declaration
public static readonly XperiflowActivityStatus Queued

Running

Denotes a Task or Job is currently running.

Declaration
public static readonly XperiflowActivityStatus Running

Checking

Only for jobs, denotes a job is being checked to see if it can be picked up by a caller server. See CallerServer._find_job_with_access_filter() function for more details.

Declaration
public static readonly XperiflowActivityStatus Checking

RunningSubTasks

Denotes a Task or Job has subtasks currently running (or have been queued).

Declaration
public static readonly XperiflowActivityStatus RunningSubTasks

PendingPaused

Denotes a Task or Job is pending pause operation.

Declaration
public static readonly XperiflowActivityStatus PendingPaused

Paused

Denotes a Task or Job is currently paused.

Declaration
public static readonly XperiflowActivityStatus Paused

Completed

Denotes a Task or Job has completed.

Declaration
public static readonly XperiflowActivityStatus Completed

PendingUserCancelled

Denotes a Task or Job is pending user cancellation.

Declaration
public static readonly XperiflowActivityStatus PendingUserCancelled

UserCancelled

Denotes a Task or Job has been cancelled by a user.

Declaration
public static readonly XperiflowActivityStatus UserCancelled

PendingSysCancelled

Denotes a Task or Job is pending system cancellation.

Declaration
public static readonly XperiflowActivityStatus PendingSysCancelled

SysCancelled

Denotes a Task or Job has been cancelled by the system. This will typically happen when a server or process is hanging and the process times out.

Declaration
public static readonly XperiflowActivityStatus SysCancelled

SysError

Denotes a Task or Job has been cancelled by a Program Error in the engine.

Declaration
public static readonly XperiflowActivityStatus SysError

SysErrorRerunnable

Denotes a Task or Job has been cancelled by a Program Error in the engine but can be rerun.

Declaration
public static readonly XperiflowActivityStatus SysErrorRerunnable

Implements

  • System.IComparable

Inherited Members

Was this page helpful?