Re: [rules-users] Concurrency problem in PackageClassLoader

2011-09-29 Thread S_Kumar_P
I also was getting this error. I brought out package building logic to execute 
once, and KnowledgeSession related logic to repeat the required number of times.

Seems there required some delay in preparing rules related classes into one 
package during iteration and loading the same. Above step was working fine for 
me.

Pseudo code:

  KnowledgeBuilder kbuilder = 
KnowledgeBuilderFactory.newKnowledgeBuilder();

  // this will parse and compile in one step

  // get the compiled packages (which are serializable)
  CollectionKnowledgePackage pkgs = null;

  // add the packages to a knowledgebase (deploy the knowledge packages).
  KnowledgeBase kbase = null;

  StatefulKnowledgeSession ksession = null;
  // constructor to be called once
public RuleEngine (byte[] rules) {

kbuilder.add(ResourceFactory.newByteArrayResource(rules),ResourceType.DRL);
//  Check the builder for errors
if (kbuilder.hasErrors()) {
  System.out.println(kbuilder.getErrors().toString());
  throw new RuntimeException(Unable to compile drl.);
}
pkgs = kbuilder.getKnowledgePackages();

// add the packages to a knowledgebase (deploy the knowledge 
packages).
kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(pkgs);
  }

// this method will be called required number of times
  public void fire(Object obj) {

ksession = kbase.newStatefulKnowledgeSession();
ksession.addEventListener(new DebugAgendaEventListener());
ksession.addEventListener(new DebugWorkingMemoryEventListener());

// setup the audit logging
//KnowledgeRuntimeLogger logger = 
KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, log/drools.log);

ksession.insert(obj);

ksession.fireAllRules();

//logger.close();

ksession.dispose();
  }


Check this out.


Thanks  Regards
Santhosh Pallerla

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of nicolas
Sent: Thursday, September 29, 2011 8:09 AM
To: rules-users@lists.jboss.org
Subject: [rules-users] Concurrency problem in PackageClassLoader

Hi,

We are using a single (Drools 5.1.1) Stateless Sessions for the parallel 
processing of thousands of facts.

From time to time we experienced the following error :

org.drools.runtime.rule.ConsequenceException: rule: Priorite - Groupe: 
TMK2612G01, P10

  at 
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
  at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:927)
  at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:856)
  at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1071)
  at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:785)
  at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:751)
  at 
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
  at 
acme.srv.ept.service.impl.traitement.MoteurTraitementDemandes.traiterDemande(MoteurTraitementDemandes.java:121)
(...)
Caused by: java.util.ConcurrentModificationException
  at java.util.HashMap$AbstractMapIterator.checkConcurrentMod(Unknown 
Source)
  at java.util.HashMap$AbstractMapIterator.makeNext(Unknown Source)
  at java.util.HashMap$KeyIterator.next(Unknown Source)
  at java.util.HashMap.analyzeMap(Unknown Source)
  at java.util.HashMap.rehash(Unknown Source)
  at java.util.HashMap.rehash(Unknown Source)
  at java.util.HashMap.putImpl(Unknown Source)
  at java.util.HashMap.put(Unknown Source)
  at 
org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.loadClass(JavaDialectRuntimeData.java:503)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
  at  
acme.srv.ept.regle.Rule_Priorite___Groupe__TMK2612G01__P10_0DefaultConsequenceInvoker.evaluate(Rule_Priorite___Groupe__TMK2612G01__P10_0DefaultConsequenceInvoker.java:29)
  at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:917)
  ... 49 more

We get the same error when we used a pool of Stateless Sessions (serial access) 
based on the same KnowledgeBase for the processing.


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


[rules-users] Guvnor and Axis2

2011-09-29 Thread Mario Viertel
Hi,

I am using an own web service (Axis2; tomcat 6) to interact with Guvnor. 
All drools related jars (drools*, mvel*, knowledge-api) are contained  
in the lib folder of service's aar file. Via knowledge-api the service 
interacts with the guvnor repository.

Unfortunately this doesn't work. At runtime a ClassNotFoundException has 
been thrown. A look into details revealed that the ClassLoader havn't 
loaded all jars containing in webservice's lib folder.

Has anybody an idea what's going wrong. I'm not sure if this is an issue 
of drools, the axis2 engine or the tomcat engine.

Thanks,
Mario
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [rules-dev] java.lang.NullPointerException while testing

2011-09-29 Thread Esteban Aliverti
First of all, I' moving this to drools-users list.
The problem seems to be that the application is not finding the change-set
file. Where is the ChangeSet(12).xml file placed? Is it reachable at the
first level of the classpath? Try to debug and see if the resource is in the
classpath. Try with this first:
this.getClass().getClassLoader().getResource(ChangeSet(12).xml);
Another solution could be to use a URLResource pointing to package's
change-set in Guvnor.

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Thu, Sep 29, 2011 at 9:15 AM, shubhranshu shubhranshu.sw...@gmail.comwrote:

 Hello everybody,

 I am new to drools. We have to integrate drools in our application. After
 lot of searching a found something very helpful. Here is what I did.

 I created a new package say test.
 I uploaded a new jar file which contains my model.
 I created a new category say banking.
 Then I created a rule under the banking category in test package.
 Finally I create a new snapshot for deployment.

 Then I get the changeset.xml
 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://localhost:8080/guvnor-5.2.0.Final-tomcat-6.0/org.drools.guvnor.Guvnor/package/Banking/Test
 '
 type='PKG' /
   /add
 /change-set

 Below is the code to test

 package com.test;

 import junit.framework.TestCase;

 import org.drools.KnowledgeBase;
 import org.drools.agent.KnowledgeAgent;
 import org.drools.agent.KnowledgeAgentConfiguration;
 import org.drools.agent.KnowledgeAgentFactory;
 import org.drools.io.ResourceFactory;
 import org.drools.runtime.StatefulKnowledgeSession;


 public class Test extends TestCase{
   public void testDroolsWithGuvnor() throws Exception {
   KnowledgeBase knowledgeBase = createKnowledgeBase();
   StatefulKnowledgeSession session =
 knowledgeBase.newStatefulKnowledgeSession();
   try {
   Person person = new Person();
   person.setAge(20);
   session.insert(person);
   assertTrue(session.getFactCount() == 1);
   session.fireAllRules();
   assertTrue(session.getFactCount() == 2);
   }
   finally {
   session.dispose();
   }
   }

   public static KnowledgeBase createKnowledgeBase(){
KnowledgeAgentConfiguration kaconf =
 KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
kaconf.setProperty( drools.agent.scanDirectories, false
 );
KnowledgeAgent kagent =
 KnowledgeAgentFactory.newKnowledgeAgent( test
 agent, kaconf );
kagent.applyChangeSet(
 ResourceFactory.newClassPathResource(ChangeSet(12).xml));
return kagent.getKnowledgeBase();

   }
 }

 But when i try to test it using junit i get the following exception.


 java.lang.NullPointerException
   at

 org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgentImpl.java:223)
   at

 org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:189)
   at

 org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:174)
   at com.test.Test.createKnowledgeBase(Test.java:34)
   at com.test.Test.testDroolsWithGuvnor(Test.java:15)
   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 junit.framework.TestCase.runTest(TestCase.java:168)
   at junit.framework.TestCase.runBare(TestCase.java:134)
   at junit.framework.TestResult$1.protect(TestResult.java:110)
   at junit.framework.TestResult.runProtected(TestResult.java:128)
   at junit.framework.TestResult.run(TestResult.java:113)
   at junit.framework.TestCase.run(TestCase.java:124)
   at junit.framework.TestSuite.runTest(TestSuite.java:243)
   at junit.framework.TestSuite.run(TestSuite.java:238)
   at

 org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
   at

 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
   at

 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at

 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
   at

 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
   at

 

Re: [rules-users] DROOLS PLANNER - getting started

2011-09-29 Thread vik
Do you now if
 org.drools.eclipse.feature - 5.1.1 is compatible with drools-planner 5.2?

Thanks :)

--
View this message in context: 
http://drools.46999.n3.nabble.com/DROOLS-PLANNER-getting-started-tp3030567p3378637.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


Re: [rules-users] DROOLS PLANNER - getting started - drools-eclipse-plugin

2011-09-29 Thread Geoffrey De Smet
I 'd recommend using org.drools.eclipse.feature - 5.2
with drools planner 5.2 because drools-planner 5.2 uses drools-core 5.2 
and org.drools.eclipse.feature - 5.2 uses the same exact version.
But 5.1.1 probably mostly works too to edit the score drl files.


Op 29-09-11 10:16, vik schreef:
 Do you now if
   org.drools.eclipse.feature - 5.1.1 is compatible with drools-planner 5.2?

 Thanks :)

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/DROOLS-PLANNER-getting-started-tp3030567p3378637.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


-- 
With kind regards,
Geoffrey De Smet


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


Re: [rules-users] DROOLS PLANNER - getting started - drools-eclipse-plugin

2011-09-29 Thread vik
Do you know if I have to install JBoss Drools Guvnor to work with Drools
Planner to write rules?

--
View this message in context: 
http://drools.46999.n3.nabble.com/DROOLS-PLANNER-getting-started-tp3030567p3378730.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


Re: [rules-users] DROOLS PLANNER - getting started - drools-eclipse-plugin

2011-09-29 Thread Geoffrey De Smet
Not needed, it's optional.

Op 29-09-11 11:05, vik schreef:
 Do you know if I have to install JBoss Drools Guvnor to work with Drools
 Planner to write rules?

 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/DROOLS-PLANNER-getting-started-tp3030567p3378730.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


-- 
With kind regards,
Geoffrey De Smet


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


Re: [rules-users] DROOLS PLANNER - getting started - drools-eclipse-plugin

2011-09-29 Thread vik
I apologize for bothering you so frequently :)...
I still have a problem...
I imported examples\source into eclipse and each time a run it the following
error  shows up 
The working directory should be set to drools-planner-examples.
at
org.drools.planner.examples.common.business.SolutionBusiness.updateDataDirs(SolutionBusiness.java:101)

--
View this message in context: 
http://drools.46999.n3.nabble.com/DROOLS-PLANNER-getting-started-tp3030567p3378876.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


Re: [rules-users] Not able to call parameterizied Java method in LHS

2011-09-29 Thread Tinku
I am facing one more issue with calling a method in lhs of the rule .. 

When I call a method as mentioned below ('getValue' is the method in class
'customObject' and 'numberofObjects' is method in class 'AnotherObject') ;
the drl file has problems in saving in eclipse. 
The error says like 'Multiple Markers at this line' 

*** 
rule A 

when 
$B : customObject() 
$C : AnotherObject() 
eval($C.numberofObjects($B.getValue(Database))  10) 
then 
rhs of the rule
end 

Please help me in this regard..


--
View this message in context: 
http://drools.46999.n3.nabble.com/Not-able-to-call-parameterizied-Java-method-in-LHS-tp3372552p3379014.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


Re: [rules-users] Regression with Drools 5.3.0-CR1

2011-09-29 Thread Edson Tirelli
   JBRULES-2995 is fixed now, except for a corner case when using .class
literals with fully qualified class names. This will be fixed in MVEL for
5.3 final release.

   This works fine now:

Primitives( classAttr == (java.lang.String.class),
  eval(classAttr.equals( java.lang.String.class ) ),
  classAttr == String.class )

Also, some improvements on the free form expression support:

$p1 : Person( age  2*10, 10  age )
$p2 : Person( age  2*$p1.age )

Please let me know if you find any other cases where free form
expressions are raising errors.

Thank you,
Edson

2011/9/26 Edson Tirelli ed.tire...@gmail.com


Ok, this is fixed:

 https://issues.jboss.org/browse/JBRULES-3224

I will check JBRULES-2995 now.

Edson


 2011/9/26 Edson Tirelli ed.tire...@gmail.com


Thanks Wolfgang. That is a different issue related to how MVEL deals
 with class literals. I will check what's the status on it anyway.

Edson


 2011/9/26 Wolfgang Laun wolfgang.l...@gmail.com

 Note that https://issues.jboss.org/browse/JBRULES-2995 reported against
 5.2.0.CR1 and still open might be related.

 -W

 2011/9/26 Edson Tirelli ed.tire...@gmail.com


Thomas,

Thanks for reporting. I will look into it.

Did you open a JIRA yet? Let me know or I will do it otherwise.

Edson

 2011/9/26 Swindells, Thomas tswinde...@nds.com

  I’ve just tried upgrading from Drools 5.3.0-CR1 from the beta and
 I’ve hit a regression.

 ** **

 JBoss seems to have been down for most of today so I haven’t been able
 to raise a Jira for it.

 ** **

 In our model we have Facts which contain fields of java.lang.class, we
 then have a rule which checks that they aren’t null.

 Eg

 Fact { ClassObject classField}

 ** **

 Rule “xyz”

 When

 Fact(classField != null)

 Then

 …

 End

 ** **

 This is giving the following exception

 ** **

 Caused by: java.lang.ClassCastException:
 org.drools.base.field.ObjectFieldImpl cannot be cast to
 org.drools.base.field.ClassFieldImpl

 at
 org.drools.base.evaluators.EqualityEvaluatorsDefinition$ClassEqualEvaluator.evaluate(EqualityEvaluatorsDefinition.java:1772)
 

 at
 org.drools.rule.LiteralRestriction.isAllowed(LiteralRestriction.java:87)
 

 at
 org.drools.rule.LiteralConstraint.isAllowed(LiteralConstraint.java:109)
 

 at
 org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:130)

 at
 org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:451)
 

 at
 org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:369)
 

 at
 org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)

 at
 org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:451)
 

 at
 org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:379)
 

 at
 org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:204)
 

 at
 org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:244)
 

 at
 org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:330)

 at
 org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:291)

 at
 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:882)
 

 at
 org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:180)
 

 ... 149 more

 ** **

 Wrapping the classField != null within an eval appears to be a work
 around.

 ** **

 This is in the suspect method:

 *public* *boolean* evaluate(InternalWorkingMemory
 workingMemory,

 *final* InternalReadAccessor
 extractor,

 *final* Object object1, *final*FieldValue 
 object2) {
 

 Object value1 = extractor.getValue( workingMemory, object1
 );

 Object value2 = object2.getValue();

 *if* ( value2 == *null* ) {

 ClassFieldImpl classField = (ClassFieldImpl) object2;*
 ***

 value2 = classField.resolve( workingMemory );

 }

 *return* *comparator*.equals( value1, value2 );

 }

 ** **

 I think the if statement just needs an instanceof check as well or some
 other way to track the fact that null may be a valid value to be comparing
 with!

 ** **

 ** **

 Thomas

 --


 **
 This message is confidential and intended only for the 

Re: [rules-users] Concurrency problem in PackageClassLoader

2011-09-29 Thread Ziggy
Thank you Santhosh,

Actually we already have the package building logic out of the session
execution stuff.
We will try to create directly a Stateful Session for each call as you did.
For now we are using our Stateless Session as a factory for the Stateful
(@see StatelessKnowledgeSessionImpl.execute(Object)). I'll update the post
with the results.

As a quick fix, we patched the JavaDialectRuntimeData class to synchronize
the loadClass(..) method. We didn't get any other concurrency problem (yet).


Regards,


--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Concurrency-problem-in-PackageClassLoader-tp3378045p3380185.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


Re: [rules-users] Expiry of events not occurring for sliding window

2011-09-29 Thread cfuser
I've done a bit more looking -- based upon what I've read and what I've seen
via testing, you don't need to have a temporal constraint on a CE for it to
be expired, provided there is an explicit one declared.  Is that correct?

That said...

Ok, maybe there is a silly mistake here, but I'm seeing the following expire
and retract objects (note no temporal constraint)


imports

declare CheeseTime
   @role(event)
   @expires(10s)
   @timestamp(timeStamp)
end   


rule Print Objects
when
$m:Object( )
from entry-point stat-stream
then
logger.warn( CheeseTime-- );
logger.warn( --+$m);
end



(note the Object() ) but not this

(same declarations except replacing the rule)


rule Print CheeseTime
when
$m:CheeseTime()
from entry-point stat-stream
then
logger.warn( Object-- );
logger.warn( --+$m);
end




For CheeseTime


public class CheeseTime {

private String type;
private long cost;
private Date timeStamp;
  :
}



Clearly, I'm missing something...

--
View this message in context: 
http://drools.46999.n3.nabble.com/Expiry-of-events-not-occurring-for-sliding-window-tp3362402p3380503.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] Package snapshots in Guvnor have wrong list of rules

2011-09-29 Thread sappelhans
Using Guvnor 5.1.1, I build a package using a custom selector that filters on
a rules' status; then take a snapshot.  In the Package Snapshot tab
selecting Business rule assets from the navigation tree shows all the
rules from the package, not the filtered subset.  But I know the selector
worked because the binary version of the snapshot downloaded via the
Deployment URL includes only the filtered subset.

Why are the assets viewable in the tree not in sync with those in the
deployed binary?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Package-snapshots-in-Guvnor-have-wrong-list-of-rules-tp3380570p3380570.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


Re: [rules-users] Guvnor Repository Report

2011-09-29 Thread sanjuk72
Thank you Jilu, this is very helpfull.




From: jliu [via Drools] ml-node+s46999n3378073...@n3.nabble.com
To: sanjuk72 sank1...@yahoo.com
Sent: Wednesday, September 28, 2011 10:51 PM
Subject: Re: [rules-users] Guvnor Repository Report


On 2011/9/29 2:07, Vincent Legendre wrote: 
Yes you can do all that (but don't know about getting history infos). A old 
post from Jervis Liu linked to more info on REST API here 
http://blog.athico.com/2011/03/atompub-interface-for-guvnor.html and 
http://community.jboss.org/wiki/AtomPubinterfaceforGuvnor


The latest REST doc can be found from here: 
https://hudson.jboss.org/jenkins/job/guvnor/lastSuccessfulBuild/artifact/guvnor-docs/target/docbook/publish/en-US/html_single/index.html#d0e1856
Both package and asset version history info are supported. 

Cheers,
Jervis

But you may start by using the existing report. If you go under Guvnor and see 
the package page, in the URL listing part, you will find a documentation 
link, which generates a PDF report with all your assets (don't know for 
history).

Le 28/09/2011 19:08, Michael Anstis a écrit : 
Have a look at the REST API documented in the user guide.

I suspect you'll be able to get a list of packages, and for each
a list of assets.


On 28 September 2011 17:59, sanjuk72 [hidden email] wrote:

I have a following need:

We are maintaining all rules in GUVNOR.
We need to run a weekly report displaying all the Rules and
there related
information like change history.


Qs: How can I access the GUVNOR repository to get this
information. If
anyone can please help.

Thanks

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-Repository-Report-tp3376667p3376667.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
  

 

___
rules-users mailing list [hidden email] 
https://lists.jboss.org/mailman/listinfo/rules-users   

 

___
rules-users mailing list [hidden email] 
https://lists.jboss.org/mailman/listinfo/rules-users   

___ 
rules-users mailing list 
[hidden email] 
https://lists.jboss.org/mailman/listinfo/rules-users





 
If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/Guvnor-Repository-Report-tp3376667p3378073.html
  
To unsubscribe from Guvnor Repository Report, click here.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-Repository-Report-tp3376667p3380871.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


Re: [rules-users] Drools 5 PseudoClock with StatelessKnowledgeSession

2011-09-29 Thread sanjuk72
Hi,

I wanted to know if you found any solution to this. I have a same issue, 
I need to run the legagcy rules and for that need to change the date that
rules have using the date-effective and date-expiry.

I was thinking of using this functionality, but it seems not available with
Stateless Sessions.

Please let me know

thanks

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-5-PseudoClock-with-StatelessKnowledgeSession-tp62084p3380930.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


Re: [rules-users] Drools 5 PseudoClock with StatelessKnowledgeSession

2011-09-29 Thread Mark Proctor
Look at the interval timer test here from line 254 onwards, and the 
subsequent cron tests:

https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/integrationtests/TimerAndCalendarTest.java#L254


On 13/10/2009 00:32, Ben Scott wrote:


Note: This e-mail is subject to the disclaimer contained at the bottom 
of this message.



I'm wanting to use the date-effective and date-expiry rule metadata to 
add date specific rule variants within my app. To test these I was 
planning on using the pseudo clock and setting the expected date prior 
to executing the rules within a StatelessKnowledgeSession. I can set 
the clock easily enough, but can't understand why the 
getSessionClock() method is missing? It's on the 
StatefulKnowledgeSession, but not on the Stateless.

I'm initialising the session like this:
SessionConfiguration sessionConfiguration = new SessionConfiguration();
sessionConfiguration.setClockType( ClockType.PSEUDO_CLOCK );
StatelessKnowledgeSession session = 
_testKnowledgeBase.newStatelessKnowledgeSession(sessionConfiguration);
The only thing I could think of to set the pseudo clock was to write a 
command something like:
private static class SetPseudoClockCommand implements 
org.drools.process.command.CommandBoolean {

public Boolean execute(ReteooWorkingMemory session) {
// Set the clock to the current date
pseudoSessionClock.advanceTime(new DateTime().getMillis(), 
TimeUnit.MILLISECONDS);

// Add a couple of days
pseudoSessionClock.advanceTime(2, TimeUnit.DAYS);
return true;
}
}
But this doesn't appear to take any effect whilst rules are running.
Is there another way to get programmatic access to the session clock, 
or some better way of changing the underlying date prior to rule 
execution?

Ben.


The information transmitted in this message and its attachments (if 
any) is intended only for the person or entity to which it is addressed.


The message may contain confidential and/or privileged material. Any 
review, retransmission, dissemination or other use of, or taking of 
any action in reliance upon this information, by persons or entities 
other than the intended recipient is prohibited.


If you have received this in error, please contact the sender and 
delete this e-mail and associated material from any computer.


The intended recipient of this e-mail may only use, reproduce, 
disclose or distribute the information contained in this e-mail and 
any attached files, with the permission of the sender.


This message has been scanned for viruses with Symantec Scan Engine 
and cleared by MailMarshal.





___
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