setBeginDate no longer returns the length
FEA: ItEr61S08TimeUnitConfigurablePlanning
This commit is contained in:
parent
88ee2d8231
commit
d8b3eed6d8
4 changed files with 10 additions and 20 deletions
|
|
@ -87,9 +87,8 @@ public class DefaultFundamentalProperties implements ITaskFundamentalProperties
|
|||
return new Date(beginDate);
|
||||
}
|
||||
|
||||
public long setBeginDate(Date beginDate) {
|
||||
public void setBeginDate(Date beginDate) {
|
||||
this.beginDate = beginDate.getTime();
|
||||
return lengthMilliseconds;
|
||||
}
|
||||
|
||||
public long getLengthMilliseconds() {
|
||||
|
|
|
|||
|
|
@ -36,11 +36,9 @@ public interface ITaskFundamentalProperties {
|
|||
public void setName(String name);
|
||||
|
||||
/**
|
||||
* Sets the beginDate. As result of this, the length of the task can change.
|
||||
* So the new value is returned
|
||||
* @return the new length
|
||||
* Sets the beginDate.
|
||||
*/
|
||||
public long setBeginDate(Date beginDate);
|
||||
public void setBeginDate(Date beginDate);
|
||||
|
||||
public Date getBeginDate();
|
||||
|
||||
|
|
|
|||
|
|
@ -174,13 +174,12 @@ public abstract class Task implements ITaskFundamentalProperties {
|
|||
Validate.notNull(dependenciesEnforcerHook);
|
||||
}
|
||||
|
||||
public long setBeginDate(Date newStart) {
|
||||
public void setBeginDate(Date newStart) {
|
||||
Date previousValue = fundamentalProperties.getBeginDate();
|
||||
Date previousEnd = fundamentalProperties.getEndDate();
|
||||
fundamentalProperties.setBeginDate(newStart);
|
||||
dependenciesEnforcerHook.setStartDate(previousValue, previousEnd,
|
||||
newStart);
|
||||
return fundamentalProperties.getLengthMilliseconds();
|
||||
}
|
||||
|
||||
private void reloadResourcesTextIfChange(Date newDate, Date previousDate) {
|
||||
|
|
|
|||
|
|
@ -188,22 +188,16 @@ public class TaskElementAdapter implements ITaskElementAdapter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public long setBeginDate(final Date beginDate) {
|
||||
Long runOnReadOnlyTransaction = transactionService
|
||||
.runOnReadOnlyTransaction(new IOnTransaction<Long>() {
|
||||
public void setBeginDate(final Date beginDate) {
|
||||
transactionService
|
||||
.runOnReadOnlyTransaction(new IOnTransaction<Void>() {
|
||||
@Override
|
||||
public Long execute() {
|
||||
public Void execute() {
|
||||
stepsBeforePossibleReallocation();
|
||||
Long result = setBeginDateInsideTransaction(beginDate);
|
||||
return result;
|
||||
taskElement.moveTo(currentScenario, beginDate);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
return runOnReadOnlyTransaction;
|
||||
}
|
||||
|
||||
private Long setBeginDateInsideTransaction(final Date beginDate) {
|
||||
taskElement.moveTo(currentScenario, beginDate);
|
||||
return getLengthMilliseconds();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue