diff --git a/li.strolch.service/src/main/java/li/strolch/execution/EventBasedExecutionHandler.java b/li.strolch.service/src/main/java/li/strolch/execution/EventBasedExecutionHandler.java index ccb641d53..a421d37fc 100644 --- a/li.strolch.service/src/main/java/li/strolch/execution/EventBasedExecutionHandler.java +++ b/li.strolch.service/src/main/java/li/strolch/execution/EventBasedExecutionHandler.java @@ -243,7 +243,7 @@ public class EventBasedExecutionHandler extends ExecutionHandler { synchronized (this.registeredActivities) { if (!this.registeredActivities.removeElement(realm, activityLoc)) - logger.warn("Activity " + actionLoc + " already removed from registered activities!"); + logger.warn("Activity " + activityLoc + " already removed from registered activities!"); } archiveActivity(realm, activity.getLocator()); diff --git a/li.strolch.service/src/main/java/li/strolch/execution/command/ExecutionCommand.java b/li.strolch.service/src/main/java/li/strolch/execution/command/ExecutionCommand.java index 741843d03..c509fb181 100644 --- a/li.strolch.service/src/main/java/li/strolch/execution/command/ExecutionCommand.java +++ b/li.strolch.service/src/main/java/li/strolch/execution/command/ExecutionCommand.java @@ -82,9 +82,12 @@ public abstract class ExecutionCommand extends Command implements TimeOrderingVi Iterator> iter = activity.elementIterator(); while (iter.hasNext()) { IActivityElement element = iter.next().getValue(); + State state = element.getState(); + if (element.getState().compareTo(State.EXECUTED) >= 0) + continue; // in series we can never have two Actions in execution, so if we found the action in execution, we stop - if (element instanceof Action && element.getState() == State.EXECUTION) + if (element instanceof Action && state == State.EXECUTION) break; boolean canExecute = isExecutable(element); @@ -104,6 +107,8 @@ public abstract class ExecutionCommand extends Command implements TimeOrderingVi Iterator> iter = activity.elementIterator(); while (iter.hasNext()) { IActivityElement element = iter.next().getValue(); + if (element.getState().isExecuted()) + continue; boolean canExecute = isExecutable(element); if (canExecute) { @@ -113,7 +118,7 @@ public abstract class ExecutionCommand extends Command implements TimeOrderingVi } protected boolean isExecutable(IActivityElement element) { - if (element.getState() == State.EXECUTED) + if (element.getState().compareTo(State.EXECUTED) >= 0) return false; return element instanceof Activity || element.getState().compareTo(State.EXECUTION) < 0; } diff --git a/li.strolch.service/src/main/java/li/strolch/execution/policy/SimpleExecution.java b/li.strolch.service/src/main/java/li/strolch/execution/policy/SimpleExecution.java index d6ca051a8..852f8cc07 100644 --- a/li.strolch.service/src/main/java/li/strolch/execution/policy/SimpleExecution.java +++ b/li.strolch.service/src/main/java/li/strolch/execution/policy/SimpleExecution.java @@ -8,8 +8,7 @@ import li.strolch.persistence.api.StrolchTransaction; /** *

- * Simple Execution Policy which sets the state of the action depending on the - * method called. + * Simple Execution Policy which sets the state of the action depending on the method called. *

* * @author Robert von Burg