Class XBRApiConduit
Provides a simplified API interface for Xperiflow job management operations. This class serves as a high-level wrapper around the ConduitOrchestration functionality, offering convenient methods for creating, starting, and retrieving Xperiflow jobs.
Namespace: Workspace.XBR.Xperiflow.SubApis
Assembly: Xperiflow.dll
public class XBRApiConduit
Examples
// Initialize the XBRApiConduit
var conduit = new XBRApiConduit();
// Create a project creation job with JObject parameters
JObject projectMetadata = new JObject
{
["task_storage"] = new JObject
{
["project_name"] = "Customer Analysis Project",
["description"] = "Advanced customer segmentation analysis",
["application"] = "FOR",
["ptype"] = "regression",
["ttype"] = "timeseries",
["vtype"] = "supervised",
["viewer_identity_ids"] = null,
["editor_identity_ids"] = null,
["manager_identity_ids"] = null
}
};
var job = conduit.CreateAndStartXperiflowJob(sessionInfo, "ProjectCreation", projectMetadata);
Console.WriteLine($"Created job with ID: {job.JobId}");
// Retrieve an existing job
var existingJob = conduit.GetXperiflowJob(sessionInfo, 12345);
Console.WriteLine($"Job status: {existingJob.ActivityStatus.DisplayName}");
Remarks
The XBRApiConduit class provides a streamlined interface for Xperiflow job operations, abstracting away the complexity of session management and client instantiation. It handles the creation of XperiflowSessionInfo and conduit clients internally, making it easier for developers to work with Xperiflow jobs without managing these dependencies directly.
Key Features:
-
Simplified job creation with automatic session and client management
-
Support for multiple parameter types (JObject, strongly-typed objects, string)
-
Optional OIS token support for explicit Xperiflow REST API interaction
-
Consistent error handling and logging across all operations
-
Support for both immediate and scheduled job execution
Methods
GetXperiflowJob(SessionInfo, int, OISToken?)
Retrieves an existing Xperiflow job by its unique identifier.
public XperiflowJob GetXperiflowJob(SessionInfo si, int jobId, OISToken? oisToken = null)
Remarks
This method provides a simplified way to retrieve an existing Xperiflow job by its ID. It handles the creation of necessary session and client objects internally, making it easy to access job information without managing these dependencies manually.
Job Information Available:
Returns
Workspace.XBR.Xperiflow.Conduit.Job.XperiflowJob
A XperiflowJob instance representing the existing job
Parameters
| Type | Name | Description |
|---|---|---|
OneStream.Shared.Common.SessionInfo | si | The session information containing user context and connection details |
System.Int32 | jobId | The unique identifier of the job to retrieve |
OneStream.Shared.Wcf.OISToken | oisToken | Optional OIS authentication token for explicit interaction with Xperiflow REST API. If null, automatically instantiates one internally. Note: You may want to provide an explicit token due to OneStream platform limitations on which Platform servers are allowed to interact with OIS |
Exceptions
OneStream.Shared.Common.XFException
Thrown when job retrieval fails due to invalid job ID, authentication issues, or system errors
CreateAndStartXperiflowJob(SessionInfo, string, JObject, int?, DateTime?, int?, string?, OISToken?)
Creates and starts a new Xperiflow job with the specified activity type and JObject parameters.
public XperiflowJob CreateAndStartXperiflowJob(SessionInfo si, string activityType, JObject parameters, int? projectId = null, DateTime? scheduledTime = null, int? priority = null, string? appName = null, OISToken? oisToken = null)
Remarks
This method creates a new Xperiflow job with the specified activity type and parameters. It provides a simplified interface by handling session and client management internally. The job behavior depends on whether a scheduled time is provided.
Immediate Execution (scheduledTime = null):
Scheduled Execution (scheduledTime provided):
Returns
Workspace.XBR.Xperiflow.Conduit.Job.XperiflowJob
A new XperiflowJob instance representing the created job
Parameters
| Type | Name | Description |
|---|---|---|
OneStream.Shared.Common.SessionInfo | si | The session information containing user context and connection details |
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 to associate the job with |
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) |
OneStream.Shared.Wcf.OISToken | oisToken | Optional OIS authentication token for explicit interaction with Xperiflow REST API. If null, automatically instantiates one internally. Note: You may want to provide an explicit token due to OneStream platform limitations on which Platform servers are allowed to interact with OIS |
Exceptions
OneStream.Shared.Common.XFException
Thrown when job creation fails due to invalid parameters, authentication issues, or system errors
System.ArgumentException
Thrown when scheduledTime is in the past
CreateAndStartXperiflowJob<T>(SessionInfo, string, T, int?, DateTime?, int?, string?, OISToken?)
Creates and starts a new Xperiflow job with the specified activity type and strongly-typed parameters.
public XperiflowJob CreateAndStartXperiflowJob<T>(SessionInfo si, string activityType, T parameters, int? projectId = null, DateTime? scheduledTime = null, int? priority = null, string? appName = null, OISToken? oisToken = null) 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, while maintaining the same simplified interface as the other overloads.
Type Safety Benefits:
Job Execution Behavior:
Returns
Workspace.XBR.Xperiflow.Conduit.Job.XperiflowJob
A new XperiflowJob instance representing the created job
Parameters
| Type | Name | Description |
|---|---|---|
OneStream.Shared.Common.SessionInfo | si | The session information containing user context and connection details |
System.String | activityType | The type of job to execute |
<T> | parameters | The job parameters as a strongly-typed serializable object |
System.Nullable<System.Int32> | projectId | Optional project ID to associate the job with |
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) |
OneStream.Shared.Wcf.OISToken | oisToken | Optional OIS authentication token for explicit interaction with Xperiflow REST API. If null, automatically instantiates one internally. Note: You may want to provide an explicit token due to OneStream platform limitations on which Platform servers are allowed to interact with OIS |
Type Parameters
| Name | Description |
|---|---|
T | The type of the serializable parameters object |
Exceptions
OneStream.Shared.Common.XFException
Thrown when job creation fails due to invalid parameters, authentication issues, or system errors
System.ArgumentException
Thrown when scheduledTime is in the past
CreateAndStartXperiflowJob(SessionInfo, string, string, int?, DateTime?, int?, string?, OISToken?)
Creates and starts a new Xperiflow job with the specified activity type and string parameters.
public XperiflowJob CreateAndStartXperiflowJob(SessionInfo si, string activityType, string parameters, int? projectId = null, DateTime? scheduledTime = null, int? priority = null, string? appName = null, OISToken? oisToken = null)
Remarks
This method creates a new Xperiflow job using a JSON string for parameters. The string is automatically parsed into a JObject before being passed to the underlying job creation system. This provides flexibility when working with parameters that are already in JSON string format or when integrating with systems that provide JSON strings directly.
String Parameter Benefits:
Job Execution Behavior:
Returns
Workspace.XBR.Xperiflow.Conduit.Job.XperiflowJob
A new XperiflowJob instance representing the created job
Parameters
| Type | Name | Description |
|---|---|---|
OneStream.Shared.Common.SessionInfo | si | The session information containing user context and connection details |
System.String | activityType | The type of job to execute |
System.String | parameters | The job parameters as a JSON string |
System.Nullable<System.Int32> | projectId | Optional project ID to associate the job with |
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) |
OneStream.Shared.Wcf.OISToken | oisToken | Optional OIS authentication token for explicit interaction with Xperiflow REST API. If null, automatically instantiates one internally. Note: You may want to provide an explicit token due to OneStream platform limitations on which Platform servers are allowed to interact with OIS |
Exceptions
OneStream.Shared.Common.XFException
Thrown when job creation fails due to invalid parameters, authentication issues, or system errors
System.ArgumentException
Thrown when scheduledTime is in the past or parameters string is invalid JSON
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