How to use the API "setTimephasedData"

Hi,

I want to know that if I have code as below:

ResourceAssignment ra = asProject.getResourceAssignments().add(asTask, asResource);

how to use the API ra.setTimephasedData? And what's the function of this API?

Hi Zhencheng,


Thank you for contacting Aspose support team again. Please use following sample code to add time phased data and share the feedback.

<span style=“font-size: 9pt; font-family: “Courier New”;”>ResourceAssignment assgn
= asProject.getResourceAssignments().add(asTask, asResource);

TimephasedData td = <span style=“font-size:9.0pt;font-family:“Courier New”;
mso-fareast-font-family:“Times New Roman”;color:navy”>new
<span style=“font-size: 9pt; font-family: “Courier New”;”>TimephasedData();

td.setStart(cal1.getTime());

td.setFinish(cal2.getTime());

td.setTimephasedDataType(TimephasedDataType.<span style=“font-size:9.0pt;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
color:#660E7A”>AssignmentRemainingWork
<span style=“font-size: 9pt; font-family: “Courier New”;”>);

td.setValue(<span style=“font-size:9.0pt;font-family:“Courier New”;
mso-fareast-font-family:“Times New Roman”;color:green”>“PT8H0M0S”
<span style=“font-size: 9pt; font-family: “Courier New”;”>);

td.setUnit(TimeUnitType.<span style=“font-size:9.0pt;font-family:
“Courier New”;mso-fareast-font-family:“Times New Roman”;color:#660E7A”>Hour
<span style=“font-size: 9pt; font-family: “Courier New”;”>);

td.setUid(assgn.get(Asn.<span style=“font-size:9.0pt;font-family:
“Courier New”;mso-fareast-font-family:“Times New Roman”;color:#660E7A”>UID
<span style=“font-size: 9pt; font-family: “Courier New”;”>));



assgn.getTimephasedData().add(td);