コード例 #1
0
ファイル: RuleComponent.java プロジェクト: harpreetoxyent/pnl
 public boolean retractFactFromRete(Object ob) throws ComponentException {
   boolean result;
   try {
     IWorkingMemory reteWorkingMemory = ruleBase.newWorkingMemory();
     reteWorkingMemory.retractObject(ob);
     result = true;
   } catch (RuleComponentException rce) {
     throw new ComponentException(rce.getMessage());
   }
   return result;
 }
コード例 #2
0
ファイル: RuleComponent.java プロジェクト: harpreetoxyent/pnl
  public List<IRuleClass> executeRules(Object[] ob) throws ComponentException {
    System.out.println("-------Inside Execute RULES---rulebase=" + ruleBase);
    System.out.println("-------Inside Execute RULES---object=" + ob);

    try {
      IWorkingMemory reteWorkingMemory = ruleBase.newWorkingMemory();
      reteWorkingMemory.assertObject(ob);
      return reteWorkingMemory.executeRules();
    } catch (RuleComponentException rce) {
      throw new ComponentException(rce.getMessage());
    }
  }
コード例 #3
0
ファイル: RuleComponent.java プロジェクト: harpreetoxyent/pnl
  public void buildRete(String masterPageLocation) throws ComponentException {

    System.out.println("*********INSIDE RULE COMPONENT  BUILD RETE************");
    this.masterPagePath = masterPageLocation;
    ruleBase = new ReteRuleBase();
    // ruleBase.readRule(RulesConstants.MASTER_PAGE_PATH);
    try {
      ruleBase.readRule(masterPageLocation);
      ruleBase.buildRete();
    } catch (RuleComponentException rce) {
      rce.printStackTrace();
      throw new ComponentException(rce.getMessage());
    }
    /*IWorkingMemory reteWorkingMemory = ruleBase.newWorkingMemory();
    reteWorkingMemory.assertObject(ob);
    return reteWorkingMemory.executeRules();*/
  }