Re: [rules-users] Persistence in fireUntilHalt() loop
Has this been resolved in any official version of DROOLS/JBPM? I have a similar problem (spring/hibernate/Drools/JBPM) - transaction does not persist processinfo - I am trying to ascertain whether 1) This indeed is a problem (or whether I have to rather look at configuration) - although I agree with the OP's analysis. 2) If this is (was) a problem - is there a fix? (in which version?) 3) If not then I suppose I have to check out the source and change the code - is there consensus that the applied fix is one of the better ways to work around the problem? Thanks a million for your time and trouble! -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Persistence-in-fireUntilHalt-loop-tp3809352p4019838.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] rules file character encoding and spring
Something like ?xml version=1.0 encoding=utf-8? which should be present on any XML file... On 19/09/2012, Joachim Van der Auwera joac...@progs.be wrote: I have a rules description like this: drools:kbase id=bodKBase drools:resources drools:resource type=DRL source=classpath:be/vlaanderen/awv/dc/bod/rule/Dienstbevel.drl/ drools:resource type=DRL source=classpath:be/vlaanderen/awv/dc/bod/rule/Kostenberekening.drl/ /drools:resources /drools:kbase How can I specify the character encoding for this? It is working fine on linux (everything is UTF-8), but gives a problem on Windows machine where it complains about the character set. Thanks for the help. Kind regards, Joachim ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rules file character encoding and spring
Maybe I was not clear. The XML is parsing just fine. The problem is with the parsing of the drl file. I think it would be useful to be able to indicate the character encoding which is used for the drl file. Is there a way to specify this using the spring configuration? Kind regards, Joachim On 19-09-12 12:26, Wolfgang Laun wrote: Something like ?xml version=1.0 encoding=utf-8? which should be present on any XML file... On 19/09/2012, Joachim Van der Auwera joac...@progs.be wrote: I have a rules description like this: drools:kbase id=bodKBase drools:resources drools:resource type=DRL source=classpath:be/vlaanderen/awv/dc/bod/rule/Dienstbevel.drl/ drools:resource type=DRL source=classpath:be/vlaanderen/awv/dc/bod/rule/Kostenberekening.drl/ /drools:resources /drools:kbase How can I specify the character encoding for this? It is working fine on linux (everything is UTF-8), but gives a problem on Windows machine where it complains about the character set. Thanks for the help. Kind regards, Joachim ___ 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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rules file character encoding and spring
I don't think it can. Perhaps the best way would be to write the DRL so that its character set is not subject to misinterpretation by an encoding selected due to some locale setting. Which characters cause the problems? -W On 19/09/2012, Joachim Van der Auwera joac...@progs.be wrote: Maybe I was not clear. The XML is parsing just fine. The problem is with the parsing of the drl file. I think it would be useful to be able to indicate the character encoding which is used for the drl file. Is there a way to specify this using the spring configuration? Kind regards, Joachim On 19-09-12 12:26, Wolfgang Laun wrote: Something like ?xml version=1.0 encoding=utf-8? which should be present on any XML file... On 19/09/2012, Joachim Van der Auwera joac...@progs.be wrote: I have a rules description like this: drools:kbase id=bodKBase drools:resources drools:resource type=DRL source=classpath:be/vlaanderen/awv/dc/bod/rule/Dienstbevel.drl/ drools:resource type=DRL source=classpath:be/vlaanderen/awv/dc/bod/rule/Kostenberekening.drl/ /drools:resources /drools:kbase How can I specify the character encoding for this? It is working fine on linux (everything is UTF-8), but gives a problem on Windows machine where it complains about the character set. Thanks for the help. Kind regards, Joachim ___ 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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rules file character encoding and spring
Accented characters cause problems, for example éèë Kind regards, Joachim On 19-09-12 13:42, Wolfgang Laun wrote: I don't think it can. Perhaps the best way would be to write the DRL so that its character set is not subject to misinterpretation by an encoding selected due to some locale setting. Which characters cause the problems? -W On 19/09/2012, Joachim Van der Auwera joac...@progs.be wrote: Maybe I was not clear. The XML is parsing just fine. The problem is with the parsing of the drl file. I think it would be useful to be able to indicate the character encoding which is used for the drl file. Is there a way to specify this using the spring configuration? Kind regards, Joachim On 19-09-12 12:26, Wolfgang Laun wrote: Something like ?xml version=1.0 encoding=utf-8? which should be present on any XML file... On 19/09/2012, Joachim Van der Auwera joac...@progs.be wrote: I have a rules description like this: drools:kbase id=bodKBase drools:resources drools:resource type=DRL source=classpath:be/vlaanderen/awv/dc/bod/rule/Dienstbevel.drl/ drools:resource type=DRL source=classpath:be/vlaanderen/awv/dc/bod/rule/Kostenberekening.drl/ /drools:resources /drools:kbase How can I specify the character encoding for this? It is working fine on linux (everything is UTF-8), but gives a problem on Windows machine where it complains about the character set. Thanks for the help. Kind regards, Joachim ___ 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 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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rules file character encoding and spring
That much is clear, but are they part of String literals? Or identifiers? For String literals, consider using the Unicode escape (\u) or import them from Java public final statics. -W On 19/09/2012, Joachim Van der Auwera joac...@progs.be wrote: Accented characters cause problems, for example éèë Kind regards, Joachim On 19-09-12 13:42, Wolfgang Laun wrote: I don't think it can. Perhaps the best way would be to write the DRL so that its character set is not subject to misinterpretation by an encoding selected due to some locale setting. Which characters cause the problems? -W On 19/09/2012, Joachim Van der Auwera joac...@progs.be wrote: Maybe I was not clear. The XML is parsing just fine. The problem is with the parsing of the drl file. I think it would be useful to be able to indicate the character encoding which is used for the drl file. Is there a way to specify this using the spring configuration? Kind regards, Joachim On 19-09-12 12:26, Wolfgang Laun wrote: Something like ?xml version=1.0 encoding=utf-8? which should be present on any XML file... On 19/09/2012, Joachim Van der Auwera joac...@progs.be wrote: I have a rules description like this: drools:kbase id=bodKBase drools:resources drools:resource type=DRL source=classpath:be/vlaanderen/awv/dc/bod/rule/Dienstbevel.drl/ drools:resource type=DRL source=classpath:be/vlaanderen/awv/dc/bod/rule/Kostenberekening.drl/ /drools:resources /drools:kbase How can I specify the character encoding for this? It is working fine on linux (everything is UTF-8), but gives a problem on Windows machine where it complains about the character set. Thanks for the help. Kind regards, Joachim ___ 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 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 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] Issue with From Clause - Class Cast Error
Hi All, I am having a very strange issue with my knowledge base... I have the following Rule: ... rule root_host no-loop true ruleflow-group 'initialize-appliance-definitions' when $app:ApplianceType ( type == ApplianceTypeIdentifier.APPLIANCE_ROOT ); not( ApplianceTypeObject() from $app.getObjectTypes()); then //Do something end; ... And the ApplianceType class is defined as: ... public class ApplianceType { private ApplianceTypeIdentifier type; private ListApplianceTypeObject objectTypes; public ApplianceType(ApplianceTypeIdentifier type, ListApplianceTypeObject initialObjectTypes) { this.type = type; if(initialObjectTypes == null) this.objectTypes = new ArrayListApplianceTypeObject(); else this.objectTypes = initialObjectTypes; } public ApplianceType(ApplianceTypeIdentifier type) { this(type, null); } public ApplianceTypeIdentifier getType() { return type; } public ListApplianceTypeObject getObjectTypes() { return objectTypes; } } When attempting to fireAllRules() I receive the following error: ... Caused by: java.lang.ClassCastException: org.drools.reteoo.FromNode incompatible with org.drools.reteoo.BetaNode at org.drools.reteoo.ReteooBuilder.resetMasks(ReteooBuilder.java:303) at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:267) at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:459) at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:1107) at org.drools.common.AbstractRuleBase.mergePackage(AbstractRuleBase.java:851) at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:610) at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:472) at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:150) at com.q1labs.frameworks.drools.DroolsEngine.getKnowledgeBase(DroolsEngine.java:139) at com.q1labs.frameworks.drools.DroolsEngine.onInit(DroolsEngine.java:50) at com.q1labs.frameworks.naming.FrameworksNaming.initializeNewComponent(FrameworksNaming.java:951) ... 3 more Any thoughts? I have been using from clauses just like this throughout my project, and have had no issues with it to this point (even those which did not use generics). -- View this message in context: http://drools.46999.n3.nabble.com/Issue-with-From-Clause-Class-Cast-Error-tp4019846.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] Issue with From Clause - Class Cast Error
The stack trace is suggestive of more complexity than you describe with this simple rule and class. mergePackage, removeRule: these methods aren't called due to a simple fireAllRules() after inserting a few facts. What's really going on here - some dynamic reconfiguration of the KB? -W On 19/09/2012, tosmun taylor.os...@ca.ibm.com wrote: Hi All, I am having a very strange issue with my knowledge base... I have the following Rule: ... rule root_host no-loop true ruleflow-group 'initialize-appliance-definitions' when $app:ApplianceType ( type == ApplianceTypeIdentifier.APPLIANCE_ROOT ); not( ApplianceTypeObject() from $app.getObjectTypes()); then //Do something end; ... And the ApplianceType class is defined as: ... public class ApplianceType { private ApplianceTypeIdentifier type; private ListApplianceTypeObject objectTypes; public ApplianceType(ApplianceTypeIdentifier type, ListApplianceTypeObject initialObjectTypes) { this.type = type; if(initialObjectTypes == null) this.objectTypes = new ArrayListApplianceTypeObject(); else this.objectTypes = initialObjectTypes; } public ApplianceType(ApplianceTypeIdentifier type) { this(type, null); } public ApplianceTypeIdentifier getType() { return type; } public ListApplianceTypeObject getObjectTypes() { return objectTypes; } } When attempting to fireAllRules() I receive the following error: ... Caused by: java.lang.ClassCastException: org.drools.reteoo.FromNode incompatible with org.drools.reteoo.BetaNode at org.drools.reteoo.ReteooBuilder.resetMasks(ReteooBuilder.java:303) at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:267) at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:459) at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:1107) at org.drools.common.AbstractRuleBase.mergePackage(AbstractRuleBase.java:851) at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:610) at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:472) at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:150) at com.q1labs.frameworks.drools.DroolsEngine.getKnowledgeBase(DroolsEngine.java:139) at com.q1labs.frameworks.drools.DroolsEngine.onInit(DroolsEngine.java:50) at com.q1labs.frameworks.naming.FrameworksNaming.initializeNewComponent(FrameworksNaming.java:951) ... 3 more Any thoughts? I have been using from clauses just like this throughout my project, and have had no issues with it to this point (even those which did not use generics). -- View this message in context: http://drools.46999.n3.nabble.com/Issue-with-From-Clause-Class-Cast-Error-tp4019846.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Issue with From Clause - Class Cast Error
Thanks for the fast response! I'll attempt to post as much as I can, splicing out any case specific info. The Java code surrounding my invocation is as follows: = //Get a list of all knowledgebase resources ListFile kbList = config.getCompleteKBList(); //Note that this is a simply a collection of absolute file paths containing DRL and RF files if(kbList == null) throw new FrameworksException(Failed to get list of knowledgebase resources. Configuration returned null); //Add all of the resources we found for(File file : kbList) { if(file == null) continue; if(log.isDebugEnabled()) log.debug(Adding resource file: + file.getAbsolutePath()); if(file.getName().endsWith(KB_FILE_EXT)) kbBuilder.add(ResourceFactory.newFileResource(file), ResourceType.DRL); else if(file.getName().endsWith(RF_FILE_EXT)) kbBuilder.add(ResourceFactory.newFileResource(file), ResourceType.DRF); else throw new FrameworksException(Found invalid file in our knowledgebase list! It was: \ + file.getAbsolutePath() + \. This extension is not supported); // Check the builder for errors if (kbBuilder.hasErrors()) { throw new FrameworksException( + file.getAbsolutePath() + : Unable to compile knowledge base: + kbBuilder.getErrors().toString()); } } KnowledgeBase kb = kbBuilder.newKnowledgeBase(); kb.addKnowledgePackages(kbBuilder.getKnowledgePackages()); = The above line is the point at which the error occurs. I am using several other rule files, but I have removed them while I am debugging this issue. I am left with simply this rule file: = package removed.kb.appliances import removed.ApplianceType; import removed.ApplianceTypeObject; import removed.ApplianceTypeObjectHost; import removed.ApplianceTypeIdentifier; import java.util.List; dialect java; rule root_appliance ruleflow-group 'initialize-appliance-definitions' when not ( ApplianceType ( type == ApplianceTypeIdentifier.APPLIANCE_ROOT ); ); then ApplianceType appliance = new ApplianceType(ApplianceTypeIdentifier.APPLIANCE_ROOT, null); insert(appliance); end; rule root_host no-loop true ruleflow-group 'initialize-appliance-definitions' when $app:ApplianceType ( type == ApplianceTypeIdentifier.APPLIANCE_ROOT ); not( ApplianceTypeObject() from $app.getObjectTypes()); then //Do something end; == If there is any more information I can provide please let me know. I believe that is everything. -- View this message in context: http://drools.46999.n3.nabble.com/Issue-with-From-Clause-Class-Cast-Error-tp4019846p4019848.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] Issue with From Clause - Class Cast Error
It reminds me of a bug which surfaced a couple of weeks ago. Mario Fusco should have already fixed it, at least in the latest version... which version are you using? The fix may need backporting. Davide -- View this message in context: http://drools.46999.n3.nabble.com/Issue-with-From-Clause-Class-Cast-Error-tp4019846p4019849.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] Issue with From Clause - Class Cast Error
I am using 5.4.0 Final Downloaded about a month ago. From drools-core-5.4.0.Final.jar: Specification-Title: Drools :: Core Specification-Version: 5.4.0.Final -- View this message in context: http://drools.46999.n3.nabble.com/Issue-with-From-Clause-Class-Cast-Error-tp4019846p4019850.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] Issue with From Clause - Class Cast Error
Well.. if you remove that line you are not including your rules in the knowledge base :) But the problem is as suspected, a fix was not back-ported. You can either use 5.5 or wait for Mario to follow up shortly with the patched 5.4 Best Davide -- View this message in context: http://drools.46999.n3.nabble.com/Issue-with-From-Clause-Class-Cast-Error-tp4019846p4019853.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] Issue with From Clause - Class Cast Error
Great! Thanks so much Davide (and laune). Cheers, Taylor -- View this message in context: http://drools.46999.n3.nabble.com/Issue-with-From-Clause-Class-Cast-Error-tp4019846p4019854.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] Capturing DDLs from Guvnor
Hi, I have configured Guvnor to work with Oracle. With this configuration I can see that Guvnor uses my Oracle Database as the datastore, and creates the necessary tables in the Oracle database. I want to capture the Oracle DDLs that Guvnor (Jackrabbit) builds to create the table in the Oracle Database, this is required to facilitate application and installs in different environments in the organization. I can go to the database and create the DDLs from there, but am wondering if there is an easier way to achieve the same. Thanks, dme -- View this message in context: http://drools.46999.n3.nabble.com/Capturing-DDLs-from-Guvnor-tp4019855.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] Capturing DDLs from Guvnor
Look in the org.apache.jackrabbit.core.persistence.db package in jackrabbit-core-2.2.8.jar for DDLs for the databases supported by JackRabbit. On 19 September 2012 21:22, dme1 meh...@hotmail.com wrote: Hi, I have configured Guvnor to work with Oracle. With this configuration I can see that Guvnor uses my Oracle Database as the datastore, and creates the necessary tables in the Oracle database. I want to capture the Oracle DDLs that Guvnor (Jackrabbit) builds to create the table in the Oracle Database, this is required to facilitate application and installs in different environments in the organization. I can go to the database and create the DDLs from there, but am wondering if there is an easier way to achieve the same. Thanks, dme -- View this message in context: http://drools.46999.n3.nabble.com/Capturing-DDLs-from-Guvnor-tp4019855.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] planning difficulty problem
For example , I have 10 doctors planning for 3 hospitals in three shifts, each hospital take maximum limit of 3 doctors only, In this case I have one remaining doctor unassigned. My doubt is how planner handle this data? will it be rejected or consider in other cycle or overwrite the planner solution? please advise... thanks, - with kind regards, -- View this message in context: http://drools.46999.n3.nabble.com/planning-difficulty-problem-tp4019857.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