Class EPPCustomUtils

java.lang.Object
com.ptc.projectmanagement.util.custom.EPPCustomUtils

public final class EPPCustomUtils extends Object


Supported API: true

Extendable: false
  • Method Details

    • getDateByAddingDuration

      public static Timestamp getDateByAddingDuration(Timestamp referenceTimestamp, long durationInMillis, Plannable plannable) throws WTException


      Supported API: true

      Extendable: false Return working date by adding duration to the passed in date. It does not consider non-working days set to Windchill System Calendar. It also uses total working hours per day considering following properties: com.ptc.projectmanagement.plannable.WorkingCalendarConfig.DAY_START com.ptc.projectmanagement.plannable.WorkingCalendarConfig.DAY_END com.ptc.projectmanagement.plannable.WorkingCalendarConfig.LUNCH_BREAK_DURATION com.ptc.projectmanagement.plannable.WorkingCalendarConfig.SHORT_BREAK_DURATION wt.calendar.nonWorkDaysOfTheWeek If Calendar is 24 Hours, then above properties are not considered.
      Parameters:
      referenceTimestamp - - Start time used to get the resultant time by adding durationInMillis.
      durationInMillis - - duration in milliseconds. It can be positive or negative value.
      plannable - - Plan or PlanActivity object used to retrieve the calendar type being used for that plan.
      Returns:
      - Resultant date by adding or subtracting(if it is negative value) durationInMillis to/from referenceTimestamp
      Throws:
      WTException
    • getWorkingDuration

      public static final long getWorkingDuration(Timestamp startTime, Timestamp endTime, Plannable plannable) throws WTException


      Supported API: true

      Extendable: false
      Parameters:
      startTime - Start Date
      endTime - End Date.
      plannable - The Plan or PlanActivity object. It is used to retrieve the Calendar Type being used for that plan.
      Returns:
      The Working Duration in MilliSeconds between Start Date and End Date considering only the Working Days.
      Throws:
      WTException
    • getTotalDuration

      public static final Long getTotalDuration(Timestamp startDate, Timestamp endDate) throws WTException


      Supported API: true

      Extendable: false
      Parameters:
      startDate - : Start Date.
      endDate - : End Date.
      Returns:
      : The total duration in milliseconds between startDate and endDate considering both working & non-working days.
      Throws:
      WTException
    • getParentPlannables

      public static WTKeyedHashMap getParentPlannables(WTCollection hierarchicals) throws WTException
      Return all Immediate Parent Objects for given set of Child Objects. Child Objects could either be PlanActivities or ResourceAssignments.

      Supported API: true

      Extendable: false
      Returns:
      WTKeyedHashMap - ChildParentMap - Key --> Child Object : Value --> Parent Object.
      Throws:
      WTException
    • getChildActivities

      public static WTKeyedHashMap getChildActivities(WTCollection parentCollection, HashSet<String> listOfActivityClassTypeInternalName, HashSet<PlannableState> listOfPlannableStates) throws WTException


      Supported API: true

      Extendable: false Return WTKeyedHashMap with parent object and collection of its child objects by applying criterion specified by respective collections. All these criterion are added as OR condition. If there is no criteria specified, all child objects are returned.
      Parameters:
      parentCollection - : Parents object for which to retrieve child objects.
      listOfPlannableStates - : State of child objects to fetch.
      Returns:
      : WTKeyedHashMap which contains Key --> ObjectIdentifier of the Parent object ; Value --> Collection of child activities.
      Throws:
      WTException - : throws WTException
    • getDeliverableSubjects

      public static WTKeyedHashMap getDeliverableSubjects(WTCollection activities) throws WTException


      Supported API: true

      Extendable: false Return Deliverable Subjects which these activities are tracking. Fixed Revision Tracking Policy - Return the Latest Iteration of the specific Revision of the deliverable subject. Fixed Subject Tracking Policy - Return the Specific Version of the deliverable subject. Latest Revision Tracking Policy - Return the Latest Iteration of the Latest Revision of deliverable subject.
      Parameters:
      activities - - Scheduled Deliverables for which deliverable subjects to fetch.
      Returns:
      WTKeyedHashMap - Key --> ObjectIdentifier of Scheduled Deliverable (PlanActivity): Value --> Collection of Deliverable Subjects being tracked by this PlanActivity.
      Throws:
      WTException - - Throws WTException
    • getFloatingBaselineMemberLinks

      public static Map getFloatingBaselineMemberLinks(WTCollection parts, WTCollection baselineIdentifers, boolean matchExactVersion) throws WTException


      Supported API: true

      Extendable: false This API retrieves associated FloatingBaselineMember objects for the given collection of partObjects. It applies criteria of VariantBaseline and exact version match while retrieving FloatingBaselineMember objects for given collection of WTParts.
      Parameters:
      parts - - Collection of WTPart objects for which FloatingBaselineMembmer objects to fetch.
      baselineIdentifers - - Collection of Variant Baseline identifiers to be applied as the Criteria to fetch FloatingBaselineMember objects, so that FloatingBaselineMember objects which are associated to these baselines are retrieved. This collection can be null or empty and will then be ignored.
      matchExactVersion - - Criteria to apply to fetch FloatingBaselineMember objects. If it is true, it will fetch only those FloatingBaselineMember objects which would float/render the exact version/iteration of WTPart passed as argument. If false, it will return FloatingBaselineMember objects based on BranchIdentifier of WTPart passed as argument. e.g. If argument is WTPart A.5 iteration and FloatingBaslineMember is displaying A.10 version. Then, If matchExactVersion = true, it would NOT return this FloatingBaslineMember object. If it is false, it would return this FloatingBaslineMember object.
      Throws:
      WTException - Throws WTException