public void goalFinished(AgentEvent ae) { IGoal goal = (IGoal)ae.getSource(); if(goal.isSucceeded()) { goalcnt++; if(goalcnt==agoalnames.length) lis.resultAvailable(null); } else { lis.exceptionOccurred(goal.getException()); } }
/** * The body method is called on the * instantiated plan instance from the scheduler. */ public void body() { String[] goalnames = (String[]) getParameter("goals").getValue(); IGoal[] goals = new IGoal[goalnames.length]; for (int i = 0; i < goalnames.length; ++i) { goals[i] = createGoal(goalnames[i]); dispatchSubgoalAndWait(goals[i]); if (!goals[i].isSucceeded()) { fail(goals[i].getException()); } } } }
public void goalFinished(AgentEvent ae) if(goal.isSucceeded())
if(!goal.isSucceeded()) mviolated = goal;
/** * The body method is called on the * instantiated plan instance from the scheduler. */ public void body() { String[] goalnames = (String[]) getParameter("goals").getValue(); IGoal[] goals = new IGoal[goalnames.length]; for (int i = 0; i < goalnames.length; ++i) { goals[i] = createGoal(goalnames[i]); dispatchSubgoal(goals[i]); } for (int i = 0; i < goals.length; ++i) { waitForGoal(goals[i]); if (!goals[i].isSucceeded()) { for (int j = 0; j < goals.length; ++j) { goals[j].drop(); } fail(goals[i].getException()); } } } }