[New] Added IActivityElement. and State.inExecutionPlanningPhase()

This commit is contained in:
Robert von Burg 2022-01-19 19:30:59 +01:00
parent b425414b74
commit 6b4c6b1433
2 changed files with 14 additions and 3 deletions

View File

@ -40,7 +40,7 @@ public enum State {
EXECUTED("Executed"), //$NON-NLS-1$
CLOSED("Closed"); //$NON-NLS-1$
private String state;
private final String state;
State(String state) {
this.state = state;
@ -72,6 +72,13 @@ public enum State {
return this == EXECUTION || this == STOPPED || this == WARNING || this == ERROR;
}
/**
* @return true if {@link #inPlanningPhase()} or {@link #inExecutionPhase()} returns true
*/
public boolean inExecutionPlanningPhase() {
return inPlanningPhase() || inExecutionPhase();
}
/**
* @return true if the state is {@link #ERROR} or {@link #STOPPED}
*/
@ -80,10 +87,10 @@ public enum State {
}
/**
* @return true if the state is one of {@link #STOPPED}, {@link #WARNING} or {@link #ERROR}
* @return true if the state is one of {@link #EXECUTION}, {@link #STOPPED}, {@link #WARNING} or {@link #ERROR}
*/
public boolean inExecutionWarningPhase() {
return this == STOPPED || this == WARNING || this == ERROR;
return this == EXECUTION || this == STOPPED || this == WARNING || this == ERROR;
}
/**

View File

@ -190,6 +190,10 @@ public interface IActivityElement extends StrolchElement {
return getState().inExecutionPhase();
}
default boolean inExecutionPlanningPhase() {
return getState().inExecutionPlanningPhase();
}
default boolean inErrorPhase() {
return getState().inErrorPhase();
}