[rules-users] Application Guvnor integration

Esteban Aliverti esteban.aliverti at gmail.com
Fri Jan 13 03:17:12 EST 2012


Can you share with us the log output please?

Best Regards,

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Fri, Jan 13, 2012 at 7:44 AM, Senthil K <kris.senthilkumar at gmail.com>wrote:

> Hi,
>
> I am trying to do integration between application and guvnor. I am unable
> to
> build knowledge base using the change_set provided for the package in
> Guvnor. Following is the snipet of code i am using. When i try to print
> number of packages from knowledgebase, it shows 0.
>
> Can you help me please.
>
>
>                System.out.println("Before rule engine start ");
>
>                String
> urlstr="
> http://192.168.2.247:8080/guvnor-5.3.0.Final-jboss-as-5.1/org.drools.guvnor.Guvnor/package/sample/LATEST/ChangeSet.xml
> ";
>                URL url = new URL(urlstr);
>
>                KnowledgeAgentConfiguration aconf =
> KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
>                        aconf.setProperty("drools.agent.newInstance",
> "false");
>                        _kagent = KnowledgeAgentFactory.newKnowledgeAgent(
> "MyAgent",aconf );
>
>            System.out.println("after creating kagent");
>            _kagent.applyChangeSet(ResourceFactory.newUrlResource(url));
>            System.out.println("after apply change set");
>
>                        ResourceChangeScannerConfiguration sconf=
>
>
> ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
>
>  sconf.setProperty("drools.resource.scanner.interval", "30");
>
>  ResourceFactory.getResourceChangeScannerService().configure(sconf);
>
>
>  ResourceFactory.getResourceChangeNotifierService().start();
>
>  ResourceFactory.getResourceChangeScannerService().start();
>
>                        System.out.println("After starting Notification
> service");
>
>
>  _kagent.applyChangeSet(ResourceFactory.newUrlResource(url));
>                        _kbase = _kagent.getKnowledgeBase();
>
>                        Collection<KnowledgePackage> kpackages =
> _kbase.getKnowledgePackages();
>
>                    System.out.println("no of packages"+kpackages.size());
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Application-Guvnor-integration-tp3655924p3655924.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120113/faf59266/attachment.html 


More information about the rules-users mailing list