=======
Agile Product Lifecycle Management SDK Developer Guide - Using APIs Release 9.3.6 E71152-01 |
|
![]() Previous |
![]() Next |
This chapter includes the following:
About Product Portfolio Management (PPM) Calendars
Creating, Printing and Deleting PPM Calendars
Updating Workweek Settings
Adding and Updating Working and Exception (non-working)) Days
Agile Product Portfolio Management is a web-based application that enables users to manage all aspects of a project or program. PPM is fully integrated with the Agile PLM suite of products to provide a centralized view of project records and associated product information within the organization.
Users of PPM includes executive staff who view portfolio data for the overall status of projects and program/project managers to create projects and manage and monitor project tasks, schedules, and budgets. For more information, refer to the Agile PLM Product Portfolio Management User Guide.
The Calendar Management component of PPM is a Release 9.3.4 enhancement. Before this enhancement, you could only specify weekend days as non-working days when preparing PPM schedules, which failed to meet general business requirements. To overcome this shortcoming, this enhancement enables specifying any day of the week an exceptional day. For example, a non-working day or a national holiday unique to a given country, or a given project.
Note: Project tasks listed under "Calendar Tasks Supported by Agile SDK" are performed programmatically and in the batch mode. PPM-related Calendar tasks are performed using the Agile PLM Clients.For background information and procedures, refer to Product Portfolio Management User Guide. |
The PPM Calendar is a new administration data type and is processed by the SDK similar to other existing administration data. For example, Workflow, Privileges, and so on.
The exposed APIs enable performing the following PPM-related tasks programmatically and in the batch mode:
Creating PPM calendarsUpdating workweek settingsAdding and Updating a Calendar's Working days and Non-Working daysAccepting and changing the status of a PPM Calendar Getting and printing exception days
Deleting PPM Calendars
Agile SDK interfaces that are exposed to support these tasks, are listed below. For additional information, you can find the Javadoc generated HTML files that document these interfaces in the Note in "Client-Side Components".
ICalendarManage
createCalenar, removeCalendar
getCalendar, getCalendars
ICalendar
addExceptionalDay
updateExceptionalDay
deleteExceptionalDay
Agile SDK exposes the following interface for this purpose.
ICalendar calendar = manager.createCalendar(param);
ICalendarManager manager = (ICalendarManager)session.getManager(ICalendarManager.class); Map<Integer, Object> param = new HashMap<Integer, Object>(); param.put(WorkCalendarConstants.ID_CALENDAR_NAME,"SDK1"); param.put(WorkCalendarConstants.ID_CALENDAR_ENABLED, "Yes"); int[] weekday = new int[]{WorkCalendarConstants.ID_WEEKEND_SAT, WorkCalendarConstants.ID_WEEKEND_SUN}; param.put(WorkCalendarConstants.ID_CALENDAR_WEEK_SETTING, weekday); // create calendar ICalendar calendar = manager.createCalendar(param); System.out.println(calendar);
The following code sample is an example of creating a PPM calendar:
Agile SDK exposes the following interface for this purpose.
calendar.setValue (WorkCalendarConstants.ID_CALENDAR_WEEK_SETTING, weekday);
The following code sample shows how to get and set an existing a PPM calendar's workweek settings:
ICalendarManager manager = (ICalendarManager) session.getManager(ICalendarManager.class); // get the calendar ICalendar calendar = manager.getCalendar("SDK1"); System.out.println(calendar); // Update work week setting int[] weekday = new int[]{WorkCalendarConstants.ID_WEEKDAY_FRI, WorkCalendarConstants.ID_WEEKEND_SUN}; calendar.setValue (WorkCalendarConstants.ID_CALENDAR_WEEK_SETTING, weekday);
Agile SDK exposes the following interface to add and update PPM Calendar working and non-working (exceptional) days.
ICalendar calendar = manager.getCalendar("SDK1");
The following code sample shows how to add and update working and non-working days in PPM Calendars:
ICalendarManager manager = (ICalendarManager)session.getManager(ICalendarManager.class); // get the calendar ICalendar calendar = manager.getCalendar("SDK1"); Map expday = new HashMap(); expday.put(WorkCalendarConstants.EXCEPTION_SETTING_START, "04/07/2014"); expday.put(WorkCalendarConstants.EXCEPTION_SETTING_END, "04/08/2014"); expday.put(WorkCalendarConstants. EXCEPTION_SETTING_COMMENT, "SDK_update11"); // add exception day calendar.addExceptionalDay(expday);
Agile SDK exposes the following interface to get and print a PPM Calendar's working and non-working days:
ICalendar calendar = manager.getCalendar("SDK1"); System.out.println(calendar);
The following code samples get and print a PPM Calendar's exception days as well as exception days for a specific calendar year:
ICalendarManager manager = (ICalendarManager)session.getManager(ICalendarManager.class); // get the calendar ICalendar calendar = manager.getCalendar("SDK1"); System.out.println(calendar); // Get & Print exception day of one specific year IVOCalendarDay[] voCalDays = calendar.getExceptionalDaysOfYear(2014); for (IVOCalendarDay day : voCalDays) { System.out.println(day+" "+day.getComment()); }
Agile SDK exposes the following interface to delete PPM Calendars.
manager.removeCalendar("SDK1");
Agile SDK exposes the following interface to delete existing PPM Calendar's
ICalendarManager manager = (ICalendarManager)session.getManager(ICalendarManager.class); // remove calendar manager.removeCalendar("SDK1");
Agile SDK exposes the following interfaces for this purpose.
Accepting Changes made to PPM Calendars:
"IProgram.acceptCalendarChange()
Changing the Status of a PPM Calendar to Cancel or Not Started:
"IProgram.changeStatusToCancelOrNotStarted(IStatus newStatus, String comment, Object[] notifyList, boolean urgent, boolean isContinue)
The following code samples show accepting changes to a PPM Calendar and changing the Status of a PPM Calendar to Cancel, or Not Started.
<<<<<<< .mineIProgram program = (IProgram) session.getObject(IProgram.OBJECT_TYPE, "PGM00011");program.acceptCalendarChange();
proposedTask = (IProgram)agileSession.getObject(IProgram.OBJECT_TYPE, "T00003");IStatus myCurrentStatus = proposedTask.getStatus();if(myCurrentStatus.getStatusType().equals(StatusConstants.TYPE_CANCEL)){ cancelTask(proposedTask,getNotStartedStatusForWorkflow(proposedTask)); System.out.println("task changed to not started");} else { cancelTask(proposedTask,getCancelStatusForWorkflow(proposedTask)); System.out.println("task changed to canceled"); } private static IStatus getCancelStatusForWorkflow(IProgram obj){ IWorkflow workflow = null; IStatus status = null; IStatus[] statuses = null; try{ workflow = obj.getWorkflow(); status = null; if(workflow!= null){ statuses = workflow.getStates(); int noOfStatuses = statuses.length; for (int i = 0; i < noOfStatuses; i++) { status = statuses[i]; if(status.getStatusType() .equals(StatusConstants.TYPE_CANCEL))break; } } }catch(APIException e){ e.printStackTrace(); }catch(Exception e){ e.printStackTrace(); } return status;} private static IStatus getNotStartedStatusForWorkflow(IProgram obj) throws APIException{ IWorkflow workflow = null; IStatus status = null; IStatus[] statuses = null; try{ workflow = obj.getWorkflow(); status = null; if(workflow!= null){ statuses = workflow.getStates(); int noOfStatuses = statuses.length; for (int i = 0; i < noOfStatuses; i++) { status = statuses[i]; if(status.getStatusType().equals (StatusConstants.TYPE_PENDING))break; } } }catch(APIException e){ e.printStackTrace(); }catch(Exception e){ e.printStackTrace(); } return status;} private static void cancelTask(IProgram objTask,IStatus status) throws APIException{ try{ objTask.changeStatusToCancelOrNotStarted(status, true, "Cancelled by Task Creation PX", true, true, new Object[0], true, true); System.out.println("task status changed"); }catch(APIException e){ throw e ; }catch(Exception e){ e.printStackTrace(); }}