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, 5 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, 5 months
[Drools Flow 5.1] persistence + spring + localTransaction
by anton.litvinenko
Hi!
I am quite new to Drools and Drools Flow - please let me know if I am asking
something obvious here :)
I've implemented my custom WorkItemHandlers that are aware of the
KnowledgeSession. Now, I am trying to enable persistence to flows using
drools-persistence-jpa and drools-spring. Ideally, I wanted drools to start
and end transactions, but I wasn't able to achieve that (this is the
problem) and I have start/end transactions manually before
starting/aborting/signaling a process (i.e. running a process is a single
transaction -> if exception happens no state is persisted).
Problem: DroolsSpringTransactionManager has a flag localTransaction which is
set to true whenever a new transaction is started and transaction is
committed only if this flag is set to true. Now, if inside workItemHandler I
invoke a method on knowledgeSession, then my call is being delegated to
SingleSessionCommandService and it tries to start a transaction, but it sees
that there is a transaction already running and sets localTransaction flag
to false -> transaction never gets committed.
Am I doing something wrong here?
Thanks in advance!
Anton
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Flow-5-1-persistence-spring-loca...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 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, 7 months
Need help setting up Drools Server using Maven
by kkelleyjr
If it is not completely apparent by the subject line I am a complete noob to
Drools and Maven...
I have done a lot of reading and I think the Drools Server exposed through
soap will work for my design...
I have found some material to get me started, but I am perplexed by a very
simple issue...
Using Maven what archetype do I use to set-up the project... Using that
archetype how to set-up the packages under the archetype... And where do I
get the dependences for the drools server to set-up the server with spring
configuration... (Yes I am a noob to spring also)
I could hack at it and surely get some format to work... But I do not want
to find out later that the set-up does not grow with the project... So what
are some best practices... I have looked and can not find them or if I did
find them I am to much of a noob to understand them...
The project will have clients of the Drools Server service.
The project will have Java classes fired by the rules. These classes may
have to become exposed web services later, I just don't know yet...
Thanks for any advice, sorry for the noob post... I have just run out of
ideas to get this off the ground...
--
View this message in context: http://drools.46999.n3.nabble.com/Need-help-setting-up-Drools-Server-usin...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 months
Use of StatelessKnowledgeSession
by aminmc
Hi there
I was wondering if someone might be able to help with what I am trying to
do. I have the following rule definition:
rule "open work item"
when
Task ( status == "OPEN")
then
insert(new Action("Take","take_task"));
insert(new Action("Complete","complete_task"));
insert(new Action("Close","close_task"));
end
Basically I want to insert a Task and then get back a list of Actions that
are available for the Task (based on the status. I have this working with a
statefulknowledgesession with the code:
List<Command> commands = new ArrayList<Command>();
for (Task task : tasks) {
commands.add(CommandFactory.newInsert(task));
}
session.execute(CommandFactory.newBatchExecution(commands));
session.fireAllRules();
session.dispose();
//this returns the actions
Collection objects = session.getObjects(new
ClassObjectFilter(Action.class));
I was wondering whether it is possible to do this with a
statelessknowledgesession instead? I could'nt see how to achieve this
without updating the task to include the actions.
Any help would be appreciated.
Cheers
--
View this message in context: http://drools.46999.n3.nabble.com/Use-of-StatelessKnowledgeSession-tp2828...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 7 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, 7 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, 7 months