Other TimePhased Data
Multi platform library to read and write schedule data
Brought to you by:
joniles
Currently you are making the timephased data from resource assignments available. Is there any plan to make other forms of timephased data (Task, Resource, Baseline) available as well? I see other sets of timephased data in the XML version of the project, though I'm not sure whether these are there in the mpp file as well.
My goal is : set planned Work and Actual via API (Export XML)
I want to add my data (Work and Actual) for Set With using MPXJ
/////
TimephasedWork w = new TimephasedWork();
w.setStart(Date.from(LocalDateTime.of(2016,9,1, 8,0).atZone(ZoneId.systemDefault()).toInstant()));
w.setFinish(Date.from(LocalDateTime.of(2016,9,1, 17,0).atZone(ZoneId.systemDefault()).toInstant()));
w.setAmountPerDay(Duration.getInstance(8, TimeUnit.HOURS));
w.setTotalAmount(Duration.getInstance(8, TimeUnit.HOURS));
TimephasedWork w2 = new TimephasedWork();
w2.setStart(Date.from(LocalDateTime.of(2016,9,2, 8,0).atZone(ZoneId.systemDefault()).toInstant()));
w2.setFinish(Date.from(LocalDateTime.of(2016,9,2, 15,0).atZone(ZoneId.systemDefault()).toInstant()));
w2.setAmountPerDay(Duration.getInstance(6, TimeUnit.HOURS));
w2.setTotalAmount(Duration.getInstance(6, TimeUnit.HOURS));
List<timephasedwork> works = new ArrayList<>();
works.add(w);
works.add(w2);</timephasedwork>
ra.setTimephasedWork(new DefaultTimephasedWorkContainer(defaultCalendar, new MSPDITimephasedWorkNormaliser(), works, false));
task.addResourceAssignment(ra);
/////
Should create an XML "TimephasedData", below
<assignment>
<uid>7</uid>
<taskuid>5</taskuid>
<resourceuid>7</resourceuid>
….
<timephaseddata>
<type>1</type>
<uid>8</uid>
<start>2016-03-29T10:00:00</start>
<finish>2016-03-30T10:00:00</finish>
<unit>1</unit>
<value>PT8H0M0S</value>
</timephaseddata>
//Other TimephasedData</assignment>
The code is executed but, it does not work?