Hi Zhencheng,
<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);