[rules-users] Guvnor's data in Oracle 11g Database.
Hi, I have a problem with creating Guvnor repository using Oracle 11g database. When I try to run JBoss, drools-guvnor.war deployment process is failed. Info from server log and my config (repository.xml) are below: Oracle JDBC provider has been copied to JBOSS_HOME/server/default/lib/. I use the latest version of Drools Guvnor and JBoss 4.2.3. Any ideas? Many thanks, tom Log: - (...) 2010-08-17 11:40:55,932 DEBUG [javax.enterprise.resource.webcontainer.jsf.config] No FacesServlet found in deployment descriptor - bypassing configuration 2010-08-17 11:41:00,456 INFO [STDOUT] ERROR 17-08 11:41:00,440 (RepositoryImpl.java:initStartupWorkspaces:542) Failed to initialize workspace 'default' javax.jcr.RepositoryException: Cannot instantiate persistence manager org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager at org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1433) at org.apache.jackrabbit.core.RepositoryImpl.access$800(RepositoryImpl.java:125) at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doInitialize(RepositoryImpl.java:2014) at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:1997) at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:535) at org.apache.jackrabbit.core.RepositoryImpl.init(RepositoryImpl.java:366) at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:673) at org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:231) at org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:279) at org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:375) at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:123) at org.drools.guvnor.server.repository.RepositoryStartupService.newSession(RepositoryStartupService.java:151) at org.drools.guvnor.server.repository.RepositoryStartupService.create(RepositoryStartupService.java:72) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166) at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102) at org.drools.guvnor.server.repository.RepositoryStartupService_$$_javassist_1.create(RepositoryStartupService_$$_javassist_1.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138) at org.jboss.seam.Component.callComponentMethod(Component.java:2171) at org.jboss.seam.Component.callCreateMethod(Component.java:2094) at org.jboss.seam.Component.newInstance(Component.java:2054) at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:112) at org.jboss.seam.init.Initialization.init(Initialization.java:727) at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
Re: [rules-users] rules un end looping when update
You are calling update(m), which means that you are telling drools that m has changed, which means that any rule that has a condition based upon that rule gets re-evaluated, which causes Your First Rule to be fired again, which will then update m again... Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of sony john Sent: 17 August 2010 11:28 To: rules-users@lists.jboss.org Subject: [rules-users] rules un end looping when update Hi all, Iam using rules 5.1 iam getting un endded printout in my console. What could be the issue. Thanks in advance. #created on: Aug 16, 2010 package com.test.supplier #list any import classes here. #declare any global variables here import com.test.supplier.dao.Workflow; rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); update(m); end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rules un end looping when update
hi thomas, Thanks for reply , I want to set values in workflow Object. How i can do it. I try without update(m) but pojo is not updated. How i can accomplish the below after calling rules i need to get workflowid that has been updated in rules. { ksession.insert(workflow); ksession.fireAllRules(); System.out.println( workflow.getWorkflowId()); } rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); m.setWorkflowId(0); update(m); end On Tue, Aug 17, 2010 at 6:30 PM, Swindells, Thomas tswinde...@nds.com wrote: You are calling update(m), which means that you are telling drools that m has changed, which means that any rule that has a condition based upon that rule gets re-evaluated, which causes Your First Rule to be fired again, which will then update m again... Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of sony john Sent: 17 August 2010 11:28 To: rules-users@lists.jboss.org Subject: [rules-users] rules un end looping when update Hi all, Iam using rules 5.1 iam getting un endded printout in my console. What could be the issue. Thanks in advance. #created on: Aug 16, 2010 package com.test.supplier #list any import classes here. #declare any global variables here import com.test.supplier.dao.Workflow; rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); update(m); end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ 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] Embedded Drools into clustered application
You get the idea! Now you are available to run on Local and Remote (using mina, I hope in less than a month we support hornetQ as well) and also DIstributed nodes (Rio). Allowing you to start using Local for your testing and initial development (following some of my rules about remote/distributed environments, I will post some about this today or tomorrow on my blog) and then move the Remote or Distributed. Greetings! :) On Mon, Aug 16, 2010 at 11:36 PM, Tan Hui Onn hui...@gmail.com wrote: Thanks for your reply. It clears my doubt : ) I checked your Drools Grid (Part 3) and found that it actually supports Local Execution Node. I like its 'transparency' so I can choose to use it later on with minimal change in codes. Thanks. 2010/8/16 Mauricio Salatino sala...@gmail.com: If you don't want session fail over it will work out of the box. If you want to start a flow inside one node and then continue the process from another node it will work. Of course both nodes need to have a connection to the same database. The idea with Drools Grid is to simplify the deployment and distribution of your knowledge session across the grid and also do that transparently for your application :) Greetings. On Mon, Aug 16, 2010 at 2:20 AM, Tan Hui Onn hui...@gmail.com wrote: Some additional note to my question. The intended clustering need not to support session failover. In other words, the session states will not be replicated from one server to another. On Fri, Aug 13, 2010 at 8:36 PM, cafebabe hui...@gmail.com wrote: Hi, Based on my understanding from reading some drools posts and blogs, stateful knowledge session will not work correctly if drools is embedded into an application deployed in clustered application servers. Am I right? What if I want to use embedded drools purely for its BPM (drools flow) in clustered application? Any gotchas to take note or it will simply not working? anybody has related experience? (i found there is work-in-progress alternative - drools grid. but i prefer to start with embedded drools flow bcoz it is simpler to code and offers more control.) -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Embedded-Drools-into-clustered-application-tp1131520p1131520.html Sent from the Drools - User 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 -- - CTO @ http://www.plugtree.com - MyJourney @ http://salaboy.wordpress.com - Co-Founder @ http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ 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 -- - CTO @ http://www.plugtree.com - MyJourney @ http://salaboy.wordpress.com - Co-Founder @ http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rules un end looping when update
Hi Thomas, thanks Its my mistake i am able to solve it . rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); m.setWorkflowActorId(0); update(m); end On Tue, Aug 17, 2010 at 6:47 PM, sony john sonyt...@gmail.com wrote: hi thomas, Thanks for reply , I want to set values in workflow Object. How i can do it. I try without update(m) but pojo is not updated. How i can accomplish the below after calling rules i need to get workflowid that has been updated in rules. { ksession.insert(workflow); ksession.fireAllRules(); System.out.println( workflow.getWorkflowId()); } rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); m.setWorkflowId(0); update(m); end On Tue, Aug 17, 2010 at 6:30 PM, Swindells, Thomas tswinde...@nds.com wrote: You are calling update(m), which means that you are telling drools that m has changed, which means that any rule that has a condition based upon that rule gets re-evaluated, which causes Your First Rule to be fired again, which will then update m again... Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of sony john Sent: 17 August 2010 11:28 To: rules-users@lists.jboss.org Subject: [rules-users] rules un end looping when update Hi all, Iam using rules 5.1 iam getting un endded printout in my console. What could be the issue. Thanks in advance. #created on: Aug 16, 2010 package com.test.supplier #list any import classes here. #declare any global variables here import com.test.supplier.dao.Workflow; rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); update(m); end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ 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] rules un end looping when update
I prefer using modify rather than update but that is a minor issue. Your key problem is that your rule fires regardless whether it needs to or not, you need to write your rule so it only fires when it is valid for the action to be performed. In your current rule you seem to be doing a null check against workflowActorId and then setting workflowId; you probably want to make these consistent so you do a null check and then set that same property to an appropriate value. Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of sony john Sent: 17 August 2010 11:47 To: Rules Users List Subject: Re: [rules-users] rules un end looping when update hi thomas, Thanks for reply , I want to set values in workflow Object. How i can do it. I try without update(m) but pojo is not updated. How i can accomplish the below after calling rules i need to get workflowid that has been updated in rules. { ksession.insert(workflow); ksession.fireAllRules(); System.out.println( workflow.getWorkflowId()); } rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); m.setWorkflowId(0); update(m); end On Tue, Aug 17, 2010 at 6:30 PM, Swindells, Thomas tswinde...@nds.com wrote: You are calling update(m), which means that you are telling drools that m has changed, which means that any rule that has a condition based upon that rule gets re-evaluated, which causes Your First Rule to be fired again, which will then update m again... Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of sony john Sent: 17 August 2010 11:28 To: rules-users@lists.jboss.org Subject: [rules-users] rules un end looping when update Hi all, Iam using rules 5.1 iam getting un endded printout in my console. What could be the issue. Thanks in advance. #created on: Aug 16, 2010 package com.test.supplier #list any import classes here. #declare any global variables here import com.test.supplier.dao.Workflow; rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); update(m); end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ 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 ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Firing Mulitple packages
Hi, Using a single kbuilder should also work. Beyond that, I don't see anything wrong in your code. You can check for errors in your kbuilder after the packages were added: if (kbuilder.hasErrors()){ IteratorKnowledgeBuilderError errors = kbuilder.getErrors().iterator(); while (errors.hasNext()){ System.out.println(Error: +errors.next().getMessage()); } throw new IllegalStateException(Errors during resource compilation); } Could you be more specific about your expectations? i.e: How do you know processes are not being added? Regarding to DSL assets, you are not going to see them in the PKG. DSL and DSLR are used during package compilation, and only the generated rules are added to the resulting package. Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Sat, Aug 14, 2010 at 8:11 AM, Vignesh viki@gmail.com wrote: Hi Esteban, I have added the complete package into the kbuilder using the package url, Below is the way Im using to add the package, KnowledgeBuilder kbuilder1 = KnowledgeBuilderFactory.newKnowledgeBuilder(); KnowledgeBuilder kbuilder2 = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder1.add(ResourceFactory.newUrlResource( http://localhost:8983/drools-guvnor/org.drools.guvnor.Guvnor/package/test1/LATEST ),ResourceType.PKG); kbuilder2.add(ResourceFactory.newUrlResource( http://localhost:8983/drools-guvnor/org.drools.guvnor.Guvnor/package/test2/LATEST ),ResourceType.PKG); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder1.getKnowledgePackages()); kbase.addKnowledgePackages(kbuilder2.getKnowledgePackages()); StatefulKnowledgeSession wrkMemory = kbase.newStatefulKnowledgeSession(); int i=wrkMemory.fireAllRules(); Let me know whether this approach is fine or if Im missing something here, provide your comments on the same. Thanks, Vignesh -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Firing-Mulitple-packages-tp1127290p1145342.html Sent from the Drools - User 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] Question on excel decision table with $variable : Type ( ) from collection
I want to build a excel decision table to implement the logic described as the following drl script: == global pricebook.PricingResult result; rule pricing when $so : SalesOrder( customer.name==customer1, from == location1, to ==location2) *$sol : SalesOrderLine($sol.count = 0, $sol.count 100) from $so.lines * then result.setPricingMode(A); result.setUnitPrice(300.0f); end == The java model for the script above is something like this: == class SalesOrder{ ... ListSalesOrderLine lines; ... } == In the excel decision table, I defined variables with the following text in excel cells: == $so : SalesOrder *$sol : SalesOrderLine ( ) from so.lines* ... == The CONDITION column is defined as :* $sol.count = $1, $sol.count $2* The decision table is translated into the following drl script: global pricebook.PricingResult result; rule pricing when $so : SalesOrder( customer.name==customer1, from == location1, to ==location2) * $sol : SalesOrderLine from $so.lines($sol.count = 0, $sol.count 100) * then result.setPricingMode(A); result.setUnitPrice(300.0f); end We can see that* $soi : SalesOrderLine ( ) from so.lines* in the excel decision table is translated into* $sol : SalesOrderLine from $so.lines($sol.count = 0, $sol.count 100) * instead of *$sol : SalesOrderLine($sol.count = 0, $sol.count 100) from $so.lines*, which causes an error. My question is, how to write the variable definition of SalesOrderLine in excel so that drools can translate it into something like $sol : SalesOrderLine($sol.count = 0, $sol.count 100) from $so.lines ? Any ideas? Thanks in advance... ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rules un end looping when update
Thanks Thomas, I am able to update now. One more question i would like to ask you. I i need to insert one more object called WorkflowMail and call WorkflowMail when the above rule condition is True how i can do it. I can insert the object but how i can call that object in rules. REgards Sony John On Tue, Aug 17, 2010 at 7:05 PM, Swindells, Thomas tswinde...@nds.com wrote: I prefer using modify rather than update but that is a minor issue. Your key problem is that your rule fires regardless whether it needs to or not, you need to write your rule so it only fires when it is valid for the action to be performed. In your current rule you seem to be doing a null check against workflowActorId and then setting workflowId; you probably want to make these consistent so you do a null check and then set that same property to an appropriate value. Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of sony john Sent: 17 August 2010 11:47 To: Rules Users List Subject: Re: [rules-users] rules un end looping when update hi thomas, Thanks for reply , I want to set values in workflow Object. How i can do it. I try without update(m) but pojo is not updated. How i can accomplish the below after calling rules i need to get workflowid that has been updated in rules. { ksession.insert(workflow); ksession.fireAllRules(); System.out.println( workflow.getWorkflowId()); } rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); m.setWorkflowId(0); update(m); end On Tue, Aug 17, 2010 at 6:30 PM, Swindells, Thomas tswinde...@nds.com wrote: You are calling update(m), which means that you are telling drools that m has changed, which means that any rule that has a condition based upon that rule gets re-evaluated, which causes Your First Rule to be fired again, which will then update m again... Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of sony john Sent: 17 August 2010 11:28 To: rules-users@lists.jboss.org Subject: [rules-users] rules un end looping when update Hi all, Iam using rules 5.1 iam getting un endded printout in my console. What could be the issue. Thanks in advance. #created on: Aug 16, 2010 package com.test.supplier #list any import classes here. #declare any global variables here import com.test.supplier.dao.Workflow; rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); update(m); end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ 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 ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ rules-users mailing list
Re: [rules-users] Insert fact to a stream in rule consequence
Or: entryPoints[XYZ].insert( fact ); Edson 2010/8/17 Tihomir Surdilovic tsurd...@redhat.com drools.getEntryPoint(XYZ).insert(fact); On 8/16/10 11:14 PM, Mike Love wrote: Hi, How does one insert a new fact in the RHS of a rule to a specific stream so that this fact is available to other rules that get facts from that stream? Thanks, Mike ___ rules-users mailing list rules-us...@lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rules un end looping when update
If you already have it in your working memory then just add an additional condition in your rule with no constraints: rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) email : WorkflowMail() then System.out.println(myid + its null values); m.setWorkflowId(0); email.doSomething(); update(m); update(email); // if you have conditions on email and want rule re-evaluation to happen end Alternatively you could have WorkflowMail as a global if you only have one instance of it, or add appropriate constraints if there are multiple instances - otherwise your rule will fire multiple times, once for each one of them. -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of sony john Sent: 17 August 2010 14:13 To: Rules Users List Subject: Re: [rules-users] rules un end looping when update Thanks Thomas, I am able to update now. One more question i would like to ask you. I i need to insert one more object called WorkflowMail and call WorkflowMail when the above rule condition is True how i can do it. I can insert the object but how i can call that object in rules. REgards Sony John On Tue, Aug 17, 2010 at 7:05 PM, Swindells, Thomas tswinde...@nds.com wrote: I prefer using modify rather than update but that is a minor issue. Your key problem is that your rule fires regardless whether it needs to or not, you need to write your rule so it only fires when it is valid for the action to be performed. In your current rule you seem to be doing a null check against workflowActorId and then setting workflowId; you probably want to make these consistent so you do a null check and then set that same property to an appropriate value. Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of sony john Sent: 17 August 2010 11:47 To: Rules Users List Subject: Re: [rules-users] rules un end looping when update hi thomas, Thanks for reply , I want to set values in workflow Object. How i can do it. I try without update(m) but pojo is not updated. How i can accomplish the below after calling rules i need to get workflowid that has been updated in rules. { ksession.insert(workflow); ksession.fireAllRules(); System.out.println( workflow.getWorkflowId()); } rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); m.setWorkflowId(0); update(m); end On Tue, Aug 17, 2010 at 6:30 PM, Swindells, Thomas tswinde...@nds.com wrote: You are calling update(m), which means that you are telling drools that m has changed, which means that any rule that has a condition based upon that rule gets re-evaluated, which causes Your First Rule to be fired again, which will then update m again... Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of sony john Sent: 17 August 2010 11:28 To: rules-users@lists.jboss.org Subject: [rules-users] rules un end looping when update Hi all, Iam using rules 5.1 iam getting un endded printout in my console. What could be the issue. Thanks in advance. #created on: Aug 16, 2010 package com.test.supplier #list any import classes here. #declare any global variables here import com.test.supplier.dao.Workflow; rule Your First Rule when m: Workflow(workflowActorId==null,myid:workflowActorId) then System.out.println(myid + its null values); update(m); end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ rules-users mailing list rules-users@lists.jboss.org
[rules-users] [rules-user] Setting Configuration Option in KnowledgeBase
Hi, I am a Newbie with Drools5.1.0 and I was trying to set a KnowledgeBaseConfiguration Option using Drools Fusion. I tried the code that was in the Documentation part of Drools Fusion: KnowledgeBaseConfiguration config = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); config.setOption(EventProcessingMode.STREAM); And the next Error appears, and I don`t understand why: Bound mismatch: The generic method setOption(T) of type KnowledgeBaseOptionsConfiguration is not applicable for the arguments (RuleBaseConfiguration.EventProcessingMode). The inferred type RuleBaseConfiguration.EventProcessingMode is not a valid substitute for the bounded parameter T extends KnowledgeBaseOption Regards, Nicolas ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] [rules-user] Setting Configuration Option in KnowledgeBase
Correct is EventProcessingOption.STREAM, not EventProcessingMode.STREAM. Where did you saw this in the docs (link)? Edson 2010/8/17 Nicolás Sanchez sancheznicola...@gmail.com Hi, I am a Newbie with Drools5.1.0 and I was trying to set a KnowledgeBaseConfiguration Option using Drools Fusion. I tried the code that was in the Documentation part of Drools Fusion: KnowledgeBaseConfiguration config = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); config.setOption(EventProcessingMode.STREAM); And the next Error appears, and I don`t understand why: Bound mismatch: The generic method setOption(T) of type KnowledgeBaseOptionsConfiguration is not applicable for the arguments (RuleBaseConfiguration.EventProcessingMode). The inferred type RuleBaseConfiguration.EventProcessingMode is not a valid substitute for the bounded parameter T extends KnowledgeBaseOption Regards, Nicolas ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Drools Fusion Performance and RETE algorithm
Hi all Looking at Drools JBoss Rules 5 0 Developer's guide it addresses the Fusion component at page 134, stating: This problem cannot be solved by the standard Drools rule engine. The volume of events is huge and it happens asynchronously. If we simply inserted them into the knowledge session, we would soon run out of memory. While the Rete algorithm behind Drools doesn't have any theoretical limitation on number of objects in the session, we could use the processing power more wisely. Drools Fusion is the right candidate for this kind of task. Ok, but my question is if this is enough, because I would guess that Fusion could be used to derived a more complex/rich event from the stream of events, and afterwards that complex event would be inserted in Working Memory (but not the flow of events that have generated the more complex event), thus reducing RETE algorithm processing. But since in our case every event will most certainly fire a rule, I am not sure about Fusion's usage. This is because our project is more a kind of Event-Trigger-Rule/Action system, meaning we have a high volume of incoming events (say more than 5000/minute), but each of the events will have to trigger a rule (and usually a rule is more or less a complex action, invoking DB operations and data structures manipulation). So, by using Fusion entry-points, would that be different than just sending the events as normal facts to Working Memory, or by dividing this in entry-points( or so called streams) we would have benefits in the RETE processing (I am assuming Fusion also uses RETE someway)? Best regards Orlando. PS-Does anyone know where can I find more info on the coupling of Drools Expert and Fusion? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Adding Map/List to a Guvnor package
Hi, Is it possible to add/use the List/Map as parameter to a Guvnor rule, if it can be done, how can we add the java.util.list or java.util.map class into Guvnor package, do we need to upload the util jar? Please clarify in this regard. Thanks, Vignesh -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Adding-Map-List-to-a-Guvnor-package-tp1191748p1191748.html Sent from the Drools - User 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] Adding Map/List to a Guvnor package
There is no need to upload any jar, because those classes are already present. You need to add them in the package configuration section (either as Import or Global) Best, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Tue, Aug 17, 2010 at 2:16 PM, Vignesh viki@gmail.com wrote: Hi, Is it possible to add/use the List/Map as parameter to a Guvnor rule, if it can be done, how can we add the java.util.list or java.util.map class into Guvnor package, do we need to upload the util jar? Please clarify in this regard. Thanks, Vignesh -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Adding-Map-List-to-a-Guvnor-package-tp1191748p1191748.html Sent from the Drools - User 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] Drools Fusion Performance and RETE algorithm
Thanks Mauricio, but since in general RETE algorithm does not get along well with high volumes of information, I was wondering if I could get more details on: 1. the implementation architecture 2. about Drools Fusion performance, does anyone has already some experience or links to share? Br Orlando. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Fusion-Performance-and-RETE-algorithm-tp1190098p1192480.html Sent from the Drools - User 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] Drools Fusion Performance and RETE algorithm
Google for a presentation that shows how fedex monitor a lot of trucks in near real time with fusion. I can't find the link, but probably Edson have it. On Tue, Aug 17, 2010 at 3:00 PM, Orlando Costa orlandorica...@gmail.comwrote: Thanks Mauricio, but since in general RETE algorithm does not get along well with high volumes of information, I was wondering if I could get more details on: 1. the implementation architecture 2. about Drools Fusion performance, does anyone has already some experience or links to share? Br Orlando. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Fusion-Performance-and-RETE-algorithm-tp1190098p1192480.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- - CTO @ http://www.plugtree.com - MyJourney @ http://salaboy.wordpress.com - Co-Founder @ http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Fusion Performance and RETE algorithm
Thanks, I already have seen this some days ago: http://www.redhat.com/f/pdf/jbw/amollenkopf_430_applying_drools.pdf but it does not say the amount of events coming, and the internals are more about the whole solution itself than about the internal Drools Expert/Fusion architecture (though is shows good rules examples with Fusion use of course). Br Orlando. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Fusion-Performance-and-RETE-algorithm-tp1190098p1193090.html Sent from the Drools - User 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] Drools Scalability
Hi all I have been looking at Drools (Expert, Fusion and Flow) to see how feasible it is to use it in our project. We have requirements for scalability: 1) system must be vertically scalable 2) system must be horizontally scalable I guess for 1), we could use KnowledgeBase partitioning, but for 2) I have no idea...has someone been looking at this, does it make sense to have a rule engine horizontally scalable at all? Br Orlando. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Scalability-tp1194022p1194022.html Sent from the Drools - User 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] Drools Scalability
Depending on the nature of your problem you can make it grow having multiple sessions with different knowledge. I'm working on Drools Grid with exactly that goal. I'm trying to create a simple way to distribute and manage knowledge sessions across different machines to be able to grow when your requirements are high. Cheers. 2010/8/17 Orlando Costa orlandorica...@gmail.com Hi all I have been looking at Drools (Expert, Fusion and Flow) to see how feasible it is to use it in our project. We have requirements for scalability: 1) system must be vertically scalable 2) system must be horizontally scalable I guess for 1), we could use KnowledgeBase partitioning, but for 2) I have no idea...has someone been looking at this, does it make sense to have a rule engine horizontally scalable at all? Br Orlando. -- View this message in context: Drools Scalabilityhttp://drools-java-rules-engine.46999.n3.nabble.com/Drools-Scalability-tp1194022p1194022.html Sent from the Drools - User mailing list archivehttp://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.htmlat Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- - CTO @ http://www.plugtree.com - MyJourney @ http://salaboy.wordpress.com - Co-Founder @ http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Fusion Performance and RETE algorithm
Hi Orlando, Mauricio, While the goal of the whole Drools platform is to provide a seamless environment for users to model business behavior using rules, processes and events, it is a misconception to say that it is all executed on RETE. Besides implementing several optimizations on top of the classic RETE algorithm (as designed by Dr. Forgy back in the 70's), Drools has specific algorithms to which it delegates processing of specific use cases/features (read some fusion and flow features). Regarding your question, entry-points are partitions on the RETE network that allow for parts of it to be evaluated concurrently, besides creating separate name spaces for facts (scopes if you will). So it does help on reducing the overall load of the matching algorithm. Although, rules are still fired sequentially as to ensure consistency of the working memory. Regarding use cases, we have customers that use 24x7 stateful sessions, keeping over 1M facts in memory constantly, with new facts coming into the session and facts expiring from the session all the time. The throughput of such use cases is obviously dependent on the percentage of facts/rules matchings, so it is hard to foresee what you will achieve on your use case without knowing in detail your rules. Although, the chosen architecture for your kbase and sessions will obviously have a high impact on the performance metrics you will achieve. Since you mentioned that in your use case every single fact will match and cause rules to fire, and the actions involve heavy operations like database access, I would recommend looking into an agent architecture, where you partition your knowledge base into several kbases with related rules. The kbases will operate on the atomic (or raw) events and create the composite events that you can feed into entry points of sessions of subsequent kbases, effectively increasing the overall system throughput and simplifying the maintenance of each agent's kbase in particular. If you are used to CEP nomenclature, you know that the above is a simplified description of an EPN. Finally, you asked about the difference between regular facts and events, and basically all events are facts with special properties. These properties allow the engine to do some fancy stuff with them, like the use of sliding windows or event lifecycle management (i.e., automatically expiring events). Although, there is nothing wrong in modeling events like regular facts if that best fits your design. Hope the above helps, Edson 2010/8/17 Orlando Costa orlandorica...@gmail.com Thanks, I already have seen this some days ago: http://www.redhat.com/f/pdf/jbw/amollenkopf_430_applying_drools.pdf but it does not say the amount of events coming, and the internals are more about the whole solution itself than about the internal Drools Expert/Fusion architecture (though is shows good rules examples with Fusion use of course). Br Orlando. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Fusion-Performance-and-RETE-algorithm-tp1190098p1193090.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] [rules-user] Setting Configuration Option in KnowledgeBase
Thanks Edson for the answer. Now I realised that there is no mistake in the Jboss documentation, the example is exactly as you wrote it. The problem is that I can`t select EventProcessingOption.STREAM, and when I was typing the only suggestion I had was EventProcessingMode.STREAM. Am I missing any Dependency? or Package? Nicolas ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] PLEASE HELP: Possible concurrency issue in Drools
On 18/08/2010 00:49, Norman C wrote: Hi All, I've posted on this topic twice and logged a JIRA ticket (https://jira.jboss.org/browse/JBRULES-2651) as well. I've received no responses and the bug hasn't been updated since I logged it. I just replied to the jira. I'm committing the fix now. Mark This is a serious issue as it causes my production system to freeze up and it has to be restarted. It's consistently reproducible (usually takes a few days). Can someone please take a quick look at the code? Does the call to SingleThreadedObjectStore.addHandle in NamedEntryPoint.insert need to be preceded by acquiring the lock? Thanks again for your help. Norman *From:* Norman C rent_my_t...@yahoo.com *To:* rules-users@lists.jboss.org *Sent:* Wed, August 4, 2010 11:23:55 PM *Subject:* Re: Possible concurrency issue in Drools I've run into this issue a few more times. Should I log a JIRA ticket for this? Any advice would be appreciated. Thanks, Norman *From:* Norman C rent_my_t...@yahoo.com *To:* rules-users@lists.jboss.org *Sent:* Sat, July 31, 2010 9:56:26 PM *Subject:* Re: Possible concurrency issue in Drools All, Just wanted to mention, I'm using version 5.0.1 of Drools. Thanks, Norman *From:* Norman C rent_my_t...@yahoo.com *To:* rules-users@lists.jboss.org *Sent:* Sat, July 31, 2010 9:50:19 PM *Subject:* Possible concurrency issue in Drools Hi All, I recently ran into an issue which I believe might point to a concurrency issue. My server stopped processing new requests, so I did a thread dump. In examining the dump, I found that all of the processing threads, save two, were blocking while trying to acquire the lock in NamedEntryPoint.insert. Both of the other two threads appeared to be infinitely looping in the NamedEntryPoint.insert method. Here are snippets of the stack traces: ActiveMQ Session Task prio=10 tid=0x2aab0003b000 nid=0x7b98 runnable [0x4c086000..0x4c087c90] java.lang.Thread.State: RUNNABLEat org.drools.util.ObjectHashMap.remove(ObjectHashMap.java:121)at org.drools.common.SingleThreadedObjectStore.removeHandle(SingleThreadedObjectStore.java:150) at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:296) at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:245) at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(ReteooWorkingMemory.java:350) at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1488) at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158) at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122) at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)at ActiveMQ Session Task prio=10 tid=0x5a35cc00 nid=0xdf6 runnable [0x4a268000..0x4a269a90] java.lang.Thread.State: RUNNABLEat org.drools.util.AbstractHashTable.resize(AbstractHashTable.java:115) at org.drools.util.ObjectHashMap.put(ObjectHashMap.java:78) at org.drools.common.SingleThreadedObjectStore.addHandle(SingleThreadedObjectStore.java:136) at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:113) at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at So it seems like one while the first thread is holding the lock and is attempting to remove an object handle from the object store in NamedEntryPoint, the other thread is trying to resize that same object store in response to an addHandle call that puts it over the threshold. I haven't worked out exactly how these concurrent accesses to the same object store by two different threads causes an infinite loop in both threads, but it seems like the call to SingleThreadedObjectStore.addHandle should be preceded by acquiring the lock. Is this correct? I can imagine that resizing a large hash map could potentially take a long time and thus synchronizing this call could impact performance, but somehow, the action of resizing the table must be protected in some way from adversely impacting other operations on the table. Any help would be appreciated. thanks, Norman ___ 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] Accumulate in Drools
Here's the modified rule : rule Test Accumulate Function when $p : ProductType ($name : name) $min_score : Number () from accumulate (Client (productTypeExperience.keySet contains $name, $score : productTypeExperience[$name]), min (((ExperienceLevel)$score).value())) then System.out.println ($min_score + $min_score); end and the runtime exception that i am getting is Caused by: org.drools.RuntimeDroolsException: [Error: unable to resolve method: java.util.HashMap.$name() [arglength=0]] [Near : {... Unknown }] Regards, Manav From: Edson Tirelli tire...@post.com To: Manav manav7...@yahoo.com; Rules Users List rules-users@lists.jboss.org Sent: Mon, August 16, 2010 7:46:54 PM Subject: Re: [rules-users] Accumulate in Drools You can't use the cast and the method call in a regular constraint. You can use it as part of an expression. So: $min_score : Number () from accumulate (Client (productTypeExperience.keySet contains $name, $score : productTypeExperience[$name], min ( ((ExperienceLevel)$score).value() ) ) We are working on the support of free form expressions on constraints for Drools 6 (not sure we can make it for 5.2). Edson 2010/8/15 Manav manav7...@yahoo.com Hi, I am trying my hand at the accumulate function in Drools 5.x but the drl fails to compile. Not sure what's wrong with it. Please help. This is the sample that i am working with rule Test Accumulate Function when $p : ProductType ($name : name) $min_score : Number () from accumulate (Client (productTypeExperience.keySet contains $name, $score : ((ExperienceLevel)productTypeExperience[$name]).value()), min ($score)) then System.out.println ($min_score + $min_score); end Regards, Manav ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Accumulate in Drools
Which version of MVEL are you using? Edson 2010/8/17 Manav manav7...@yahoo.com Here's the modified rule : rule Test Accumulate Function when $p : ProductType ($name : name) $min_score : Number () from accumulate (Client (productTypeExperience.keySet contains $name, $score : productTypeExperience[$name]), min (((ExperienceLevel)$score).value())) then System.out.println ($min_score + $min_score); end and the runtime exception that i am getting is Caused by: org.drools.RuntimeDroolsException: [Error: unable to resolve method: java.util.HashMap.$name() [arglength=0]] [Near : {... Unknown }] Regards, Manav -- *From:* Edson Tirelli tire...@post.com *To:* Manav manav7...@yahoo.com; Rules Users List rules-users@lists.jboss.org *Sent:* Mon, August 16, 2010 7:46:54 PM *Subject:* Re: [rules-users] Accumulate in Drools You can't use the cast and the method call in a regular constraint. You can use it as part of an expression. So: $min_score : Number () from accumulate (Client (productTypeExperience.keySet contains $name, $score : productTypeExperience[$name], min ( ((ExperienceLevel)$score).value() ) ) We are working on the support of free form expressions on constraints for Drools 6 (not sure we can make it for 5.2). Edson 2010/8/15 Manav manav7...@yahoo.com Hi, I am trying my hand at the accumulate function in Drools 5.x but the drl fails to compile. Not sure what's wrong with it. Please help. This is the sample that i am working with rule Test Accumulate Function when $p : ProductType ($name : name) $min_score : Number () from accumulate (Client (productTypeExperience.keySet contains $name, $score : ((ExperienceLevel)productTypeExperience[$name]).value()), min ($score)) then System.out.println ($min_score + $min_score); end Regards, Manav ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.com -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users