Skip to main content

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

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

Declaration
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
TypeNameDescription
OneStream.Shared.Common.SessionInfosiThe session information containing user context and connection details
System.Int32jobIdThe unique identifier of the job to retrieve
OneStream.Shared.Wcf.OISTokenoisTokenOptional 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.

Declaration
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
TypeNameDescription
OneStream.Shared.Common.SessionInfosiThe session information containing user context and connection details
System.StringactivityTypeThe type of job to execute
Newtonsoft.Json.Linq.JObjectparametersThe job parameters as a JObject
System.Nullable<System.Int32>projectIdOptional project ID to associate the job with
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)
OneStream.Shared.Wcf.OISTokenoisTokenOptional 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.

Declaration
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
TypeNameDescription
OneStream.Shared.Common.SessionInfosiThe session information containing user context and connection details
System.StringactivityTypeThe type of job to execute
<T>parametersThe job parameters as a strongly-typed serializable object
System.Nullable<System.Int32>projectIdOptional project ID to associate the job with
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)
OneStream.Shared.Wcf.OISTokenoisTokenOptional 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
NameDescription
TThe 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.

Declaration
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
TypeNameDescription
OneStream.Shared.Common.SessionInfosiThe session information containing user context and connection details
System.StringactivityTypeThe type of job to execute
System.StringparametersThe job parameters as a JSON string
System.Nullable<System.Int32>projectIdOptional project ID to associate the job with
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)
OneStream.Shared.Wcf.OISTokenoisTokenOptional 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.GetHashCode
  • System.Object.GetType
  • System.Object.MemberwiseClone
  • System.Object.ReferenceEquals(System.Object,System.Object)
  • System.Object.ToString

Was this page helpful?