Re: [rules-users] Drools error log msg?

2014-02-25 Thread Markus Schneider
I'll rewrite the rule and give you feedback tomorrow.

"would you be interested in doing some research and see if/how they
impact performance and rule authoring?" - No problem. It would be a
pleasure for me to help.

-markus


2014-02-25 17:22 GMT+01:00 Davide Sottara :

>  The "after 20 facts or so" makes me think that some constraint behaves
> differently when jitted
> (constraints are jitted lazily, to go from interpreted to compiled mode,
> only when they are used
> often enough).
> In fact, there was a bug that was fixed a few days ago regarding a
> different behavior of "contains".
> The interpreted version would work as String.contains, while the compiled
> version would work
> as Collection.contains - or vice versa, I don't remember right now.
>
> Unfortunately, the fix can't be backported to 5.5.0.Final.
> Can you try to rewrite constraints like :
>
> _name:catalog['name'] not contains 'Timer'
>
> into
>
> _name:catalog['name'], ! ((String) catalog['name']).contains( 'Timer' )
>
> and see if the situation improves?
>
>
> On a totally unrelated topic...
> I have also noticed that you have a very peculiar data model..
> we developed traits in 5.6 and 6.x to deal with relational models like
> yours..
> would you be interested in doing some research and see if/how they
> impact performance and rule authoring?
> Davide
>
>
>
> On 02/25/2014 02:31 PM, Markus Schneider wrote:
>
> The reason why I've activated the logging was that some rules are not
> fired after inserting a special
> amount of facts - in my case exactly 20.
>
> Some more details here:
> I work on an Event Correlation & Analysis OSS solution that's based on
> Grails & Drools 5.5.0-Final.
> I'm using a stateful knowledge session and only call dispose() when the
> app is stopped - but all facts
> are retracted. The functional testing works fine but as I've mentioned it
> before when I run the integration
> testing it fails, because rules are not fired ('ClearAlertRule' is not
> fired) when I insert more than 20 facts.
> I saw the errors in the drools log but I didn't know if they were relevant
> for my problem here.
>  I've attached two picts which document the right and the wrong behavior
> of the rule processing
>  - also I've listed the rules of my rulebase.
>
>  Has anybody an idea?
>
>  Cheers,
>
>  -markus
>
>
> //--
> rule 'UpdateAlertRule'
> //--
>dialect  'mvel'
>salience 900
>no-loop
>when
>  _event : Event(eventClass == "Event",
> _name:catalog['name'],
>  _category:catalog['category'],
>  _severity:catalog['severity'],
>  _state:catalog['state'],
>  _source:catalog['source'],
>  _subSource:catalog['subSource'],
>  _origin:catalog['origin'],
>  _subOrigin:catalog['subOrigin'],
>  _owner:catalog['owner'],
>  _description:catalog['description'],
>  _selector:("from Alert where " +
> "name='" + catalog['name'] + "' " +
> "and severity='" + catalog['severity'] + "' " +
> "and not state='Closed'"
>  )
>   )
>  eval(isDuplicate(_event,"UpdateAlertRule",_selector) == true)
>then
> System.out.println("UpdateAlertRule is processed.")
>  EntityBuilder entityBuilder = new EntityBuilder();
>  entityBuilder.addProperty("modifiedBy","UpdateAlertRule");
> entityBuilder.addProperty("counter",1);
>  AlertHandler alertHandler = new
> AlertHandler(entityBuilder.getProperties(),_selector);
>  alertHandler.update();
>  RuleLogHandler ruleLogHandler = new RuleLogHandler();
> ruleLogHandler.create("UpdateAlertRule",_name);
>end
>
> //--
> rule 'ClearAlertRule'
> //--
>dialect  'mvel'
>salience 800
>no-loop
>when
>  _event : Event(eventClass == "Event",
> _name:catalog['name'] contains 'Info',
>  _category:catalog['category'],
>  _severity:catal

Re: [rules-users] Drools error log msg?

2014-02-25 Thread Markus Schneider
Hi Davide,

thank you for the fast response. I've defined an DebugAgendaEventListener
as it's described here:
Drools Docu 5.5.0-Final/Section 7.2/HelloWorld example.
http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html/index.html

Where can I find any docu about the config of the DebugAgendaEventListener?

Cheers,

-markus




2014-02-25 12:59 GMT+01:00 Davide Sottara :

>  You likely have configured a DebugAgendaEventListener, which logs agenda
> events (rules activated, fired, etc..)
> on the standard error rather than the standard output. If you want a
> different behavior, remove the listener
> and implement one of your own.
> These are not errors anyway.
> Davide
>
>
> On 02/25/2014 09:40 AM, Markus Schneider wrote:
>
>  Hi list,
>
>  I see the following error msg in my drools log but I don't know how to
> interpret this.
>  Do I have a serious problem here?
>
>  Has anybody a clue?
>
>  Thanks in advance.
>
>  Cheers,
>
>  -markus
>
> | Error ==>[AfterActivationFiredEvent: getActivation()=[Activation
> rule=UpdateAlertRule, act#=37, salience=900, tuple=[fact
> 0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event : 19]
> ],
> getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87
> ]
> | Error ==>[BeforeActivationFiredEvent:  getActivation()=[Activation
> rule=EventRetractionRule, act#=36, salience=1, tuple=[fact
> 0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event : 19]
> ],
> getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87
> ]
> EventRetractionRule is processed.
> | Error ==>[ObjectRetractedEventImpl: getFactHandle()=[fact
> 0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event :
> 19], getOldObject()=rapideca.plugins.rbm.entity.Event : 19,
> getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87,
> getPropagationContext()=PropagationContextImpl [activeActivations=0,
> dormantActivations=2, entryPoint=EntryPoint::DEFAULT, factHandle=[fact
> 0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event :
> 19], leftTuple=[fact
> 0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event : 19]
> , originOffset=-1, propagationNumber=40, rule=[Rule
> name=EventRetractionRule, agendaGroup=MAIN, salience=1, no-loop=true],
> type=1]]
> 2014-02-25 08:59:03,524 [eventQueueReceiverJmsListenerContainer-1] INFO
> log.RuleLogHandler  - RuleLog with id: 38 was successfully saved.
> | Error ==>[AfterActivationFiredEvent: getActivation()=[Activation
> rule=EventRetractionRule, act#=36, salience=1, tuple=[fact
> 0:-1:184363445:184363445:19:null:null]
> ],
> getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87
> ]
>
>
> ___
> rules-users mailing 
> listrules-users@lists.jboss.orghttps://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

[rules-users] Drools error log msg?

2014-02-25 Thread Markus Schneider
Hi list,

I see the following error msg in my drools log but I don't know how to
interpret this.
Do I have a serious problem here?

Has anybody a clue?

Thanks in advance.

Cheers,

-markus

| Error ==>[AfterActivationFiredEvent: getActivation()=[Activation
rule=UpdateAlertRule, act#=37, salience=900, tuple=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event : 19]
],
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87]
| Error ==>[BeforeActivationFiredEvent:  getActivation()=[Activation
rule=EventRetractionRule, act#=36, salience=1, tuple=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event : 19]
],
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87]
EventRetractionRule is processed.
| Error ==>[ObjectRetractedEventImpl: getFactHandle()=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event :
19], getOldObject()=rapideca.plugins.rbm.entity.Event : 19,
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87,
getPropagationContext()=PropagationContextImpl [activeActivations=0,
dormantActivations=2, entryPoint=EntryPoint::DEFAULT, factHandle=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event :
19], leftTuple=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event : 19]
, originOffset=-1, propagationNumber=40, rule=[Rule
name=EventRetractionRule, agendaGroup=MAIN, salience=1, no-loop=true],
type=1]]
2014-02-25 08:59:03,524 [eventQueueReceiverJmsListenerContainer-1] INFO
log.RuleLogHandler  - RuleLog with id: 38 was successfully saved.
| Error ==>[AfterActivationFiredEvent: getActivation()=[Activation
rule=EventRetractionRule, act#=36, salience=1, tuple=[fact
0:-1:184363445:184363445:19:null:null]
],
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87]
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] Drools 6 - Trouble with newReaderResource(Reader reader)

2013-10-01 Thread Markus Schneider
Hi list,

try to make my first experiences with Drools 6. For that purpose I've
modified slightly the 'KieFileSystemExample'
(
https://github.com/droolsjbpm/drools/blob/6.0.0.CR3/drools-examples-api/kiefilesystem-example/src/main/java/org/drools/example/api/kiefilesystem/KieFileSystemExample.java
)
as the code below shows. I try to use the newReaderResource(Reader reader)
but when I run maven test I get
the following error:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.33 sec
<<< FAILURE! - in
org.drools.example.api.kiefilesystem.KieFileSystemExampleTest
testGo(org.drools.example.api.kiefilesystem.KieFileSystemExampleTest)  Time
elapsed: 0.263 sec  <<< ERROR!
java.lang.RuntimeException: Unable to fetch module from resource
:[ReaderResource resource=java.io.StringReader@6a5714de encoding='null']
at java.io.ByteArrayInputStream.(ByteArrayInputStream.java:106)
at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:192)
at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.addKieModule(KieRepositoryImpl.java:157)
at
org.drools.example.api.kiefilesystem.KieFileSystemExample.go(KieFileSystemExample.java:39)
at
org.drools.example.api.kiefilesystem.KieFileSystemExampleTest.testGo(KieFileSystemExampleTest.java:16)

public class KieFileSystemExample {

public String getRule() {
String s = "" +
   "package org.drools.example.api.kiefilesystem \n\n" +
   "import org.drools.example.api.kiefilesystem.Message
\n\n" +
   "global java.io.PrintStream out \n\n" +
   "rule \"rule 1\" when \n" +
   " m : Message( ) \n" +
   "then \n" +
   " out.println( m.getName() + \": \" + m.getText() ); \n"
+
   "end \n" +
   "rule \"rule 2\" when \n" +
   " Message( text == \"Hello, HAL. Do you read me, HAL?\"
) \n" +
   "then \n" +
   " insert( new Message(\"HAL\", \"Dave. I read you.\" )
); \n" +
   "end";
return s;
}

public void go(PrintStream out) {

KieServices ks = KieServices.Factory.get();
KieRepository kr = ks.getRepository();

KieModule kModule =
kr.addKieModule(ks.getResources().newReaderResource( (Reader) new
StringReader(getRule()) ));

KieContainer kContainer =
ks.newKieContainer(kModule.getReleaseId());
KieSession kSession = kContainer.newKieSession();
kSession.setGlobal("out", out);

kSession.insert(new Message("Dave", "Hello, HAL. Do you read me,
HAL?"));
kSession.fireAllRules();
}

public static void main(String[] args) {
new KieFileSystemExample().go(System.out);
}
}

Any Idea?

Thanks in advance.

Regards,

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

Re: [rules-users] Drools 6 Spring JTA Persistence

2013-09-04 Thread Markus Schneider
Hi Alex,

I'm developing a Grails Drools Plugin, too. At the moment I'm working on an
ECA (Event Correlation & Analysis) solution so my current focus is on
expert & fusion. But jBPM is also an important module that I'll need in the
future.
Maybe we can come togehter and create one feature rich grails plugin.
Let me know if you're interested.

Cheers

-markus





2013/9/4 Alexander Herwix 

> Hey Martin,
>
> haven't looked at your code yet, but I have Drools 6 CR1 and 2 running in
> grails though without local HT and JTA persistence. It was pretty straight
> forward, just included the dependencies and pruned duplicate entries (check
> the dependency report).
>
> If I get the plugin working I would be glad to share a demo project.
> However, I think that a fully fledged release of the plugin to grails
> central would take some more time.
>
> Cheers, Alex
>
> Am 03.09.2013 um 21:23 schrieb Martin Minka :
>
> Alex,
> I am sorry, I don't have solution for your problem, but maybe I will work
> soon on same issue.
> Are you using Drools 6.0.0.CR2 ? If yes, where you able to overcome this
> problem
> http://drools.46999.n3.nabble.com/rules-users-classloader-problem-in-Drools-6-0-0-CR1-and-CR2-working-in-Beta5-td4025726.html?
>
> Do you mind to share your plugin code with community ?
>
> Best regards,
> Martin
>
>
>
> 2013/9/3 Alexander Herwix 
>
>> Hey guys,
>>
>> I'm working on a Grails plugin for Drools/Jbpm 6 and I have trouble to
>> get persistence working in a user friendly way. It would be awesome if
>> someone with a better understanding of drools and especially drools spring
>> integration could help me to figure this out :)
>>
>> I have considered multiple approaches:
>>
>> - Use a spring LocalContainerEntityManagerFactoryBean with a local
>> JpaTransactionManager to configure a KieEnvironment via Spring.
>>
>> I basically got this working, but this doesn't provide real integration
>> with Grails, as there are 2 seperate local TransactionManagers involved -
>> limiting the ability to integrate drools in the grails app.
>>
>> - Use JTA-Transactions.
>>
>> As I want the plugin to be as user friendly as possible I would like to
>> keep using the default tomcat container for development. There is the
>> Atomikos Plugin for Grails which configures Grails to work with JTA. This
>> works pretty nicely and should suffice for the development environment.
>>
>> My problem is integrating the Atomikos backed JTATransactionManager with
>> the drools 6 spring environment configuration as I have not much experience
>> with JTA. I have looked at the Tests for Kie-Spring and looked at as much
>> documentation as I could find, but I can't seem to figure this out.
>>
>> This is what I use to configure the environment via spring (in Grails
>> groovy syntax)
>>
>> jbpmGlobals(MapGlobalResolver)
>>
>> dacceptor(ClassObjectMarshallingStrategyAcceptor,['*.*'])
>>
>> kie.kstore(id:'kiestore')
>>
>> kie.environment(id: 'jbpmEnv'){
>> kie.'entity-manager-factory'(ref:'entityManagerFactory')
>>
>> kie.globals(ref:'jbpmGlobals')
>>
>> kie.'object-marshalling-strategies'(){
>> kie.'jpa-placeholder-resolver-strategy'()
>>
>> kie.'serializable-placeholder-resolver-strategy'('strategy-acceptor-ref':"dacceptor")
>> }
>> }
>> //Tried to wrap my JtaTransactionManager with KieSpringTransactionManager
>> jbpmTransactionManager(KieSpringTransactionManager,
>> ref('transactionManager'))
>>
>>
>> the environment value for transactionManager cannot be set here, because
>> the parser expects a JpaTransactionManager. I tried to add the
>> transactionManager manually to the environment and found the
>> KieSpringTransactionManager, which looked like it could help me somehow,
>> but in the end, there is always the default implementation of the
>> JtaTransactionManager used which can't find the transactionManager that I
>> configured.
>>
>> Error:
>> NamingException occurred when processing request: [GET] /bpm/test/testJbpm
>> Cannot create resource instance. Stacktrace follows:
>> javax.naming.NamingException: Cannot create resource instance
>>  at
>> org.apache.naming.factory.TransactionFactory.getObjectInstance(TransactionFactory.java:116)
>> at
>> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
>>  at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
>> at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
>>  at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
>> at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
>>  at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
>> at javax.naming.InitialContext.lookup(InitialContext.java:411)
>>  at
>> org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:122)
>> at
>> org.drools.persistence.jta.JtaTransactionManager.(JtaTransactionManager.java:69)
>>  at
>> org.drools.persistence.SingleSessionCommandService.in

Re: [rules-users] timer in stateless kbsession?

2013-08-13 Thread Markus Schneider
Thanx for the fast response. That's what I've assumed but I wasn't really
sure.

-markus


2013/8/13 Wolfgang Laun 

> Doesn't make much sense to have timers in a stateless session. Just
> use a stateful session.
> -W
>
> On 13/08/2013, Markus Schneider  wrote:
> > Hi list,
> >
> > short question regarding timers. Are they available in stateless
> sessions?
> >
> > Regards,
> >
> > -markus
> >
> ___
> 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] timer in stateless kbsession?

2013-08-13 Thread Markus Schneider
Hi list,

short question regarding timers. Are they available in stateless sessions?

Regards,

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