[New] Added IActivityElement state helper methods

This commit is contained in:
Robert von Burg 2022-01-14 11:00:06 +01:00
parent 99e10e03c4
commit 988fdd4d73
1 changed files with 25 additions and 0 deletions

View File

@ -175,8 +175,33 @@ public interface IActivityElement extends StrolchElement {
*
* @return the result of the visitor being accepted
*/
@Override
<T> T accept(StrolchElementVisitor<T> visitor);
default boolean inCreatedPhase() {
return getState().inCreatedPhase();
}
default boolean inPlanningPhase() {
return getState().inPlanningPhase();
}
default boolean inExecutionPhase() {
return getState().inExecutionPhase();
}
default boolean inErrorPhase() {
return getState().inErrorPhase();
}
default boolean inExecutionWarningPhase() {
return getState().inExecutionWarningPhase();
}
default boolean inClosedPhase() {
return getState().inClosedPhase();
}
default Activity findParent(Predicate<Activity> predicate) {
Activity parent = getParent();