Skip to main content

Class ConduitOrchestration

Provides orchestration capabilities for Xperiflow jobs and scheduled tasks. This class serves as the main entry point for creating and managing jobs within the Xperiflow system.

Namespace: Workspace.XBR.Xperiflow.Conduit

Assembly: Xperiflow.dll

Declaration
public class ConduitOrchestration

Examples

// Initialize the orchestration client
var conduit = new ConduitOrchestration(sessionInfo, xperiflowSessionInfo, conduitClient);

// Create a SensibleAI Forecast project creation job with minimal metadata
JObject minimalMetadata = new JObject
{
["task_storage"] = new JObject
{
["project_name"] = "Minimal Project",
["description"] = "Basic project setup",
["application"] = "FOR",
["ptype"] = "regression",
["ttype"] = "timeseries",
["vtype"] = "supervised",
["viewer_identity_ids"] = null,
["editor_identity_ids"] = null,
["manager_identity_ids"] = null
}
};

var projectJob = conduit.CreateAndStartJobAsync("ProjectCreation", minimalMetadata).Result;

// Create a scheduled project creation job
var scheduledTime = DateTime.Today.AddDays(1).AddHours(2);
var scheduledProjectJob = conduit.CreateAndStartJobAsync("ProjectCreation", minimalMetadata,
scheduledTime: scheduledTime).Result;

Remarks

The ConduitOrchestration class provides a high-level API for job management operations including creating immediate jobs, scheduled jobs, and managing job parameters. It handles the communication with the Xperiflow conduit API and provides type-safe methods for job creation.

Key Features:

  • Create immediate jobs with JObject or strongly-typed parameters

  • Create scheduled jobs for future execution

  • Support for optional job configuration (app name, project ID, priority)

  • Automatic parameter serialization for strongly-typed objects

  • Comprehensive error handling and logging

Methods

CreateAndStartJobAsync(string, JObject, int?, DateTime?, int?, string?, CancellationToken)

Creates and starts a new Xperiflow job with the specified activity type and parameters.

Declaration
public Task<XperiflowJob> CreateAndStartJobAsync(string activityType, JObject parameters, int? projectId = null, DateTime? scheduledTime = null, int? priority = null, string? appName = null, CancellationToken cancellationToken = default)
Remarks

This method creates a new job in the Xperiflow system with the specified job activity type and parameters. The job behavior depends on whether a scheduled time is provided:

Immediate Execution (scheduledTime = null):

Scheduled Execution (scheduledTime provided):

Returns

Task< Workspace.XBR.Xperiflow.Conduit.Job.XperiflowJob >

A new XperiflowJob instance representing the created job

Parameters
TypeNameDescription
System.StringactivityTypeThe type of job to execute
Newtonsoft.Json.Linq.JObjectparametersThe job parameters as a JObject
System.Nullable<System.Int32>projectIdOptional project ID
System.Nullable<System.DateTime>scheduledTimeOptional scheduled time for future execution. If null, job is queued to execute immediately
System.Nullable<System.Int32>priorityOptional priority level. The lower the number, the higher the priority
System.StringappNameOptional application name (defaults to current app)
System.Threading.CancellationTokencancellationTokenOptional cancellation token to cancel the operation
Exceptions

OneStream.Shared.Common.XFException Thrown when job creation fails System.ArgumentException Thrown when scheduledTime is in the past

CreateAndStartJobAsync<T>(string, T, int?, DateTime?, int?, string?, CancellationToken)

Creates and starts a new Xperiflow job with the specified activity type and serializable parameters.

Declaration
public Task<XperiflowJob> CreateAndStartJobAsync<T>(string activityType, T parameters, int? projectId = null, DateTime? scheduledTime = null, int? priority = null, string? appName = null, CancellationToken cancellationToken = default) where T : class
Remarks

This overload accepts a strongly-typed serializable object for parameters, which will be automatically serialized to JSON for the job execution. This provides better type safety and IntelliSense support compared to using JObject directly.

The job behavior depends on whether a scheduled time is provided:

Immediate Execution (scheduledTime = null):

Scheduled Execution (scheduledTime provided):

Returns

Task< Workspace.XBR.Xperiflow.Conduit.Job.XperiflowJob >

A new XperiflowJob instance representing the created job

Parameters
TypeNameDescription
System.StringactivityTypeThe type of job to execute
<T>parametersThe job parameters as a serializable object
System.Nullable<System.Int32>projectIdOptional project ID
System.Nullable<System.DateTime>scheduledTimeOptional scheduled time for future execution. If null, job executes immediately
System.Nullable<System.Int32>priorityOptional priority level. The lower the number, the higher the priority.
System.StringappNameOptional application name (defaults to current app)
System.Threading.CancellationTokencancellationTokenOptional cancellation token to cancel the operation
Type Parameters
NameDescription
TThe type of the serializable parameters object
Exceptions

OneStream.Shared.Common.XFException Thrown when job creation fails System.ArgumentException Thrown when scheduledTime is in the past

CreateAndStartJobAsync(string, string, int?, DateTime?, int?, string?, CancellationToken)

Creates and starts a new Xperiflow job with the specified activity type and string parameters.

Declaration
public Task<XperiflowJob> CreateAndStartJobAsync(string activityType, string parameters, int? projectId = null, DateTime? scheduledTime = null, int? priority = null, string? appName = null, CancellationToken cancellationToken = default)
Returns

Task< Workspace.XBR.Xperiflow.Conduit.Job.XperiflowJob >

A new XperiflowJob instance representing the created job

Parameters
TypeNameDescription
System.StringactivityTypeThe type of job to execute
System.StringparametersThe job parameters as a string
System.Nullable<System.Int32>projectIdOptional project ID
System.Nullable<System.DateTime>scheduledTimeOptional scheduled time for future execution. If null, job executes immediately
System.Nullable<System.Int32>priorityOptional priority level. The lower the number, the higher the priority
System.StringappNameOptional application name (defaults to current app)
System.Threading.CancellationTokencancellationTokenOptional cancellation token to cancel the operation
Exceptions

OneStream.Shared.Common.XFException Thrown when job creation fails System.ArgumentException Thrown when scheduledTime is in the past

GetJobAsync(int, CancellationToken)

Retrieves an existing Xperiflow job by its ID.

Declaration
public Task<XperiflowJob> GetJobAsync(int jobId, CancellationToken cancellationToken = default)
Remarks

This method retrieves an existing job from the Xperiflow system by its ID. The returned job instance can be used to monitor the job's status, progress, and other metadata.

Returns

Task< Workspace.XBR.Xperiflow.Conduit.Job.XperiflowJob >

A XperiflowJob instance representing the existing job

Parameters
TypeNameDescription
System.Int32jobIdThe unique identifier of the job to retrieve
System.Threading.CancellationTokencancellationTokenOptional cancellation token to cancel the operation
Exceptions

OneStream.Shared.Common.XFException Thrown when job retrieval fails

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?