Re: [rules-users] .drl(rule)file creation
Thanks for reply. yaa i want exactly the same my U.I should generate the DRL file .But I dont know how to generate a DRL file through U.I. Please help me to generate the DRL through U.I. Thanks in Advance. Kedar ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] .drl(rule)file creation
Hi kedar, Of course, I do not know what you are trying to achieve in the end, but from the limited information that I have, I think I can agree with manstis that there are 2 options. 1) Download and install Guvnor, which is a UI to edit rules and may be exaclty what you want. 2) Write an application that constructs a text file, based on some inputs and save the text file as myveryimportantrules.drl I have never tried option 2, but it doesn't seem very hard. kedar vyawahare wrote: Thanks for reply. yaa i want exactly the same my U.I should generate the DRL file .But I dont know how to generate a DRL file through U.I. Please help me to generate the DRL through U.I. Thanks in Advance. Kedar ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drl-rule-file-creation-tp2683529p2686047.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 verifier
It's really worthwhile to add a DRL compile run before you let the verifier do its work. -W On 16 March 2011 10:02, FrankVhh frank.vanhoensho...@agserv.eu wrote: Hi Toni and Wolfgang, Thanks for your replies. First, to clarify my self, with duplicate rules, I actually meant rules that are exactlly the same, but with other names. Moreover, I inserted the verification just before rule execution, and execution runs fine. So, there shouldn't be a compile error. Removing the then part of a rule does not make any difference. It still runs, but doesn't return any notes/warnings/errors in the ruleset. Toni, I am not using one of the M versions. Drools verifier is version 5.1.0. As a general remark, I definitely agree that gap analysis often comes up with some very unuseful information. I usually call those uncovered areas, women with beards or experienced juniors. However, there always might be valuable information in there. Besides, the question whether this information is valuable or not, doesn't matter, it just doesn't show and it should. Regards, Frank Toni Rikkola-2 wrote: Yes it can often be ignored and we need some configuration to silence the unwanted warnings. The current way is best for use cases like the decision table verification in Guvnor. Age is a good example. Person's age can't be less than 0 or more than 120. The top number is difficult. 120 is pretty safe, but usually you should be suspicious from ~90. So in the configurations you could set: Person.age 0-90 = check that they are covered Person.age 90-120 = check them, but make a notification You can of course do this today with custom verification rules. Just use a clean verifier base and add your own verifier rules. Toni On Mar 15, 2011, at 12:39 PM, Wolfgang Laun wrote: 2011/3/15 Toni Rikkola lt;toni.rikk...@gmail.comgt; The verifier can actually find some gaps from rule sets. For example uncovered checks for number values. If you have Person( age 18 ) it gives a warning that you might want to cover Person( age = 18 ). I'd say that such a warning may not be very useful because - in many cases you may not be interested in the other values at all, - in some cases 18, 19,... is handled with Person( age 50 ) with low salience (not recommended!), - in many (other) cases you use a (low salience) catch all rule to handle facts not selected by 1st order rules, Moreover, I'm thinking of using additional rules with Verifier, with one of the primary targets being magic numbers. But Verifier is a fine achievement, and the confiugration is here to get you what you want! -W Toni Rikkola ___ 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 -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-verifier-tp2681002p2686028.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] .drl(rule)file creation
You could look into using org.drools.ide.common.client.modeldriven.brl.RuleModel (in droolsjbpm-ide-common). This is the basic model used by all of the guided editors before translating it into DRL with org.drools.ide.common.server.util.BRDRLPersistence (in droolsjbpm-ide-common too). There are a lot of Unit Tests that illustrate construction of DRL using this approach. With kind regards, Mike On 16 March 2011 09:20, FrankVhh frank.vanhoensho...@agserv.eu wrote: Hi kedar, Of course, I do not know what you are trying to achieve in the end, but from the limited information that I have, I think I can agree with manstis that there are 2 options. 1) Download and install Guvnor, which is a UI to edit rules and may be exaclty what you want. 2) Write an application that constructs a text file, based on some inputs and save the text file as myveryimportantrules.drl I have never tried option 2, but it doesn't seem very hard. kedar vyawahare wrote: Thanks for reply. yaa i want exactly the same my U.I should generate the DRL file .But I dont know how to generate a DRL file through U.I. Please help me to generate the DRL through U.I. Thanks in Advance. Kedar ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drl-rule-file-creation-tp2683529p2686047.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] Impement My own login page
I want to use my own login page in BRMS and for the same don't know the Action url and login fields name that I have to use in my custome login page. Please let me know the url and all the fileds name used in login page. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Impement-My-own-login-page-tp2686687p2686687.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] InvocationTargetException in KnowledgeStoreServiceImpl
Hi! I get InvocationTargetException after the following: return constructor.newInstance( kbase, conf, env ); in KnowledgeStoreServiceImpl. I see that in return (T) constructorAccessor.newInstance(initargs) of Constructor class it throws the InvocationTargetException. The exception is null so I can't see what it the problem! I call the code from this: EntityManagerFactory emf = Persistence.createEntityManagerFactory(org.drools.persistence.jpa); Environment env = KnowledgeBaseFactory.newEnvironment(); env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); env.set(EnvironmentName.GLOBALS, new MapGlobalResolver()); env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager()); ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); I define the transaction manager in my spring beans like this: username username myurl oracle.jdbc.OracleDriver I see that bitronix is up via the debugging messages. (2011-03-16 12:14:53,399 DEBUG (PoolingDataSource.java:84) - building XA pool for java/DS1 with 0 connection(s) etc..) in persistence.xml I have: org.hibernate.ejb.HibernatePersistence java/DS1 persistenceorm.xml org.drools.persistence.info.SessionInfo org.jbpm.persistence.processinstance.ProcessInstanceInfo org.drools.persistence.info.WorkItemInfo true What could cause the problem? When I defined the btm with tomcat and not with spring - it worked fine. (but I had context reloading problems). when I define it only with spring - it get this weird exception. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/InvocationTargetException-in-KnowledgeStoreServiceImpl-tp2686763p2686763.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] Impement My own login page
We don't use Struts (if that's what your Action URL relates to?) IIRC we use Seam to authenticate. Not sure of the class names though :( On 16 March 2011 10:12, Satyendra Sharma satyendra.sha...@birlasoft.comwrote: I want to use my own login page in BRMS and for the same don't know the Action url and login fields name that I have to use in my custome login page. Please let me know the url and all the fileds name used in login page. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Impement-My-own-login-page-tp2686687p2686687.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 verifier
I've just realized that the code you posted does not include checking for errors during the verifier builds. ListVerifierError errors = verifier.getErrors(); if( errors.size() 0 ){ printStream.println( ### Verifier errors ### ); for( VerifierError error: errors ){ printStream.println( error.getMessage() ); } } else { VerifierReport result = verifier.getResult(); // here we can obtain Verifier results... } On 16 March 2011 10:02, FrankVhh frank.vanhoensho...@agserv.eu wrote: Hi Toni and Wolfgang, Thanks for your replies. First, to clarify my self, with duplicate rules, I actually meant rules that are exactlly the same, but with other names. Moreover, I inserted the verification just before rule execution, and execution runs fine. So, there shouldn't be a compile error. Removing the then part of a rule does not make any difference. It still runs, but doesn't return any notes/warnings/errors in the ruleset. Toni, I am not using one of the M versions. Drools verifier is version 5.1.0. As a general remark, I definitely agree that gap analysis often comes up with some very unuseful information. I usually call those uncovered areas, women with beards or experienced juniors. However, there always might be valuable information in there. Besides, the question whether this information is valuable or not, doesn't matter, it just doesn't show and it should. Regards, Frank Toni Rikkola-2 wrote: Yes it can often be ignored and we need some configuration to silence the unwanted warnings. The current way is best for use cases like the decision table verification in Guvnor. Age is a good example. Person's age can't be less than 0 or more than 120. The top number is difficult. 120 is pretty safe, but usually you should be suspicious from ~90. So in the configurations you could set: Person.age 0-90 = check that they are covered Person.age 90-120 = check them, but make a notification You can of course do this today with custom verification rules. Just use a clean verifier base and add your own verifier rules. Toni On Mar 15, 2011, at 12:39 PM, Wolfgang Laun wrote: 2011/3/15 Toni Rikkola lt;toni.rikk...@gmail.comgt; The verifier can actually find some gaps from rule sets. For example uncovered checks for number values. If you have Person( age 18 ) it gives a warning that you might want to cover Person( age = 18 ). I'd say that such a warning may not be very useful because - in many cases you may not be interested in the other values at all, - in some cases 18, 19,... is handled with Person( age 50 ) with low salience (not recommended!), - in many (other) cases you use a (low salience) catch all rule to handle facts not selected by 1st order rules, Moreover, I'm thinking of using additional rules with Verifier, with one of the primary targets being magic numbers. But Verifier is a fine achievement, and the confiugration is here to get you what you want! -W Toni Rikkola ___ 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 -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-verifier-tp2681002p2686028.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] InvocationTargetException in KnowledgeStoreServiceImpl - full code
Hi! I posted my previous message from the web client and it was corrupted. So here is the full one: get InvocationTargetException after the following: return constructor.newInstance( kbase, conf, env ); in KnowledgeStoreServiceImpl. I see that in return (T) constructorAccessor.newInstance(initargs) of Constructor class it throws the InvocationTargetException. The exception is null so I can't see what it the problem! I call the code from this: EntityManagerFactory emf = Persistence.createEntityManagerFactory(org.drools.persistence.jpa); Environment env = KnowledgeBaseFactory.newEnvironment(); env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); env.set(EnvironmentName.GLOBALS, new MapGlobalResolver()); env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager()); ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); I define the transaction manager in my spring beans like this: !-- Bitronix Transaction Manager embedded configuration -- bean id=xaDataSource class=bitronix.tm.resource.jdbc.PoolingDataSource init-method=init destroy-method=close property name=className value=bitronix.tm.resource.jdbc.lrc.LrcXADataSource / property name=uniqueName value=java/DS1 / property name=maxPoolSize value=5 / property name=minPoolSize value=0 / property name=allowLocalTransactions value=false / property name=testQuery value=SELECT 1 FROM DUAL / property name=driverProperties props prop key=userusername/prop prop key=passwordusername/prop prop key=urlurl/prop prop key=driverClassNameoracle.jdbc.OracleDriver/prop /props /property /bean bean id=btmConfig factory-method=getConfiguration class=bitronix.tm.TransactionManagerServices property name=serverId value=spring-btm / /bean bean id=bitronixTransactionManager factory-method=getTransactionManager class=bitronix.tm.TransactionManagerServices depends-on=btmConfig,xaDataSource destroy-method=shutdown / bean id=jtaTransactionManager class=org.springframework.transaction.jta.JtaTransactionManager property name=transactionManager ref=bitronixTransactionManager / property name=userTransaction ref=bitronixTransactionManager / /bean !-- end of Bitronix Transaction Manager embedded configuration -- bean id=transactionManager class=org.springframework.orm.hibernate3.HibernateTransactionManager property name=sessionFactory ref=OnMediaSessionFactory / /bean I see that bitronix is up via the debugging messages. (2011-03-16 12:14:53,399 DEBUG (PoolingDataSource.java:84) - building XA pool for java/DS1 with 0 connection(s) etc..) in persistence.xml I have: persistence-unit name=org.drools.persistence.jpa transaction-type=JTA providerorg.hibernate.ejb.HibernatePersistence/provider jta-data-sourcejava/DS1/jta-data-source mapping-filepersistenceorm.xml/mapping-file classorg.drools.persistence.info.SessionInfo/class classorg.jbpm.persistence.processinstance.ProcessInstanceInfo/class classorg.drools.persistence.info.WorkItemInfo/class exclude-unlisted-classestrue/exclude-unlisted-classes properties property name=hibernate.dialect value=org.hibernate.dialect.Oracle10gDialect / property name=hibernate.connection.autocommit value=false / property name=hibernate.max_fetch_depth value=3 / property name=hibernate.show_sql value=true / property name=hibernate.connection.driver_class value=oracle.jdbc.driver.OracleDriver / property name=hibernate.jndi.class value=bitronix.tm.jndi.BitronixInitialContextFactory/ property name=hibernate.transaction.manager_lookup_class value=org.hibernate.transaction.BTMTransactionManagerLookup / /properties /persistence-unit What could cause the problem? When I defined the btm with tomcat and not with spring - it worked fine. (but I had context reloading problems). when I define it only with spring - it get this weird exception. Thanks! Odelya
Re: [rules-users] Drools verifier
Hi Wolfgang, I was about to report the fact that using drools-verifier 5.2.0 M1 didn't help, when I saw your comment about checking the error. Apparently there is something wrong: ### Verifier errors ### [ERR 101] Line 1:1 no viable alternative at input ':' Verifier could not form a PackageDescr from the resources that it was trying to verify. I do not understand this completely. When I execute the ruleset, it runs as planned, but this error message seems to imply there is something wrong with the drl. Is it a problem that I feed the verifier with String ruleText = C:\\Users\\Frank\\Documents\\DroolsWorkSpaces\\EmpiricalExperiments\\Financial Rules\\src\\main\\rules\\clearancerules.drl; verifier.addResourcesToVerify( ResourceFactory.newReaderResource( new StringReader( ruleText ) ), ResourceType.DRL ); Do the inputs need to be in another format or is there definitely something wrong in the rules themselves? Regards, Frank -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-verifier-tp2681002p2687184.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] Impement My own login page
Custom login page will be normal HTML form and will be place it in drools's war file So Need the action name and login fields name that will be used to populate the login detail. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Impement-My-own-login-page-tp2686687p2687202.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 verifier
You are feeding it the pathname, not the text from the file. -W On 16 March 2011 11:52, FrankVhh frank.vanhoensho...@agserv.eu wrote: Hi Wolfgang, I was about to report the fact that using drools-verifier 5.2.0 M1 didn't help, when I saw your comment about checking the error. Apparently there is something wrong: ### Verifier errors ### [ERR 101] Line 1:1 no viable alternative at input ':' Verifier could not form a PackageDescr from the resources that it was trying to verify. I do not understand this completely. When I execute the ruleset, it runs as planned, but this error message seems to imply there is something wrong with the drl. Is it a problem that I feed the verifier with String ruleText = C:\\Users\\Frank\\Documents\\DroolsWorkSpaces\\EmpiricalExperiments\\Financial Rules\\src\\main\\rules\\clearancerules.drl; verifier.addResourcesToVerify( ResourceFactory.newReaderResource( new StringReader( ruleText ) ), ResourceType.DRL ); Do the inputs need to be in another format or is there definitely something wrong in the rules themselves? Regards, Frank -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-verifier-tp2681002p2687184.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 verifier
String path = C:...; Resource resource = ResourceFactory.newClassPathResource( path, getClass() ); if( resource != null ){ verifier.addResourcesToVerify( resource, ResourceType.DRL ); } else { //... } On 16 March 2011 12:03, Wolfgang Laun wolfgang.l...@gmail.com wrote: You are feeding it the pathname, not the text from the file. -W On 16 March 2011 11:52, FrankVhh frank.vanhoensho...@agserv.eu wrote: Hi Wolfgang, I was about to report the fact that using drools-verifier 5.2.0 M1 didn't help, when I saw your comment about checking the error. Apparently there is something wrong: ### Verifier errors ### [ERR 101] Line 1:1 no viable alternative at input ':' Verifier could not form a PackageDescr from the resources that it was trying to verify. I do not understand this completely. When I execute the ruleset, it runs as planned, but this error message seems to imply there is something wrong with the drl. Is it a problem that I feed the verifier with String ruleText = C:\\Users\\Frank\\Documents\\DroolsWorkSpaces\\EmpiricalExperiments\\Financial Rules\\src\\main\\rules\\clearancerules.drl; verifier.addResourcesToVerify( ResourceFactory.newReaderResource( new StringReader( ruleText ) ), ResourceType.DRL ); Do the inputs need to be in another format or is there definitely something wrong in the rules themselves? Regards, Frank -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-verifier-tp2681002p2687184.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 verifier
You may have to use newFileResource( path ) or change the path. Sorry -W On 16 March 2011 12:06, Wolfgang Laun wolfgang.l...@gmail.com wrote: String path = C:...; Resource resource = ResourceFactory.newClassPathResource( path, getClass() ); if( resource != null ){ verifier.addResourcesToVerify( resource, ResourceType.DRL ); } else { //... } On 16 March 2011 12:03, Wolfgang Laun wolfgang.l...@gmail.com wrote: You are feeding it the pathname, not the text from the file. -W On 16 March 2011 11:52, FrankVhh frank.vanhoensho...@agserv.eu wrote: Hi Wolfgang, I was about to report the fact that using drools-verifier 5.2.0 M1 didn't help, when I saw your comment about checking the error. Apparently there is something wrong: ### Verifier errors ### [ERR 101] Line 1:1 no viable alternative at input ':' Verifier could not form a PackageDescr from the resources that it was trying to verify. I do not understand this completely. When I execute the ruleset, it runs as planned, but this error message seems to imply there is something wrong with the drl. Is it a problem that I feed the verifier with String ruleText = C:\\Users\\Frank\\Documents\\DroolsWorkSpaces\\EmpiricalExperiments\\Financial Rules\\src\\main\\rules\\clearancerules.drl; verifier.addResourcesToVerify( ResourceFactory.newReaderResource( new StringReader( ruleText ) ), ResourceType.DRL ); Do the inputs need to be in another format or is there definitely something wrong in the rules themselves? Regards, Frank -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-verifier-tp2681002p2687184.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] Problems with Guided Rule Editor in Eclipse
Title: CARTE DE VISITE I have the same problem with BRL editor under eclipse. Also the action part dialog box does not show DSL phrases ... The plugin is incomplete/buggy and shows errors but rules are correct (you can compile and run them). This problem is the same since version 5.0. There is a JIRA for that since then ... I don't know when a fix is planned, but my feeling is that nobody uses the guided editor under eclipse (dsrl editor works well and provide completions on facts and DSL sentences). But it is not easy when you have rules that comes from Guvnor ... Le 15/03/2011 20:47, John Peterson a crit: I am experimenting with the Guided Rule Editor in Eclipse, but I am unable to get a Guided Rule to parse. I have created a Drools Project using the basic Hello World example for starters. Ive created a class called Item with 3 attributes itemPrice (float), ItemNumber (int), and itemDescription (String) with getters/setters. I do a New-Drools-Guided Rule to create a .brl file called GuidedRule.brl and get the drools.package created automatically. In drools.package, I add package com.sample; and import com.sample.Item; and save it. Then I go over to GuidedRule.brl and create a simple rule in the guided editor (this is the DRL view of it): rule GuidedRule dialect mvel when item : Item() then item.setItemDescription(New Description); end When I click save I get errors. On the Generated drl (read only), I get two problems - BuildError: Unable to build _expression_ for 'consequence': Failed to compile: 2 compilation error(s): - (1,4) unqualified type in strict mode for: item - (1,44) unable to resolve method using strict-mode: java.lang.Object.setItemDescription(java.lang.String) ' item.setItemDescription( "New Description" );' On the brl source view, I get an error at the attributes - BuildError: Unable to resolve ObjectType 'Item' It seems to not be able to see my class, which is public, belonging to the same package, and included as an import in drools.package. I can get the rule to work if I dont reference Item (simple eval(true) in the LHS, for example). I am running Drools 5.1.1 on Eclipse 3.5. Am I overlooking something simple here? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Vincent LEGENDRE Consultant Snior EURODECISION 9A rue de la Porte de Buc 78000 VERSAILLES Tl. : +33 (0)1 39 07 12 40 Direct : +33 (0)1 39 07 26 16 www.eurodecision.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools verifier
Hi Wolfgang, Yes, you are absolutely right about the path mistake. Can't believe I missed that. Fixing it removes the errors from the verifier. However, it still does not return the expected outputs... System.out.println(result.getVerifierData().getAll().isEmpty()); = returns false, which is as expected But the following statement still does not return anything. for (VerifierMessageBase base : result .getBySeverity(Severity.WARNING)) { System.out.println(base); } I'm sorry to take so much of your time, I really appreciate your efforts. Regards, Frank -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-verifier-tp2681002p2687459.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] Can business people write rules?
Le 15/03/2011 22:53, jwest a écrit : However, I don't know how to make this first line more complex using the guided editor. For example, you can hover on the second line of the rule and click on it and the shown dialog pop ups, allowing me to make this line more complex through adding restrictions on a field, new formula, etc. I can't get a similar dialog for the first line of the rule. No you can't ... A DSL sentence stands for a whole condition (or action). You can't really add contraints in it. One thing that could work is to define DSL phrase starting with - (see documentation) and add them just under the main DSL sentence. But careful using that, as DSL phrase are not filtered according to their context, your DSL may become complex and a bad usage (which becomes more and more frequent as the DSL grows) will produce rules that does not compile, or worse, that does silly things ... I think I should be able, otherwise how could I write an 'OR' condition between this 2 lines? You must first create a OR condition (something like one of the following is true :), which will create a container for sub-conditions. You can then insert the condition inside this OR container. Also, enums are displayed as a simple selection list (combo box) in the DSL sentence. Is it possible to have multi-selection, effectively getting a list of selected values to be used inside the rule? I don't think so To gain flexibility on rules coding, you should consider not using DSL, or use it when you are really forced to (it is my opinion, as discussed in this thread : http://drools-java-rules-engine.46999.n3.nabble.com/Who-writes-your-rules-Dev-vs-BA-td2398166.html) ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools verifier
And no Severity.ERROR or Severity.NOTE either? What kind of verifier finding(s) do you expect? A rule sample might help. -W PS: I'm just investigating this corner of Drools, and you do provide some inspiration ;-) On 16 March 2011 12:29, FrankVhh frank.vanhoensho...@agserv.eu wrote: Hi Wolfgang, Yes, you are absolutely right about the path mistake. Can't believe I missed that. Fixing it removes the errors from the verifier. However, it still does not return the expected outputs... System.out.println(result.getVerifierData().getAll().isEmpty()); = returns false, which is as expected But the following statement still does not return anything. for (VerifierMessageBase base : result .getBySeverity(Severity.WARNING)) { System.out.println(base); } I'm sorry to take so much of your time, I really appreciate your efforts. Regards, Frank -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-verifier-tp2681002p2687459.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 verifier
Can you make few rules for us to test this with. I have to say that the verifier is not perfect when it searches for redundancy, so your rules might be too complex for it at the moment. Toni On Mar 16, 2011, at 1:29 PM, FrankVhh wrote: Hi Wolfgang, Yes, you are absolutely right about the path mistake. Can't believe I missed that. Fixing it removes the errors from the verifier. However, it still does not return the expected outputs... System.out.println(result.getVerifierData().getAll().isEmpty()); = returns false, which is as expected But the following statement still does not return anything. for (VerifierMessageBase base : result .getBySeverity(Severity.WARNING)) { System.out.println(base); } I'm sorry to take so much of your time, I really appreciate your efforts. Regards, Frank -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-verifier-tp2681002p2687459.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 verifier
Hi, Thanks all for your replies. I forgot I had already uncommented the RHS of a rule, whic onviously did not return a warning. When I comment it, this warning is displayed. Sorry to bother you with this trivial problem. Redundancy, however, isn't detected yet. Neither are the gaps [temperature = 0] and [precipitation != snow] I am assuming this has more to do with the rules, than it has to do with drools verfier. These are the redundant rules: = rule Rule 1 salience 200 agenda-group group1 lock-on-active true when $w : Weather( temperature 0 || precipitation == Weather.SNOW ) $a : Assignment( status == Assignment.INACTIVE) then System.out.println(This rule fired); end rule Rule 2 salience 200 agenda-group group1 lock-on-active true when $w : Weather( temperature 0 || precipitation == Weather.SNOW ) $a : Assignment( status == Assignment.INACTIVE) then System.out.println(This rule fired); end rule Rule 3 salience 200 agenda-group group1 lock-on-active true when $w : Weather( temperature 0 || precipitation == Weather.SNOW ) $a : Assignment( status == Assignment.INACTIVE) then System.out.println(This rule fired); end -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-verifier-tp2681002p2688101.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] InvocationTargetException in KnowledgeStoreServiceImpl - full code
can you paste here the full stack trace of your problem? along with the version of jbpm and drools that you are using. Greetings. On Wed, Mar 16, 2011 at 7:38 AM, Odelya Holiday odel...@sintecmedia.comwrote: Hi! I posted my previous message from the web client and it was corrupted. So here is the full one: get InvocationTargetException after the following: return constructor.newInstance( kbase, conf, env ); in KnowledgeStoreServiceImpl. I see that in return (T) constructorAccessor.newInstance(initargs) of Constructor class it throws the InvocationTargetException. The exception is null so I can't see what it the problem! I call the code from this: EntityManagerFactory emf = Persistence.createEntityManagerFactory(org.drools.persistence.jpa); Environment env = KnowledgeBaseFactory.newEnvironment(); env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); env.set(EnvironmentName.GLOBALS, new MapGlobalResolver()); env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager()); ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); I define the transaction manager in my spring beans like this: !-- Bitronix Transaction Manager embedded configuration -- bean id=xaDataSource class=bitronix.tm.resource.jdbc.PoolingDataSource init-method=init destroy-method=close property name=className value=bitronix.tm.resource.jdbc.lrc.LrcXADataSource / property name=uniqueName value=java/DS1 / property name=maxPoolSize value=5 / property name=minPoolSize value=0 / property name=allowLocalTransactions value=false / property name=testQuery value=SELECT 1 FROM DUAL / property name=driverProperties props prop key=userusername/prop prop key=passwordusername/prop prop key=urlurl/prop prop key=driverClassNameoracle.jdbc.OracleDriver/prop /props /property /bean bean id=btmConfig factory-method=getConfiguration class=bitronix.tm.TransactionManagerServices property name=serverId value=spring-btm / /bean bean id=bitronixTransactionManager factory-method=getTransactionManager class=bitronix.tm.TransactionManagerServices depends-on=btmConfig,xaDataSource destroy-method=shutdown / bean id=jtaTransactionManager class=org.springframework.transaction.jta.JtaTransactionManager property name=transactionManager ref=bitronixTransactionManager / property name=userTransaction ref=bitronixTransactionManager / /bean !-- end of Bitronix Transaction Manager embedded configuration -- bean id=transactionManager class=org.springframework.orm.hibernate3.HibernateTransactionManager property name=sessionFactory ref=OnMediaSessionFactory / /bean I see that bitronix is up via the debugging messages. (2011-03-16 12:14:53,399 DEBUG (PoolingDataSource.java:84) - building XA pool for java/DS1 with 0 connection(s) etc..) in persistence.xml I have: persistence-unit name=org.drools.persistence.jpa transaction-type=JTA providerorg.hibernate.ejb.HibernatePersistence/provider jta-data-sourcejava/DS1/jta-data-source mapping-filepersistenceorm.xml/mapping-file classorg.drools.persistence.info.SessionInfo/class classorg.jbpm.persistence.processinstance.ProcessInstanceInfo/class classorg.drools.persistence.info.WorkItemInfo/class exclude-unlisted-classestrue/exclude-unlisted-classes properties property name=hibernate.dialect value=org.hibernate.dialect.Oracle10gDialect / property name=hibernate.connection.autocommit value=false / property name=hibernate.max_fetch_depth value=3 / property name=hibernate.show_sql value=true / property name=hibernate.connection.driver_class value=oracle.jdbc.driver.OracleDriver / property name=hibernate.jndi.class value=bitronix.tm.jndi.BitronixInitialContextFactory/ property name=hibernate.transaction.manager_lookup_class value=org.hibernate.transaction.BTMTransactionManagerLookup / /properties /persistence-unit What could cause the problem? When I defined the btm with tomcat and not with spring - it worked fine. (but I had context reloading problems). when I define it only with
Re: [rules-users] Impement My own login page
Guvnor uses GWT extensively and our login mechanism uses a GWT RPC call to the server to authenticate with Seam. Our authentication mechanism is exposed through org.drools.guvnor.server.security.SecurityServiceImpl There is no HTML form with INPUT fields that you can easily substitute for your own. On 16 March 2011 10:59, Satyendra Sharma satyendra.sha...@birlasoft.comwrote: Custom login page will be normal HTML form and will be place it in drools's war file So Need the action name and login fields name that will be used to populate the login detail. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Impement-My-own-login-page-tp2686687p2687202.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] A question about using lane in Drools-flow (Tihomir Surdilovic)
On 3/15/11 12:27 PM, Wen Yao wrote: Thanks Tihomir. Attached is my bpmn file which I haven't edited. I don't think I am using jBPM. I just new a ruleflow file which is supported by Drools 5.1. It's a bpmn file. For question 3, I created a bpmn file in eclipse and didn't edit it. Then try to import it into oryx. It didn't work. Thanks for your answer! Best regards, Wen I am able to open your process without errors in both Eclipse as well as in Oryx after importing it to Guvnor. Here is what I have tested your process with: Guvnor: latest from trunk (https://github.com/droolsjbpm/guvnor) as well as the version that comes with jBPM5-Final ( http://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.0-Final/ ) and also the latest snapshot (http://hudson.jboss.org/hudson/job/jBPM5/lastSuccessfulBuild/artifact/target/) Oryx: Latest version (http://people.redhat.com/tsurdilo/oryx/1.0.0.049-SNAPSHOT/), you should download designer-1.0.0.049-SNAPSHOT-jboss.war http://people.redhat.com/tsurdilo/oryx/1.0.0.049-SNAPSHOT/designer-1.0.0.049-SNAPSHOT-jboss.war and rename it to designer.war before deploying. You may be using some older versions, if you let me what what they are then I can test with those as well. Thanks. Tihomir On Tue, Mar 15, 2011 at 12:00 PM, rules-users-requ...@lists.jboss.org mailto:rules-users-requ...@lists.jboss.org wrote: Send rules-users mailing list submissions to rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.jboss.org/mailman/listinfo/rules-users or, via email, send a message with subject or body 'help' to rules-users-requ...@lists.jboss.org mailto:rules-users-requ...@lists.jboss.org You can reach the person managing the list at rules-users-ow...@lists.jboss.org mailto:rules-users-ow...@lists.jboss.org When replying, please edit your Subject line so it is more specific than Re: Contents of rules-users digest... Today's Topics: 1. Importing existing .dslr + .dsl to Guvnor (wantastic) 2. Re: A question about using lane in Drools-flow (Tihomir Surdilovic) -- Message: 1 Date: Tue, 15 Mar 2011 07:24:16 -0700 (PDT) From: wantastic wantas...@gmail.com mailto:wantas...@gmail.com Subject: [rules-users] Importing existing .dslr + .dsl to Guvnor To: rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org Message-ID: 1300199055985-2681597.p...@n3.nabble.com mailto:1300199055985-2681597.p...@n3.nabble.com Content-Type: text/plain; charset=us-ascii Hello everyone, I am a newbie to Guvnor. I have a set of .dslr files with .dsl to translate them. I know I can just copy and paste .dslr file and .dsl file. However, the problem is that I call external function within .dsl file and when I try to validate the dsl, it complains for not having the method. ex) [condition][Trade]xpathMatch {xpath}=trade : Trade( type == Trade.TRADE_TYPE ) and eval( DslHelper.xmlContentMatches(trade, {xpath}) ) This is my condition and it has all models like Trade. However, it complains about not having DslHelper function. This function has so many dependencies that I cannot upload through POJO jar. Is there any elegant way to solve this problem? Thanks in advance :) -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Importing-existing-dslr-dsl-to-Guvnor-tp2681597p2681597.html Sent from the Drools - User mailing list archive at Nabble.com. -- Message: 2 Date: Tue, 15 Mar 2011 10:24:40 -0400 From: Tihomir Surdilovic tsurd...@redhat.com mailto:tsurd...@redhat.com Subject: Re: [rules-users] A question about using lane in Drools-flow To: rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org Message-ID: 4d7f76a8.5030...@redhat.com mailto:4d7f76a8.5030...@redhat.com Content-Type: text/plain; charset=iso-8859-1 On 3/14/11 9:27 PM, Wen Yao wrote: Hi, When I was working on a project using Drools-flow, I had some problems with the lane and laneset. 1. In eclipse, I used the Flow editor to create a process and add some swimlanes. When I tried to run it, it always had this error: org.xml.sax.SAXParseException: lane is after an invalid element: org.drools.xml.Handler Then I looked into the XML file and changed the following code: laneSet lane name=Patient /lane lane name=Doctor /lane /laneSet to: laneSet lane name=Patient /lane /laneSet laneSet lane name=Doctor /lane /laneSet It worked. Could you explain why? Are you using jbpm-5.0-Final? I
Re: [rules-users] Problems with Guided Rule Editor in Eclipse
Thanks for the response, Vincent. Do you happen to have a link to the URL for the JIRA? I was looking for it, but haven't found it yet. It would seem to me that this is basic functionality. It sounds, from your response, that BRL is just not the focus. jp Date: Wed, 16 Mar 2011 12:17:02 +0100 From: Vincent Legendre vincent.legen...@eurodecision.com Subject: Re: [rules-users] Problems with Guided Rule Editor in Eclipse To: Rules Users List rules-users@lists.jboss.org Message-ID: 4d809c2e.4070...@eurodecision.com Content-Type: text/plain; charset=iso-8859-1 I have the same problem with BRL editor under eclipse. Also the action part dialog box does not show DSL phrases ... The plugin is incomplete/buggy and shows errors but rules are correct (you can compile and run them). This problem is the same since version 5.0. There is a JIRA for that since then ... I don't know when a fix is planned, but my feeling is that nobody uses the guided editor under eclipse (dsrl editor works well and provide completions on facts and DSL sentences). But it is not easy when you have rules that comes from Guvnor ... Le 15/03/2011 20:47, John Peterson a ?crit : I am experimenting with the Guided Rule Editor in Eclipse, but I am unable to get a Guided Rule to parse. I have created a Drools Project using the basic Hello World example for starters. I've created a class called Item with 3 attributes -- itemPrice (float), ItemNumber (int), and itemDescription (String) with getters/setters. I do a New-Drools-Guided Rule to create a .brl file called GuidedRule.brl and get the drools.package created automatically. In drools.package, I add package com.sample; and import com.sample.Item; and save it. Then I go over to GuidedRule.brl and create a simple rule in the guided editor (this is the DRL view of it): rule GuidedRule dialect mvel when item : Item() then item.setItemDescription(New Description); end When I click save I get errors. On the Generated drl (read only), I get two problems - BuildError: Unable to build expression for 'consequence': Failed to compile: 2 compilation error(s): - (1,4) unqualified type in strict mode for: item - (1,44) unable to resolve method using strict-mode: java.lang.Object.setItemDescription(java.lang.String) ' item.setItemDescription( New Description );' On the brl source view, I get an error at the attributes - BuildError: Unable to resolve ObjectType 'Item' It seems to not be able to see my class, which is public, belonging to the same package, and included as an import in drools.package. I can get the rule to work if I don't reference Item (simple eval(true) in the LHS, for example) I am running Drools 5.1.1 on Eclipse 3.5. Am I overlooking something simple here? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Vincent LEGENDRE /Consultant S?nior/ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Basic doubt regarding Drools Fusion - @expires
Hi all! I’ve got a really basic doubt… I’ve read several documentation regarding it but I think I need some advice here… Imagine that I have an event: declare A @role( event ) @expires( 1h ) end On my Java code, I call “fireAllRules()” method every time that I put an event into the working memory. My doubt: When does event A expires? a) One hour after it was inserted (time-based and without the “fireAllRules()” method call) or b) by calling “fireAllRules()” method (event-based) T.I.A. Vítor Mendonça Moreira Analista / Programador Direcção de Investigação e Desenvolvimento Rua Dr. Francisco Sá Carneiro, nº. 4 r/c esq. 2500 - 206 - Caldas da Rainha Tel: (+351) 262 832 196 Fax: (+351) 262 186 455 Web: www.makewise.pthttp://www.makewise.pt Uma empresa: Grupo Sousa Pedrohttp://www.sousapedro.com [cid:image002.jpg@01CBE3EF.C9596900] Declaração: A informação contida nesta mensagem, e os ficheiros anexos, é privilegiada e confidencial, destinando-se exclusivamente ao(s) destinatário(s).Se não é o destinatário (ou o responsável pela sua entrega ao destinatário) e recebeu a mesma por engano, fica notificado que é estritamente proibido reproduzir, guardar ou distribuir toda ou qualquer parte desta mensagem e ficheiros anexos.Por favor reencaminhe a mensagem para o responsável pelo seu envio ou contacte-nos por telefone e elimine a mensagem e ficheiros anexos do seu computador,sem os reproduzir. Disclaimer: The information contained in this message, and any files attached, is privileged and confidential, and intended exclusively for the included addresses.If you are not the intended recipient (or the person responsible for delivering to the intended recipient) and received this message by mistake, be aware that copy, storage, distribution or any other use of all or part of this message and the files attached is strictly prohibited. Please notify the sender by reply e-mail or contact us by telephone and delete this message and the files attached, without retaining a copy. inline: image001.jpginline: image002.jpg___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Open file leak in Drools Compiler
I am running Drools (actually JBoss Rules 5.1.0 ) in Glassfish. My deployable is an EJB that uses a StatelessKnowledgeSession to run some rules that I get from a KnowledgeAgent that has a Changeset with a .drl in it. Therefore, I have placed the drools compiler into the deployable and it all appears to work. Glassfish has a clever little mechanism that, when you unload a deployable that had some open streams, it tells you all about it (and kindly closes them). Glassfish is reporting that InputStreams are being left open that were opened in the isPackage() method of org.drools.commons.jci.compilers.EclipseJavaCompiler. That method has the following code in it:- final InputStream is = pClassLoader.getResourceAsStream(ClassUtils.convertClassToResourcePath(pClazzName)); if (is != null) { return false; } So, when is is not null (i.e. open), it is forgotten about and not closed. Isn't this a potential file handle leak? Chris Selwyn ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Execution Server - SOAP Support / XML Format
Hi Mauricio, I tried to make the server working with a soap endpoint, I followed you documentation from your article http://planet.jboss.org/post/drools_server_drools_grid_for_remote_distributed_executions, modified the camel-server.xml etc ... When the server start it complains that he can not open the soap.wsdl file, I suppose I should have that file, how do you create that file ? Thanks for your help bd -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Execution-Server-SOAP-Support-XML-Format-tp1961864p2688639.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 Execution Server - SOAP Support / XML Format
Hi there, Can you share the stack trace that you are getting when you start the server? I didn't create th soap.wsdl file. Greetings. On Wed, Mar 16, 2011 at 1:55 PM, bdoucet bdou...@xhpsi.com wrote: Hi Mauricio, I tried to make the server working with a soap endpoint, I followed you documentation from your article http://planet.jboss.org/post/drools_server_drools_grid_for_remote_distributed_executions , modified the camel-server.xml etc ... When the server start it complains that he can not open the soap.wsdl file, I suppose I should have that file, how do you create that file ? Thanks for your help bd -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Execution-Server-SOAP-Support-XML-Format-tp1961864p2688639.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] Open file leak in Drools Compiler
Only if garbage collection never runs. Then you'd already be in trouble. :) --- On Wed, 3/16/11, Chris Selwyn ch...@selwyn-family.me.uk wrote: From: Chris Selwyn ch...@selwyn-family.me.uk Subject: [rules-users] Open file leak in Drools Compiler To: Drools users rules-users@lists.jboss.org Date: Wednesday, March 16, 2011, 11:49 AM I am running Drools (actually JBoss Rules 5.1.0 ) in Glassfish. My deployable is an EJB that uses a StatelessKnowledgeSession to run some rules that I get from a KnowledgeAgent that has a Changeset with a .drl in it. Therefore, I have placed the drools compiler into the deployable and it all appears to work. Glassfish has a clever little mechanism that, when you unload a deployable that had some open streams, it tells you all about it (and kindly closes them). Glassfish is reporting that InputStreams are being left open that were opened in the isPackage() method of org.drools.commons.jci.compilers.EclipseJavaCompiler. That method has the following code in it:- final InputStream is = pClassLoader.getResourceAsStream(ClassUtils.convertClassToResourcePath(pClazzName)); if (is != null) { return false; } So, when is is not null (i.e. open), it is forgotten about and not closed. Isn't this a potential file handle leak? Chris Selwyn ___ 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] Open file leak in Drools Compiler
Isn't it regarded as bad practice to rely on the finalize() method called by the garbage collector to release such resources? Chris On 16/03/2011 17:04, Greg Barton wrote: Only if garbage collection never runs. Then you'd already be in trouble. :) --- On Wed, 3/16/11, Chris Selwynch...@selwyn-family.me.uk wrote: From: Chris Selwynch...@selwyn-family.me.uk Subject: [rules-users] Open file leak in Drools Compiler To: Drools usersrules-users@lists.jboss.org Date: Wednesday, March 16, 2011, 11:49 AM I am running Drools (actually JBoss Rules 5.1.0 ) in Glassfish. My deployable is an EJB that uses a StatelessKnowledgeSession to run some rules that I get from a KnowledgeAgent that has a Changeset with a .drl in it. Therefore, I have placed the drools compiler into the deployable and it all appears to work. Glassfish has a clever little mechanism that, when you unload a deployable that had some open streams, it tells you all about it (and kindly closes them). Glassfish is reporting that InputStreams are being left open that were opened in the isPackage() method of org.drools.commons.jci.compilers.EclipseJavaCompiler. That method has the following code in it:- final InputStream is = pClassLoader.getResourceAsStream(ClassUtils.convertClassToResourcePath(pClazzName)); if (is != null) { return false; } So, when is is not null (i.e. open), it is forgotten about and not closed. Isn't this a potential file handle leak? Chris Selwyn ___ 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 - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1498/3509 - Release Date: 03/15/11 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Problems with Guided Rule Editor in Eclipse
I was pretty sure to have seen something about sample BRL from Guvnor appears in error in eclipse. I can find some on JIRA, but never the same problem I have ... May be on another forum, but not JIRA ... Anyway, my problem is using DSL in BRL opened with eclipse plugin Guided Editor. Seems that the transformation to DRL is incomplete for DSL sentences, and action part cannot add DSL sentences. I will try with the last version and see if it is still there, and then post a clear new JIRA... But, re-reading your post, may be your problem is different ... As far I can remember, BRL with no DSL in it works ok ... try to copy your generated DRL in a new DRL file to see what happens ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Open file leak in Drools Compiler
Yes, but it's not a full blown leak. Wrapping stream use in a try/finally block is best. Feel free and open a JIRA to fix it. There may be other instances. --- On Wed, 3/16/11, Chris Selwyn ch...@selwyn-family.me.uk wrote: From: Chris Selwyn ch...@selwyn-family.me.uk Subject: Re: [rules-users] Open file leak in Drools Compiler To: Rules Users List rules-users@lists.jboss.org Cc: Greg Barton greg_bar...@yahoo.com Date: Wednesday, March 16, 2011, 12:18 PM Isn't it regarded as bad practice to rely on the finalize() method called by the garbage collector to release such resources? Chris On 16/03/2011 17:04, Greg Barton wrote: Only if garbage collection never runs. Then you'd already be in trouble. :) --- On Wed, 3/16/11, Chris Selwynch...@selwyn-family.me.uk wrote: From: Chris Selwynch...@selwyn-family.me.uk Subject: [rules-users] Open file leak in Drools Compiler To: Drools usersrules-users@lists.jboss.org Date: Wednesday, March 16, 2011, 11:49 AM I am running Drools (actually JBoss Rules 5.1.0 ) in Glassfish. My deployable is an EJB that uses a StatelessKnowledgeSession to run some rules that I get from a KnowledgeAgent that has a Changeset with a .drl in it. Therefore, I have placed the drools compiler into the deployable and it all appears to work. Glassfish has a clever little mechanism that, when you unload a deployable that had some open streams, it tells you all about it (and kindly closes them). Glassfish is reporting that InputStreams are being left open that were opened in the isPackage() method of org.drools.commons.jci.compilers.EclipseJavaCompiler. That method has the following code in it:- final InputStream is = pClassLoader.getResourceAsStream(ClassUtils.convertClassToResourcePath(pClazzName)); if (is != null) { return false; } So, when is is not null (i.e. open), it is forgotten about and not closed. Isn't this a potential file handle leak? Chris Selwyn ___ 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 - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1498/3509 - Release Date: 03/15/11 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Open file leak in Drools Compiler
This is JCI code that we inline. We should probably check if there is a new JCI version that fixes the problem if it is indeed a problem. Can I ask you please to open a JIRA with the info you reported here? Thanks, Edson 2011/3/16 Greg Barton greg_bar...@yahoo.com Yes, but it's not a full blown leak. Wrapping stream use in a try/finally block is best. Feel free and open a JIRA to fix it. There may be other instances. --- On Wed, 3/16/11, Chris Selwyn ch...@selwyn-family.me.uk wrote: From: Chris Selwyn ch...@selwyn-family.me.uk Subject: Re: [rules-users] Open file leak in Drools Compiler To: Rules Users List rules-users@lists.jboss.org Cc: Greg Barton greg_bar...@yahoo.com Date: Wednesday, March 16, 2011, 12:18 PM Isn't it regarded as bad practice to rely on the finalize() method called by the garbage collector to release such resources? Chris On 16/03/2011 17:04, Greg Barton wrote: Only if garbage collection never runs. Then you'd already be in trouble. :) --- On Wed, 3/16/11, Chris Selwynch...@selwyn-family.me.uk wrote: From: Chris Selwynch...@selwyn-family.me.uk Subject: [rules-users] Open file leak in Drools Compiler To: Drools usersrules-users@lists.jboss.org Date: Wednesday, March 16, 2011, 11:49 AM I am running Drools (actually JBoss Rules 5.1.0 ) in Glassfish. My deployable is an EJB that uses a StatelessKnowledgeSession to run some rules that I get from a KnowledgeAgent that has a Changeset with a .drl in it. Therefore, I have placed the drools compiler into the deployable and it all appears to work. Glassfish has a clever little mechanism that, when you unload a deployable that had some open streams, it tells you all about it (and kindly closes them). Glassfish is reporting that InputStreams are being left open that were opened in the isPackage() method of org.drools.commons.jci.compilers.EclipseJavaCompiler. That method has the following code in it:- final InputStream is = pClassLoader.getResourceAsStream(ClassUtils.convertClassToResourcePath(pClazzName)); if (is != null) { return false; } So, when is is not null (i.e. open), it is forgotten about and not closed. Isn't this a potential file handle leak? Chris Selwyn ___ 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 - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1498/3509 - Release Date: 03/15/11 ___ 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] Basic doubt regarding Drools Fusion - @expires
By default, Drools does not start any internal thread, so that you can embed it in non-multithread applications or in JEE containers. That means that the actual release of events in such cases depends on triggers. In your example, after 1h has passed, whenever something happens to the session (a new rule is fired, a new event is inserted, the session clock is advanced, etc), the event will be expired as part of the action. Remember though that it only happens when running in STREAM mode. In CLOUD mode, event garbage collection does not make sense and will not happen. Edson 2011/3/16 Makewise - Vitor Rui Mendonça vitor.mendo...@brisa.pt Hi all! I’ve got a really basic doubt… I’ve read several documentation regarding it but I think I need some advice here… Imagine that I have an event: *declare* A @role( event ) @expires( 1h ) *end* On my Java code, I call “fireAllRules()” method every time that I put an event into the working memory. My doubt: When does event A expires? a) One hour after it was inserted (time-based and without the “fireAllRules()” method call) or b) by calling “fireAllRules()” method (event-based) T.I.A. Vítor Mendonça Moreira *Analista / Programador Direcção de Investigação e Desenvolvimento* Rua Dr. Francisco Sá Carneiro, nº. 4 r/c esq. 2500 - 206 - Caldas da Rainha Tel: (+351) 262 832 196 Fax: (+351) 262 186 455 Web: www.makewise.pt Uma empresa: Grupo Sousa Pedro http://www.sousapedro.com -- Declaração: A informação contida nesta mensagem, e os ficheiros anexos, é privilegiada e confidencial, destinando-se exclusivamente ao(s) destinatário(s).Se não é o destinatário (ou o responsável pela sua entrega ao destinatário) e recebeu a mesma por engano, fica notificado que é estritamente proibido reproduzir, guardar ou distribuir toda ou qualquer parte desta mensagem e ficheiros anexos.Por favor reencaminhe a mensagem para o responsável pelo seu envio ou contacte-nos por telefone e elimine a mensagem e ficheiros anexos do seu computador,sem os reproduzir. Disclaimer: The information contained in this message, and any files attached, is privileged and confidential, and intended exclusively for the included addresses.If you are not the intended recipient (or the person responsible for delivering to the intended recipient) and received this message by mistake, be aware that copy, storage, distribution or any other use of all or part of this message and the files attached is strictly prohibited. Please notify the sender by reply e-mail or contact us by telephone and delete this message and the files attached, without retaining a copy. -- ___ 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 image001.jpgimage002.jpg___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Problems with Guided Rule Editor in Eclipse
I'm working in Eclipse only right now, but not using DSL for this particular situation (yet). I've manage to make the error go away by removing the package name from drools.package, however, when I attempt to run the code that builds the application to run the rule, it fails to resolve the Object (Fact) used in the rule. Copying the generated DRL to a .drl file works fine. Date: Wed, 16 Mar 2011 18:20:33 +0100 From: Vincent Legendre vincent.legen...@eurodecision.com Subject: Re: [rules-users] Problems with Guided Rule Editor in Eclipse To: Rules Users List rules-users@lists.jboss.org Message-ID: 4d80f161.3080...@eurodecision.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed I was pretty sure to have seen something about sample BRL from Guvnor appears in error in eclipse. I can find some on JIRA, but never the same problem I have ... May be on another forum, but not JIRA ... Anyway, my problem is using DSL in BRL opened with eclipse plugin Guided Editor. Seems that the transformation to DRL is incomplete for DSL sentences, and action part cannot add DSL sentences. I will try with the last version and see if it is still there, and then post a clear new JIRA... But, re-reading your post, may be your problem is different ... As far I can remember, BRL with no DSL in it works ok ... try to copy your generated DRL in a new DRL file to see what happens ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Problem with CommandFactory.newStartProcess in 5.2 M1
There appears to be a problem with CommandFactory.newStartProcess in Drools 5.2 M1. If I do this: String someString = Some String; MapString, Object variables = new HashMapString, Object(); variables.put(someString, someString); ListCommand? cmds = new ArrayListCommand?(); cmds.add(CommandFactory.newStartProcess(SampleFlow, variables)); cmds.add(CommandFactory.newFireAllRules()); The default value for the someString variable in SampleFlow does NOT get updated. However, if I do this: String someString = Some String; MapString, Object variables = new HashMapString, Object(); variables.put(someString, someString); ListCommand? cmds = new ArrayListCommand?(); StartProcessCommand cmd = new StartProcessCommand(); cmd.setProcessId(SampleFlow); cmd.setParameters(variables); cmds.add(cmd); cmds.add(CommandFactory.newFireAllRules()); the someString variable does get updated. However, StartProcessCommand is not intended to be used (Discouraged Access), so I don't want to use this solution. Dan ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] drools design question
Hi, We are developing an insurance application and we have decided to use drool rules for our business rules Now, we could have global business rules(applies to all states), specific to state, specific to factor X, specific to factor Y etc. This way we are expecting many drl files. Now, when the application runs, we would know the values for state, factor X, factor Y etc. and using these values we would determine(using database) which drl files to load dynamically and just run the rules in those drls. Is this approach recommended? Do you have any suggestions? Thanks -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drools-design-question-tp2691182p2691182.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] Problem with CommandFactory.newStartProcess in 5.2 M1
That's weird, I'm looking at the master repository and that's exactly what the newStartProcess do: public Command newStartProcess(String processId, MapString, Object parameters) { StartProcessCommand startProcess = new StartProcessCommand(); startProcess.setProcessId(processId); startProcess.setParameters((HashMapString, Object) parameters); return startProcess; } Let me check out the 5.2 M1 tag 2011/3/16 Seaver, Daniel (GE Healthcare) dan.sea...@ge.com There appears to be a problem with CommandFactory.newStartProcess in Drools 5.2 M1. If I do this: String someString = Some String; MapString, Object variables = *new* HashMapString, Object(); variables.put(someString, someString); ListCommand? cmds = *new* ArrayListCommand?(); cmds.add(CommandFactory.newStartProcess(SampleFlow, variables)); cmds.add(CommandFactory.*newFireAllRules*()); The default value for the someString variable in SampleFlow does NOT get updated. However, if I do this: String someString = Some String; MapString, Object variables = *new* HashMapString, Object(); variables.put(someString, someString); ListCommand? cmds = *new* ArrayListCommand?(); StartProcessCommand cmd = *new* StartProcessCommand(); cmd.setProcessId(SampleFlow); cmd.setParameters(variables); cmds.add(cmd); cmds.add(CommandFactory.*newFireAllRules*()); the someString variable does get updated. However, StartProcessCommand is not intended to be used (Discouraged Access), so I don’t want to use this solution. *Dan* ___ 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] Custom dates with @date-effective and @date-expires
Hi, Can I use any arbitrary date for the drools execution so that correct rules are fired based on not current date but any arbitrary date? This is in the context of @date-effective and @date-expires metadata that can be specified as part of a rule. Drools expert documentation seems to imply that this metadata uses current date though I am not clear what current date (system date?) means. Thanks Faisal Shafique ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] drools design question
You could also use drools (maybe a decision table) to select the different drl files. Best regards, El mar 16, 2011 8:24 p.m., marunam suta...@gmail.com escribió: Hi, We are developing an insurance application and we have decided to use drool rules for our business rules Now, we could have global business rules(applies to all states), specific to state, specific to factor X, specific to factor Y etc. This way we are expecting many drl files. Now, when the application runs, we would know the values for state, factor X, factor Y etc. and using these values we would determine(using database) which drl files to load dynamically and just run the rules in those drls. Is this approach recommended? Do you have any suggestions? Thanks -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drools-design-question-tp2691182p2691182.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] Problem with CommandFactory.newStartProcess in 5.2 M1
Cool.. let me see... I don't have eclipse.. but I will take a look at the class.. Greetings. On Wed, Mar 16, 2011 at 11:00 PM, Seaver, Daniel (GE Healthcare) dan.sea...@ge.com wrote: I’ve attached an eclipse project that demonstrates the problem if you’d like to see it with your own eyes. Take a look at CmdStyleRuleFlowTest.java. *Dan* *From:* Mauricio Salatino [mailto:sala...@gmail.com] *Sent:* Wednesday, March 16, 2011 4:28 PM *To:* Rules Users List *Cc:* Seaver, Daniel (GE Healthcare) *Subject:* Re: [rules-users] Problem with CommandFactory.newStartProcess in 5.2 M1 That's weird, I'm looking at the master repository and that's exactly what the newStartProcess do: public Command newStartProcess(String processId, MapString, Object parameters) { StartProcessCommand startProcess = new StartProcessCommand(); startProcess.setProcessId(processId); startProcess.setParameters((HashMapString, Object) parameters); return startProcess; } Let me check out the 5.2 M1 tag 2011/3/16 Seaver, Daniel (GE Healthcare) dan.sea...@ge.com There appears to be a problem with CommandFactory.newStartProcess in Drools 5.2 M1. If I do this: String someString = Some String; MapString, Object variables = *new* HashMapString, Object(); variables.put(someString, someString); ListCommand? cmds = *new* ArrayListCommand?(); cmds.add(CommandFactory.newStartProcess(SampleFlow, variables)); cmds.add(CommandFactory.*newFireAllRules*()); The default value for the someString variable in SampleFlow does NOT get updated. However, if I do this: String someString = Some String; MapString, Object variables = *new* HashMapString, Object(); variables.put(someString, someString); ListCommand? cmds = *new* ArrayListCommand?(); StartProcessCommand cmd = *new* StartProcessCommand(); cmd.setProcessId(SampleFlow); cmd.setParameters(variables); cmds.add(cmd); cmds.add(CommandFactory.*newFireAllRules*()); the someString variable does get updated. However, StartProcessCommand is not intended to be used (Discouraged Access), so I don’t want to use this solution. *Dan* ___ 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 - -- - 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] Problems with Guided Rule Editor in Eclipse
In experimenting with my own Guided editor files I am trying both the Fact and Condition sentences to use the Guided editor in Eclipse without typing any DRL or Java by prospective business users. I have a Java project with classes that are imported by a rule project with drools.package (and the imports), a dsl file, and a guided rule (.brl) file. The most obvious odd thing is that when using while the Fact menu, the menu is populated correctly, but my int field is being surrounded by quotes in the translated drl (i.e., it is translated as a string). This is despite the fact that relational operators are presented for the field, but string operators for string fields. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Problems-with-Guided-Rule-Editor-in-Eclipse-tp2683535p2692235.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] [Urgent] Error in ontext assist in DSLR Editor
I am seeing this behavior in 5.1.1 - it is as if the context sensitivity is far to greedy for replacement. Since this may not have been clearly understood from the original posting, if I have There is an {Instance} with field of {value} and my cursor is at the end of the line and I select, using control-space in the editor whose name is {name} it produces Twhose name is {name} instead of appending whose name is {name} Is this intended behavior? It effectively prohibits nesting dsl expressions when using the dslr editor. This seems like something a JIRA would have been written on to handle by now. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Urgent-Error-in-ontext-assist-in-DSLR-Editor-tp54560p2692264.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