Package org.drools.rule

Examples of org.drools.rule.Package


      "    <connection from=\"2\" to=\"3\" />\n" +
      "  </connections>\n" +
      "\n" +
      "</process>");
    builder.addRuleFlow(source);
    Package pkg = builder.getPackage();
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( pkg );
        WorkingMemory workingMemory = ruleBase.newStatefulSession();
        List<String> collection = new ArrayList<String>();
        collection.add("one");
View Full Code Here


      "    <connection from=\"2\" to=\"3\" />\n" +
      "  </connections>\n" +
      "\n" +
      "</process>");
    builder.addRuleFlow(source);
    Package pkg = builder.getPackage();
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( pkg );
        WorkingMemory workingMemory = ruleBase.newStatefulSession();
        List<String> collection = new ArrayList<String>();
        collection.add("one");
View Full Code Here

            "    <connection from=\"1\" to=\"2\" />\n" +
            "    <connection from=\"2\" to=\"3\" />\n" +
            "  </connections>\n" +
            "</process>");
        builder.addRuleFlow(source);
        Package pkg = builder.getPackage();
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( pkg );
        WorkingMemory workingMemory = ruleBase.newStatefulSession();
        List<String> myList = new ArrayList<String>();
        workingMemory.setGlobal("myList", myList);
View Full Code Here

    public void testProcessEventListener() throws Exception {
        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();

        // create a simple package with one process to test the events
        final Package pkg = new Package( "org.drools.test" );
        RuleFlowProcess process = new RuleFlowProcess();
        process.setId("org.drools.process.event");
        process.setName("Event Process");
       
        StartNode startNode = new StartNode();
        startNode.setName("Start");
        startNode.setId(1);
        process.addNode(startNode);
       
        ActionNode actionNode = new ActionNode();
        actionNode.setName("Print");
        DroolsAction action = new DroolsConsequenceAction("java", null);
        action.setMetaData("Action", new Action() {
      public void execute(ProcessContext context) throws Exception {
              System.out.println("Executed action");
      }
        });
        actionNode.setAction(action);
        actionNode.setId(2);
        process.addNode(actionNode);
        new ConnectionImpl(
            startNode, Node.CONNECTION_DEFAULT_TYPE,
            actionNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        EndNode endNode = new EndNode();
        endNode.setName("End");
        endNode.setId(3);
        process.addNode(endNode);
        new ConnectionImpl(
            actionNode, Node.CONNECTION_DEFAULT_TYPE,
            endNode, Node.CONNECTION_DEFAULT_TYPE
        );
       
        pkg.addProcess(process);
        List<KnowledgePackage> pkgs = new ArrayList<KnowledgePackage>();
        pkgs.add( new KnowledgePackageImp( pkg ) );
        kbase.addKnowledgePackages( pkgs );
       
        StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();
View Full Code Here

        System.err.println(error);
      }
      fail("Could not build process");
    }
   
    Package pkg = builder.getPackage();
    RuleBase ruleBase = RuleBaseFactory.newRuleBase();
    ruleBase.addPackage( pkg );
    final StatefulSession session = ruleBase.newStatefulSession();
    List<Message> myList = new ArrayList<Message>();
    session.setGlobal("myList", myList);
View Full Code Here

        System.err.println(error);
      }
      fail("Could not build process");
    }
   
    Package pkg = builder.getPackage();
    RuleBase ruleBase = RuleBaseFactory.newRuleBase();
    ruleBase.addPackage( pkg );
    final StatefulSession session = ruleBase.newStatefulSession();
    List<Message> myList = new ArrayList<Message>();
    session.setGlobal("myList", myList);
View Full Code Here

      "  </connections>\n" +
      "\n" +
      "</process>");
    builder.addRuleFlow(source);
   
    Package pkg = builder.getPackage();
    RuleBase ruleBase = RuleBaseFactory.newRuleBase();
    ruleBase.addPackage( pkg );
    final StatefulSession session = ruleBase.newStatefulSession();
    List<String> myList = new ArrayList<String>();
    session.setGlobal("myList", myList);
View Full Code Here

      "  </connections>\n" +
      "\n" +
      "</process>");
    builder.addRuleFlow(source);
   
    Package pkg = builder.getPackage();
    RuleBase ruleBase = RuleBaseFactory.newRuleBase();
    ruleBase.addPackage( pkg );
    final StatefulSession session = ruleBase.newStatefulSession();
    List<String> myList = new ArrayList<String>();
    session.setGlobal("myList", myList);
View Full Code Here

      "  </connections>\n" +
      "\n" +
      "</process>");
    builder.addRuleFlow(source);
   
    Package pkg = builder.getPackage();
    RuleBase ruleBase = RuleBaseFactory.newRuleBase();
    ruleBase.addPackage( pkg );
    final StatefulSession session = ruleBase.newStatefulSession();
    List<String> myList = new ArrayList<String>();
    session.setGlobal("myList", myList);
View Full Code Here

      "  </connections>\n" +
      "\n" +
      "</process>");
    builder.addRuleFlow(source);
   
    Package pkg = builder.getPackage();
    RuleBase ruleBase = RuleBaseFactory.newRuleBase();
    ruleBase.addPackage( pkg );
    final StatefulSession session = ruleBase.newStatefulSession();
    List<String> myList = new ArrayList<String>();
    session.setGlobal("myList", myList);
View Full Code Here

TOP

Related Classes of org.drools.rule.Package

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.