Problem with Guvnor 5.1.1, <save> frequently does not save...
by David Shields
I have spent several days writing rules and tests for them in Guvnor, and
kept having strange results. A test would sometimes fail, repeatedly, and
then finally start working after I would delete and recreate some portion
of it, or change a value.
After two of us spent many hours trying to identify the extent of the
problem, we concluded the following:
1. The problem happens under both IE and Firefox.
2. The problem happens less frequently under Firefox if we install and
turn on a third-party plug-in which disables Firefox caching web pages.
3. Saving a new rule or test will allow us to work with it (edit - save -
test scenarios). However, frequently the rule or test will just disappear
once we log out.
4. A "Save" and "Check-in" will often work correctly if we cross our
fingers and do the following:
a. Save it once (the screen updates, and you can check the
version history)
b. Refresh the browser
c. Make the change again
d. Save it a second time
5. After doing a "Save" and "Check-in", you can immediately do a "view
source" and see your changes in place. However, if you then close the
test (or rule) and re-open it, you will often find that the change is
gone, and the test or rule looks like it did before you made the change.
A sample screenshot appears below. In this case, I created the test with
the "performedTime" set to 20-Sep-2008. I ran the test and it failed,
because the rule was checking for greater than or equal to 21-Sep-2008. I
then changed the date on the test to 21-Sep-2008, did a "save changes" and
a "Check-in", and then ran the scenario again.
As you can see below, the asserted object contains the date 20-Sep-2008,
even though the test clearly shows 21-Sep-2008.
Does anybody have any ideas on this? If I copy the above test into a new
test, it will often work the first time, but then it may disappear, once I
logout, even though it was saved and checked-in.
It almost seems like there is something wrong with the imbedded
repository, and / or the first running of the test created fact objects
that are persisting and being found the second time I ran the changed
test. ...
We are running the Final release of Drools Guvnor 5.1.1 found in
drools-5.1.1-guvnor.zip downloaded on 4-Sep-2010
We are running under Tomcat 6.0, with the recommended jar files replaced.
Thanks for your help!
--------------------------------------------------
David Shields
Division of Clinical Informatics
Department of Community and Family Medicine
Duke University Medical Center
Phone (864) 787-8551
13 years, 4 months
How to Access and Execute Rules from Database
by Ashish Soni
Hi All ,
I am able to configure oracle database in drools but now i am not able to
find how can i load rules from the DB and execute them , I gone through the
documentation but not able to get much information or might be i am missing
something.
If any one can provide me a example or some pointer ,hints then it would be
helpful.
Regards,
Ashish
13 years, 4 months
Drools and mobile
by Leonardo Gomes
Since I'm really a noobie on mobile development, this may be a stupid
question, but it doesn't hurt to ask: Does anybody here ever used Drools on
a mobile application? Would its dependencies allow it to be run on an
Android or Blackberry?
Basically, my idea is that with the CEP stuff added on Drools 5, it would be
interesting to capture events generated by the device and do some analysis.
Waiting on your feedback :)
Thanks,
- Leonardo.
13 years, 6 months
unable to determine operator for symbol [before]
by vladimiro
Hi all,
I'm building a KnowledgeBase with KnowledgeAgent and a precompiled
rule package. When the package contains a rule using temporal operators
such "after" or "before" I get the exception listed at the end of this
message.
I'm using the latest version of drools 5 and my runtime configuration
includes the following libraries:
* drools-core - the rule engine itself.
* drools-api
* mvel2-2.0.10
* joda-time-1.6
the rule causing such a behaviour is:
rule 'Test2'
dialect 'mvel'
when
u1:UserType( firstName=="UserA" )
lie:UserEventType( event=="Login", user.id==u1.id)
loe:UserEventType(event=="Logout", user.id==u1.id, this before lie)
then
Message msg = new Message();msg.setText("Test2
fired");driver.getMessages().add(msg);
end
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:418)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:120)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:109)
at
info.vladimiro.tesi.peservice.KnowledgeBaseService.<init>(KnowledgeBaseService.java:94)
at
info.vladimiro.tesi.peservice.KnowledgeBaseService.getInstance(KnowledgeBaseService.java:65)
at
info.vladimiro.tesi.peservice.PEListener$KBTask.run(PEListener.java:35)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: org.drools.RuntimeDroolsException: unable to determine
operator for symbol [before]
at
org.drools.base.evaluators.Operator.determineOperator(Operator.java:71)
at org.drools.base.evaluators.Operator.readResolve(Operator.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1033)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1728)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.base.BaseEvaluator.readExternal(BaseEvaluator.java:53)
at ...
Can someone help? Thanks in advance.
Vladimiro Corsi
13 years, 6 months
Drools Human Task Service Persistence
by ramram
Hi All,
I have been trying to persist the Human TasK service to Oracle. And I got
the below error. Please check my persistence.xml file and the error that I
have recieved. It seems this is happening because of some oracle reserved
words are used to name the columns.
Any suggestions??? on this Topic?????
persistence.xml
============
<persistence-unit name="org.drools.task">
<class>org.drools.task.Attachment</class>
<class>org.drools.task.Content</class>
<class>org.drools.task.BooleanExpression</class>
<class>org.drools.task.Comment</class>
<class>org.drools.task.Deadline</class>
<class>org.drools.task.Comment</class>
<class>org.drools.task.Deadline</class>
<class>org.drools.task.Delegation</class>
<class>org.drools.task.Escalation</class>
<class>org.drools.task.Group</class>
<class>org.drools.task.I18NText</class>
<class>org.drools.task.Notification</class>
<class>org.drools.task.EmailNotification</class>
<class>org.drools.task.EmailNotificationHeader</class>
<class>org.drools.task.PeopleAssignments</class>
<class>org.drools.task.Reassignment</class>
<class>org.drools.task.Status</class>
<class>org.drools.task.Task</class>
<class>org.drools.task.TaskData</class>
<class>org.drools.task.SubTasksStrategy</class>
<class>org.drools.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.drools.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.drools.task.User</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.connection.driver_class"
value="oracle.jdbc.OracleDriver"/>
<property name="hibernate.connection.url"
value="jdbc:oracle:thin:@DB_URL" />
<property name="hibernate.connection.username" value="drools"/>
<property name="hibernate.connection.password" value="drools"/>
<property name="hibernate.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
Error
============
Hibernate: select task0_.id as col_0_0_, deadline1_.id as col_1_0_,
deadline1_.date as col_2_0_ from Task task0_, Deadline deadline1_ where
(deadline1_.id in (select start
deadl2_.id from Deadline startdeadl2_ where
task0_.id=startdeadl2_.Deadlines_StartDeadLine_Id) or deadline1_.id in
(select enddeadlin3_.id from Deadline enddeadlin3_ where
task0_.id=enddeadlin3_.Deadlines_EndDeadLine_Id)) and
deadline1_.escalated=0 order by deadline1_.date
javax.persistence.PersistenceException:
org.hibernate.exception.SQLGrammarException: could not execute query
at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73)
at org.drools.task.service.TaskService.<init>(TaskService.java:65)
at org.drools.task.service.TaskService.<init>(TaskService.java:48)
at com.fp.taskservice.RunTaskService.start(RunTaskService.java:45)
at
com.fp.taskservice.RunTaskService.contextInitialized(RunTaskService.java:28)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.hibernate.exception.SQLGrammarException: could not execute
query
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2223)
at
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
... 28 more
Caused by: java.sql.SQLException: ORA-01747: invalid user.table.column,
table.column, or column specification
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
at
oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
at
oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:503)
at
oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
at
oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:535)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
at
oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
at
oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3026)
at
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
... 36 more
java.lang.Exception
at com.fp.taskservice.RunTaskService.start(RunTaskService.java:50)
at
com.fp.taskservice.RunTaskService.contextInitialized(RunTaskService.java:28)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
Regards,
Ram
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Human-Task-Ser...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 6 months
Rules Flow Eclipse editor
by Prafull Kumar
Hi All,
I would like to know how we can modify the Rules flow eclipse editor look and
feel and functionality. e.g. If we have a Embedded Sub-Process in the flow and
reduce the size of it, the arrows are still displayed in the main canvas. Please
see the attached snapshot for reference.
How we can fix it? also if we want to open the Embedded Sub-Process in a new
window for easy maintainability/readability of the very complex processes, how
we can achieve it?
Going forward we are also looking to create the custom editor for the nodes.
Please guide us if its possible and there is any document for this.
Note: It seems that I can not attach files in the mailing list. Let me know if
its possible to share the image.
Regards, Prafull
13 years, 6 months
Drools 5.1 - exception when trying to use incremental KB updates.
by Stephen Mcgruer
Just moved to Drools 5.1, using a Guvnor package as the base for a
Knowledge Base with incremental updating enabled. Our resource is a
Guvnor PKG. We encounter the following error when a snapshot is made:
[2010:08:224 16:08:903:debug] KnowledgeAgent: Diffing: [UrlResource
path='http://localhost:1337/drools-guvnor/org.drools.guvnor.Guvnor/package/TEST...']
[2010:08:224 16:08:935:debug] BinaryResourceDiffProducerImpl:
Comparing [Rule name=Resource Null-Checker, agendaGroup=MAIN,
salience=0, no-loop=false] against [Rule name=Resource Null-Checker,
agendaGroup=MAIN, salience=0, no-loop=false]
Exception in thread "Thread-30" org.drools.RuntimeDroolsException:
java.lang.reflect.InvocationTargetException : [Rule name=Resource
Null-Checker, agendaGroup=MAIN, salience=0, no-loop=false]
at org.drools.core.util.ReflectiveVisitor.visit(ReflectiveVisitor.java:56)
at
org.drools.agent.impl.BinaryResourceDiffProducerImpl.diff(BinaryResourceDiffProducerImpl.java:63)
at
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:785)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:586)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185)
at
org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:1106)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.drools.core.util.ReflectiveVisitor.visit(ReflectiveVisitor.java:47)
... 6 more
Caused by: java.lang.RuntimeException: this MVELReturnValueExpression
must be compiled for equality
at
org.drools.base.mvel.MVELReturnValueExpression.equals(MVELReturnValueExpression.java:123)
at
org.drools.rule.ReturnValueRestriction.equals(ReturnValueRestriction.java:306)
at
org.drools.rule.ReturnValueConstraint.equals(ReturnValueConstraint.java:121)
at java.util.Arrays.equals(Unknown Source)
at org.drools.rule.OrConstraint.equals(OrConstraint.java:132)
at java.util.AbstractList.equals(Unknown Source)
at org.drools.rule.Pattern.equals(Pattern.java:317)
at org.drools.rule.GroupElement.equals(GroupElement.java:273)
at
org.drools.agent.impl.BinaryResourceDiffProducerImpl.compareRules(BinaryResourceDiffProducerImpl.java:258)
at
org.drools.agent.impl.BinaryResourceDiffProducerImpl.visitRule(BinaryResourceDiffProducerImpl.java:117)
... 11 more
The rule in question is quite straight-forward, works on the initial
load up and worked in 5.0.1 fine. It is not the rule that was just
changed. If I remove that rule, another is just substituted in its
place in the error message.
What might be causing this? If you need more information, please ask.
Stephen
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
13 years, 6 months
Authorisation of Guvnor users on Glassfish
by Chris Selwyn
I am using Guvnor 2.1.1 on Glassfish 2.1 and mostly it seems to work
very well.
However, I am now looking to setup authentication of users to the Guvnor
server and this is where I am finding problems.
I tried writing a class with an "authenticate" method to authenticate
against a Glassfish realm using ProgrammaticLogin but (as far as I can
tell) this class is not being used by Guvnor.
Looking at the source, Guvnor appears to only use the
org.jboss.seam.security.Identity.authenticate method which uses only the
jaas-config-name value from the components.xml file.
So I then tried setting the jaas-config-name to "fileRealm" (which
exists in Glassfish's default login.conf) but now I get
"javax.security.auth.login.LoginException: No credentials." logged in my
server.log (and the user get a fail message, naturally).
Has anyone out there managed to configure Guvnor to authenticate against
a Glassfish realm or JAAS context and would be willing to help me through?
Chris Selwyn
13 years, 6 months
Import Functions in Guvnor
by Pankaj Khattar
Can anybody share that how to import java function in the guvnor & use them
in writing rules in guvnor.
For example i have a drl file in which i have
import function com.alu.ae.ais.smp.fm.drools.service.Function.delayAlert;
in which 'Function' is the class & 'delayAlert' a method in the class, the
rule is as
rule "Delay Alert"
no-loop true
dialect "mvel"
lock-on-active
when
then
delayAlert(<method parameter>);
end
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Import-Functions-in-G...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 7 months