public IFuture<Void> execute(IInternalAccess ia) { // System.out.println("sb start: "+getComponentIdentifier()); state.setAttributeValue(ragent, OAVBDIRuntimeModel.agent_has_initparents, null); state.setAttributeValue(ragent, OAVBDIRuntimeModel.agent_has_state, OAVBDIRuntimeModel.AGENTLIFECYCLESTATE_ALIVE); // Remove arguments from state. if(state.getAttributeValue(ragent, OAVBDIRuntimeModel.agent_has_arguments)!=null) state.setAttributeValue(ragent, OAVBDIRuntimeModel.agent_has_arguments, null); rulesystem.init(); // System.out.println("sb end: "+getComponentIdentifier()); return IFuture.DONE; } });
/** * Start the example. */ public static void main(String[] args) { Rulebase rb = new Rulebase(); rb.addRule(createFindSolutionRuleJCL()); // rb.addRule(createFindSolutionRule()); IPatternMatcherFunctionality pf = new RetePatternMatcherFunctionality(rb); RuleSystem system = new RuleSystem(createState(), rb, pf); system.init(); RuleSystemExecutor exe = new RuleSystemExecutor(system, true); RuleEnginePanel.createRuleEngineFrame(exe, "Golfing Example"); } }