0 Replies Latest reply on Jul 24, 2015 11:02 AM by Suresh Ramamurthy

    Guided Rule Template in KIE 6.2.0.Final - Issue

    Suresh Ramamurthy Newbie

      I created a Gruided Rule Template in KIE Workbench and populated some data. Now when I build and deploy and get a kjar out of it, I have simple program which introspects for all the rules available for a package and it looks like the template related rule are not displayed. What is going wrong. Am I missing something.

       

      Below code shows you how to loop and get all the rules.


           KieServices ks = KieServices.Factory.get();        

           KieContainer kContainer = ks.getKieClasspathContainer();               

           CollectionkiePkgs = kContainer.getKieBase("rules").getKiePackages() ;       

           System.out.println("kiePkgs Length is " + kiePkgs.size() ) ;       

       

           for(KiePackage kiePkg : kiePkgs)   {       

                System.out.println("Package Name is --->" + kiePkg.getName() ) ;               

                Collection  rules = kiePkg.getRules() ;               

       

                for (Rule rule : rules)  {       

                     System.out.println("Rule Name is --->" + rule.getName() )  ;       

                }               

           }

       

      Any inputs are highly appreciated