Re: [rules-users] Facing problem in ResourceChangeScanner

2012-03-23 Thread Jiri Svitak
Hello Saurabh,

which types of resources do you specify in your changeset.xml?
Also try to debug ResourceChangeScanner by adding following line at the 
begining of your code:

SystemEventListenerFactory.setSystemEventListener(new 
PrintStreamSystemEventListener(System.out));

Jiri Svitak


On 03/23/2012 07:51 AM, Saurabh wrote:
 Hi ,

 I am trying to understand KnowledgeAgent functioality.
   but i am facing following issue

   ResourceChangeScanner  is scanning the change resource and building the
 Knowledgebase but still firing previous rules.

 I am using these line of codes

  File fxml = new File(change-set.xml);
   kbase = KnowledgeBaseFactory.newKnowledgeBase();
  ResourceChangeScannerConfiguration sconf =
 ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
   sconf.setProperty(drools.resource.scanner.interval, 2);
   
 ResourceFactory.getResourceChangeScannerService().configure(sconf);

   KnowledgeAgentConfiguration aconf =
 KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
   aconf.setProperty(drools.agent.scanDirectories, true);

 aconf.setProperty(drools.agent.useKBaseClassLoaderForCompiling, true);
   aconf.setProperty(drools.agent.scanResources, true);
   aconf.setProperty(drools.agent.newInstance, true);
   KnowledgeAgent kagent = 
 KnowledgeAgentFactory.newKnowledgeAgent(test
 agent, kbase, aconf);
  System.out.println(test agent: + kagent.getName());

 kagent.applyChangeSet(ResourceFactory.newUrlResource(fxml.toURI().toURL()));
  ksession =
 kagent.getKnowledgeBase().newStatefulKnowledgeSession();


 Thanks ,
 Saurabh

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Facing-problem-in-ResourceChangeScanner-tp3850837p3850837.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] Resource Change Scanner Service modified date error

2012-01-06 Thread Jiri Svitak
Hello Dean,

you are right,
https://issues.jboss.org/browse/GUVNOR-1699
solves something different. Bugzilla 
https://bugzilla.redhat.com/show_bug.cgi?id=733008
still waits to be solved. I have updated this bugzilla to be linked to 
belonging JIRA issues.
You can look also on other bugs which have the same root cause. But I am 
not developer, so I cannot
tell you when it'll be fixed.

Jiri Svitak

On 01/05/2012 02:27 PM, Dean wrote:
 Hi

 I am experiencing a problem with starting the ResourceChangeScannerService
 as described here: https://bugzilla.redhat.com/show_bug.cgi?id=733008

 I can create a KnowledgeAgent instance and apply a changeset to it which
 loads the desired package from Guvnor. However, as soon as I attempt to
 start the ScannerService in order to be notified of changes to this package
 I immediately receive the exception: java.lang.IllegalStateException: reader
 does have a modified date. Then on every scanner interval following, the
 scanner fails each time with the same error message.

 Apparently, this issue has already been fixed here:
 https://issues.jboss.org/browse/GUVNOR-1699

 However, I am still experiencing this problem even with Drools 5.4.0.Beta1

 Could somebody perhaps help me with this. I am attempting to rebuild the
 source code on my side, however, I am having endless problems with Maven.

 Regards

 Dean

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3634802.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] 5.3.0.Final resource change scanner bug

2011-10-25 Thread Jiri Svitak

This has been already reported:
https://bugzilla.redhat.com/show_bug.cgi?id=741219
https://bugzilla.redhat.com/show_bug.cgi?id=741287

This happens for Guvnor's PKG, XLS, DRF and I guess CSV too. You'll find 
test cases there.


Jiri Svitak

On 10/25/2011 12:07 AM, Michael Anstis wrote:


Thanks Lisa, I appreciate it is a pain for you but your help is much 
appreciated.


sent on the move

On 24 Oct 2011 23:03, lhorton lhor...@abclegal.com 
mailto:lhor...@abclegal.com wrote:


Yes, all compile ok without change set (our tests compile the
rules in code,
but our server compiles using knowledge agent).  I had to roll
everything
back to 5.2 for our developers, but I'll find some time tomorrow
to try
things out with 5.3 again.  I'll see if I can narrow it down to
specific
file(s) that fail compilation.

--
View this message in context:

http://drools.46999.n3.nabble.com/5-3-0-Final-resource-change-scanner-bug-tp3449420p3449655.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org mailto: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] IllegalStateException happens when ResourceChangeScanner working on Version 5.3.0.CR1

2011-10-06 Thread Jiri Svitak
I have already reported this issue:
https://bugzilla.redhat.com/show_bug.cgi?id=733008

On 10/04/2011 02:56 PM, Oliver Liu wrote:
 Hi Guys,

 I want to upgrade drools from 5.1.1 to 5.3.0 CR1, but i found
 ResourceChangeScanner could't work.

 In version 5.1.1, i wrote this code to get a KnowledgeAgent

   KnowledgeAgent kagent =
 KnowledgeAgentFactory.newKnowledgeAgent(ReleaseAgent);
   kagent.addEventListener(new ReloadingRuleEventListener(this));
   
 kagent.applyChangeSet(ResourceFactory.newClassPathResource(changeset-url.xml));

 changeset-url.xml content is like:
 change-set xmlns='http://drools.org/drools-5.0/change-set'
  xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
  xs:schemaLocation='http://drools.org/drools-5.0/change-set

 http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd'
 add
resource

 source='http://hostname:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/PackageName1/snapshot_release'
type='PKG' basicAuthentication=enabled username=user1
 password=123456 /

resource

 source='http://hostname:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/PackageName2/snapshot_release'
type='PKG' basicAuthentication=enabled username=user1
 password=123456 /

resource

 source='http://hostname:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/PackageName3/snapshot_release'
type='PKG' basicAuthentication=enabled username=user1
 password=123456 /
 /add
 /change-set

 then wrote this code to scan if there is a new version snapshot on guvnor
   ResourceChangeScannerConfiguration sconf = ResourceFactory
   .getResourceChangeScannerService()
   .newResourceChangeScannerConfiguration();
   sconf.setProperty(drools.resource.scanner.interval,60);

   
 ResourceFactory.getResourceChangeScannerService().configure(sconf);
   ResourceFactory.getResourceChangeScannerService().start();
   ResourceFactory.getResourceChangeNotifierService().start();

 It works very well, each time when ResourceChangeScanner finding there is
 new snapshot, it can reload the rules from guvnor properly.

 But when i updated to 5.3.0 CR1, ran this code, error happens:
 Exception in thread Thread-2 java.lang.IllegalStateException: reader does
 have
   a modified date
  at
 org.drools.io.impl.ReaderResource.getLastModified(ReaderResource.java
 :64)
  at
 org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScann
 erImpl.java:169)
  at
 org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(Res
 ourceChangeScannerImpl.java:326)
  at java.lang.Thread.run(Thread.java:619)

 It seems in new version, UrlResource was parsed to ReaderResource(i rememer
 in 5.1.1, each resource in changeset-url.xml was parsed to UrlResource).


 Can you give a help?
 Thanks a lot


 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/IllegalStateException-happens-when-ResourceChangeScanner-working-on-Version-5-3-0-CR1-tp3393027p3393027.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] Debugging unification in backward chaining

2011-08-01 Thread Jiri Svitak
Hello,

is there a way to debug unification process in backward chaining (Drools 5.2.0 
feature)?

Jiri Svitak
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users