2003 年版以来、私は常に MS-Project XML ファイルのインポートに苦労してきました。
今、私は MSP 2013 の問題に対処しなければなりません (なぜ Microsoft なのか? なぜそれほど予測できないのか?)
目的の値を正しくインポートするには、いくつかの基本的な情報が必要なようです。
これが私がすることです:
task.setEstimated(false); //to get rid of the percentage in the duration value
task.setPercentageComplete(50d); //50% for example
task.setPercentageWorkComplete(50d);
task.setPhysicalPercentComplete(50d);
task.setStart(<start date>);
task.setFinish(<finish date>);
task.setActualStart(<actual start date>);
task.setActualFinish(<actual finish date>); //only necessary if the task is 100%
task.setDuration(Duration.getInstance(4d, TimeUnit.DAYS)); //4d for example
task.setActualDuration(Duration.getInstance(2d, TimeUnit.DAYS));
double remainingDuration = task.getDuration().getDuration() - task.getActualDuration().getDuration();
task.setRemainingDuration(Duration.getInstance(remainingDuration, task.getDuration().getUnits()));
//if your task has resources assigned, you should set the work values
//suppose you have 2 resources assigned with 3 units each
double work = task.getDuration().getDuration() * 6;
task.setWork(Duration.getInstance(work, task.getDuration().getUnits()));
task.setRegularWork(work);
double actualWork = work * task.getPercentageComplete() / 100d;
task.setActualWork(Duration.getInstance(actualWork, task.getWork().getUnits()));
double remaining = task.getWork().getDuration() - task.getActualWork().getDuration();
task.setRemainingWork(Duration.getInstance(remaining, task.getWork().getUnits()));
まあ、これで十分だと思います。