Go to primary content
Agile Product Lifecycle Management Web Services Guide
Release 9.3.6
E71166-01
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

11 Working with Projects

You can use the project management features of Agile Product Portfolio Management (PPM) to define a project and its associated elements such as activity schedules, deliverables, and discussions. These capabilities enable you to determine the availability of the required resources, assigning resources to tasks, identifying bottlenecks, and responding to over- and under-allocated resource conditions. You can also create and reuse project templates.

You can use the Projects object to schedule and execute projects. Each project, in addition to schedule information, contains attachments, discussions and actions items, resources and roles, history and content of related activities. For management visibility, data is rolled up to higher levels by rules and parent-child relationships.

The Agile Project web service provides support for creating, loading, and working with Projects. It handles the Projects object in its entirety, including programs, phases, tasks, and gates.

11.1 Differences in the Behavior of Projects Objects

The project web service helps implement several interfaces commonly used by other Agile PLM objects and also provides the following functionality that separates Projects objects from other objects.

  • The Projects object is a container of other underlying objects, such as Phases, Tasks, and Gates. The underlying objects are related to the parent object, usually the Projects, through the Schedule table.

  • Projects have baselines that allow you to track changes in the schedule. Therefore, the project web service provides operations that let you create, get, or remove a baseline.

  • Projects can be archived. If you archive the root Projects, the entire Projects tree is soft-deleted from the system.

  • Projects can be locked or unlocked.

  • Project summary information can be retrieved from Agile PPM by external systems.

11.2 Working with Project Baselines

Projects baselines allow you to compare actual progress with your original plans. When you create a baseline, a snapshot of your Projects' schedule is preserved. The original estimates contained in the baseline are permanent reference points against which you can compare the updated task structure, schedule, and actual dates.

11.2.1 Creating Baselines

You can create baselines only for the root Projects object.

Example: Creating a baseline

CreateBaselineRequestType createBaselineRequestType =
new CreateBaselineRequestType();
AgileCreateBaselineRequestType[] agileCreateBaselineRequestType =
    new AgileCreateBaselineRequestType[1];
agileCreateBaselineRequestType[0] = new AgileCreateBaselineRequestType();
agileCreateBaselineRequestType[0].setProjectIdentifier("PGM00014"); //Project Identifier
agileCreateBaselineRequestType[0].setDescription("My New Baseline"); //Name of the baseline to be  created
createBaselineRequestType.setRequests(agileCreateBaselineRequestType);

11.2.2 Getting Baselines

You can save multiple baselines, and retrieve them later for comparison.

Example: Getting Baselines

GetBaselinesRequestType getBaselinesRequestType =
new GetBaselinesRequestType();
AgileGetBaselinesRequestType[] agileGetBaselinesRequestType =
    new AgileGetBaselinesRequestType[1];
agileGetBaselinesRequestType[0] = new AgileGetBaselinesRequestType();
agileGetBaselinesRequestType[0].setProjectIdentifier("PGM00014");
getBaselinesRequestType.setRequests(agileGetBaselinesRequestType);

11.2.3 Removing Baselines

You can removes the list of baselines associated with the Project.

Example: Removing Baselines

RemoveBaselineRequestType removeBaselinesRequestType =
new RemoveBaselineRequestType();
AgileRemoveBaselineRequestType[] agileRemoveBaselineRequestType =
    new AgileRemoveBaselineRequestType[1];
agileRemoveBaselineRequestType[0] = new AgileRemoveBaselineRequestType();
agileRemoveBaselineRequestType[0].setProjectIdentifier("PGM00014"); //Project Identifier
agileRemoveBaselineRequestType[0].setVersion(3); //Baseline version number
removeBaselinesRequestType.setRequests(agileRemoveBaselineRequestType);

Once a Projects' schedule is defined, you can reschedule it using the reschedule operation. This operation takes a couple of parameters, the IProgram.RESCHEDULE constant and the new value for that schedule option. Here is the list of IProgram.RESCHEDULE constants you can use:

  • STARTDATE - This moves the scheduled start date to the specified date.

  • ENDDATE - This moves the scheduled end date to the specified date.

  • BACKWARDDAYS - This moves the schedule backward by the specified number of days.

  • FORWARDDAYS - This moves the schedule forward by the specified number of days.

Example: Rescheduling projects

RescheduleRequestType rescheduleRequestType =
new RescheduleRequestType();
AgileRescheduleRequestType[] agileRescheduleRequestType =
    new AgileRescheduleRequestType[1];
agileRescheduleRequestType[0] = new AgileRescheduleRequestType();
agileRescheduleRequestType[0].setProjectIdentifier("PGM00014");
RescheduleType rescheduleType = new RescheduleType();
rescheduleType.setForwardDays(5);
//            rescheduleType.setBackwardDays(5); //Number of days you want to forward the schedule
//            Calendar startDate = Calendar.getInstance();
//            startDate.setTime(new Date(2011, 01, 01));
//            Calendar endDate = (Calendar)startDate.clone();
//            endDate.add(Calendar.DAY_OF_YEAR, +5);
//            rescheduleType.setStartDate(startDate); 
//Setting the start date of the activity
//            rescheduleType.setEndDate(endDate); //Setting the end date of the activity
agileRescheduleRequestType[0].setRescheduleType(rescheduleType);
rescheduleRequestType.setRequests(agileRescheduleRequestType);

11.2.4 Loading a Project

You can load a PPM Project using the loadProject operation.

Example: Loading a project.

Create a new Project using the from UpdateNewProject.xml
String objectId = createProject();
 Load the project. This would give the details of the Phase,Task,Gate numbers existing in the Project
LoadProjectsResponseType loadProjectResponse = loadProject(objectId);
 Process the response to get the Status.
String status = loadProjectResponse.getStatusCode().value();

11.2.5 Updating a Project

You can update a PPM project using the updateProject operation.

Example: To update a project.

Create a new Project using the from UpdateNewProject.xml
String objectId = createProject();
  Load the project. This would give the details of the Phase,Task,Gate numbers existing in the Project
ProjectType project = loadProject(objectId); 
UpdateProjectsResponseType updateProjectsResponse = updateProject(project);

11.2.6 loadDeliverablesStatus

This sample demonstrates creating a project with deliverable and loading the deliverable statuses of a Project using the LoadDeliverablesStatus operation.

Example: To load the deliverable status of a loaded project.

Create the request for loadDeliverablesStatus webservice operation
LoadDeliverablesStatusRequestType loadDeliverablesStatusReq = new LoadDeliverablesStatusRequestType();
loadDeliverablesStatusReq.setMessageId("Project WS Sample - LoadDeliverablesStatus");
loadDeliverablesStatusReq.setMessageName("Project WS Sample - LoadDeliverablesStatus");
 Set the project created in dataPrepare for loading the deliverable status
AgileObjectIdentifierType[] ids = new AgileObjectIdentifierType[1];
ids[0] = new AgileObjectIdentifierType();
ids[0].setObjectName(projectNumber);
ids[0].setClassName("ActivitiesClass");
ids[0].setSubClassName("Program");
ids[0].setClassId(18022);
ids[0].setSubClassId(18027);
loadDeliverablesStatusReq.setProjectIdentifier(ids[0]);
loadDeliverablesStatusReq.setIncludeAllLevels(new Boolean(true));
 The agile Stub is used to make the loadDeliverablesStatus webservice
 call. The status code obtained from the response object is printed to
 verify the success of the updateProjects operation.
LoadDeliverablesStatusResponseType loadDeliverablesStatusRes = agileStub.loadDeliverablesStatus(loadDeliverablesStatusReq);

11.2.7 Validating a Project

The validateProject operation is used to validate a PPM project.

Example: To validate a project.

Create a new Project using the from UpdateNewProject.xml
String objectId = createProject();
 Validate the project with some data modified in the ValidateProject.xml
ValidateProjectsResponseType validateProjectsResponse = validateProject(objectId);

11.3 Substituting Project Resources

A resource's availability can frequently change due to overloading, reassignments, vacation, and illness. You can substitute an existing resource for another resource. The current resource's role is assigned to the substituted resource, but only for that Projects. To substitute Projects resources, use the operation "substituteResource."

When you substitute resources, you can specify users and user groups. You can also specify whether the resource assignment applies to the Projects' children.

Example: Substituting projects resources

SubstituteResourceRequestType substituteResourceRequestType =
new SubstituteResourceRequestType();
AgileSubstituteResourceRequestType[] agileSubstituteResourceRequestType =
    new AgileSubstituteResourceRequestType[1];
agileSubstituteResourceRequestType[0] = new AgileSubstituteResourceRequestType();
agileSubstituteResourceRequestType[0].setProjectIdentifier("PGM00014");
AgileUserUserGroupIdentifierType currentUser = new AgileUserUserGroupIdentifierType();
currentUser.setClassIdentifier("User");
currentUser.setObjectIdentifier("badriv");
agileSubstituteResourceRequestType[0].setCurrentResource(currentUser); //Currently allocated resource
AgileUserUserGroupIdentifierType newUser = new AgileUserUserGroupIdentifierType();
newUser.setClassIdentifier("User");
newUser.setObjectIdentifier("yvonnec");
agileSubstituteResourceRequestType[0].setNewResource(newUser); //Resource that substitutes the current resource
agileSubstituteResourceRequestType[0].setApplyToChildren(true); //the delegated owner is set for the children as well
substituteResourceRequestType.setRequests(agileSubstituteResourceRequestType);

Example: Assigning Users from a Resource Pool

AssignUsersFromPoolRequestType assignUsersFromPoolRequestType =
new AssignUsersFromPoolRequestType();
AgileAssignUsersFromPoolRequestType[] agileAssignUsersFromPoolRequestType =
    new AgileAssignUsersFromPoolRequestType[1];
agileAssignUsersFromPoolRequestType[0] = new AgileAssignUsersFromPoolRequestType();
agileAssignUsersFromPoolRequestType[0].setProjectIdentifier("PGM00014");
agileAssignUsersFromPoolRequestType[0].setUsergroup("Test"); //Assign userpool from which you want to assign resources
String[] users = {"brianl"}; //Create an array of users you want to add from the userpool above. brianl is a part of the userpool "Test"
agileAssignUsersFromPoolRequestType[0].setUsers(users);
assignUsersFromPoolRequestType.setRequests(agileAssignUsersFromPoolRequestType);

11.4 Delegating Ownership of a Project to Another User

The owner or manager of a Projects object can assign the ownership of the Projects to other users by delegating it. The delegated user receives a request that he can accept or decline. If he accepts, the delegated user becomes owner of the task. A delegated owner is automatically given the Projects Manager role for the delegated Projects object.

To delegate ownership of a Projects, use the delegateOwnership operation. When you delegate ownership of a Projects, you automatically update the Delegated Owner field, which is read-only. The delegateOwnership operation lets you specify whether delegated ownership also applies to the Projects' children.

Example: Delegating project ownership to another user

DelegateOwnershipRequestType delegateOwnershipRequestType =
new DelegateOwnershipRequestType();
AgileDelegateOwnershipRequestType[] agileDelegateOwnershipRequestType =
    new AgileDelegateOwnershipRequestType[1];
agileDelegateOwnershipRequestType[0] = new AgileDelegateOwnershipRequestType();
agileDelegateOwnershipRequestType[0].setProjectIdentifier("PGM00014");
agileDelegateOwnershipRequestType[0].setUserIdentifier("yvonnec"); //loginID of the user
agileDelegateOwnershipRequestType[0].setApplyToChildren(true); //the delegated owner is set for the children as well
delegateOwnershipRequestType.setRequests(agileDelegateOwnershipRequestType);

11.5 Locking and Unlocking Projects

The owner of Projects can lock or unlock the Projects object. You cannot modify the schedule of a Projects object once it is locked. To lock or unlock a Projects object, use the operation "setLock."


Note:

Projects are automatically locked when you use the Gantt Chart or the Microsoft Project integration functionality in Agile Web Client.

Example: Locking a Projects object

SetLockRequestType setLockRequestType =
new SetLockRequestType();
AgileSetLockRequestType[] agileSetLockRequestType =
    new AgileSetLockRequestType[1];
agileSetLockRequestType[0] = new AgileSetLockRequestType();
agileSetLockRequestType[0].setProjectIdentifier("PGM00014");
agileSetLockRequestType[0].setLock(true);
setLockRequestType.setRequests(agileSetLockRequestType);

11.5.1 Checking Projects Lock Status

IsLockedRequestType isLockedRequestType =
new IsLockedRequestType();
AgileIsLockedRequestType[] agileIsLockedRequestType =
    new AgileIsLockedRequestType[1];
agileIsLockedRequestType[0] = new AgileIsLockedRequestType();
agileIsLockedRequestType[0].setProjectIdentifier("PGM00014");
isLockedRequestType.setRequests(agileIsLockedRequestType);

11.6 Working with Timesheets

The Timesheet feature enables you to view timesheet entry by assigned resources on a project. It enables you to track reported time data to ascertain resource utilization and related costs.

11.6.1 Updating a Timesheet

You can use logorChangeTimesheet operation to update a timesheet.

Example: To update a Timesheet

LogOrChangeTimesheetRequestType logOrChangeTimesheetRequestType = new LogOrChangeTimesheetRequestType();
            AgileLogOrChangeTimesheetRequestType  agileLogOrChangeTimesheetRequestType = new AgileLogOrChangeTimesheetRequestType();
agileLogOrChangeTimesheetRequestType.setTimeZone(timeZone);     
            agileLogOrChangeTimesheetRequestType.setYear(year);    
            agileLogOrChangeTimesheetRequestType.setMonth(month);
            agileLogOrChangeTimesheetRequestType.setDay(day);
            AgileTimesheetChangeRowType agileTimesheetChangeRowType = new AgileTimesheetChangeRowType();
            agileTimesheetChangeRowType = new AgileTimesheetChangeRowType();
            agileTimesheetChangeRowType.setProjectName(programName);
            AgileTimesheetChangeCellType agileTimesheetChangeCellType = new AgileTimesheetChangeCellType();
            agileTimesheetChangeCellType = new AgileTimesheetChangeCellType();
            agileTimesheetChangeCellType.setDayOfWeek(5);
            agileTimesheetChangeCellType.setHours(3);
            agileTimesheetChangeRowType.getChangeCells().add(agileTimesheetChangeCellType);
            agileLogOrChangeTimesheetRequestType.getChangeRows().add(agileTimesheetChangeRowType);
logOrChangeTimesheetRequestType.getRequests().add(agileLogOrChangeTimesheetRequestType);
            LogOrChangeTimesheetResponseType LogOrChangeTimesheetResponse = agileStub.logOrChangeTimesheet(logOrChangeTimesheetRequestType);

11.6.2 Retrieving a Timesheet

You can use the retrieveTimesheet to load the timesheet table.

Example: To retrieve a Timesheet

RetrieveTimesheetRequestType retrieveTimesheetRequestType = new RetrieveTimesheetRequestType();
            AgileRetrieveTimesheetRequestType  agileRetrieveTimesheetRequestType = new AgileRetrieveTimesheetRequestType();
            agileRetrieveTimesheetRequestType.setTimeZone(timeZone);
            agileRetrieveTimesheetRequestType.setYear(year);
            agileRetrieveTimesheetRequestType.setMonth(month);
            agileRetrieveTimesheetRequestType.setDay(day);
            retrieveTimesheetRequestType.getRequests().add(agileRetrieveTimesheetRequestType);                         RetrieveTimesheetResponseType RetrieveTimesheetResponse = agileStub.retrieveTimesheet(retrieveTimesheetRequestType);

11.6.3 Exporting a Searched Timesheet

You can export searched timesheets using the exportsearchedTimesheet operation.

Example: To export a searched Timesheet.

ExportSearchedTimesheetRequestType exportSearchedTimesheetRequestType = new ExportSearchedTimesheetRequestType();
            AgileExportSearchedTimesheetRequestType  agileExportSearchedTimesheetRequestType = new AgileExportSearchedTimesheetRequestType();
agileExportSearchedTimesheetRequestType.getUsers().addAll(Arrays.asList(agileUserUserGroupIdentifierType));
            agileExportSearchedTimesheetRequestType.getPrograms().addAll(Arrays.asList(agileObjectIdentifierType));
            agileExportSearchedTimesheetRequestType.setFromYear(fromYear);
            agileExportSearchedTimesheetRequestType.setFromMonth(fromMonth);
            agileExportSearchedTimesheetRequestType.setFromDay(fromDay);
            agileExportSearchedTimesheetRequestType.setEndYear(toYear);
            agileExportSearchedTimesheetRequestType.setEndMonth(toMonth);
            agileExportSearchedTimesheetRequestType.setEndDay(toDay);
            agileExportSearchedTimesheetRequestType.setIncludeCheckbox(includeCheckbox);
            agileExportSearchedTimesheetRequestType.setFileType(fileType);
            agileExportSearchedTimesheetRequestType.setFilePath(filePath);
            agileExportSearchedTimesheetRequestType.setFileName(fileName);
exportSearchedTimesheetRequestType.getRequests().add(agileExportSearchedTimesheetRequestType);
            ExportSearchedTimesheetResponseType ExportSearchedTimesheetResponse = agileStub.exportSearchedTimesheet(exportSearchedTimesheetRequestType);

Note:

The must share the folder to which you export the file.

11.6.4 Exporting to aXML

Using the exporttoAXML operation, you can export project object to aXML file.

Example: To export project object to aXML file.

 ExportToAXMLRequestType exportToAXMLRequestType = new ExportToAXMLRequestType();                         
            AgileExportToAXMLRequestType agileExportToAXMLRequestType[] = new AgileExportToAXMLRequestType[1];
            agileExportToAXMLRequestType[0] = new AgileExportToAXMLRequestType();
            
            agileExportToAXMLRequestType[0].setFileName("output.aXML"); // file name of result file 
            agileExportToAXMLRequestType[0].setFilePath("\\10.182.16.235\localWSTest"); //the URL to put the output file
            agileExportToAXMLRequestType[0].setFilter("Default Project Filter");
            AgileObjectIdentifierType agileObjectIdentifierType[] = new AgileObjectIdentifierType[1];
            agileObjectIdentifierType[0] = new AgileObjectIdentifierType();
            agileObjectIdentifierType[0].setObjectName(programNumber);
            agileExportToAXMLRequestType[0].getProgram().addAll(Arrays.asList(agileObjectIdentifierType));
exportToAXMLRequestType.getRequests().addAll(Arrays.asList(agileExportToAXMLRequestType));             
            ExportToAXMLResponseType ExportToAXMLResponse = agileStub.exportToAXML(exportToAXMLRequestType);

Note:

The folder to which you export the file must be shared.

11.7 Working with Calendars

The Project calendar feature defines work days and non-work days. It allows the definition of non-workdays for a specific project (For example: National holidays, which is not a working day). During the scheduling or re-scheduling of a project the schedule process would skip over any non-working days and schedule the project on working days. Non-Work Days are based on a calendar designation.

11.7.1 Creating a Calendar

You can create calendars for Projects for both working and non-working days in specific countries and regions using the createCalendar operation.

Example: To create a Calendar

CreateCalendarRequestType createCalendarRequestType = new CreateCalendarRequestType();                         
            AgileCreateCalendarRequestType  agileCreateCalendarRequestType = new                                              AgileCreateCalendarRequestType();
            agileCreateCalendarRequestType.setName("WS_Calendar_1");
            agileCreateCalendarRequestType.setEnabled(enabled);
            agileCreateCalendarRequestType.setDescription(description);
            agileCreateCalendarRequestType.setWorkWeekSetting(weekSetting);
            agileCreateCalendarRequestType.setCreateFrom(name);
            createCalendarRequestType.getRequests().add(agileCreateCalendarRequestType);             
            CreateCalendarResponseType CreateCalendarResponse = agileStub.createCalendar

11.7.2 Getting a Calendar

You can get a calendar from Agile PLM using the getCalendar operation.

Example: To get a Calendar

GetCalendarRequestType getCalendarRequestType = new GetCalendarRequestType();                         
            AgileGetCalendarRequestType  agileGetCalendarRequestType[] = new AgileGetCalendarRequestType[1];
            agileGetCalendarRequestType[0] = new AgileGetCalendarRequestType();          
            
            agileGetCalendarRequestType[0].setCalendarIdentifier(calendarName);
            getCalendarRequestType.getRequests().addAll(Arrays.asList(agileGetCalendarRequestType));             
            GetCalendarResponseType getCalendarResponse = agileStub.getCalendar(getCalendarRequestType);

11.7.3 Removing a Calendar

You can remove a calendar from Agile PLM using the removeCalendar operation.

Example: To remove a Calendar

RemoveCalendarRequestType removeCalendarRequestType = new RemoveCalendarRequestType();                         
            AgileRemoveCalendarRequestType  agileRemoveCalendarRequestType = new AgileRemoveCalendarRequestType();                         
            agileRemoveCalendarRequestType.setName(name);
            removeCalendarRequestType.getRequests().add(agileRemoveCalendarRequestType);             
            RemoveCalendarResponseType RemoveCalendarResponse = agileStub.removeCalendar(removeCalendarRequestType);

11.7.4 Updating a Calendar

You can update a calendar in Agile PLM using the updateCalendar operation.

Example: To update a Calendar

UpdateCalendarRequestType updateCalendarRequestType = new UpdateCalendarRequestType();                         
            AgileUpdateCalendarRequestType  agileUpdateCalendarRequestType[] = new AgileUpdateCalendarRequestType[1];                  
            agileUpdateCalendarRequestType[0].setFinish(finish);
            agileUpdateCalendarRequestType[0].setActionType("add");
            agileUpdateCalendarRequestType[0].setNewName("New Web services");
            agileUpdateCalendarRequestType[0].setDescription("xxx");
            agileUpdateCalendarRequestType[0].setEnabled("No");
            agileUpdateCalendarRequestType[0].setReason("test from java ws client");
            updateCalendarRequestType.getRequests().addAll(Arrays.asList(agileUpdateCalendarRequestType));             
            UpdateCalendarResponseType updateCalendarResponse = agileStub.updateCalendar(updateCalendarRequestType);