KnowledgeAgent detects resource changes and updates but nothing changes
by Tina Vießmann
Hi,
I've set up a knowledge agent the change set configuration. While
running the application I'm changing the rules file and the agent
detects the change and rebuidls the knowledge base. But after that the
output that should have changed didn't change.
Thank you! :)
Greetings
Tina
Here are the code snippets:
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent("AITS CEP Engine Agent");
kagent.applyChangeSet(ResourceFactory.newClassPathResource("changeset.xml"));
KnowledgeBase knowledgeBase = kagent.getKnowledgeBase();
session = knowledgeBase.newStatefulKnowledgeSession();
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMSchema-instance'
xs:schmeaLocation='http://drools.org/drools-5.0/change-setdrools-change-set-5.0.xsd'
>
<add>
<resource source='classpath:testRule.drl' type='DRL' />
</add>
</change-set>
The status information put out to the console are:
[2010:08:230 16:08:93:debug] ResourceChangeScanner attempt to scan 1
resources
[2010:08:230 16:08:93:debug] ResourceChangeScanner modified
resource=[ClassPathResource path='testRule.drl'] : 1282139449234 :
1282141364812
[2010:08:230 16:08:93:debug] ResourceChangeNotification received
ChangeSet notification
[2010:08:230 16:08:93:debug] ResourceChangeScanner thread is waiting for
60 seconds.
[2010:08:230 16:08:93:debug] ResourceChangeNotification processing ChangeSet
[2010:08:230 16:08:93:debug] ResourceChangeNotification ChangeSet
modified resource=[ClassPathResource path='testRule.drl'] for
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31
[2010:08:230 16:08:93:debug] KnowledgeAgent received ChangeSet changed
notification
[2010:08:230 16:08:93:info] KnowledgeAgent applying ChangeSet
[2010:08:230 16:08:93:debug] KnowledgeAgent rebuilding KnowledgeBase
using ChangeSet
[2010:08:230 16:08:109:debug] ResourceChangeNotification thread is
waiting for queue update
[2010:08:230 16:08:218:debug] KnowledgeAgent obtaining pkg
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=[Rule name=Insert Watcher Into Knowledge Base,
agendaGroup=MAIN, salience=0, no-loop=false]
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=[Rule name=Add Event to Watcher Set,
agendaGroup=MAIN, salience=0, no-loop=false]
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.TypeDeclaration@1bed3d1
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.TypeDeclaration@1f528ab
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.Function@1bb9829
[2010:08:230 16:08:234:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.Function@eb840f
[2010:08:230 16:08:234:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] KnowledgeAgent adding
KnowledgeDefinitionsPackage net.eads.astrium.aits.cep.rules
[2010:08:230 16:08:250:info] KnowledgeAgent new KnowledgeBase now built
and in use
[2010:08:230 16:08:250:debug] KnowledgeAgent finished rebuilding
KnowledgeBase using ChangeSet
15 years, 6 months
Spring configuration v5.1.0.M2 V/s v5.1.0
by KiranP
Hello Everybody,
I was dazelled by reading the post
http://drools-java-rules-engine.46999.n3.nabble.com/5-1-0-CR1-Drools-Spri...
Drools-Spring-Configuration-Changed?
I was working with Drools v5.1.0.M2 which had around 50 different Processes
and Simple configuration as :
"Configure EMF and Transaction Manager pass them to JPAKnowledgeServiceBean
and directly use it into
my own Services - ProcessService.startprocess(); and
ProcessService.resumeService();"
this services in turn were calling simple API Provided by :
JPAKnowledgeServiceBean
createNew...();
load...( id ) ;
and the workItemHandler to Task Assignment was taken care by the
Configuration File - drools.session.conf
now i want to upgrade to Drools v5.1.0
but for that i have to create 50 different Spring Configurations one for
each process and use a kstore (its not as easy as it looks)
then again i cannot have a single service method like
ProcessService.startProcess(processId);
instead i have to use ProcessService.startProcessABCProcess(); then
ProcessService.startXYZProcess(processId); and so on for all the 50
processes
more over this we also have to re-create the Environment,kbase and
configuration for each process start and resume......
Dont you think that the M2 version API's were more easy and effective???????
Suggestions and Work-out are very much welcome.....
-----
Keep Working >>
KiranP
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Spring-configuration-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
Rule template shortcut needed
by djb
Hi there,
My question is related to the ability to remove criterion in a rule template
by a cunning commenting trick so that if the variable @{VAR} is blank, the
line will be blank. Wolfgang wrote the code, I believe.
I've got a situation where I've got DB rows where i've got:
TYPE | CODE | TYPE2 | CODE2_FROM | CODE2_TO
there are 17 types. So it lets us have rules like
Type U code 123 cannot be charged with Type V codes 234 to 236.
I need the rules to compare the correct property, but I don't want to lose
the advantage of the RETE algorithm by using a getValue("type1") function.
I see one solution:
2. Make a template with 17 + 17 + 17 = 51 columns, where each one uses the
// @{VAR} trick.
Is there a better way? Or, should I just do getValue("type")?
Thanks
Daniel
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Rule-template-shortcu...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
Re: [rules-users] Skills required for using Drools Guvnor
by Swapnil Sawant
Just wanted to make picture more clear.
I will be developing my application where I would be using drools guvnor for managing rules separately .
In the process of development, I would be setting up all the things required for 'running rules in my application'
Once application development is finished, I will be deploying it at client side.
Once this deployment is done, now If any rule has to be managed(updations) then what kind of skills the end user of this application should possess so that he can manage the rules on his own ?
Thanks,
Swapnil Sawant
From: Swapnil Sawant
Sent: Wednesday, August 18, 2010 2:27 PM
To: 'rules-users(a)lists.jboss.org'
Subject: RE: Skills required for using Drools Guvnor
Small correction.... Java programming language :)
From: Swapnil Sawant
Sent: Wednesday, August 18, 2010 2:22 PM
To: 'rules-users(a)lists.jboss.org'
Subject: Skills required for using Drools Guvnor
Hi,
I had a very basic question. I wanted to know the pre-requisite skills which are required in order to start working on drools guvnor GUI.
When I say work , I mean creating rules/modifying them etc.
Technical knowledge(e.g. java technology) is must in this case?
Thanks & Regards,
Swapnil Sawant
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
15 years, 6 months
Re: [rules-users] Skills required for using Drools Guvnor
by Swapnil Sawant
Small correction.... Java programming language :)
From: Swapnil Sawant
Sent: Wednesday, August 18, 2010 2:22 PM
To: 'rules-users(a)lists.jboss.org'
Subject: Skills required for using Drools Guvnor
Hi,
I had a very basic question. I wanted to know the pre-requisite skills which are required in order to start working on drools guvnor GUI.
When I say work , I mean creating rules/modifying them etc.
Technical knowledge(e.g. java technology) is must in this case?
Thanks & Regards,
Swapnil Sawant
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
15 years, 6 months
PLEASE HELP: Possible concurrency issue in Drools
by Norman C
Hi All,
I've posted on this topic twice and logged a JIRA ticket
(https://jira.jboss.org/browse/JBRULES-2651) as well. I've received no
responses and the bug hasn't been updated since I logged it.
This is a serious issue as it causes my production system to freeze up and it
has to be restarted. It's consistently reproducible (usually takes a few
days).
Can someone please take a quick look at the code? Does the call to
SingleThreadedObjectStore.addHandle in NamedEntryPoint.insert need to be
preceded by acquiring the lock?
Thanks again for your help.
Norman
________________________________
From: Norman C <rent_my_time(a)yahoo.com>
To: rules-users(a)lists.jboss.org
Sent: Wed, August 4, 2010 11:23:55 PM
Subject: Re: Possible concurrency issue in Drools
I've run into this issue a few more times. Should I log a JIRA ticket for
this? Any advice would be appreciated.
Thanks,
Norman
________________________________
From: Norman C <rent_my_time(a)yahoo.com>
To: rules-users(a)lists.jboss.org
Sent: Sat, July 31, 2010 9:56:26 PM
Subject: Re: Possible concurrency issue in Drools
All,
Just wanted to mention, I'm using version 5.0.1 of Drools.
Thanks,
Norman
________________________________
From: Norman C <rent_my_time(a)yahoo.com>
To: rules-users(a)lists.jboss.org
Sent: Sat, July 31, 2010 9:50:19 PM
Subject: Possible concurrency issue in Drools
Hi All,
I recently ran into an issue which I believe might point to a concurrency
issue. My server stopped processing new requests, so I did a thread dump. In
examining the dump, I found that all of the processing threads, save two, were
blocking while trying to acquire the lock in NamedEntryPoint.insert. Both of
the other two threads appeared to be infinitely looping in the
NamedEntryPoint.insert method. Here are snippets of the stack traces:
ActiveMQ Session Task" prio=10 tid=0x00002aab0003b000 nid=0x7b98 runnable
[0x000000004c086000..0x000000004c087c90] java.lang.Thread.State: RUNNABLE
at org.drools.util.ObjectHashMap.remove(ObjectHashMap.java:121) at
org.drools.common.SingleThreadedObjectStore.removeHandle(SingleThreadedObjectStore.java:150)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:296)
at org.drools.common.NamedEntryPoint.retract(NamedEntryPoint.java:245) at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(ReteooWorkingMemory.java:350)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1488)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at
ActiveMQ Session Task" prio=10 tid=0x000000005a35cc00 nid=0xdf6 runnable
[0x000000004a268000..0x000000004a269a90] java.lang.Thread.State: RUNNABLE
at org.drools.util.AbstractHashTable.resize(AbstractHashTable.java:115) at
org.drools.util.ObjectHashMap.put(ObjectHashMap.java:78) at
org.drools.common.SingleThreadedObjectStore.addHandle(SingleThreadedObjectStore.java:136)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:113)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80) at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28) at
So it seems like one while the first thread is holding the lock and is
attempting to remove an object handle from the object store in NamedEntryPoint,
the other thread is trying to resize that same object store in response to an
addHandle call that puts it over the threshold. I haven't worked out exactly
how these concurrent accesses to the same object store by two different threads
causes an infinite loop in both threads, but it seems like the call to
SingleThreadedObjectStore.addHandle should be preceded by acquiring the lock.
Is this correct? I can imagine that resizing a large hash map could potentially
take a long time and thus synchronizing this call could impact performance, but
somehow, the action of resizing the table must be protected in some way from
adversely impacting other operations on the table.
Any help would be appreciated.
thanks,
Norman
15 years, 6 months
Re: [rules-users] [rules-user] Setting Configuration Option in KnowledgeBase
by Nicolás Sanchez
Thanks Edson for the answer. Now I realised that there is no mistake in the
Jboss documentation, the example is exactly as you wrote it.
The problem is that I can`t select EventProcessingOption.STREAM, and when I
was typing the only suggestion I had was EventProcessingMode.STREAM.
Am I missing any Dependency? or Package?
Nicolas
15 years, 6 months
[rules-user] Setting Configuration Option in KnowledgeBase
by Nicolás Sanchez
Hi, I am a Newbie with Drools5.1.0 and I was trying to set a
KnowledgeBaseConfiguration Option using Drools Fusion.
I tried the code that was in the Documentation part of Drools Fusion:
KnowledgeBaseConfiguration config =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
config.setOption(EventProcessingMode.STREAM);
And the next Error appears, and I don`t understand why:
Bound mismatch: The generic method setOption(T) of type
KnowledgeBaseOptionsConfiguration is not applicable for the arguments
(RuleBaseConfiguration.EventProcessingMode). The inferred type
RuleBaseConfiguration.EventProcessingMode is not a valid substitute
for the bounded parameter <T extends KnowledgeBaseOption>
Regards,
Nicolas
15 years, 6 months
rules un end looping when update
by sony john
Hi all,
Iam using rules 5.1
iam getting un endded printout in my console.
What could be the issue.
Thanks in advance.
#created on: Aug 16, 2010
package com.test.supplier
#list any import classes here.
#declare any global variables here
import com.test.supplier.dao.Workflow;
rule "Your First Rule"
when
m: Workflow(workflowActorId==null,myid:workflowActorId)
then
System.out.println(myid + "its null values");
update(m);
end
15 years, 6 months