[Fix] Fixed issues where remaining actions on Activity aren't executed
This ocurred because of settings remaining unneeded Actions to state CLOSED, and thus execution was not continued.
This commit is contained in:
parent
bb1cd337c7
commit
1354a89f72
|
@ -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());
|
||||
|
|
|
@ -82,9 +82,12 @@ public abstract class ExecutionCommand extends Command implements TimeOrderingVi
|
|||
Iterator<Entry<String, IActivityElement>> 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<Entry<String, IActivityElement>> 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;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ import li.strolch.persistence.api.StrolchTransaction;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 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.
|
||||
* </p>
|
||||
*
|
||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||
|
|
Loading…
Reference in New Issue