/** * Create a new plan. */ public RPlan(MPlan mplan, Object candidate, IInternalAccess ia) { super(mplan); this.candidate = candidate; this.ia = ia; setLifecycleState(PlanLifecycleState.NEW); setProcessingState(PlanProcessingState.READY); }
/** * Create a new plan. */ public RPlan(MPlan mplan, ICandidateInfo candidate, Object reason, IInternalAccess agent, Map<String, Object> mappingvals, MConfigParameterElement config) { super(mplan, agent, mappingvals, config); this.candidate = candidate; this.reason = reason; setLifecycleState(PlanLifecycleState.NEW); setProcessingState(PlanProcessingState.READY); // Tricky, requires reason to be set before initing parameters. super.initParameters(mappingvals, config); }
/** * Called after unblocking the component thread. */ public void afterBlock() { RPlan rplan = ExecutePlanStepAction.RPLANS.get(); testBodyAborted(rplan); if(rplan!=null) { rplan.setProcessingState(PlanProcessingState.RUNNING); if(rplan.resumecommand!=null) { // performs only cleanup without setting future rplan.resumecommand.execute(Boolean.FALSE); rplan.resumecommand = null; } } }
/** * Called before blocking the component thread. */ public void beforeBlock() { RPlan rplan = ExecutePlanStepAction.RPLANS.get(); testBodyAborted(rplan); ComponentSuspendable sus = ComponentSuspendable.COMSUPS.get(); if(rplan!=null && sus!=null && !RPlan.PlanProcessingState.WAITING.equals(rplan.getProcessingState())) { final ResumeCommand<Void> rescom = rplan.new ResumeCommand<Void>(sus, false); rplan.setProcessingState(PlanProcessingState.WAITING); rplan.resumecommand = rescom; } }
/** * Called before blocking the component thread. */ public void beforeBlock() { testBodyAborted(); ComponentSuspendable sus = ComponentSuspendable.COMSUPS.get(); if(sus!=null && !RPlan.PlanProcessingState.WAITING.equals(getProcessingState())) { final ResumeCommand<Void> rescom = new ResumeCommand<Void>(sus, false); setProcessingState(PlanProcessingState.WAITING); // System.out.println("setting rescom: "+getId()+" "+rescom); resumecommand = rescom; } }
rplan.setProcessingState(PlanProcessingState.RUNNING); assert RPlan.RPLANS.get()==null : RPlan.RPLANS.get()+", "+rplan; RPlan.RPLANS.set(rplan); rplan.setProcessingState(PlanProcessingState.WAITING); assert RPlan.RPLANS.get()==rplan : RPlan.RPLANS.get()+", "+rplan; RPlan.RPLANS.set(null);
/** * Called after unblocking the component thread. */ public void afterBlock() { testBodyAborted(); setProcessingState(PlanProcessingState.RUNNING); setWaitAbstraction(null); if(resumecommand!=null) { // performs only cleanup without setting future // System.out.println("afterblock rescom: "+getId()+" "+resumecommand); resumecommand.execute(new ResumeCommandArgs(Boolean.FALSE, null, null)); // resumecommand.execute(new Tuple2<Boolean, Boolean>(Boolean.FALSE, null)); resumecommand = null; } }
rplan.setProcessingState(PlanProcessingState.RUNNING); ExecutePlanStepAction.RPLANS.set(rplan); if(rplan.aborted && rplan.getLifecycleState()==PlanLifecycleState.BODY) rplan.setProcessingState(PlanProcessingState.WAITING);
rplan.setProcessingState(RPlan.PlanProcessingState.RUNNING); Object res = null; if(part==0) rplan.setProcessingState(PlanProcessingState.WAITING);
rplan.setProcessingState(RPlan.PlanProcessingState.RUNNING); Object res = null; if(part==0) rplan.setProcessingState(PlanProcessingState.WAITING);