Project::ReadSchedulingContext method
Gets the scheduling context based on a set of projects and resources.
Namespace: WebSvcProject
Assembly: ProjectServerServices (in ProjectServerServices.dll)
Parameters
- projectUids
- Type: []
An array of project GUIDs.
- resourceUids
- Type: []
An array of resource GUIDs.
Return value
Type: WebSvcProject.ProjectContextDataSetContains the scheduling context that is derived from the specified projects and resources.
Gets a list of projects that are related to specified projects or resources. A relationship exists if one of the following conditions is met:
Projects share enterprise resources (either those on the project team or in the input list).
Projects have interproject dependencies (cross-project links).
Projects share resources with or have cross-project links with projects that are related to projects in the input list (an indirect relationship).
Project Server Permissions
Permission | Description |
|---|---|
Allows a user to open the specified projects. Category permission. |
Consider two projects that share one enterprise resource, as in the following table.
Project name and GUID | Resources and GUIDs |
|---|---|
Project1 f0e98e26-2c9c-4f74-b40a-640f3f3f03f5 | Resource1; d58fd816-d380-46e3-aff1-6cef617d32a2 Resource2; b3dab395-bc33-4dd7-a3a7-a45522857369
|
Project2 a9d03b87-37f1-473d-90f6-77ba3c521a40 | Resource1; d58fd816-d380-46e3-aff1-6cef617d32a2
|
In the following code fragment for a test application, WebSvcProject is an arbitrary name for a reference to the Project web service, and project is an initialized instance of the WebSvcProject.Project class.
try { Guid[] projectUids = { new Guid("a9d03b87-37f1-473d-90f6-77ba3c521a40") }; Guid[] resourceUids = null; WebSvcProject.ProjectContextDataSet dsProjectContext = project.ReadSchedulingContext(projectUids, resourceUids); dsProjectContext.WriteXml(@"C:\Tests\SchedulingContextOut.txt"); } catch (SoapException ex) { . . . }
The value of the Relationship element in the SchedulingContextOut.txt file shows that Project2 is related to Project1 by a shared resource. If you add one or both resource GUIDs to the resourceUids array, the result is the same.
Note |
|---|
If you add both project GUIDs to the projectUids array, dsProjectContext is empty. |
<?xml version="1.0" standalone="yes"?>
<ProjectContextDataSet xmlns="http://schemas.microsoft.com/office/project/server/webservices/ProjectContextDataSet/">
<Relationships>
<PROJ_UID>a9d03b87-37f1-473d-90f6-77ba3c521a40</PROJ_UID>
<RelatedTo_UID>f0e98e26-2c9c-4f74-b40a-640f3f3f03f5</RelatedTo_UID>
<RelatedTo_NAME>Project1</RelatedTo_NAME>
<Relationship>2</Relationship>
<HasBuildTeamPermission>true</HasBuildTeamPermission>
</Relationships>
</ProjectContextDataSet>
Note