[rules-users] ClassCastException using RuleAgent
Hello there! I'm getting an classcastexception when I try to insert facts on my RuleAgent: Properties props = new Properties(); props.put(url, http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/com.acme.rules/latest ); props.put(newInstance, true); props.put(name,testagent); RuleAgent agent = RuleAgent.newRuleAgent(props); StatefulSession session = agent.getRuleBase().newStatefulSession(); session.insert(fact); The error happens on the session.insert method. It also happens inside my Seam application When I try to insert the facts on the working memory. My drools package contains the model that I've extracted from my seam application. If I run it using a local drl file, it works fine. This problem only happens with the rule agent Could someone give me a hand on this? Regards -- In a world without fences and walls, who needs Gates and Windows? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Using nested properties on guided editor
Hello there! I'm trying Guvnor 5.0M1 (really nice :)) after reading : http://blog.athico.com/2008/08/machine-learning-and-apache-mahout.html I thought I could use nested objects in my rules. For instance, I have a technical rule: when $t: Trabalho( situacao.dscSituacao == AGUARDANDO APROVAÇÃO ) Situacao( dscSituacao == EM APROVAÇÃO ) then $t.setSituacaoValida(true); But I can't find a way to bind this using guided editor. I add the fact Trabalho, bind it to $t variable, but when selecting a restriction to a field, it ends on situacao, not letting me navigate deeper on the graph. Is this possible? Do I need a latest version on the SVN in order to use this? Best Regards -- In a world without fences and walls, who needs Gates and Windows? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Rule Agent retrieving null rulebase
Hello there! I've just started with the BRMS (what an awesome feature I might add). So I've deployed a simple rule, packaged it and created a snapshot. The package is created and when I access the url provided by the BRMS it tries to download the package, so I'm assuming it is published. So I ran this code inside eclipse: public static void main(String[] args) { RuleAgent agent = RuleAgent.newRuleAgent(/MyRules.properties); RuleBase rb = agent.getRuleBase(); StatefulSession session = rb.newStatefulSession(); Funcionario f = new Funcionario(); f.setSalario(1000.0); Cargo c = new Cargo(); c.setDescricao(desenvolvedor); f.setCargo(c); session.insert(c); Decision d = new Decision(); session.insert(d); session.fireAllRules(); session.dispose(); } -MyRules.properties http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/com.synos.rules.credito/production-1 poll=10 It throws a nullpointer exception, as the agent.getRulebase() is returning a null object. What am I missing here? Best regards -- In a world without fences and walls, who needs Gates and Windows? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users