FRAMES | NO FRAMES
CopyProject Method

Creates a copy of project under another name.

Availability: Business Analyst Server.


void CopyProject ( 
    string  WorkspaceName,
    string  ProjectName,
    string  NewProjectName,
    string  DestinationWorkspaceName
);

Parameter Description
WorkspaceName Workspace name. Type String.
ProjectName Project name. Type String.
NewProjectName New project name. Type String.
Length Destination workspace name. If this parameter is null, the destination workspace will be the source workspace. Type String. Available with Business Analyst Online and Business Analyst Server 10.0 SP2.

Remarks

If the source project is absent, this method throws an exception. If the target project already exists, this method has no effect.

Examples

The example below creates a copy of a project in the Business Analyst Repository.

C#
// Instantiate the BAServerHelper class to access analysis methods
BAServerHelper baServerHelper = new BAServerHelper();
 
string workspace = "Default Workspace";
string sourceProject = "Default Project";
string targetProject = "project_CopyProject";
 
// Create a project copy
baServerHelper.CopyProject(workspace, sourceProject, targetProject);
 
// Get the list of all projects and ensure that the given project exists
string[] projects = baServerHelper.GetProjects(workspace);
bool projectFound = Array.IndexOf(projects, targetProject) >= 0;
 
// Remove the project copy
baServerHelper.DeleteProject(workspace, targetProject);

See Also