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
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.
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
| Type | Name | Description |
|---|---|---|
System.String | activityType | The type of job to execute |
Newtonsoft.Json.Linq.JObject | parameters | The job parameters as a JObject |
System.Nullable<System.Int32> | projectId | Optional project ID |
System.Nullable<System.DateTime> | scheduledTime | Optional scheduled time for future execution. If null, job is queued to execute immediately |
System.Nullable<System.Int32> | priority | Optional priority level. The lower the number, the higher the priority |
System.String | appName | Optional application name (defaults to current app) |
System.Threading.CancellationToken | cancellationToken | Optional 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.
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
| Type | Name | Description |
|---|---|---|
System.String | activityType | The type of job to execute |
<T> | parameters | The job parameters as a serializable object |
System.Nullable<System.Int32> | projectId | Optional project ID |
System.Nullable<System.DateTime> | scheduledTime | Optional scheduled time for future execution. If null, job executes immediately |
System.Nullable<System.Int32> | priority | Optional priority level. The lower the number, the higher the priority. |
System.String | appName | Optional application name (defaults to current app) |
System.Threading.CancellationToken | cancellationToken | Optional cancellation token to cancel the operation |
Type Parameters
| Name | Description |
|---|---|
T | The 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.
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
| Type | Name | Description |
|---|---|---|
System.String | activityType | The type of job to execute |
System.String | parameters | The job parameters as a string |
System.Nullable<System.Int32> | projectId | Optional project ID |
System.Nullable<System.DateTime> | scheduledTime | Optional scheduled time for future execution. If null, job executes immediately |
System.Nullable<System.Int32> | priority | Optional priority level. The lower the number, the higher the priority |
System.String | appName | Optional application name (defaults to current app) |
System.Threading.CancellationToken | cancellationToken | Optional 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.
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
| Type | Name | Description |
|---|---|---|
System.Int32 | jobId | The unique identifier of the job to retrieve |
System.Threading.CancellationToken | cancellationToken | Optional 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.GetHashCodeSystem.Object.GetTypeSystem.Object.MemberwiseCloneSystem.Object.ReferenceEquals(System.Object,System.Object)System.Object.ToString