[Minor] Always allow to execute Release actions
This commit is contained in:
parent
e4a4c3bf36
commit
eab14c2839
|
@ -35,11 +35,9 @@ public class ReservationExecution extends DurationExecution {
|
||||||
public boolean isExecutable(Action action) {
|
public boolean isExecutable(Action action) {
|
||||||
switch (action.getType()) {
|
switch (action.getType()) {
|
||||||
case TYPE_RESERVE:
|
case TYPE_RESERVE:
|
||||||
|
return !isReserved(tx(), action);
|
||||||
case TYPE_RELEASE:
|
case TYPE_RELEASE:
|
||||||
if (action.getType().equals(TYPE_RESERVE))
|
return true;
|
||||||
return !isReserved(tx(), action);
|
|
||||||
return isReserved(tx(), action);
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return super.isExecutable(action);
|
return super.isExecutable(action);
|
||||||
}
|
}
|
||||||
|
@ -80,9 +78,8 @@ public class ReservationExecution extends DurationExecution {
|
||||||
Resource resource = tx.getResourceFor(action, true);
|
Resource resource = tx.getResourceFor(action, true);
|
||||||
|
|
||||||
if (!resource.hasParameter(BAG_PARAMETERS, PARAM_RESERVED))
|
if (!resource.hasParameter(BAG_PARAMETERS, PARAM_RESERVED))
|
||||||
throw new StrolchModelException(
|
throw new StrolchModelException("Parameter " + PARAM_RESERVED + " on bag " + BAG_PARAMETERS + " missing on "
|
||||||
"Parameter " + PARAM_RESERVED + " on bag " + BAG_PARAMETERS + " missing on " + resource
|
+ resource.getLocator());
|
||||||
.getLocator());
|
|
||||||
|
|
||||||
BooleanParameter reservedP = resource.getParameter(BAG_PARAMETERS, PARAM_RESERVED);
|
BooleanParameter reservedP = resource.getParameter(BAG_PARAMETERS, PARAM_RESERVED);
|
||||||
return reservedP.getValue();
|
return reservedP.getValue();
|
||||||
|
|
Loading…
Reference in New Issue