Solution Install/Uninstall
Installing a Solution
The following outlines the steps to download and install a Solution from the Solution Exchange into your OneStream development environment.
Prerequisites
- Ensure your OneStream development environment is already installed and up to date.
- Verify that you have the necessary permissions and licenses to install solutions (key may be required to access partner solutions).
Step-by-Step Installation Instructions
-
Open the Solution Exchange: Launch your browser and navigate to the Solution Exchange at https://solutionexchange.onestream.com/.
-
Search for the Solution: Navigate to the Solution Catalog and then use the search bar to locate the desired solution by name. For example, you might search for "Cube."
-
Review of the Solution Details: Before installing, it’s recommended to review the solution’s description, publisher information, versioning, and release notes to ensure it meets your needs.
-
Click “Download”: Once confirmed, click the Download button. The download process may take a few moments depending on the size of the solution.
-
Load the Solution: After the download is completed, navigate to the Application tab of your OneStream development environment. Click “Load/Extract”, then click “Select File” and select the previously downloaded solution from the dialog. Click “Load” to finish the install.
-
Refresh OneStream Application: Refresh the OneStream application. Navigate to the OnePlace tab. Launch the newly downloaded Solution.
Removing a Solution
Solutions in OneStream can significantly enhance your development experience by adding value via extensibility. However, there are several reasons why you might want to uninstall a solution. Compatibility issues are one factor, as certain solutions may conflict with updates to OneStream, leading to errors or unexpected behavior. Additionally, different applications might require different sets of solutions, so uninstalling unnecessary ones can help keep your development environment clean and focused. Lastly, regularly reviewing and uninstalling unused or outdated solutions can help maintain the security of your development environment. By periodically managing your solutions, you can ensure that OneStream remains efficient and tailored to your specific needs.
How to Uninstall
You will want to have a settings page that has descriptions of Uninstall Full, Uninstall UI, as well as buttons that a user can select for both options. If your solution does not have database tables, then you may only want to have one button just for Uninstall UI. Here’s what an end user would do to complete the process:
- Click Application > Solution’s Settings Page > Uninstall
- There are two uninstall options:
- Uninstall UI removes the solution, including related dashboards and business rules but leaves the database and related tables in place. For some releases, this step should be performed before accepting any new version of the solution since some of the dashboards or other objects may have been modified.
- Uninstall Full removes all the related data tables, all data, the solution dashboards, and business rules. Choose this option to completely remove the solution or to perform an upgrade that significantly changes the data tables.
Uninstall procedures are irreversible.
Here’s an example of how an uninstall dashboard could look from your settings page.
Behind the Scenes: Uninstall Routine
When you uninstall a solution, OneStream runs several methods behind the scenes to ensure the solution is completely removed. These methods are executed based on which uninstall type was selected to ensure that all components of the solution are properly uninstalled. Here are the methods that are called during the Uninstall Routine:
DeleteWorkspace()
Deleting a workspace will delete all nested maintenance units, dashboard groups, components, data adapters, parameters, files, and assemblies.
- C#
- VB.NET
private void DeleteWorkspace(SessionInfo si)
{
try
{
// Delete the workspace associated With this solution
Guid workspaceId = Guid.Empty;
// Get the workspace ID to delete
workspaceId = BRApi.Dashboards.Workspaces.GetWorkspaceIDFromName(si, false, "Workspace Name Here");
if (!workspaceId.Equals(Guid.Empty))
{
// Delete workspace And all child items
BRApi.Dashboards.Workspaces.DeleteWorkspace(si, false, workspaceId, true);
}
}
catch (Exception ex)
{
throw ErrorHandler.LogWrite(si, new XFException(si, ex));
}
}
Private Sub DeleteWorkspace(ByVal si As SessionInfo)
Try
'Delete the workspace associated with this solution
Dim workspaceId As Guid = Guid.Empty
'Get the workspace to delete
workspaceId = BRApi.Dashboards.Workspaces.GetWorkspaceIDFromName(si, False, "[Insert Solution Name]")
If Not workspaceId.Equals(Guid.Empty) Then
'Delete workspace and all child items
BRApi.Dashboards.Workspaces.DeleteWorkspace(si, False, workspaceId, True)
End If
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Sub
DeleteProfile()
Deleting a profile will remove the solution’s UI from OnePlace.
- C#
- VB.NET
private static bool DeleteProfile(SessionInfo si, DashboardExtenderArgs args)
{
try
{
// Delete Solution Dashboard Profile
using DbConnInfo dbConnApp = BRApi.Database.CreateApplicationDbConnInfo(si);
using DbConnInfo dbConnFW = BRApi.Database.CreateFrameworkDbConnInfo(si);
DashboardProfile dashProfile = null;
dashProfile = EngineDashboardProfiles.GetProfile(dbConnApp, "[Insert Dashboard Profile Name]");
if (dashProfile != null)
{
SecurityHelperWcf.ValidateDelete(dbConnFW, dbConnApp, DashboardHelperWcf.GetRoleType(true), dashProfile, throwOnError: true);
EngineDashboardProfiles.DeleteProfile(dbConnApp, dashProfile.UniqueID);
}
return true;
}
catch (Exception ex)
{
BRApi.ErrorLog.LogError(si, new XFException(si, ex));
return false;
}
}
Private Sub DeleteDashboardProfile(ByVal si As SessionInfo, ByVal args As DashboardExtenderArgs)
Try
'Delete Solution Dashboard Profile
Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si)
Using dbConnFW As DbConnInfo = BRApi.Database.CreateFrameworkDbConnInfo(si)
Dim dashProfile As DashboardProfile = Nothing
dashProfile = EngineDashboardProfiles.GetProfile(dbConnApp, "[Insert Dashboard Profile Name]")
If dashProfile IsNot Nothing Then
SecurityHelperWcf.ValidateDelete(dbConnFW, dbConnApp, DashboardHelperWcf.GetRoleType(True), dashProfile, throwOnError:=True)
EngineDashboardProfiles.DeleteProfile(dbConnApp, dashProfile.UniqueID)
End If
End Using
End Using
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Sub
DropSolutionTables()
Dropping solution tables will drop all the Solution’s related database tables. This requires a DROP TABLE
SQL script which will be described in the next section.
- C#
- VB.NET
private static bool DropSolutionTables(SessionInfo si, DashboardExtenderArgs args, ref StringBuilder returnMessage)
{
try
{
// Open the DDL script used to create the custom tables required for this solution
if (BRApi.Security.Authorization.IsUserInAdminGroup(si))
{
// Get the SQL from the TableDrop file in the dashboard
string setupFileName = "[Insert Table Drop File Name]";
DashboardFileResource fileResource = BRApi.Dashboards.FileResources.GetFileResource(si, false, args.PrimaryDashboard.WorkspaceID, setupFileName);
if (fileResource == null)
{
returnMessage.AppendLine("Table Drop File (" + setupFileName + ") is missing or invalid.");
return false;
}
else
{
// Define string to hold SQL table drop script
string sqlScript = Encoding.UTF8.GetString(fileResource.FileBytes);
// Create connection to application database
using DbConnInfo dbConnApp = BRApi.Database.CreateApplicationDbConnInfo(si);
try
{
// Create the dashboard Table(s) from the defined script
BRApi.Database.ExecuteActionQuery(dbConnApp, sqlScript, false, true);
// Message that tables dropped successfully
returnMessage.AppendLine("Solution Tables and Data Uninstalled");
return true;
}
catch
{
// Message that table drop failed
returnMessage.AppendLine("Error: Solution Tables and Data NOT Uninstalled");
return false;
}
}
}
else
returnMessage.AppendLine("Security Error: Adminstration Rights Required to Execute Uninstall");
return false;
}
catch (Exception ex)
{
throw ErrorHandler.LogWrite(si, new XFException(si, "Unhandled Exception in DropSolutionTables() function.", ex.Message, ex.InnerException));
}
}
Private Shared Function DropSolutionTables(ByVal si As SessionInfo, ByVal args As DashboardExtenderArgs) As String
Try
'Open the DDL script used to create the custom tables required for this solution
Dim message As String = String.Empty
If BRApi.Security.Authorization.IsUserInAdminGroup(si) Then
'Get the SQL from the TableDrop file in the dashboard
Dim setupFileName As String = "[Insert Table Drop File Name]"
Dim fileResource As DashboardFileResource = BRApi.Dashboards.FileResources.GetFileResource(si, False, args.PrimaryDashboard.WorkspaceID, setupFileName)
If fileResource Is Nothing Then
message = $"Table Drop File ({setupFileName}) is missing or invalid."
Else
'Define string to hold SQL table drop script
Dim sqlScript As String = System.Text.Encoding.UTF8.GetString(fileResource.FileBytes)
'Create connection to application database
Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si)
Try
'Create the dashboard Table(s) from the defined script
BRApi.Database.ExecuteActionQuery(dbConnApp, sqlScript, False, True)
'Message that tables dropped successfully
message = "Solution Tables and Data Uninstalled"
Catch tableEX As Exception
'Message that table drop failed
message = "Error: Solution Tables and Data NOT Uninstalled"
End Try
End Using
End If
Else
message = "Security Error: Adminstration Rights Required to Execute Uninstall"
End If
Return message
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, "Unhandled Exception in DropSolutionTables() function.", ex.Message, ex.InnerException))
End Try
End Function
UninstallSolution()
When called this method will uninstall the UI, Business Rules, and drop all the Solution’s related database tables. It calls a combination of the previous 3 methods based on the uninstall type. For example, if a user selects Uninstall UI (uninstall type does not equal “Full”), then only the DeleteProfile
and DeleteWorkspace
methods are invoked.
- C#
- VB.NET
private static XFSelectionChangedTaskResult UninstallSolution(SessionInfo si, DashboardExtenderArgs args)
{
try
{
// Uninstall UI, BRs and Drop Solution Tables
Guid workspaceId = BRApi.Dashboards.Workspaces.GetWorkspaceIDFromName(si, false, "[Insert Workspace Name]");
string solutionCode = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si, false, workspaceId, "HelpAboutSolutionCode_DTKH");
XFSelectionChangedTaskResult selectionChangedTaskResult = new();
System.Text.StringBuilder message = new();
bool tablesDropped = false;
if (BRApi.Security.Authorization.IsUserInAdminGroup(si))
{
// Uninstall the Solution
string uninstallType = args.NameValuePairs.XFGetValue("Type", "UI");
// Evaluate the uninstall type
if (uninstallType.XFEqualsIgnoreCase("Full"))
{
// Drop all associated database tables
tablesDropped = DropSolutionTables(si, args, ref message);
if (!tablesDropped)
{
message.Append("Error: User Interface & Solution Tables NOT Fully Uninstalled.");
}
}
// Delete Solution Workspace, all child items of that Workspace and the Dashboard Profile
if (DeleteProfile(si) && DeleteWorkspace(si))
{
message.AppendLine("To Complete the Process:");
message.AppendLine("1) Close the Dialog");
message.AppendLine("2) Close the Dashboard Page");
// Log the Uninstall
BRApi.ErrorLog.LogMessage(si, $"Solution ({solutionCode}) was uninstalled [Type: {uninstallType}]{Environment.NewLine}");
}
else
{
message.Append("Error: Profile and/or Workspace could NOT be deleted.");
}
}
else
message.Append("Security Error: Adminstration Rights Required to Execute Uninstall.");
// Set the return value
selectionChangedTaskResult.IsOK = true;
selectionChangedTaskResult.ShowMessageBox = true;
selectionChangedTaskResult.Message = message.ToString();
return selectionChangedTaskResult;
}
catch (Exception ex)
{
throw ErrorHandler.LogWrite(si, new XFException(si, ex));
}
}
Public Function UninstallSolution(ByVal si As SessionInfo, ByVal args As DashboardExtenderArgs) As XFSelectionChangedTaskResult
Try
'Uninstall UI, BRs and Drop Solution Tables
Dim workspaceId As Guid = BRApi.Dashboards.Workspaces.GetWorkspaceIDFromName(si, False, "Allocation Express (ALE)")
Dim solutionCode As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si, False, workspaceId, "HelpAboutSolutionCode_ALEH")
Dim selectionChangedTaskResult As New XFSelectionChangedTaskResult()
Dim message As New Text.StringBuilder
If BRApi.Security.Authorization.IsUserInAdminGroup(si) Then
'Uninstall the Solution
Dim uninstallType As String = args.NameValuePairs.XFGetValue("Type", "UI")
'Evaluate the uninstall type
If uninstallType.XFEqualsIgnoreCase("Full") Then
'Drop all associated database tables
Dim dropMessage As String = DropSolutionTables(si, args)
message.AppendLine(dropMessage)
End If
If uninstallType.XFEqualsIgnoreCase("UI") Or uninstallType.XFEqualsIgnoreCase("Full") Then
'Remove the UI (Maintenance Unit & BRs)
Try
'Delete the Dashboard Profile
Me.DeleteDashboardProfile(si, args)
'Delete Solution BR's - If you have Legacy Business Rules
Me.DropSolutionBRs(si)
'Delete Workspace
Me.DeleteWorkspace(si)
message.AppendLine("User Interface Uninstalled")
message.AppendLine("To Complete the Process:")
message.AppendLine("1) Close the Dialog")
message.AppendLine("2) Close the Dashboard Page")
Catch tableEX As Exception
If message.Length = 0 Then
message.Append("Error: User Interface & Business Rules NOT Fully Uninstalled.")
Else
message.AppendLine("Error: User Interface & Business Rules NOT Fully Uninstalled.")
End If
End Try
End If
'Log the Uninstall
BRApi.ErrorLog.LogMessage(si, $"Solution ({solutionCode}) was uninstalled [Type: {uninstallType}]{Environment.NewLine}")
Else
message.Append("Security Error: Adminstration Rights Required to Execute Uninstall.")
End If
'Set the return value
selectionChangedTaskResult.IsOK = True
selectionChangedTaskResult.ShowMessageBox = True
selectionChangedTaskResult.Message = message.ToString
Return selectionChangedTaskResult
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
Drop Table Script
A DROP TABLE
script in SQL is used to delete an entire table from a database, including all its data and structure. The goal is to remove the table permanently, which can be useful for cleaning up unused tables or resetting a database. However, it's important to use this command with caution, as it cannot be undone and all data in the table will be lost.
When Uninstall Full is selected, the DROP TABLE
script is run. This script will be a SQL command with the tables to dop stored in a TXT file.
USE [YourDatabaseName];
DROP TABLE [YourSchemaName].[TableName1];
DROP TABLE [YourSchemaName].[TableName2];
DROP TABLE [YourSchemaName].[TableName3];
Legacy Business Rules
In the newer versions of the OneStream platform, business logic is handled by the solution’s assemblies in the current workspace. If you are running a OneStream platform version prior to 8.x, then your solution may contain legacy business rules, which you likely will want to remove from the application on uninstall. This requires an additional method.
DropSolutionBRs()
When called this method will uninstall the legacy business rules from the application.
- C#
- VB.NET
private string DropSolutionBRs(SessionInfo si)
{
try
{
// Delete business rules associated with this app
string message = String.Empty;
// List of Business Rules that need to be removed
Dictionary<string, BusinessRuleType> dsbBusinessRules = new Dictionary<string, BusinessRuleType>() {
{"{DashboardExtender BRNames}", BusinessRuleType.DashboardExtender},
{"{XFBRString BRNames}", BusinessRuleType.DashboardStringFunction},
{"{DashboardDataSet BRNames}", BusinessRuleType.DashboardDataSet},
{"{Extensibility BRNames}", BusinessRuleType.Extender},
{"{Finance BRNames}", BusinessRuleType.Finance}
};
if (BRApi.Security.Authorization.IsUserInAdminGroup(si))
{
var frameworkObject = new Framework();
// Get/Delete Dashboard Business Rules
foreach (KeyValuePair<string, BusinessRuleType> br in dsbBusinessRules)
{
BusinessRuleInfo brInfo = frameworkObject.GetBusinessRule(si, false, br.Value, br.Key);
if (brInfo != null && !string.IsNullOrEmpty(brInfo.Name))
{
frameworkObject.DeleteBusinessRule(si, false, br.Value, br.Key);
}
}
}
else
message = "Security Error: Administration Rights Required to Execute Uninstall.";
return message;
}
catch (Exception ex)
{
throw ErrorHandler.LogWrite(si, new XFException(si, ex));
}
}
Private Function DropSolutionBRs(ByVal si As SessionInfo) As String
Try
'Delete business rules associated with this app
Dim message As String = String.Empty
Dim dsbBusinessRules As New Dictionary(Of String, BusinessRuleType) From {
{"DashboardExtender BRNames", BusinessRuleType.DashboardExtender},
{"XFBRString BRNames", BusinessRuleType.DashboardStringFunction},
{"DashboardDataSet BRNames", BusinessRuleType.DashboardDataSet},
{"Extensibility BRNames", BusinessRuleType.Extender},
{"{Finance BRNames}", BusinessRuleType.Finance}
}
If BRApi.Security.Authorization.IsUserInAdminGroup(si) Then
Dim frameworkObject As New Framework
'Get/Delete Dashboard Business Rules
For Each br As KeyValuePair(Of String, BusinessRuleType) In dsbBusinessRules
Dim brInfo As BusinessRuleInfo = frameworkObject.GetBusinessRule(si, False, br.Value, br.Key)
If brInfo IsNot Nothing Then
frameworkObject.DeleteBusinessRule(si, False, br.Value, br.Key)
End If
Next
Else
message = "Security Error: Administration Rights Required to Execute Uninstall."
End If
Return message
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
Dashboard Settings Page
A DROP TABLE
script in SQL is used to delete an entire table from a database, including all its data and structure. The goal is to remove the table permanently, which can be useful for cleaning up unused tables or resetting a database. However, it's important to use this command with caution, as it cannot be undone and all data in the table will be lost. When Uninstall Full is selected, the DROP TABLE
script is run.
Important Considerations
Be sure to extract your solutions as a zip from OneStream so that you can have the current state as a backup before you uninstall. If you uninstall a solution without having an extract, you will lose the current state and any changes that were made.
- Click Application > Tools > Load/Extract
- Select the Extract tab
- From the File Type combo box, select XF Project
- Click the ellipsis button and a file explorer dialog will appear
- Navigate to and select the xfProj file for your solution, then hit Open
- Check the box for Extract To Zip
- Click Extract and save the zip to a destination folder