How to check the Work Allocation is set to default allocation?
Hello Team,
I am trying to fetch the work allocation details of a user from RTC.
I found some solutions to get the details of work allocation as below,
// Get the resource planning client
final IResourcePlanningClient resourcePlanning =
(IResourcePlanningClient) this.teamRepository.getClientLibrary(IResourcePlanningClient.class);
// Get the contributor related planning information
IContributorInfo info =
resourcePlanning.getResourcePlanningManager().getContributorInfo(inspectUser, true, monitor);
ItemCollection<IWorkResourceDetails> workDetails = info.getWorkDetails(inspectUser);
for (IWorkResourceDetails iWorkResourceDetails : workDetails) {
.........
//For example to get timeline
IDevelopmentLineHandle developmentLine = iWorkResourceDetails.getDevelopmentLine();
.........
}
----------------------------------------------------------------
In the above code I can able to fetch all details except "Default Allocation" information.
This information is stored as a boolean. I had tried/used all the necessary methods to find it but no use.
Please let me know is there any way to find that information.
Thanks in advance.
I am trying to fetch the work allocation details of a user from RTC.
I found some solutions to get the details of work allocation as below,
// Get the resource planning client
final IResourcePlanningClient resourcePlanning =
(IResourcePlanningClient) this.teamRepository.getClientLibrary(IResourcePlanningClient.class);
// Get the contributor related planning information
IContributorInfo info =
resourcePlanning.getResourcePlanningManager().getContributorInfo(inspectUser, true, monitor);
ItemCollection<IWorkResourceDetails> workDetails = info.getWorkDetails(inspectUser);
for (IWorkResourceDetails iWorkResourceDetails : workDetails) {
.........
//For example to get timeline
IDevelopmentLineHandle developmentLine = iWorkResourceDetails.getDevelopmentLine();
.........
}
----------------------------------------------------------------
In the above code I can able to fetch all details except "Default Allocation" information.
This information is stored as a boolean. I had tried/used all the necessary methods to find it but no use.
Please let me know is there any way to find that information.
Thanks in advance.
Accepted answer
This is how I think that works:
/* (non-Javadoc) * @see com.ibm.js.team.admin.automation.allocation.core.IWorkAssignment#isDefaultAllocation() */ @Override public boolean isDefaultAllocation() { Timestamp calStartTS = SimpleDateFormatUtil .createTimeStamp( SimpleDateFormatUtil.CalendarStart, SimpleDateFormatUtil.SIMPLE_DATE_FORMAT_PATTERN_YYYY_MM_DD_HH_MM_SS_Z); Timestamp startTS = new Timestamp(getStartDate().getTime()); Timestamp calEndTS = SimpleDateFormatUtil .createTimeStamp( SimpleDateFormatUtil.CalendarEnd, SimpleDateFormatUtil.SIMPLE_DATE_FORMAT_PATTERN_YYYY_MM_DD_HH_MM_SS_Z); Timestamp endTS = new Timestamp(getEndDate().getTime()); boolean sameStart = startTS.equals(calStartTS); boolean sameEnd = endTS.equals(calEndTS); return sameStart && sameEnd; }