Re: [rules-users] Human Task - ERROR : JPAKnowledgeService.newStatefulKnowledgeSession ...
i share persistence.xmlhere yes i configure the persistence with JTA but i dont sure about correctness of it ! i have some other files beside persistence.xml that maybe can help : ormTask.xml JBPMorm.xml jboss-web.xml Thanks S.M.H.Jamali From: Mauricio Salatino sala...@gmail.com To: S.M.H.Jamali cpp...@yahoo.com; Rules Users List rules-users@lists.jboss.org Sent: Wednesday, November 9, 2011 8:22 PM Subject: Re: [rules-users] Human Task - ERROR : JPAKnowledgeService.newStatefulKnowledgeSession ... You will need to solve that problem. looks like a configuration problem, can you share the persistence.xml file? did you configure persistence with JTA? Cheers 2011/11/9 S.M.H.Jamali cpp...@yahoo.com Hello all, I get an exception while last line of below method executed : public StatefulKnowledgeSession createSession() throws Exception { /* * Create the knowledgebase using the required bpmn and drl files */ KnowledgeBase kbase = readKnowledgeBase(HumanTask.bpmn); EntityManagerFactory emf = Persistence.createEntityManagerFactory( org.jbpm.persistence.jpa ); Environment env = KnowledgeBaseFactory.newEnvironment(); env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf ); env.set( EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager() ); env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() ); Properties properties = new Properties(); properties.put(drools.processInstanceManagerFactory, org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory); properties.put(drools.processSignalManagerFactory, org.jbpm.persistence.processinstance.JPASignalManagerFactory); KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties); return JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env); } its stack-trace is : 14:26:13,111 WARN [JtaTransactionManager] Participating in existing JTA transaction, but no JTA TransactionManager or TransactionSychronizationRegistry available: java.lang.NullPointerException at org.drools.persistence.jta.JtaTransactionManager.registerTransactionSynchronization(JtaTransactionManager.java:221) at org.drools.persistence.SingleSessionCommandService.registerRollbackSync(SingleSessionCommandService.java:333) at org.drools.persistence.SingleSessionCommandService.init(SingleSessionCommandService.java:123) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)... Can anyone help me to solve this problem ? Thanks in advance S.M.H.Jamali ___ 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.jugargentina.org - 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] Security test cases for Drools
If you are allowing customers to define their own rules then you are effectively allowing them to execute any arbitrary java statements. You either need to have someone review and check all their rules before they are applied, restrict what they can do to the UI to such a level you are sure they can't compromise it (perhaps DSL might work?), sanatize there input to a whitelist of statements (probably no eval and very limited in what they can put in the then part, or you could go the whole hog and setup a java security sandbox and classloaders to place limits on what operations they can do - though even then you need to design it carefully so they can't modify any of your application state. Thomas -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users- boun...@lists.jboss.org] On Behalf Of kapokfly Sent: 09 November 2011 17:10 To: rules-users@lists.jboss.org Subject: Re: [rules-users] Security test cases for Drools Thanks Edson. We are developing a web based UI (if possible embed guvnor into our application) and open the ability to customers to define their own rules, so a company policy on this won't work. Will evaluate other concern points and have more discussions on this. Ivan -- View this message in context: http://drools.46999.n3.nabble.com/Security- test-cases-for-Drools-tp3494072p3494170.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00 ** ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Security test cases for Drools
Thanks Thomas. We are in the middle to design both the strategy to secure ourselves and the test cases need to be covered, do you have some kind of references available for us otherwise we will work out our version. - Ivan, your Panda, forever -- View this message in context: http://drools.46999.n3.nabble.com/Security-test-cases-for-Drools-tp3494072p3496169.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Data Modeling for medical expert system
Hi Davide, thank you for your advices. I'll give it a shot and will share my experiences. Sincerly On Wed, 9 Nov 2011 10:38:35 -0800 (PST), Davide Sottara wrote: Tohu is a relatively old, unofficial and inactive project. We're refactoring that as drools-informer, but that's work in progress and I'm not sure the jQuery web client that comes with tohu would still work. So I'd recommend to stick to tohu for your thesis (especially giving your time constraints :)) Feel free to contact me (dso...@gmail.com) if you have questions. I'm sort-of-in-co-charge of monitoring drools research and I normally tutor bachelor/master students at the university. So, I'd be happy to share advice in exchange for information on where and how drools is being used as a research platform ;) -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Data-Modeling-for-medical-expert-system-tp3490855p3494429.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Dirk Conzelmann IT-Services Telefon: +49.179.2237995 Email: i...@dirk-conzelmann.de Web: www.dirk-conzelmann.de ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Writing complicated rules - consecutive number problem
Thomas I have implemented a solution based on your response, for the 'not' part of the rule I used ... there must be a person one year younger OR one year older - to allow for the oldest and younget person at each end of the list. It seems to work well, thank you both so much for helping. -- View this message in context: http://drools.46999.n3.nabble.com/Writing-complicated-rules-consecutive-number-problem-tp3482704p3496358.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] [Planner] CachedMoveFactory drive to Corrupted undo move
Thanks for your response. I'have juste test you proposition of method on assigment, and i've got the same error. I also test with a simplier rule set : Juste 1 rule : (and the two for scoreCalculator of course) rule notPlannified when $assigment: Assigment() then insertLogical(new IntConstraintOccurrence(notPlannified, ConstraintType.NEGATIVE_SOFT, 50, $assigment)); I desactivate the solverScope.calculateScoreFromWorkingMemory(); call in UI, juste in case. I check my cloneSolution : i juste clone the assigment object and copy the score. equals and hashcode are ok on assigment and move object. No overrided equals and hashcode on other facts, but since i don't recreate nor clone them, i think it's unnecessary. (In fact i don't really understand where hashcode and equals was really necessary since the working memory keep same instances). -- View this message in context: http://drools.46999.n3.nabble.com/Planner-CachedMoveFactory-drive-to-Corrupted-undo-move-tp3495070p3496696.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] [Planner] CachedMoveFactory drive to Corrupted undo move
Try with environmentMode set to TRACE. It might fail-faster with a clearer message about what's going wrong. Op 10-11-11 14:18, npiedeloup schreef: Thanks for your response. I'have juste test you proposition of method on assigment, and i've got the same error. I also test with a simplier rule set : Juste 1 rule : (and the two for scoreCalculator of course) rule notPlannified when $assigment: Assigment() then insertLogical(new IntConstraintOccurrence(notPlannified, ConstraintType.NEGATIVE_SOFT, 50, $assigment)); I desactivate the solverScope.calculateScoreFromWorkingMemory(); call in UI, juste in case. I check my cloneSolution : i juste clone the assigment object and copy the score. equals and hashcode are ok on assigment and move object. No overrided equals and hashcode on other facts, but since i don't recreate nor clone them, i think it's unnecessary. (In fact i don't really understand where hashcode and equals was really necessary since the working memory keep same instances). -- View this message in context: http://drools.46999.n3.nabble.com/Planner-CachedMoveFactory-drive-to-Corrupted-undo-move-tp3495070p3496696.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- With kind regards, Geoffrey De Smet ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] NPE while creating Session using SimpleCredentials
Hi, I am getting NPE at line 3, I doubt if SimpleCredentials is an issue over here. Please provide inputs if someone has faced the same. try { Repository repository = configurator.getJCRRepository( repositoryHomeDirectory ); Credentials credentials = new SimpleCredentials(admin, admin.toCharArray()); //line 3 Session session = repository.login(credentials, production); Node node = session.getRootNode(); System.out.println(root node path: + node.getPath()); } catch (Exception e) { e.printStackTrace(); } TIA. Regards, Praveen. -- View this message in context: http://drools.46999.n3.nabble.com/NPE-while-creating-Session-using-SimpleCredentials-tp3496768p3496768.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] A little suggestion about the 'ResourceFactory', 'DrlParser' API
Maybe there is something I don't understand, but I also have the impression that encoding management is strange in Drools. The lexer = new DRLLexer( new ANTLRInputStream( is ) ); line indeed leads to using the default encoding of the machine. It is the same for the CSV parser (rule templates, Drools 5.1.1): public void parseFile(final InputStream inStream) { final BufferedReader reader = new BufferedReader(new InputStreamReader(inStream)); It means that if I write my rule on a Windows machine (CP1252) and deploy it on a Linux server (UTF-8), it will not work as expected. Conditions like...: Person(firstname == Béatrice) ... will become things like (CP1252 file transported onto a UTF-8 platform and read as UTF-8) : Person(firstname == B¤atrice) I wonder how you deal with that in Guvnor. Best regards, Bruno. Le 10/11/2011 06:47, Miles Wen a écrit : Would you please provide a method in 'org.drools.io.ResourceFactory' like this: public static Resource newReaderResource(InputStream stream, String encoding); then I can use this method to load drl files as a stream while explicitly specify its ecoding? And in line: 287 of class 'org.drools.compiler.DrlParser': lexer = new DRLLexer( new ANTLRInputStream( is ) ); no encoding specified as well. The ANTLRInputStream has constructors which allows you to specify the encoding, otherwise it would figure out the encoding according to the environment, which is unpredictable some times. I'm using drools 5.3.0, the newest version. Thosse problems exists for quite a while during previous versions. I'm fainting to see they are almost there after upgraded to the new version. -- Regards. Miles. Wen ___ 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] Bugs in Drools 5.3.0 break Fusion event processing
Thanks Richard, I will fix them for the next release. Edson 2011/11/9 Richard Calmbach rcalm...@gmail.com Edson: Thanks for the quick reply. I created these JIRA issues: F1: Duplicate job scheduling in org.drools.time.impl.DefaultTimerJobInstance.call() - https://issues.jboss.org/browse/JBRULES-3284 F2: NullPointerException in org.drools.time.impl.DefaultTimerJobInstance.compareTo(DefaultTimerJobInstance) - https://issues.jboss.org/browse/JBRULES-3285 F3: org.drools.time.TimerService.scheduleJob(Job, JobContext, Trigger) suddenly requires non-null JobContext - https://issues.jboss.org/browse/JBRULES-3286 While you are working on the event scheduling system, you may also want to look at these two earlier bug reports for Drools 5.2.0: Long.MAX_VALUE duration for A and not(B after A) type rules causes invalid session clock time in rule RHS when running with pseudo clock - https://issues.jboss.org/browse/JBRULES-3100 A and not(B after A) type rules don't fire when session clock has negative values (pre Unix epoch) - https://issues.jboss.org/browse/JBRULES-3103 I have not checked their status in Drools 5.3.0, but the description should tell you whether they still apply. FWIW, among all of these, F2 (JBRULES-3285) has the highest priority (as it's breaking my unit tests), followed by F1 (JBRULES-3284). Thanks! Vincent: Yes, I think there is risk. Even if you don't use jobs explicitly, Drools uses the same event scheduling system for both internal events and application-defined events and jobs. The main problem is this: How do you establish correctness of your code and the overall system? Well, you make sure your unit tests and functional tests pass. As it stands, I cannot get my tests to pass with Drools 5.3.0, so I cannot put Drools 5.3.0 in production. No matter which version you use, only good test coverage will give you the assurance that your system is functioning properly. I encourage you to try out Drools 5.3.0 (in a test environment) and to report any issues you run into. It can only help make Drools better. 2011/11/9 Vincent LEGENDRE vincent.legen...@eurodecision.com Just wondering : does these problems happends because you use clocks and jobs, or is it general to fusion 5.3 ? Did not migrate my project on 5.3 for now. So do you think there is a risk, knowing that I only use very basic fusion features ? -- *De: *Edson Tirelli ed.tire...@gmail.com *À: *Rules Users List rules-users@lists.jboss.org *Envoyé: *Mercredi 9 Novembre 2011 14:53:00 *Objet: *Re: [rules-users] Bugs in Drools 5.3.0 break Fusion event processing Richard, This is great info. Yes, please open JIRA's for all 3 issues and we will make sure this is fixed for the next release. Thank you, Edson ___ 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] Preventing re-evaluation on modification of 'output' fact
Thanks for the feedback. Wolfgang, that's a good thought, but we do need to do some re-evaluation along the way - just not as much as we're doing right now - so the 'dirty update' approach doesn't seem applicable here. Robert, your post got me thinking. If I'm interpreting what you're saying correctly - Drools is smart enough to know which rules depend on which types of objects in their LHS, so if you modify an object of a particular type, only the rules that depend on that type get re-evaluated. It seems completely logical, but I hadn't thought about it that way. Am I understanding the mechanics correctly? If so, I think we need to re-design our 'output' fact a bit. It currently contains several lists of codes - 2 lists for the order, 1 for the buyer, and 1 for each of the recipients. It's bound to a variable in the LHS of nearly every rule and is updated in the RHS of a majority of them, which I now realize is causing nearly every rule to be re-evaluated after the firing of a majority of the rules. As a result, performance deteriorates rapidly as the number of facts grows. I'm thinking that we should put the lists of suspect codes directly into the facts that they're related to so that when a list is updated, only the rules that care about that type of fact will get re-evaluated. We'd get rid of the 'output' fact altogether and instead, after the fireAllRules() call completes, we'd iterate through all of the facts we put into the rules engine and retrieve the lists of codes from each. How does this approach sound? -- View this message in context: http://drools.46999.n3.nabble.com/Preventing-re-evaluation-on-modification-of-output-fact-tp3455022p3497378.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Import static or function in rules-flow constraint?
I am building a version 5.1 (.bpmn file extension) rules-flow diagram using the Eclipse plugin. I am writing rules based constraints (as opposed to code constraints), and I would like to call a static Java method from some of my constraints. If I was working in a .drl file, and I wanted to call a static method in my LHS, I could use one of the following, in the import section of the file: import static my.package.MyClass.SomeStaticFunction or import function my.package.MyClass.SomeStaticFunction If I open a constraint, and open the Imports editor, I can add imports for classes. If I add the first import above to this dialog, and save the .bpmn file, when I open the Imports editor again, I have the following: import static and no reference to the function. If I add the second import above in the same place, when I save and reopen the dialog, the import function line is completely gone. I can't see any reference to the function in the .bpmn file opened in a text editor, either. Is this the expected behavior? If so, how can I call a static Java method from my constraint? Do I have to reference the full package path of the method? Can I only do this from a Java code constraint? The documentation is silent on the topic of importing a function for rules constraint, although it says the format is the same as the LHS of a rule in a .drl file. I'm using Drools version 5.3.0.Final. -- View this message in context: http://drools.46999.n3.nabble.com/Import-static-or-function-in-rules-flow-constraint-tp3497558p3497558.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Using Drools with JSP application.
Hello Everyone, I am learning Drools engine and have come across an issue.I am not able to configure the Rules,for using it in a web application.I want a UI from which the user selects some values and based on it the rules are executed by drools.I studied the examples and got them working but they seem to be worked with standalone features.I would like to seek some help over it. Use Case: A html-jsp form having a select box for states of a country. When user selects a state,candidates from that state should be displayed by the rule engine. I have got the database connection working,but not able to configure rules over jsp.I am using a Apache tomcat 5.0 server. Thanks Sachin -- View this message in context: http://drools.46999.n3.nabble.com/Using-Drools-with-JSP-application-tp3498955p3498955.html Sent from the Drools: User forum mailing list archive at Nabble.com.___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Orxy Designer
Thanks for ur info i have just created a work def item so i got email task in the left -- View this message in context: http://drools.46999.n3.nabble.com/Orxy-Designer-tp3492716p3498993.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Using Drools with JSP application.
Drools is a library you can use in Java applications. You should therefore be able to reference in your Tomcat web-application by adding the necessary JARS to your WEB-INF/lib folder. Your JSPs should then be able to create or reference a KnowledgeBase, create Sessions and perform the necessary function you describe. I assume you know how to write a web application with Java. With kind regards, Mike 2011/11/11 sachintaware sachitawar...@gmail.com Hello Everyone, I am learning Drools engine and have come across an issue.I am not able to configure the Rules,for using it in a web application.I want a UI from which the user selects some values and based on it the rules are executed by drools.I studied the examples and got them working but they seem to be worked with standalone features.I would like to seek some help over it. Use Case: A html-jsp form having a select box for states of a country. When user selects a state,candidates from that state should be displayed by the rule engine. I have got the database connection working,but not able to configure rules over jsp.I am using a Apache tomcat 5.0 server. Thanks Sachin -- View this message in context: Using Drools with JSP application.http://drools.46999.n3.nabble.com/Using-Drools-with-JSP-application-tp3498955p3498955.html Sent from the Drools: User forum mailing list archivehttp://drools.46999.n3.nabble.com/Drools-User-forum-f47000.htmlat 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] ClassLoader parameter and Init function of RuleBaseConfiguration
*push* -- View this message in context: http://drools.46999.n3.nabble.com/ClassLoader-parameter-and-Init-function-of-RuleBaseConfiguration-tp3489741p3499019.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Using Drools with JSP application.
Thank you for the prompt response Mike :) What I get by you say is that I should create a Web-Application project in eclipse and not a Drools project(What traditionally examples show in the documentation) and import the necessary JAR'S from the Drools directory(Drools expert directory downloaded).br/ This should allow me to create the .DRL files writing rules and creating knowledge sessions using the jsp files that are created the projects.br/ What I tried was creating a drools project and replacing the .java files with .jsp which certainly wont work!! :( *My Use Case:* br/ Creating a UI with a Select box which will have States of a country. When a user selects a state a rule from should display the candidates/users belonging to that state on the UI. -- View this message in context: http://drools.46999.n3.nabble.com/Using-Drools-with-JSP-application-tp3498955p3499025.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users