Drool 5 memberOf problem
by dxande6
I'm trying to validate that there is a Factor in a collection using the
global variable ownedProductFactorSet. I'm having trouble. I do not get an
error, it just doesn't resolve to true. I've validated the
ownedProductFactor set has the Factor
Java class that is contained withing the ownedProductFactorSet:
Factor
String key
String value
Here is the code in the drl:
global Set ownedProductFactorSet;
rule "Owned Products"
ruleflow-group "discount-pricing"
lock-on-active true
when
not Factor(key == FactorKeys.DISCOUNT)
String(FactorKeys.PHONE_PACKAGE memberOf ownedProductFactorSet)
Factor(key == RulesKeys.WIRELESS)
then
logger(kcontext).info("SUCCESS - *******************************");
insert(new Factor(FactorKeys.DISCOUNT)); end
It never gets to the consequence (RHS - "then" part) of this rule.
If I comment out the following line:
String(FactorKeys.PHONE_PACKAGE memberOf ownedProductFactorSet) It
will work.
Any help with the memberOf keyword is greatly appreciated.
Thanks,
-dxande6
--
View this message in context: http://drools.46999.n3.nabble.com/Drool-5-memberOf-problem-tp2953475p2953...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Rete
by Abhay B. Chaware
Have been reading about how Rete operates and how Drools implements Rete and so on .. and that Rete builds a network of nodes and each node is a pattern and has memory of facts which satisfy the pattern .... just as a curiosity, how does this all work internally ? what does it mean when they say that it builds a network .. and nodes are shared and attached .. what does really happen internally ?
Thanks
13 years, 6 months
Architectural problems and web service call
by Yoann Charpiot
Hi,
I'm new on Drools and i try to understand the architecture of the suite and
the dependencies between Guvnor and Expert.
I want to know if there is a physical link between the repository of rules
managed by Guvnor and the rules engine Expert when playing a rule in
production.
if not, is it possible to modify a rule in production without an IT
redeployment?
More generally, how are persist rules in the repository? Is it possible to
save them in a database or is it only persist in cache? if you have any
documentation on that.
And last question, do you have any documentation on how to expose a service
rule as a web service and how to consume it with the API?
Thanks you for your feedback.
13 years, 6 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, 6 months
Cast error message and DSL
by Giorgio Spagnardi
Hi to all,
I used the business rule guided editor to write a new rule. I'm verifying
the wrtitten rule but Guvnor returns the error message:
[MyRule] Unable to build expression for 'consequence': [Error: unable to
cast type: int; to: class java.lang.Integer] [Near : {...
tValue()));drools.update($sa); ....}] ^
[Line: 1, Column: 67] ' $sa.setBonusEsclusivo(percentuale(25,
((Integer)$cm).intValue()));update($sa);'
In DSL there is: [consequence][] Assign customer bonus of {num} percent=
$sa.setBonusEsclusivo(percentuale({num},
((Integer)$cm).intValue()));update($sa);
I didn't find a similiar error message....
Thanks in advance,
G.
--
View this message in context: http://drools.46999.n3.nabble.com/Cast-error-message-and-DSL-tp2951642p29...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Drools with LDAP
by Sumeet Karawal
Hi,
Is it possible to integrate Drools - BRMS with LDAP. I want to use roles
defined in LDAP as roles for BRMS for role based access of rules. Also can
it be Integrated with any Reporting tool.
Thanks & Regards,
Sumeet Karawal
Mailto: sumeet.karawal(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
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
FW: typical rules application
by Abhay B. Chaware
Anyone ?
________________________________
From: Abhay B. Chaware
Sent: Friday, May 13, 2011 6:17 PM
To: 'Rules Users List'
Subject: typical rules application
Hi
I am just trying to get a feel of size of a typical rules application. How many low-to-medium complex rules a typical rules application will have ? I understand and agree that it totally depends upon the application and business needs, but I am trying to get a feel of if rules is the correct solution to a problem and if that can be determined by number of rules.
e.g.
if to satisfy a business need, I wrote a rules application and ended up writing say 20 medium-complex rules and in another case, I wrote a rules application and ended up writing say 10,000 low/medium complex rules
which one of these two cases sound like real, logical candidate for a rules based app and why ? Is there a rule of thumb, that "x" number of rules is a good number for an application to qualify under rules technology ?
-abhay
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
Recommended way to register custom ResourceTypeBuilder?
by helo
Hello there,
in a project I've been working on lately I had to implement my own custom
ResourceTypeBuilder for a special file format I'm using. The import of files
in my format works perfectly using my ResourceTypeBuilder, my only concern
left is where to register my ResourceTypeBuilder.
What I'm doing right now is something like this:
ResourceTypeBuilderRegistry.getInstance().register(myResourceType, new
myResourceTypeBuilder());
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder ();
kbuilder.add (...);
The problem I see with this is that I will have to do this every time I
write an application using my file format. I would like to know if there is
a nicer way to register my ResourceTypeBuilder, maybe via some configuration
file like drools.rulebase.conf or drools.session.conf. I would greatly
prefer that over the solution I'm using now.
Thanks in advance!
Cheers
Henning Losert
--
View this message in context: http://drools.46999.n3.nabble.com/Recommended-way-to-register-custom-Reso...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months