[Fix] Lock activities during execution!
This commit is contained in:
parent
5c8ccabd7f
commit
111a75c034
|
@ -24,6 +24,7 @@ public class ExecuteActivityCommand extends ExecutionCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doCommand() {
|
public void doCommand() {
|
||||||
|
tx().lock(this.activity.getRootElement());
|
||||||
this.activity.accept(this);
|
this.activity.accept(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ public class SetActionToErrorCommand extends ExecutionCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doCommand() {
|
public void doCommand() {
|
||||||
|
tx().lock(this.action.getRootElement());
|
||||||
ExecutionPolicy executionPolicy = getExecutionPolicy(this.action);
|
ExecutionPolicy executionPolicy = getExecutionPolicy(this.action);
|
||||||
executionPolicy.toError(this.action);
|
executionPolicy.toError(this.action);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ public class SetActionToExecutedCommand extends ExecutionCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doCommand() {
|
public void doCommand() {
|
||||||
|
tx().lock(this.action.getRootElement());
|
||||||
ExecutionPolicy executionPolicy = getExecutionPolicy(this.action);
|
ExecutionPolicy executionPolicy = getExecutionPolicy(this.action);
|
||||||
executionPolicy.toExecuted(this.action);
|
executionPolicy.toExecuted(this.action);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ public class SetActionToStoppedCommand extends ExecutionCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doCommand() {
|
public void doCommand() {
|
||||||
|
tx().lock(this.action.getRootElement());
|
||||||
ExecutionPolicy executionPolicy = getExecutionPolicy(this.action);
|
ExecutionPolicy executionPolicy = getExecutionPolicy(this.action);
|
||||||
executionPolicy.toStopped(this.action);
|
executionPolicy.toStopped(this.action);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ public class SetActionToWarningCommand extends ExecutionCommand {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doCommand() {
|
public void doCommand() {
|
||||||
|
tx().lock(this.action.getRootElement());
|
||||||
ExecutionPolicy executionPolicy = getExecutionPolicy(this.action);
|
ExecutionPolicy executionPolicy = getExecutionPolicy(this.action);
|
||||||
executionPolicy.toWarning(this.action);
|
executionPolicy.toWarning(this.action);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,8 @@ import li.strolch.persistence.api.StrolchTransaction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <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>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||||
|
@ -42,7 +43,6 @@ public class SimpleExecution extends ExecutionPolicy {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setActionState(Action action, State state) {
|
protected void setActionState(Action action, State state) {
|
||||||
tx().lock(action.getRootElement());
|
|
||||||
|
|
||||||
action.setState(state);
|
action.setState(state);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue