[Fix] Initialize ExecutionPolicy before calling isExecutable()

This commit is contained in:
Robert von Burg 2023-02-27 10:50:24 +01:00
parent 5230e80879
commit 3a82050cb6
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 3 additions and 1 deletions

View File

@ -197,7 +197,9 @@ public class PlanAndExecuteActivityCommand extends BasePlanningAndExecutionComma
boolean anyActionNotExecutable = activity.streamActionsDeep().anyMatch(a -> {
if (!a.getState().canSetToExecution())
return false;
boolean executable = getExecutionPolicy(a).isExecutable(a);
ExecutionPolicy executionPolicy = getExecutionPolicy(a);
executionPolicy.initialize(a);
boolean executable = executionPolicy.isExecutable(a);
if (!executable)
logger.info("Action " + a.getLocator() + " is not executable yet!");
return !executable;