[New] Added ExecutionPolicy.getActivityType()

This commit is contained in:
Robert von Burg 2023-11-24 12:51:35 +01:00
parent d6cfc6711a
commit d2627d13e7
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 13 additions and 2 deletions

View File

@ -96,6 +96,13 @@ public abstract class ExecutionPolicy extends StrolchPolicy {
return this.controller;
}
/**
* Returns the type of activity for which this {@link ExecutionPolicy} is being executed
*/
public String getActivityType() {
return this.actionLoc.get(1);
}
/**
* Returns the type of the {@link Resource} for this action. Can only be called after {@link #initialize(Action)}
* was called.
@ -255,8 +262,12 @@ public abstract class ExecutionPolicy extends StrolchPolicy {
*/
protected void setActionState(Action action, State state) {
if (action.getState().inClosedPhase())
throw new IllegalStateException("Action " + action.getLocator() + " has state " + action.getState() +
" and can not be changed to " + state);
throw new IllegalStateException("Action " +
action.getLocator() +
" has state " +
action.getState() +
" and can not be changed to " +
state);
action.setState(state);