Package org.drools

Examples of org.drools.KnowledgeBase.addKnowledgePackages()


      KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
      kbuilder.add(new ClassPathResource("ruleflow.rf"), ResourceType.DRF);
      kbuilder.add(new ClassPathResource("ruleflow2.rf"), ResourceType.DRF);
      kbuilder.add(new ClassPathResource("ruleflow3.rf"), ResourceType.DRF);
      KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
      kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
        return kbase;
    }
}
View Full Code Here


        assertEquals( 0, javaDialect.getResults().size() );

        final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        List<KnowledgePackage> packages = new ArrayList<KnowledgePackage>();
        packages.add( new KnowledgePackageImp(pkgBuilder.getPackage()) );
        kbase.addKnowledgePackages( packages );
        final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

        ksession.setGlobal( "value", true );

        RuleFlowProcessInstance processInstance = new RuleFlowProcessInstance();
View Full Code Here

                       null );

        final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        List<KnowledgePackage> packages = new ArrayList<KnowledgePackage>();
        packages.add( new KnowledgePackageImp(pkgBuilder.getPackage()) );
        kbase.addKnowledgePackages( packages );
        final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

        ksession.setGlobal( "value", true );       

        RuleFlowProcessInstance processInstance = new RuleFlowProcessInstance();
View Full Code Here

          System.out.println(error);
        }
       
        Collection<KnowledgePackage> kpkgs = kbuilder.getKnowledgePackages();
        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        kbase.addKnowledgePackages( kpkgs );       
        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        List<Long> list = new ArrayList<Long>();
        ksession.setGlobal("list", list);

        Person john = new Person("John Doe", 20);
View Full Code Here

       
//        RuleBaseConfiguration config = new RuleBaseConfiguration();
//        config.setRuleBaseUpdateHandler(null);

        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        kbase.addKnowledgePackages( builder.getKnowledgePackages() );
        StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();

        List<String> list = new ArrayList<String>();
        session.setGlobal( "list", list );
View Full Code Here

            "    <connection from=\"4\" to=\"3\"/>\n" +
            "  </connections>\n" +
            "</process>";
        builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        builder.add( new ReaderResource( new StringReader( process2 )), ResourceType.DRF );
        kbase.addKnowledgePackages( builder.getKnowledgePackages() );
       
        WorkflowProcessInstanceUpgrader.upgradeProcessInstance(
            session, processInstance.getId(), "org.test.ruleflow2", new HashMap<String, Long>());
        assertEquals("org.test.ruleflow2", processInstance.getProcessId());
       
View Full Code Here

       
//      RuleBaseConfiguration config = new RuleBaseConfiguration();
//      config.setRuleBaseUpdateHandler(null);

        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        kbase.addKnowledgePackages( builder.getKnowledgePackages() );
        StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();

        List<String> list = new ArrayList<String>();
        session.setGlobal( "list", list );
View Full Code Here

            "    <connection from=\"4\" to=\"3\"/>\n" +
            "  </connections>\n" +
            "</process>";
        builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        builder.add( new ReaderResource( new StringReader( process2 )), ResourceType.DRF );
        kbase.addKnowledgePackages( builder.getKnowledgePackages() );
       
        Map<String, Long> mapping = new HashMap<String, Long>();
        mapping.put("2", 102L);
       
        WorkflowProcessInstanceUpgrader.upgradeProcessInstance(
View Full Code Here

       
//      RuleBaseConfiguration config = new RuleBaseConfiguration();
//      config.setRuleBaseUpdateHandler(null);

        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        kbase.addKnowledgePackages( builder.getKnowledgePackages() );
        StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();

        List<String> list = new ArrayList<String>();
        session.setGlobal( "list", list );
View Full Code Here

            "    <connection from=\"2\" to=\"3\"/>\n" +
            "  </connections>\n" +
            "</process>";
        builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
        builder.add( new ReaderResource( new StringReader( process2 )), ResourceType.DRF );
        kbase.addKnowledgePackages( builder.getKnowledgePackages() );
       
        Map<String, Long> mapping = new HashMap<String, Long>();
        mapping.put("2:1", 101L);
       
        WorkflowProcessInstanceUpgrader.upgradeProcessInstance(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.