This method creates a SAS Workspace from a logical
name definition. Here is the signature for this method:
CreateWorkspaceByLogicalName([in]BSTR name,
[in] enum Visibility visibility, [in]BSTR logicalName,
[in]BSTR referenceDN, [out]BSTR *xmlInfo, [out, retval]IWorkspace
**newWorkspace)
The CreateWorkspaceByLogicalName
method creates a new workspace by performing the following steps:
-
Creates a list of all
ServerDefs that define the provided logicalName.
-
Selects the first serverDef
in the list.
-
Locates a LoginDef that
matches both the DomainName (from the ServerDef) and the provided
referenceDN.
-
Attempts to create a
connection, once for each MachineDNSName in the serverDef, adding
the results (either success or failure) into the xmlInfo.
If a connection to SAS
could not be established, then the next serverDef is tried and the
process is repeated from step 3.
If no Workspace has
been created after going through all of the host names in each serverDef
and all of the serverDefs that match the given logicalName, then an
error is returned (SEE_XML). Also, the table of connectionAttempts
is returned in Err.Description (and if IWorkspaces.UseXMLInErrorInfo
is true).
If a Workspace is created,
then the IWorkspace is added to an internal list in the WorkspaceManager.
In this case, the errorString will still show all failed attempts,
if any.
The name that is passed
to the method can be used in other IWorkspaces methods to determine
which workspace to locate or remove. The name is also set on IWorkspace->Name
before this method returns. The SAS Workspace Manager does not ever
look at IWorkspace->Name, so a client could change the name after
calling Create. The xmlInfo parameter is defined only when this method
returns an IWorkspace. For more information, see
Error Reporting
.
Note: The workspace manager should
be notified when a workspace is no longer in use, so that the workspace
can be removed from the internal list, and so the reference that the
workspace manager holds on the Workspace can be released.