diff --git a/li.strolch.model/src/main/java/li/strolch/model/State.java b/li.strolch.model/src/main/java/li/strolch/model/State.java index ed1dbb769..776c26e18 100644 --- a/li.strolch.model/src/main/java/li/strolch/model/State.java +++ b/li.strolch.model/src/main/java/li/strolch/model/State.java @@ -191,13 +191,6 @@ public enum State { return this == PLANNED || this == EXECUTABLE || this == State.STOPPED; } - /** - * @return true if {@link #PLANNED} or {@link #EXECUTABLE} or {@link #EXECUTION} - */ - public boolean isExecutable() { - return this == PLANNED || this == EXECUTABLE || this == EXECUTION; - } - /** * @return true if state >= {@link #EXECUTED} */ diff --git a/li.strolch.service/src/main/java/li/strolch/execution/command/SetActionToExecutableCommand.java b/li.strolch.service/src/main/java/li/strolch/execution/command/SetActionToExecutableCommand.java deleted file mode 100644 index db00fe05f..000000000 --- a/li.strolch.service/src/main/java/li/strolch/execution/command/SetActionToExecutableCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -package li.strolch.execution.command; - -import java.text.MessageFormat; - -import li.strolch.exception.StrolchException; -import li.strolch.model.State; -import li.strolch.model.activity.Activity; -import li.strolch.persistence.api.StrolchTransaction; - -public class SetActionToExecutableCommand extends ActionExecutionCommand { - - public SetActionToExecutableCommand(StrolchTransaction tx) { - super(tx); - } - - @Override - public void validate() { - super.validate(); - - if (!this.action.getState().canSetToExecutable()) { - String msg = "Current state is {0} and can not be changed to {1} for action {2}"; - msg = MessageFormat.format(msg, this.action.getState(), State.EXECUTABLE, this.action.getLocator()); - throw new StrolchException(msg); - } - } - - @Override - public void doCommand() { - if (this.action.getState() == State.EXECUTABLE) { - logger.warn("Action " + this.action.getLocator() + " is already in state EXECUTABLE! Not changing."); - return; - } - - Activity rootElement = this.action.getRootElement(); - State currentState = rootElement.getState(); - - this.action.setState(State.EXECUTABLE); - - getConfirmationPolicy(this.action).toExecutable(this.action); - - updateOrderState(tx(), rootElement, currentState, rootElement.getState()); - } -} diff --git a/li.strolch.service/src/main/java/li/strolch/execution/policy/ConfirmationPolicy.java b/li.strolch.service/src/main/java/li/strolch/execution/policy/ConfirmationPolicy.java index 5cfe8804d..0c6b927bb 100644 --- a/li.strolch.service/src/main/java/li/strolch/execution/policy/ConfirmationPolicy.java +++ b/li.strolch.service/src/main/java/li/strolch/execution/policy/ConfirmationPolicy.java @@ -32,10 +32,6 @@ public class ConfirmationPolicy extends StrolchPolicy { // do nothing } - public void toExecutable(Action action) { - // do nothing - } - public void toExecution(Action action) { // do nothing } @@ -60,11 +56,6 @@ public class ConfirmationPolicy extends StrolchPolicy { // do nothing } - @Override - public void undo() { - // nothing to undo - } - /** * Calls the appropriate confirmation method depending on the state of the {@link Action} * @@ -76,7 +67,6 @@ public class ConfirmationPolicy extends StrolchPolicy { case CREATED -> toCreated(action); case PLANNING -> toPlanning(action); case PLANNED -> toPlanned(action); - case EXECUTABLE -> toExecutable(action); case EXECUTION -> toExecution(action); case WARNING -> toWarning(action); case ERROR -> toError(action);