[rules-users] org.hibernate.StaleObjectStateException on aborting process
Running JBoss 6.0. Somewhere inside running JTA transaction: @Override public void stopProcess(PropertyObject object) { StatefulKnowledgeSession ksession = ProcessHelper.loadSession(Registry.get().getMainProcessName(), object.getKnowledgeSessionId()); ksession.abortProcessInstance(object.getProcessInstanceId()); } aborting process leads to org.hibernate.StaleObjectStateException: WARN [com.arjuna.ats.arjuna] ARJUNA-12125 TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple 0:c0a801e8:126a:4d3fd283:3d, org.hibernate.transaction.synchronization.HibernateSynchronizationImpl@1fa8761 : javax.persistence.OptimisticLockException: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.drools.persistence.session.SessionInfo#13] at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:1243) [:3.6.0.Final] at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1166) [:3.6.0.Final] at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1147) [:3.6.0.Final] at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1153) [:3.6.0.Final] at org.hibernate.ejb.AbstractEntityManagerImpl$3.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1067) [:3.6.0.Final] at org.hibernate.transaction.synchronization.CallbackCoordinator.beforeCompletion(CallbackCoordinator.java:122) [:3.6.0.Final] at org.hibernate.transaction.synchronization.HibernateSynchronizationImpl.beforeCompletion(HibernateSynchronizationImpl.java:51) [:3.6.0.Final] at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:97) [:6.0.0.20101110-CR1] at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:274) [:6.0.0.20101110-CR1] at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:94) [:6.0.0.20101110-CR1] at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:159) [:6.0.0.20101110-CR1] at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1156) [:6.0.0.20101110-CR1] at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:119) [:6.0.0.20101110-CR1] at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75) [:6.0.0.20101110-CR1] at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:162) [:6.0.0.20101110-CR1] at com.infotech.web.util.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:53) [:] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.20101110-CR1] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20101110-CR1] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.20101110-CR1] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.20101110-CR1] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.20101110-CR1] at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final] at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.20101110-CR1] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.20101110-CR1] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.20101110-CR1] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.20101110-CR1] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.20101110-CR1] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.20101110-CR1] at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.20101110-CR1] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.20101110-CR1] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.20101110-CR1] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
[rules-users] Large amount of rules deployment
Hi, I have 9000 rules in a DRL file and would like to import to BRMS. Please suggest a way to import it efficiently. Thanks Benson ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] looping over list
Hi, Maybe can you try the collect keyword? According to what I see in the documentation (4.8.3.9. Conditional Element collect) it seems to fit your needs. I'll probably give this a try: rule Select Officer ruleflow-group select_officer no-loop true salience 20 when $processInstance: WorkflowProcessInstance() $requestData: RequestData($genre : genre, $cost : cost) $sublist : ArrayList() from collect( Officer( minimumCost = $cost, $cost = maximumCost ) from $genre) then System.out.println(Hey!); List shrunkOfficersWithGenre = $sublist; end Best regards, Bruno (newbie). odelyaholiday a écrit : I have a list of officers: public static final MapString, ListOfficer officersPerGenre = new HashMapString, ListOfficer(); Where the Officer with: String name; Integer mininumCost; Integer maximumCost; in officersPerGenre I fill for each genre list of officers. In my drools: rule Select Officer ruleflow-group select_officer no-loop true salience 20 when $processInstance: WorkflowProcessInstance() $requestData: RequestData(); then System.out.println(Hey!); List officersWithGenre = (List)officers.get($requestData.getGenre()); end Now I need to shrink the officersWithGenre only to officers that $requestData.cost is between their mininumCost and maximum cost. How do I write it in drools? In java i will simply iterate over the collection. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Clearing an AgendaGroup
Hi I have a rule set with two agenda groups. I have a rule with autofocus on group1. If the rules in group1 are exhausted it activates group2 using setFocus(). rule Active second group agenda-group group1 auto-focus true salience -1 when eval(true) then drools.setFocus(group2) end Now I noticed that while executing rules from group2, rules from group1 were still being triggerd and executed. So I added this to the then clause. drools.getWorkingMemory().getAgenda().clearAndCancelAgendaGroup(group1) Alas, it made no difference. Some debugging made clear that after the then clause the stack contained only MAIN and group2. Am I missing some basic notion on agenda groups? Greetz Evert -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Clearing-an-AgendaGroup-tp2353014p2353014.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] Is Drools appropriate for this app scenario?
@plugtreelabs: First of all, thank you very much for your response and hints. @all: As I'm still not quire sure how to realize my scenario: Please, could someone provide me with some diagrams or architectural sketches of a typical rules-based e-commerce web application? -- Or at least point me to online resources on that topic, especially showing the integration of the RBMS in a web app? This would really help me out a lot at the moment. _Recap: The main goal is that endusers shall, on the one hand, define almost the whole set of entities and rules in an initial shop specification/configuration process, and on the other hand, this set shall be modifiable later on (primarily through enhancements, not restrictions). The entity set basically is: customer types, product categories, products, product packages, customer(type)-to-product(type) price assignments (i.e. pricing rules), and inter-product/package selection rules, ...all of these dynamically definable via a WebUI and in a manner appropriate for non-technical end-users (considering declarative programming a good approach for this(?)). The most dynamic parts will be the multi-dimensional pricing tables in terms of (a) their schema -- when new pricing parameters (=dimensions) like delivery distance are added -- and (b) their value contents -- when concrete prices change. Another quite dynamic part will be the inter-product selection rule specifications from which a smart e-catalog will be generated for the client-side. Such rules will state sth. like: Prod A must always be ordered with Prod B, Prod B can never be ordered when Package C is selected, and similar. -- Currently, some high-level architectural layouts of a simple, rules-based e-commerce web app (Which components are necessary in which place? And which components are already delivered by Drools?) would be very helpful for me. Thank you very much for your help in advance. Best regards Sebastien -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Is-Drools-appropriate-for-this-app-scenario-tp2303204p2353169.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] Is Drools appropriate for this app scenario?
It's pretty old, but you've got some architectural diagrams here: http://www.infoq.com/articles/Rule-Engines On Wed, Jan 26, 2011 at 12:27 PM, Sebastien Chevalier sebastien.cheval...@web.de wrote: @plugtreelabs: First of all, thank you very much for your response and hints. @all: As I'm still not quire sure how to realize my scenario: Please, could someone provide me with some diagrams or architectural sketches of a typical rules-based e-commerce web application? -- Or at least point me to online resources on that topic, especially showing the integration of the RBMS in a web app? This would really help me out a lot at the moment. _Recap: The main goal is that endusers shall, on the one hand, define almost the whole set of entities and rules in an initial shop specification/configuration process, and on the other hand, this set shall be modifiable later on (primarily through enhancements, not restrictions). The entity set basically is: customer types, product categories, products, product packages, customer(type)-to-product(type) price assignments (i.e. pricing rules), and inter-product/package selection rules, ...all of these dynamically definable via a WebUI and in a manner appropriate for non-technical end-users (considering declarative programming a good approach for this(?)). The most dynamic parts will be the multi-dimensional pricing tables in terms of (a) their schema -- when new pricing parameters (=dimensions) like delivery distance are added -- and (b) their value contents -- when concrete prices change. Another quite dynamic part will be the inter-product selection rule specifications from which a smart e-catalog will be generated for the client-side. Such rules will state sth. like: Prod A must always be ordered with Prod B, Prod B can never be ordered when Package C is selected, and similar. -- Currently, some high-level architectural layouts of a simple, rules-based e-commerce web app (Which components are necessary in which place? And which components are already delivered by Drools?) would be very helpful for me. Thank you very much for your help in advance. Best regards Sebastien -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Is-Drools-appropriate-for-this-app-scenario-tp2303204p2353169.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] Is Drools appropriate for this app scenario?
Sebastien, I have built an e-commerce site [www.stoneside.com] with some if not all of the things you are talking about. If you go there and design a product you can see the rules working. Drools is being used for: Pricing rules and discounts within a product. Rules regarding what components of a product can exist with other components. [the end-user is custom designing something to purchase] Rules determine how to display the product as the end-user designs their product. Rules generate the BOM once the user ultimately orders the product that they designed. All the rules are managed using excel spreadsheet templates. We [the developers] defined the templates and the business enters the rules into the spreadsheet. This has worked pretty well. The biggest hurdle being defining the templates correctly and populating the initial sets of rules. Some of the more complex products have at least 5K rules [across all 4 areas of rules] that needed to be defined. So, I think it is appropriate for your app scenario. You will need to think about what you need as rules and what those rule 'templates' need to look like. Jeff -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Sebastien Chevalier Sent: Wednesday, January 26, 2011 6:28 AM To: rules-users@lists.jboss.org Subject: Re: [rules-users] Is Drools appropriate for this app scenario? @plugtreelabs: First of all, thank you very much for your response and hints. @all: As I'm still not quire sure how to realize my scenario: Please, could someone provide me with some diagrams or architectural sketches of a typical rules-based e-commerce web application? -- Or at least point me to online resources on that topic, especially showing the integration of the RBMS in a web app? This would really help me out a lot at the moment. _Recap: The main goal is that endusers shall, on the one hand, define almost the whole set of entities and rules in an initial shop specification/configuration process, and on the other hand, this set shall be modifiable later on (primarily through enhancements, not restrictions). The entity set basically is: customer types, product categories, products, product packages, customer(type)-to-product(type) price assignments (i.e. pricing rules), and inter-product/package selection rules, ...all of these dynamically definable via a WebUI and in a manner appropriate for non-technical end-users (considering declarative programming a good approach for this(?)). The most dynamic parts will be the multi-dimensional pricing tables in terms of (a) their schema -- when new pricing parameters (=dimensions) like delivery distance are added -- and (b) their value contents -- when concrete prices change. Another quite dynamic part will be the inter-product selection rule specifications from which a smart e-catalog will be generated for the client-side. Such rules will state sth. like: Prod A must always be ordered with Prod B, Prod B can never be ordered when Package C is selected, and similar. -- Currently, some high-level architectural layouts of a simple, rules-based e-commerce web app (Which components are necessary in which place? And which components are already delivered by Drools?) would be very helpful for me. Thank you very much for your help in advance. Best regards Sebastien -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Is-Drools-appropriat e-for-this-app-scenario-tp2303204p2353169.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] Possible bug using from and or
Hi This little rule won't compile: rule Test from and or dialect mvel when $person : Person() Address( ) from $person.addresses (Address() or Address()) then # do stuff end BuildError: Unable to build expression for 'from' : [Error: Failed to compile: 1 compilation error(s): - (1,7) unqualified type in strict mode for: $person] [Near : {... Unknown }] ^ [Line: 1, Column: 0] '$person.addresses(Address() or Address())' BuildError: Unable to determine the used declarations. java.lang.Class cannot be cast to org.mvel2.util.MethodStub This does work rule Test from and or dialect mvel when $person : Person() Address( ) from $person.addresses Address() or Address() then # do stuff end And this also: rule Test from and or dialect mvel when $person : Person() Address( ) from $person.getAddresses() (Address() or Address()) then # do stuff end Can anybody confirm this as a bug? Tnx Evert -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Possible-bug-using-from-and-or-tp235p235.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] How to write a rule that fires when it matches against specific facts in working memory.
Thanks for outlining the approach, Edson. Unfortunately, I'm a newbie using drools, so I just need some clarification on what you mean by 'matchAll is your own accumulate function with the semantics you described.' ? Do you mean that I have to create a 'custom' accumulate function ? Edson, if that's the case, then I'll try to search for example of creating a custom function. When I last searched, I did find an example on the Internet, however, I don't think I found details of how to make the function available to the rules engine (is it as simple as including the jar in the classpath or do I need to take addtional steps to use Matchall in drl ?) Can you please elaborate for the benefit of a noobie ? Thanks Gurvinder -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.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] Possible bug using from and or
This is an ambiguity inherent to the DRL language. This happens because the parser has no way of knowing if the (...) following the expression belong to the expression (i.e., is a method call, where you forgot the , between parameters) or if it is not part of the expression. So, we arbitrarily decided that the parser will always consider the () in this case as part of the expression, and if it is not a valid syntax, it will raise an error. You found one way of breaking the ambiguity by adding () on getAddresses, but you could also do: ( Address( ) from $person.addresses ) or add a ; at the end of the expression: Address( ) from $person.addresses; It is not a bug, as it is an ambiguity inherent to the language, not the implementation, but I guess we could have better documentation on that. Just for the curious, it is the same kind of ambiguity present on java/c++ parsers when you have nested if/else without blocks {}. Ex: if (...) if( ... ) ...; else ...; Does the else above belong to the first or second if? The parser has no way to know that, so they arbitrarily decided that in java/c++ that says the else belongs to the closest if and my identation above is misleading... Edson 2011/1/26 Evert Penninckx evert.pennin...@gmail.com Hi This little rule won't compile: rule Test from and or dialect mvel when $person : Person() Address( ) from $person.addresses (Address() or Address()) then # do stuff end BuildError: Unable to build expression for 'from' : [Error: Failed to compile: 1 compilation error(s): - (1,7) unqualified type in strict mode for: $person] [Near : {... Unknown }] ^ [Line: 1, Column: 0] '$person.addresses(Address() or Address())' BuildError: Unable to determine the used declarations. java.lang.Class cannot be cast to org.mvel2.util.MethodStub This does work rule Test from and or dialect mvel when $person : Person() Address( ) from $person.addresses Address() or Address() then # do stuff end And this also: rule Test from and or dialect mvel when $person : Person() Address( ) from $person.getAddresses() (Address() or Address()) then # do stuff end Can anybody confirm this as a bug? Tnx Evert -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Possible-bug-using-from-and-or-tp235p235.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] Doubt in converting .brl to .drl format in java
Hi, Don't know if it may help but I've just had a similar error (java.lang.RuntimeException: com.thoughtworks.xstream.mapper.CannotResolveClassException: definitions : definitions) when adding a bpmn2 rule flow file (an XML file) as a BRL resource in a KnowledgeBuilder (no comment... :-)). My2cts, Bruno. Kamal Thiyagarajan a écrit : Hello, I had try to convert .brl file to .drl format using java code i got an error in conversion. my java code is String fileName = c:/Sampleguide.brl; File file = new File(fileName); //System.out.println(hello); String content = FileUtils.readFileToString(file); System.out.println(content); BRXMLPersistence read = (BRXMLPersistence) BRXMLPersistence.getInstance(); BRDRLPersistence write = (BRDRLPersistence) BRDRLPersistence.getInstance(); //BRDRLPersistence.getInstance(); String outputDRL = write.marshal(read.unmarshal(content)); System.out.println(outputDRL); I got error like this com.thoughtworks.xstream.converters.ConversionException: metadataList : metadataList : metadataList : metadataList Debugging information message : metadataList : metadataList cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message : metadataList : metadataList class : org.drools.brms.client.modeldriven.brl.RuleModel required-type : org.drools.brms.client.modeldriven.brl.RuleModel path: /rule/metadataList --- at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60) at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137) at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909) at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853) at com.thoughtworks.xstream.XStream.fromXML(XStream.java:845) at org.drools.brms.server.util.BRXMLPersistence.unmarshal(BRXMLPersistence.java:91) at com.sample.DroolsTest.main(DroolsTest.java:30) Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: metadataList : metadataList at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:68) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:71) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:86) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:96) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38) at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:52) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.determineType(AbstractReflectionConverter.java:347) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:208) at
[rules-users] Guvnor UI bugs?
I'm running Drools 5.1.1 on JDK 1.6, client is Chrome on XP. I've noticed quite a few UI bugs in Guvnor, most feel like browser caching issues, setter/getter issues etc. For example, when creating test scenarios, changing the values in the 'given' clause then running the scenario results in the 'old' values being sent. Anybody else notice this or have any workarounds? -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-UI-bugs-tp2356106p2356106.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] Clearing an AgendaGroup
Were the rules in Agenda Group group1 executed, or merely evaluated? Agenda Group controls which activations on the agenda are executed, rules in all Agenda Groups will continue to be evaluated. Thanks, Mike On 26 January 2011 10:52, Evert Penninckx evert.pennin...@gmail.com wrote: Hi I have a rule set with two agenda groups. I have a rule with autofocus on group1. If the rules in group1 are exhausted it activates group2 using setFocus(). rule Active second group agenda-group group1 auto-focus true salience -1 when eval(true) then drools.setFocus(group2) end Now I noticed that while executing rules from group2, rules from group1 were still being triggerd and executed. So I added this to the then clause. drools.getWorkingMemory().getAgenda().clearAndCancelAgendaGroup(group1) Alas, it made no difference. Some debugging made clear that after the then clause the stack contained only MAIN and group2. Am I missing some basic notion on agenda groups? Greetz Evert -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Clearing-an-AgendaGroup-tp2353014p2353014.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] How to write a rule that fires when it matches against specific facts in working memory.
Accumulate functions are very well documented in the Expert manual. Look for a section titled Accumulate Functions. You could also use accumulate with all the steps in inline code, which is documented in the preceding section. -W On 26 January 2011 16:50, groovenarula gnaru...@la-z-boy.com wrote: Thanks for outlining the approach, Edson. Unfortunately, I'm a newbie using drools, so I just need some clarification on what you mean by 'matchAll is your own accumulate function with the semantics you described.' ? Do you mean that I have to create a 'custom' accumulate function ? Edson, if that's the case, then I'll try to search for example of creating a custom function. When I last searched, I did find an example on the Internet, however, I don't think I found details of how to make the function available to the rules engine (is it as simple as including the jar in the classpath or do I need to take addtional steps to use Matchall in drl ?) Can you please elaborate for the benefit of a noobie ? Thanks Gurvinder -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.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] Clearing an AgendaGroup
manstis wrote: Were the rules in Agenda Group group1 executed, or merely evaluated? Agenda Group controls which activations on the agenda are executed, rules in all Agenda Groups will continue to be evaluated. I figured as much. But they're still being fired. I haven't had the chance to test this on a simple case. My ruleset has for now about 5 to 10 rules in group1 and about 15 in group2. Group1 evaluates the initial state of the working memory and signals possible inconsistencies (inserted as message facts in drool). The second group modifies facts in the working memory. The final state is expected to be inconsistent in regard to the consistency checks on the initial state. Yet, I see warnings being entered in drools after group2 modified facts I could consider a rule flow, but the checks are only there to debug abnormal behaviour and not related to a business process or something. I'd really want to keep it hidden from the java-code calling the drools rules. Grtz E. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Clearing-an-AgendaGroup-tp2353014p2356753.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] Possible bug using from and or
Ok thanks for the info. The drools error mesages are a bit vague from time to time ;-) e. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Possible-bug-using-from-and-or-tp235p2356762.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] proper syntax for multiple function calls within LHS
hello, I'm a newbie to Drools. I'm trying to write a rule that performs some math, without resorting to a function or eval. I searched the forum but found lots of posts on nested function calls,etc but not what I was searching for. For simplicity, lets assume I have the following classes public class ONE{ double A double B double C } public class TWO{ double D double E } where A, B, C, D, E are themselves calculated values (apr, price at some date, etc) 1. What does the LHS of a rule that compares A D look like? 2. What does the LHS of a rule that compares A+B C look like? 3. What does the LHS of a rule that compares A+D C look like? I apologize in advance if this was covered already. Thanks. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/proper-syntax-for-multiple-function-calls-within-LHS-tp2359020p2359020.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] How to write a rule that fires when it matches against specific facts in working memory.
Thanks Wolfgang. I found it. I Work on it and let you'll know how it goes. Sent from my iPhone On Jan 27, 2011, at 1:08 AM, Wolfgang Laun-2 [via Drools - Java Rules Engine] ml-node+2356705-1292265879-9...@n3.nabble.com wrote: Accumulate functions are very well documented in the Expert manual. Look for a section titled Accumulate Functions. You could also use accumulate with all the steps in inline code, which is documented in the preceding section. -W On 26 January 2011 16:50, groovenarula [hidden email] wrote: Thanks for outlining the approach, Edson. Unfortunately, I'm a newbie using drools, so I just need some clarification on what you mean by 'matchAll is your own accumulate function with the semantics you described.' ? Do you mean that I have to create a 'custom' accumulate function ? Edson, if that's the case, then I'll try to search for example of creating a custom function. When I last searched, I did find an example on the Internet, however, I don't think I found details of how to make the function available to the rules engine (is it as simple as including the jar in the classpath or do I need to take addtional steps to use Matchall in drl ?) Can you please elaborate for the benefit of a noobie ? Thanks Gurvinder -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users If you reply to this email, your message will be added to the discussion below: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2356705.html To unsubscribe from How to write a rule that fires when it matches against specific facts in working memory., click here. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2359225.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] How to write a rule that fires when it matches against specific facts in working memory.
I suggest you use this as a base for your implementation, as I think it will help you: https://github.com/droolsjbpm/droolsjbpm/blob/master/drools-core/src/main/java/org/drools/base/accumulators/CollectSetAccumulateFunction.java https://github.com/droolsjbpm/droolsjbpm/blob/master/drools-core/src/main/java/org/drools/base/accumulators/CollectSetAccumulateFunction.java Edson 2011/1/26 groovenarula gnaru...@la-z-boy.com Thanks Wolfgang. I found it. I Work on it and let you'll know how it goes. Sent from my iPhone On Jan 27, 2011, at 1:08 AM, Wolfgang Laun-2 [via Drools - Java Rules Engine] [hidden email]http://user/SendEmail.jtp?type=nodenode=2359225i=0 wrote: Accumulate functions are very well documented in the Expert manual. Look for a section titled Accumulate Functions. You could also use accumulate with all the steps in inline code, which is documented in the preceding section. -W On 26 January 2011 16:50, groovenarula [hidden email]http://user/SendEmail.jtp?type=nodenode=2356705i=0by-user=t wrote: Thanks for outlining the approach, Edson. Unfortunately, I'm a newbie using drools, so I just need some clarification on what you mean by 'matchAll is your own accumulate function with the semantics you described.' ? Do you mean that I have to create a 'custom' accumulate function ? Edson, if that's the case, then I'll try to search for example of creating a custom function. When I last searched, I did find an example on the Internet, however, I don't think I found details of how to make the function available to the rules engine (is it as simple as including the jar in the classpath or do I need to take addtional steps to use Matchall in drl ?) Can you please elaborate for the benefit of a noobie ? Thanks Gurvinder -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.html?by-user=tby-user=t http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.htmlhttp://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.html?by-user=t Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list [hidden email]http://user/SendEmail.jtp?type=nodenode=2356705i=1by-user=t https://lists.jboss.org/mailman/listinfo/rules-users https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list [hidden email]http://user/SendEmail.jtp?type=nodenode=2356705i=2by-user=t https://lists.jboss.org/mailman/listinfo/rules-users https://lists.jboss.org/mailman/listinfo/rules-users -- If you reply to this email, your message will be added to the discussion below: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2356705.html?by-user=t http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2356705.htmlhttp://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2356705.html?by-user=t To unsubscribe from How to write a rule that fires when it matches against specific facts in working memory., click herehttp://drools-java-rules-engine.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2294599code=Z25hcnVsYTFAbGEtei1ib3kuY29tfDIyOTQ1OTl8MjAzMTM1NDY2Mw==by-user=t. -- View this message in context: Re: How to write a rule that fires when it matches against specific facts in working memory.http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2359225.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 -- 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] How to write a rule that fires when it matches against specific facts in working memory.
Edson, This surely looks like a great template to base my implementation - it looks like an great starting point. Gurvinder -Original Message- From: Edson Tirelli-4 [via Drools - Java Rules Engine] [mailto:ml-node+2359987-1512063982-9...@n3.nabble.com] Sent: Wed 1/26/2011 11:44 PM To: Gurvinder Narula1 Subject: Re: How to write a rule that fires when it matches against specific facts in working memory.   I suggest you use this as a base for your implementation, as I think it will help you: https://github.com/droolsjbpm/droolsjbpm/blob/master/drools-core/src/main/java/org/drools/base/accumulators/CollectSetAccumulateFunction.java https://github.com/droolsjbpm/droolsjbpm/blob/master/drools-core/src/main/java/org/drools/base/accumulators/CollectSetAccumulateFunction.java   Edson 2011/1/26 groovenarula [hidden email] Thanks Wolfgang. I found it. I Work on it and let you'll know how it goes. Sent from my iPhone On Jan 27, 2011, at 1:08 AM, Wolfgang Laun-2 [via Drools - Java Rules Engine] [hidden email] http://user/SendEmail.jtp?type=nodenode=2359225i=0 wrote: Accumulate functions are very well documented in the Expert manual. Look for a section titled Accumulate Functions. You could also use accumulate with all the steps in inline code, which is documented in the preceding section. -W On 26 January 2011 16:50, groovenarula [hidden email] http://user/SendEmail.jtp?type=nodenode=2356705i=0by-user=t wrote: Thanks for outlining the approach, Edson. Unfortunately, I'm a newbie using drools, so I just need some clarification on what you mean by 'matchAll is your own accumulate function with the semantics you described.' ? Do you mean that I have to create a 'custom' accumulate function ? Edson, if that's the case, then I'll try to search for example of creating a custom function. When I last searched, I did find an example on the Internet, however, I don't think I found details of how to make the function available to the rules engine (is it as simple as including the jar in the classpath or do I need to take addtional steps to use Matchall in drl ?) Can you please elaborate for the benefit of a noobie ? Thanks Gurvinder -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.html?by-user=tby-user=tby-user=t http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.html http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.html?by-user=tby-user=t Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=2356705i=1by-user=t https://lists.jboss.org/mailman/listinfo/rules-users https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=2356705i=2by-user=t https://lists.jboss.org/mailman/listinfo/rules-users https://lists.jboss.org/mailman/listinfo/rules-users If you reply to this email, your message will be added to the discussion below: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2356705.html?by-user=tby-user=t http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2356705.html
Re: [rules-users] Guvnor UI bugs?
You can browse our Jira for workarounds. Please make a ticket for bugs you find if one doesn't already exist. https://jira.jboss.org/browse/GUVNOR Toni Rikkola On Jan 26, 2011, at 8:11 PM, jlegelis wrote: I'm running Drools 5.1.1 on JDK 1.6, client is Chrome on XP. I've noticed quite a few UI bugs in Guvnor, most feel like browser caching issues, setter/getter issues etc. For example, when creating test scenarios, changing the values in the 'given' clause then running the scenario results in the 'old' values being sent. Anybody else notice this or have any workarounds? -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-UI-bugs-tp2356106p2356106.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] Clearing an AgendaGroup
After reading this description, I don't see any reason for using auto-focus in the rule you have presented in the original email; especially the combination with setFocus() in the RHS looks rather kinky to me. Do you really mean that the final state after group2 is expected to be *in*consistent w.r.t. the checks in group1? Anyway, I would use a rule in MAIN to give the focus to group1 and then to group2 and avoid auto-focus and any control logic in the rules of either group. -W On 26 January 2011 20:47, Evert Penninckx evert.pennin...@gmail.com wrote: manstis wrote: Were the rules in Agenda Group group1 executed, or merely evaluated? Agenda Group controls which activations on the agenda are executed, rules in all Agenda Groups will continue to be evaluated. I figured as much. But they're still being fired. I haven't had the chance to test this on a simple case. My ruleset has for now about 5 to 10 rules in group1 and about 15 in group2. Group1 evaluates the initial state of the working memory and signals possible inconsistencies (inserted as message facts in drool). The second group modifies facts in the working memory. The final state is expected to be inconsistent in regard to the consistency checks on the initial state. Yet, I see warnings being entered in drools after group2 modified facts I could consider a rule flow, but the checks are only there to debug abnormal behaviour and not related to a business process or something. I'd really want to keep it hidden from the java-code calling the drools rules. Grtz E. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Clearing-an-AgendaGroup-tp2353014p2356753.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] proper syntax for multiple function calls within LHS
These questions are answered in the Drools Expert documentation. Look for subsection headers Bound Variable Restriction and Return Value Restriction. -W On 27 January 2011 02:13, garySFCA844 gs999...@yahoo.com wrote: hello, I'm a newbie to Drools. I'm trying to write a rule that performs some math, without resorting to a function or eval. I searched the forum but found lots of posts on nested function calls,etc but not what I was searching for. For simplicity, lets assume I have the following classes public class ONE{ double A double B double C } public class TWO{ double D double E } where A, B, C, D, E are themselves calculated values (apr, price at some date, etc) 1. What does the LHS of a rule that compares A D look like? 2. What does the LHS of a rule that compares A+B C look like? 3. What does the LHS of a rule that compares A+D C look like? I apologize in advance if this was covered already. Thanks. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/proper-syntax-for-multiple-function-calls-within-LHS-tp2359020p2359020.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] Looking for smart way to import huge amount of rules into BRMS
Hi, I need to import a drl file with 9000 rules inside into BRMS. However, I found that it takes very long time to import and it also takes long time to get downloaded into the application to build the ruleBase. Is there any smart way or faster way to manage this procedure? Please advise Thanks ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to import rules from a drl to another drl file
Is not there any way using which we can keep rules in say different files and just import them in a single file. This will make the rule management an easy process. Please help me doing this? I don't want to keep all my rules in a single/long file. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/how-to-import-rules-from-a-drl-to-another-drl-file-tp56211p2360526.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