FRAMES | NO FRAMES
RenameWorkspace Method

Renames an existing workspace.

Availability: Business Analyst Server.

void RenameWorkspace ( 
    string  WorkspaceName, 
    string  NewWorkspaceName 
); 

Parameter Description
WorkspaceName Workspace name. Type String.
NewWorkspaceName New workspace name. Type String.

Remarks

If the source workspace is absent or the target workspace already exists, this method has no effect.

Examples

The example below renames a workspace of the Business Analyst Server Repository. In order to demonstrate this method, a new workspace is created and then renamed.

C#
// Instantiate the BAServerHelper class to access analysis methods
BAServerHelper baServerHelper = new BAServerHelper();
 
string sourceWorkspace = "workspace_RenameWorkspace";
string targetWorkspace = "workspace_RenamedWorkspace";
 
// Create the source workspace and delete the target workspace just in case
baServerHelper.CreateWorkspace(sourceWorkspace);
baServerHelper.DeleteWorkspace(targetWorkspace);
 
// Rename the source workspace to the taget workspace
baServerHelper.RenameWorkspace(sourceWorkspace, targetWorkspace);
 
// Get the list of all workspaces and ensure that the source workspace is absent
// and the target workspace exists
string[] workspaces = baServerHelper.GetWorkspaces();
bool sourceMissing = Array.IndexOf(workspaces, sourceWorkspace) < 0;
bool targetFound = Array.IndexOf(workspaces, targetWorkspace) >= 0;
 
// Delete the target workspace
baServerHelper.DeleteWorkspace(targetWorkspace);

See Also