FRAMES | NO FRAMES |
Deletes a workspace.
Availability: Business Analyst Server.
void DeleteWorkspace ( string WorkspaceName );
Parameter | Description |
---|---|
WorkspaceName | Name of workspace to delete. Type String. |
If the workspace to delete is absent, this method has no effect. If the "Default Workspace" is deleted, all of its contents will be deleted and the workspace will be recreated on the next full reload.
The example below demonstrates the deletion of an existing workspace in the Business Analyst Server Repository.
C# |
// Instantiate the BAServerHelper class to access analysis methods BAServerHelper baServerHelper = new BAServerHelper(); string deletedWorkspace = "existingWorkspace_DeleteWorkspace"; // Create a workspace to be deleted baServerHelper.CreateWorkspace(deletedWorkspace); // Get the list of all workspaces and ensure that the given workspace exists string[] workspaces = baServerHelper.GetWorkspaces(); bool workspaceFound = Array.IndexOf(workspaces, deletedWorkspace) >= 0; // Delete the workspace baServerHelper.DeleteWorkspace(deletedWorkspace); // Get the list of all workspaces and ensure that the given workspace is absent workspaces = baServerHelper.GetWorkspaces(); bool workspaceDeleted = Array.IndexOf(workspaces, deletedWorkspace) < 0; |