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 Rules | Workspace Assemblies | |
|---|---|---|
| File structure | Single file per rule | Multiple files and folders per assembly |
| Compilation | Each rule compiles independently | All files compile together into one assembly |
| Code sharing | BR referencing or ContainsGlobalFunctionsForFormulas | Proper class-level dependencies with Imports/using |
| Organization | Flat list on the Business Rules page | Hierarchical: Workspace > Maintenance Unit > Assembly > Files |
| Language | VB.NET (Business Rules page) | VB.NET or C# (per assembly) |
| Namespace | OneStream.BusinessRule.{Type}.{RuleName} | Workspace.{Prefix}.{AssemblyName} |
| Development experience | Single editor pane | Folders, multiple files, dependency management |
The Workspace Hierarchy
- 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.
Workspace Properties
Key properties on the Workspace object that affect assemblies:
| Property | Description |
|---|---|
| NamespacePrefix | The prefix used in the compiled namespace (Workspace.{Prefix}.{Assembly}). If blank, defaults to the workspace name. |
| IsShareableWorkspace | When True, other workspaces can reference this workspace's assemblies. The Default workspace is always shareable. |
| SharedWorkspaceNames | Comma-separated list of workspace names this workspace can reference (e.g., SharedWorkspace1,SharedWorkspace2). |
| AccessGroup | Controls which users can see and use the workspace's content. |
| MaintenanceGroup | Controls which users can edit and administer the workspace. |
| WorkspaceAssemblyService | The entry-point factory class for this workspace (e.g., MyAssembly.WsAssemblyFactory). |
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:
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: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 Type | Description |
|---|---|
| StandardClass | A regular class file â utilities, helpers, shared logic |
| ServiceFactory | The entry-point factory that routes service requests to your classes |
| DashboardDataSetBR | Dashboard DataSet business rule (same signature as BR page DataSet rules) |
| DashboardExtenderBR | Dashboard Extender business rule |
| DashboardStringFunctionBR | Dashboard String Function (XFBR) business rule |
| CubeViewExtenderBR | CubeView Extender business rule |
| SpreadsheetBR | Spreadsheet business rule |
| FinanceCoreService | Finance core calculation service |
| DataSetService | DataSet service for the Service Factory pattern |
| DashboardService | Dashboard service for the Service Factory pattern |
| ComponentService | Component service for the Service Factory pattern |
| DataManagementStepService | Data Management step service |
| DynamicDashboardsService | Dynamic dashboard creation service |
| DynamicDimensionService | Dynamic dimension service |
| DynamicCubeViewService | Dynamic CubeView service |
| DynamicDataService | Dynamic data service |
| DynamicGridService | Dynamic grid service |
| FinanceCustomCalculateService | Finance custom calculation service |
| FinanceGetDataCellService | Finance GetDataCell service |
| FinanceMemberListsService | Finance member list service |
| SqlTableEditorService | SQL table editor service |
| TableViewService | Table view service |
| XFBRStringService | String 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.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:
For example, if your assembly is
DashboardLib and the factory file is WsAssemblyFactory:How the Factory Routes Requests
When OneStream needs to execute assembly code (e.g., a dashboard requests a DataSet), it:
- Looks up the Workspace Assembly Service property to find the factory class
- Calls
CreateWsAssemblyServiceInstancewith the appropriateWsAssemblyServiceType - The factory returns the concrete service class
- 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:WsAssemblyServiceType Reference
The
WsAssemblyServiceType enum defines all the service types that the factory can route to:| Value | Enum | Description |
|---|---|---|
| 0 | Component | Generic component service |
| 1 | Dashboard | Dashboard rendering and interaction |
| 2 | DataManagementStep | Data Management sequence steps |
| 3 | DataSet | Dashboard DataSet provider |
| 4 | DynamicDashboards | Dynamic dashboard creation |
| 5 | DynamicDimension | Dynamic dimension member generation |
| 6 | DynamicCubeView | Dynamic CubeView creation |
| 7 | DynamicData | Dynamic data provider |
| 8 | DynamicGrid | Dynamic grid generation |
| 9 | FinanceCore | Core finance engine calculations |
| 10 | FinanceCustomCalculate | Custom calculation logic |
| 11 | FinanceGetDataCell | Custom GetDataCell logic |
| 12 | FinanceMemberLists | Dynamic member list generation |
| 13 | SqlTableEditor | SQL table editor service |
| 14 | TableView | Table view rendering |
| 15 | XFBRString | String 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:
Shorthand keywords are also available:
| Syntax | Behavior |
|---|---|
WS | Looks at the Workspace-level factory only |
WSMU | Looks at the Maintenance Unit first, then falls back to the Workspace |
Current | References the same Maintenance Unit containing the step (Data Management) |
Related Content
- Referencing Assemblies and Sharing Code â Create assembly dependencies, reference code across workspaces, and use the compiled namespace pattern for in-code class references