return false;
}
private boolean performAtomic(Plan p) {
if (p instanceof TaskPlan) {
TaskPlan plan = (TaskPlan) p;
Task task = plan.getTask();
// First try to do it as a dialogue turn
List<Turn> turns = getModelSet().getTurns(plan.getQName());
for (Turn turn : Priority.copyShuffleSort(turns))
if (Bool.maybeTrue(turn.isApplicable(task))) {
setFocus(plan);
setCurrentTurn(turn);
return true;
}
// If not, try to execute a script
List<Script> scripts = getModelSet().getScripts(plan.getQName());
for (Script script : Priority.copyShuffleSort(scripts))
if (Bool.maybeTrue(script.isApplicable(task))) {
setFocus(plan);
script.apply(task, true);
performedFocus(null);