Re: [rules-users] Insert a fact into drools server from a web application or java application
Thank you for the response... Unfortunately, I have read this and still kinda lost on what any of that means... Is there an example with drools that I can look at to help me see this a little better? -- View this message in context: http://drools.46999.n3.nabble.com/Insert-a-fact-into-drools-server-from-a-web-application-or-java-application-tp3214229p3229963.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Drools5.2.2 integration with scala2.9.0.1
Hi, I am new with Drools. I am integrating Drools with Scala. I am trying the project given at http://www.gettingcirrius.com/2010/12/using-jboss-rules-drools-in-scala.html http://www.gettingcirrius.com/2010/12/using-jboss-rules-drools-in-scala.html . I have made a small change in the code to supply the Drools rule file as given below: File f = new File("WeatherRules.drl"); kbuilder.add(ResourceFactory.newFileResource(f), ResourceType.DRL); The code is running fine and there is no error but the rules are not working. The output I got is: Creating Knowledge Session Creating and insertng Temperature Firing all rules It seems that the configured rules are not working. The dependencies I am using in for is: Scala: 2.9.0.1 Sbt: 0.7.7 jaxb-xjc: 2.2.4-1 drools-core: 5.2.0.Final drools-compiler: 5.2.0.Final jxl: 2.6 xstream: 1.3.1 Am I missing something? Please help me to integrate Drools with scala. Thanks in advance. Any help will be appreciated. thanks, Puneet -- View this message in context: http://drools.46999.n3.nabble.com/Drools5-2-2-integration-with-scala2-9-0-1-tp3229566p3229566.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Inserting multiple objects of the same class as facts
Hello, I am facing a problem with the following code with Drools 5.0.1: I insert multiple objects as facts into my stateful session here: === StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); /** mapTypes here is an array of MapType objects **/ for(int i=0;i___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] installing oryx designer with guvnor 5.2 (on win2003, as4.2.3)
thanks! the newest version designer-1.0.0.053-jboss.war did the trick. cheers. -- View this message in context: http://drools.46999.n3.nabble.com/installing-oryx-designer-with-guvnor-5-2-on-win2003-as4-2-3-tp3228131p3229096.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to install drools 5.2 with integrated oryx designer on jboss as 7?
okay, thank you very much for your replies. I am very much looking forward to all of this as I will start setting drools up for our users pretty soon, and I would like to use an as accurate version as possible (as you can imagine) that it can stay like this for a while. I guess as 5.3 is available soon, 5.4 will be available this year? cheers. itchupe -- View this message in context: http://drools.46999.n3.nabble.com/how-to-install-drools-5-2-with-integrated-oryx-designer-on-jboss-as-7-tp3228094p3228830.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to install drools 5.2 with integrated oryx designer on jboss as 7?
Just fyi, see this post on running jBPM5 on AS7: http://planet.jboss.org/post/jbpm5_on_as7_lightning The web Designer also has support for AS7 with its latest version: http://sourceforge.net/projects/jbpm/files/designer/designer-1.0.0.054/ Once we get Guvnor running on AS7 I am sure we will update the jBPM installer to it for full integration. Thanks. On 8/5/11 8:49 AM, Geoffrey De Smet wrote: > There are troubles with guvnor (because of seam 2 and the way guvnor > architecturally (mis)uses it) on JBoss AS 7. > We've been trying to quick fix these, but without much luck. > Guvnor 5.4 will upgrade to seam 3 (the protype works already, and will > use seam correctly) and will run on JBoss AS 7. > > Op 05-08-11 11:06, itchupe schreef: >> hello there >> >> anyone has experience with that. I am not familiar with as 7 at all. >> how should i start? or does it not make sense yet to use as 7 with drools at >> all? >> >> (i am missing a 5.2 standalone download... will there be one for 5.3 with as >> 7 or tomcat?) >> >> >> cheers. >> >> -- >> View this message in context: >> http://drools.46999.n3.nabble.com/how-to-install-drools-5-2-with-integrated-oryx-designer-on-jboss-as-7-tp3228094p3228094.html >> Sent from the Drools: User forum mailing list archive at Nabble.com. >> ___ >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users >> ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] installing oryx designer with guvnor 5.2 (on win2003, as4.2.3)
On 8/5/11 5:22 AM, itchupe wrote: > hello > > unfortunately i have to use a windows 2003 server... > (as on jboss as 6 i could not get drools 5.2 to work) > i used drools-5.1-standalone and > deployed drools 5.2 (of guvnor-5.2.0.Final-jboss-as-5.1.war) and > oryx designer on jboss as 4.2.3 which both are working > except the integration of oryx designer is incorrect. > > when i try to open a bpmn-file, on tab edit it displays the error: > --- > HTTP Status 404 - /designer/editor/ > > type Status report > > message /designer/editor/ > > description The requested resource (/designer/editor/) is not available. > JBossWeb/2.0.1.GA > --- > > where can i change the configuration? > http://localhost:8080/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.Guvnor/Guvnor.html > http://localhost:8080/designer/editor You should probably first rename your guvnor-5.2.0.Final-jboss-as-5.1.war to drools-guvnor.war before deploying it in $jbossas/server/default/deploy directory. Not sure where you got the designer war from (it is hosted on sourceforge: http://sourceforge.net/projects/jbpm/files/designer/ ). Make sure you get the *-jboss.war and rename it to designer.war before deploying alongside the guvnor war. Guvnor currently expects the designer to live on the same host and port right now. Designer is configurable as to where it looks up the guvnor location. In order to change this information you have to deploy designer as an exploded war and edit $jbossas/server/default/deploy/designer.war/profiles/jbpm.xml. The bottom of this file contains section ..you should leave the subdomain as-is and change other attributes as necessary. Just as a note, with jbpm5 installer (http://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.1.0.Final/) puts it all together for you and really is the easiest way to get started with using guvnor/designer/jbpm-console, and saves you the headache with issues like these. Thanks. > > > cheers. > itchupe > > -- > View this message in context: > http://drools.46999.n3.nabble.com/installing-oryx-designer-with-guvnor-5-2-on-win2003-as4-2-3-tp3228131p3228131.html > Sent from the Drools: User forum mailing list archive at Nabble.com. > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Events Monitoring Tool
Does someone know a tool like Zabbix to monitor events inserted in the working memory? When my ad-hoc listener receives an event I could give it to the tool and then insert this event into the working memory. I need to see the latest events for a configurable period of time. Thanks & Regards, -- View this message in context: http://drools.46999.n3.nabble.com/Events-Monitoring-Tool-tp3228713p3228713.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to install drools 5.2 with integrated oryx designer on jboss as 7?
There are troubles with guvnor (because of seam 2 and the way guvnor architecturally (mis)uses it) on JBoss AS 7. We've been trying to quick fix these, but without much luck. Guvnor 5.4 will upgrade to seam 3 (the protype works already, and will use seam correctly) and will run on JBoss AS 7. Op 05-08-11 11:06, itchupe schreef: > hello there > > anyone has experience with that. I am not familiar with as 7 at all. > how should i start? or does it not make sense yet to use as 7 with drools at > all? > > (i am missing a 5.2 standalone download... will there be one for 5.3 with as > 7 or tomcat?) > > > cheers. > > -- > View this message in context: > http://drools.46999.n3.nabble.com/how-to-install-drools-5-2-with-integrated-oryx-designer-on-jboss-as-7-tp3228094p3228094.html > Sent from the Drools: User forum mailing list archive at Nabble.com. > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > -- With kind regards, Geoffrey De Smet ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Some basic queries
Please study the documentation ("Expert") and the examples about how to write conditions and their components. See below for some pointers. 2011/8/5 Gaurav Silakari > > Below is my drl and the Pojo that I am using, please guide me on this : > #created on: Aug 5, 2011 > package com.sample > import com.sample.Customer > > rule "Below 100" > > when > $c:Customer() > $c.getSi() < 100 > $c: Customer( si < 100 ) This is the proper way of making a constraint on a fact attribute. "getSi" and "si" relate according to JavaBeans. > > then > $c.setVal("<100"); > > end > > rule "Below 200" > > when > $c:Customer() > $c.getSi() < 200 > # Same as above. You realize that <100 also means <200; if so, both rules will fire and "val" could be set either way. > > then > $c.setVal("<200"); > > end > > > rule "Below 300" > > when > $c:Customer() > $c.getSi() < 300 > # see comment on rule "Below 200" -W > then > $c.setVal("<300"); > > end > > > > > *Pojo :* > > package com.sample; > > public class Customer { > > private double si; > private String val; > > public double getSi() { > return si; > } > public double setSi(double p,double r, double t) { > si = (p*r*t)/100; > return si; > } > public String getVal() { > return val; > } > public void setVal(String val) { > this.val = val; > } > > } > > The error that I get while executing is : > > > > [9,13]: unknown:9:13 mismatched token: [@33,126:126='<',<79>,9:13]; > expecting type THEN[20,13]: unknown:20:13 mismatched token: > [@67,224:224='<',<79>,20:13]; expecting type THEN[32,13]: unknown:32:13 > mismatched token: [@101,323:323='<',<79>,32:13]; expecting type THEN > java.lang.RuntimeException: Unable to compile "methodCall.drl". > at com.sample.Calling.createRuleBase(Calling.java:48) > at com.sample.Calling.main(Calling.java:24) > > > > and my calling class is : > > > package com.sample; > > import java.io.IOException; > import java.io.InputStreamReader; > import java.io.Reader; > > import org.drools.RuleBase; > import org.drools.RuleBaseFactory; > import org.drools.StatefulSession; > import org.drools.compiler.PackageBuilder; > import org.drools.rule.Package; > > public class Calling { > > > public static void main(String[] args)throws IOException { > > > Customer c1 = new Customer(); > c1.setSi(1000, 5, 2); > > try { > > RuleBase ruleBase = createRuleBase(); > StatefulSession session = ruleBase.newStatefulSession (); > > session.insert(c1); > session.fireAllRules(); > session.dispose(); > > System.out.println("Interest is : "+c1.getVal()); > > } > catch (Throwable t) { > t.printStackTrace(); > } > } > > private static RuleBase createRuleBase() throws Exception > { > Reader source = new InputStreamReader(Calling.class.getResourceAsStream( > "methodCall.drl" ) ); > > PackageBuilder builder = new PackageBuilder(); > builder.addPackageFromDrl( source ); > > if ( builder.hasErrors() ) { > System.out.println( builder.getErrors().toString() ); > throw new RuntimeException( "Unable to compile \"methodCall.drl\"."); > } > > Package pkg = builder.getPackage(); > RuleBase ruleBase = RuleBaseFactory.newRuleBase(); > ruleBase.addPackage( pkg ); > > return ruleBase; > > } > > } > > > ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Some basic queries
Thanks for the information. I am trying to get the value in the when condition from a function(that returns a value). But facing some errors in doing that...May be I am doing some mistake in creating drl. Below is my drl and the Pojo that I am using, please guide me on this : Drl : #created on: Aug 5, 2011package com.sampleimport com.sample.Customerrule "Below 100"when$c:Customer()$c.getSi() < 100then $c.setVal("<100");endrule "Below 200"when$c:Customer()$c.getSi() < 200then $c.setVal("<200");endrule "Below 300"when$c:Customer()$c.getSi() < 300then $c.setVal("<300");endPojo : package com.sample;public class Customer {private double si;private String val;public double getSi() {return si;}public double setSi(double p,double r, double t) {si = (p*r*t)/100;return si;}public String getVal() {return val;}public void setVal(String val) {this.val = val;}} The error that I get while executing is : [9,13]: unknown:9:13 mismatched token: [@33,126:126='<',<79>,9:13]; expecting type THEN[20,13]: unknown:20:13 mismatched token: [@67,224:224='<',<79>,20:13]; expecting type THEN[32,13]: unknown:32:13 mismatched token: [@101,323:323='<',<79>,32:13]; expecting type THENjava.lang.RuntimeException: Unable to compile "methodCall.drl".at com.sample.Calling.createRuleBase(Calling.java:48)at com.sample.Calling.main(Calling.java:24) and my calling class is : package com.sample;import java.io.IOException;import java.io.InputStreamReader;import java.io.Reader;import org.drools.RuleBase;import org.drools.RuleBaseFactory;import org.drools.StatefulSession;import org.drools.compiler.PackageBuilder;import org.drools.rule.Package;public class Calling {public static void main(String[] args)throws IOException {Customer c1 = new Customer();c1.setSi(1000, 5, 2);try { RuleBase ruleBase = createRuleBase();StatefulSession session = ruleBase.newStatefulSession ();session.insert(c1);session.fireAllRules();session.dispose();System.out.println("Interest is : "+c1.getVal());}catch (Throwable t) {t.printStackTrace();}}private static RuleBase createRuleBase() throws Exception{Reader source = new InputStreamReader(Calling.class.getResourceAsStream( "methodCall.drl" ) );PackageBuilder builder = new PackageBuilder();builder.addPackageFromDrl( source );if ( builder.hasErrors() ) {System.out.println( builder.getErrors().toString() );throw new RuntimeException( "Unable to compile \"methodCall.drl\".");}Package pkg = builder.getPackage();RuleBase ruleBase = RuleBaseFactory.newRuleBase();ruleBase.addPackage( pkg );return ruleBase;}} Thanks & Regards,Gaurav SilakariMailto: gaurav.silak...@tcs.comFrom:Wolfgang Laun To:Rules Users List Date:08/04/2011 04:05 PMSubject:Re: [rules-users] Some basic queriesSent by:rules-users-boun...@lists.jboss.org2011/8/4 Gaurav SilakariHi, I have some queries on Drools. These might be very basic but I need to get them cleared. 1) Is it possible to bind the constructor name of java class(provided in the 'import' syntax) with a bind variable in LHS of the ruleWhatever would you need the binding for? MyClass.class.getName() is also the constructor's name. 2) Is it possible to call a parameterised (single parameter) method of a class (by giving class reference as bind variable and class being declared in 'import' syntax ) in LHS of the ruleIf the Class object is an attribute of some fact it can be bound and you can usereflection to call the method. This could be written as a DRL function. 3) Is it possible to call a parameterised method (with single parameter) in the RHS of the rule (The method would be pertaining to the class imported in the 'import' syntax and method name being invoked through the bind variable reference )Assuming the method name (or the Method object) comes from a field in some fact, it can be bound to a variable. On the RHS you proceed as in Java.-W___rules-users mailing listrules-users@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users=-=-=Notice: The information contained in this e-mailmessage and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] installing oryx designer with guvnor 5.2 (on win2003, tomcat6)
hello i am trying to use drools on a windows 2003 server... (not my choice, but hey :) on on tomcat 6 i deployed drools 5.2 and oryx designer. 1. the oryx designer does not work properly (i can put objects on the drawarea but i can not use any other functionality, see example) 2. and integration in guvnor does not work. (1.) When for example i try to do "show BPMN 2.0 DI XML" in designer it displays the error: Oryx: An error occurred while generating the BPMN 2.0 DI XML Serialization. ==> INFO 05-08 11:27:02,426 (NilAuthenticator.java:authenticate:35) All users are guests. javax.xml.bind.PropertyException: name: com.sun.xml.bind.namespacePrefixMapper value: de.hpi.bpmn2_0.transformation.BPMN PrefixMapper@11f5ff9 at javax.xml.bind.helpers.AbstractMarshallerImpl.setProperty(AbstractMarshallerImpl.java:338) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.setProperty(MarshallerImpl.java:532) at org.oryxeditor.server.Bpmn2_0Servlet.performTransformationToDi(Bpmn2_0Servlet.java:127) at org.oryxeditor.server.Bpmn2_0Servlet.doPost(Bpmn2_0Servlet.java:78) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665) at java.lang.Thread.run(Thread.java:662) (2.) Knowledge Bases -> Create New -> New BPMN2 Process --- HTTP Status 404 - /designer/editor/ type Status report message /designer/editor/ description The requested resource (/designer/editor/) is not available. Apache Tomcat/6.0.32 --- urls are: http://localhost:8080/drools/org.drools.guvnor.Guvnor/Guvnor.html http://localhost:8080/designer/editor any help would be appreciated. cheers. itchupe -- View this message in context: http://drools.46999.n3.nabble.com/installing-oryx-designer-with-guvnor-5-2-on-win2003-tomcat6-tp3228253p3228253.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] installing oryx designer with guvnor 5.2 (on win2003, as4.2.3)
hello unfortunately i have to use a windows 2003 server... (as on jboss as 6 i could not get drools 5.2 to work) i used drools-5.1-standalone and deployed drools 5.2 (of guvnor-5.2.0.Final-jboss-as-5.1.war) and oryx designer on jboss as 4.2.3 which both are working except the integration of oryx designer is incorrect. when i try to open a bpmn-file, on tab edit it displays the error: --- HTTP Status 404 - /designer/editor/ type Status report message /designer/editor/ description The requested resource (/designer/editor/) is not available. JBossWeb/2.0.1.GA --- where can i change the configuration? http://localhost:8080/guvnor-5.2.0.Final-jboss-as-5.1/org.drools.guvnor.Guvnor/Guvnor.html http://localhost:8080/designer/editor cheers. itchupe -- View this message in context: http://drools.46999.n3.nabble.com/installing-oryx-designer-with-guvnor-5-2-on-win2003-as4-2-3-tp3228131p3228131.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] how to install drools 5.2 with integrated oryx designer on jboss as 7?
hello there anyone has experience with that. I am not familiar with as 7 at all. how should i start? or does it not make sense yet to use as 7 with drools at all? (i am missing a 5.2 standalone download... will there be one for 5.3 with as 7 or tomcat?) cheers. -- View this message in context: http://drools.46999.n3.nabble.com/how-to-install-drools-5-2-with-integrated-oryx-designer-on-jboss-as-7-tp3228094p3228094.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users