Workspace Assemblies

Getting Started with Workspace Assemblies

Workspace Assemblies are multi-file code libraries integrated into OneStream workspaces. Unlike standalone Business Rules — which are single-file, independently compiled units — assemblies let you organize code across files and folders, define proper class-level dependencies, and compile everything into a single unit. They provide a Visual Studio-like development experience and are the recommended approach for any non-trivial OneStream application.

Why Workspace Assemblies?

Business RulesWorkspace Assemblies
File structureSingle file per ruleMultiple files and folders per assembly
CompilationEach rule compiles independentlyAll files compile together into one assembly
Code sharingBR referencing or ContainsGlobalFunctionsForFormulasProper class-level dependencies with Imports/using
OrganizationFlat list on the Business Rules pageHierarchical: Workspace > Maintenance Unit > Assembly > Files
LanguageVB.NET (Business Rules page)VB.NET or C# (per assembly)
NamespaceOneStream.BusinessRule.{Type}.{RuleName}Workspace.{Prefix}.{AssemblyName}
Development experienceSingle editor paneFolders, multiple files, dependency management
💡Tip
If you're new to OneStream development, start with the Business Rules guide series to learn the fundamentals. Workspace Assemblies build on the same concepts — SessionInfo, BRApi, args objects — but provide a more powerful way to organize and share your code.

The Workspace Hierarchy

diagramWorkspace Hierarchy

Loading diagram...

  • Workspace — The top-level container. Every application has a Default workspace (always shareable, namespace prefix = Default). You can create additional workspaces to group related functionality.
  • Maintenance Unit — An organizational container within a workspace. Each maintenance unit can hold assemblies, dashboard components, and cube view groups. Think of maintenance units as project-level containers.
  • Assembly — A compiled code unit containing files, folders, and dependencies. All files in an assembly compile together and share a namespace.
  • Dependencies — Links to other assemblies, prepackaged DLLs, or Business Rules that your assembly needs to reference.
â„šī¸Info
Think of Workspaces as solution-level containers and Maintenance Units as project-level containers. A workspace groups related maintenance units together, while each maintenance unit manages its own assemblies, dashboards, and security.

Workspace Properties

Key properties on the Workspace object that affect assemblies:
PropertyDescription
NamespacePrefixThe prefix used in the compiled namespace (Workspace.{Prefix}.{Assembly}). If blank, defaults to the workspace name.
IsShareableWorkspaceWhen True, other workspaces can reference this workspace's assemblies. The Default workspace is always shareable.
SharedWorkspaceNamesComma-separated list of workspace names this workspace can reference (e.g., SharedWorkspace1,SharedWorkspace2).
AccessGroupControls which users can see and use the workspace's content.
MaintenanceGroupControls which users can edit and administer the workspace.
WorkspaceAssemblyServiceThe entry-point factory class for this workspace (e.g., MyAssembly.WsAssemblyFactory).
💡Tip
Always set the NamespacePrefix property explicitly rather than relying on the default. If you later rename the workspace, references using the old name as a prefix will break — but an explicit prefix remains stable.

Assembly Structure

When you create an assembly, you choose a compiler language (VB.NET or C#) and start adding files and folders. All files in the assembly compile together into a single namespace:
plaintext
1Workspace.{NamespacePrefix}.{AssemblyName}
Each file in the assembly becomes a class within that namespace. For example, if your workspace has NamespacePrefix = FP and the assembly is named DashboardLib, a file called RevenueDataSet compiles to:
plaintext
1Workspace.FP.DashboardLib.RevenueDataSet
You can organize files into folders for clarity — folders don't affect the compiled namespace, they're purely organizational.

Source Code Types

When adding a file to an assembly, you select its type. This determines the code template and how OneStream treats the file:
Source Code TypeDescription
StandardClassA regular class file — utilities, helpers, shared logic
ServiceFactoryThe entry-point factory that routes service requests to your classes
DashboardDataSetBRDashboard DataSet business rule (same signature as BR page DataSet rules)
DashboardExtenderBRDashboard Extender business rule
DashboardStringFunctionBRDashboard String Function (XFBR) business rule
CubeViewExtenderBRCubeView Extender business rule
SpreadsheetBRSpreadsheet business rule
FinanceCoreServiceFinance core calculation service
DataSetServiceDataSet service for the Service Factory pattern
DashboardServiceDashboard service for the Service Factory pattern
ComponentServiceComponent service for the Service Factory pattern
DataManagementStepServiceData Management step service
DynamicDashboardsServiceDynamic dashboard creation service
DynamicDimensionServiceDynamic dimension service
DynamicCubeViewServiceDynamic CubeView service
DynamicDataServiceDynamic data service
DynamicGridServiceDynamic grid service
FinanceCustomCalculateServiceFinance custom calculation service
FinanceGetDataCellServiceFinance GetDataCell service
FinanceMemberListsServiceFinance member list service
SqlTableEditorServiceSQL table editor service
TableViewServiceTable view service
XFBRStringServiceString function (XFBR) service

The Service Factory Pattern

The Service Factory is the entry point for workspace assemblies. It implements the IWsAssemblyServiceFactory interface with a single method — CreateWsAssemblyServiceInstance — that OneStream calls to get the appropriate service class for a given request type.
1Imports OneStream.Shared.Common
2Imports OneStream.Shared.Wcf
3Imports OneStreamWorkspacesApi
4
5Namespace Workspace.__WsNamespacePrefix.__WsAssemblyName
6  Public Class WsAssemblyFactory
7      Implements IWsAssemblyServiceFactory
8
9      Public Function CreateWsAssemblyServiceInstance(
10          ByVal si As SessionInfo,
11          ByVal brGlobals As BRGlobals,
12          ByVal workspace As DashboardWorkspace,
13          ByVal wsAssemblyServiceType As WsAssemblyServiceType,
14          ByVal itemName As String) As IWsAssemblyServiceBase _
15          Implements IWsAssemblyServiceFactory.CreateWsAssemblyServiceInstance
16
17          Select Case wsAssemblyServiceType
18              Case WsAssemblyServiceType.DataSet
19                  Return New RevenueDataSet()
20
21              Case WsAssemblyServiceType.Dashboard
22                  Return New MainDashboard()
23
24              Case WsAssemblyServiceType.XFBRString
25                  Return New StringFunctions()
26          End Select
27
28          Return Nothing
29      End Function
30  End Class
31End Namespace

Registering the Factory

After creating the factory file, you need to tell OneStream where to find it. Set the Workspace Assembly Service property on the Maintenance Unit (or Workspace) to:
plaintext
1{AssemblyName}.{FactoryFileName}
For example, if your assembly is DashboardLib and the factory file is WsAssemblyFactory:
plaintext
1DashboardLib.WsAssemblyFactory
âš ī¸Warning
The most common setup issue with workspace assemblies is forgetting to set the Workspace Assembly Service property. If your assembly compiles but nothing runs at runtime, check this property first — it must be set on either the Maintenance Unit or the Workspace.

How the Factory Routes Requests

diagramService Factory Request Flow

Loading diagram...

When OneStream needs to execute assembly code (e.g., a dashboard requests a DataSet), it:
  1. Looks up the Workspace Assembly Service property to find the factory class
  2. Calls CreateWsAssemblyServiceInstance with the appropriate WsAssemblyServiceType
  3. The factory returns the concrete service class
  4. OneStream invokes the service method on that class

DataSet Service Example

Here's a simple DataSet service class that the factory returns for WsAssemblyServiceType.DataSet:
1Imports System.Data
2Imports OneStream.Shared.Common
3Imports OneStream.Shared.Wcf
4
5Namespace Workspace.__WsNamespacePrefix.__WsAssemblyName
6  Public Class RevenueDataSet
7      Implements IWsAssemblyServiceBase
8
9      Public Function GetDataSet(
10          ByVal si As SessionInfo,
11          ByVal globals As BRGlobals,
12          ByVal api As Object,
13          ByVal args As DashboardDataSetArgs) As Object
14
15          Select Case args.FunctionType
16              Case DashboardDataSetFunctionType.GetDataSet
17                  If args.DataSetName.XFEqualsIgnoreCase("RevenueByEntity") Then
18                      Dim sql As String = "SELECT EntityName, Amount FROM vFactData WHERE ScenarioName = 'Actual'"
19                      Using dbConn As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si)
20                          Return BRApi.Database.ExecuteSqlUsingReader(dbConn, sql, Nothing, False)
21                      End Using
22                  End If
23          End Select
24
25          Return Nothing
26      End Function
27  End Class
28End Namespace

WsAssemblyServiceType Reference

The WsAssemblyServiceType enum defines all the service types that the factory can route to:
ValueEnumDescription
0ComponentGeneric component service
1DashboardDashboard rendering and interaction
2DataManagementStepData Management sequence steps
3DataSetDashboard DataSet provider
4DynamicDashboardsDynamic dashboard creation
5DynamicDimensionDynamic dimension member generation
6DynamicCubeViewDynamic CubeView creation
7DynamicDataDynamic data provider
8DynamicGridDynamic grid generation
9FinanceCoreCore finance engine calculations
10FinanceCustomCalculateCustom calculation logic
11FinanceGetDataCellCustom GetDataCell logic
12FinanceMemberListsDynamic member list generation
13SqlTableEditorSQL table editor service
14TableViewTable view rendering
15XFBRStringString function (XFBR) service

Referencing from Dashboard Components

When a dashboard component needs to call an assembly-based DataSet or Extender, use the workspace referencing syntax instead of a Business Rule name:
plaintext
1{Workspace.WorkspaceName.AssemblyName.FileName}{DataSetName}{Param1=[Value1]}
Shorthand keywords are also available:
SyntaxBehavior
WSLooks at the Workspace-level factory only
WSMULooks at the Maintenance Unit first, then falls back to the Workspace
CurrentReferences the same Maintenance Unit containing the step (Data Management)
â„šī¸Info
For a complete breakdown of referencing syntax — including cross-workspace references, in-code class references, and the compiled namespace pattern — see Referencing Assemblies and Sharing Code.