Avirail | 1 Aug 2012 10:55
Picon
Favicon

Simple declared Variable

Hello people,

i have a simple question about building a rule. Is there a possibility to
build something like this:

I only want to compare two declared variables, unfortunately the forum
search and google don“t delivered any results.

Thank you,
Philipp

--
View this message in context: http://drools.46999.n3.nabble.com/Simple-declared-Variable-tp4018979.html
Sent from the Drools: User forum mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
jpullmann | 1 Aug 2012 11:52
Picon
Favicon

Matching consecutive events

Dear contributors, 

  this rule is expected to match a sequence of 2 consecutive events: 

rule "test"		
    when        
        // a)
       	$ev1 : LocalizationEvent( type == TYPE.HINT,  $target : target  )
from entry-point "events/localization"       	      
       	$ev2 : LocalizationEvent( type == TYPE.HINT, target == $target, this
after $ev1 ) from entry-point "events/localization"
       	// b) 
        // Ev1 directly followed by ev2: no other HINT in between
       	not( LocalizationEvent( type == TYPE.HINT, target == $target, this
after $ev1, this before $ev2 )  from entry-point "events/localization" )
    then    
      do()
end

 The second event is interpreted as a "confirmation" of the first event (a). 
 No other (deviating) event is allowed between them (b). With this
restriction 
 in place, the rule requires a sequence of 3 input events for activation,
otherwise 
 2 events are sufficient (as expected). The events are ordered correctly and
it is 
 not obvious, why a third event is needed since the interval between ev1 and
ev2 is 
 closed ? This leads to an unnecessary delay in rule activation.. How could
this be 
(Continue reading)

gboro54 | 1 Aug 2012 13:57
Picon

Drools 5.4 - Can't catch Exception

So I keep getting the exceptions below. I have surrounded the fireAllRules
with a try catch throwable block to try and debug this but I never seem to
be able to catch it.  This only happens in the first couple 100 invocations
of the fireAllRules then never happens again(sometimes it never happens at
all). Is there a way to handle this exception or prevent it from happening?
I am assuming that this is occurring do to an activation being evaluated
after the OrderSideContext is retracted from working memory. Anyone else run
into a similar issue?

TIA
-Mike

07:48:35,377 ERROR [stderr] (Thread-118) Exception in thread "Thread-118"
java.lang.RuntimeException: unable to invoke method:
com.billing.domain.context.OrderSideContext.getPrimarySide: target of method
is null
07:48:35,377 ERROR [stderr] (Thread-118)        at
org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:66)
07:48:35,377 ERROR [stderr] (Thread-118)        at
org.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)
07:48:35,378 ERROR [stderr] (Thread-118)        at
org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
07:48:35,378 ERROR [stderr] (Thread-118)        at
org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)
07:48:35,378 ERROR [stderr] (Thread-118)        at
org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:34)
07:48:35,378 ERROR [stderr] (Thread-118)        at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
07:48:35,378 ERROR [stderr] (Thread-118)        at
org.mvel2.ast.Substatement.getReducedValueAccelerated(Substatement.java:44)
(Continue reading)

gboro54 | 1 Aug 2012 14:08
Picon

Re: fire a rule only once (for the time being)

I don't think it would be outrageous to build a stateful session per user.
The expensive part is building the knowledge base. Session creation is
cheap. 

slyfox wrote
> 
> been thinking about this a lot.  I know the real solution is to use
> logical inserts but I'm wondering how it would work in my case.
> 
> The problem is that I may have several users with similar rules.  Again,
> its a financial app so if a user wants to know if a price breaks a certain
> threshold, say low for the day, ideally when that low is broken the fact
> should be removed.  However if I do that, would other user's rules ever
> fire (assuming they are looking for the same criteria)?
> 
> Would it be outrageous to create one session per user?  Is this a lot of
> overhead?
> 

--
View this message in context: http://drools.46999.n3.nabble.com/fire-a-rule-only-once-for-the-time-being-tp4018887p4018982.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

dunnlow | 2 Aug 2012 02:42
Picon
Favicon

Add calendars to knowledge session from Spring?

I am using the Drools 5.4 integration server in a stateless session.  I have
it running fine with the example.  Now, I want to use custom Quartz
calendars in my rules.  The only way I could come up with to do this in
Spring (a la integration server) was to create a bean that takes a ksession
constructer then creates the calendars and adds them to that ksession.  

I see that the bean is created with a knowledge session and all seems ok,
but none of my calendar-based rules ever fire regardless of how the
calendars are configured.  (I test the calendars in my bean (with a call to
isTimeIncluded())  and they seem to be in working order.

Also weird is that bean's constructor gets called twice and with two
different knowledge sessions.  Once when I start the application, and then
again when I send to the rules service.

1) What is the right was to add custom calendars to a knowledge session (via
Spring)?

2) Any idea why my bean is getting called twice with different knowledge
sessions?

Thanks for any insight.  -J

---in knowledge-service.xml
<drools:ksession id="ksession1" type="stateful" kbase="kbase1"
note="node1"/>
<bean id="myCalendar" class="org.test.MyQuartzCalendarLoader">
    <constructor-arg ref="ksession1"/>
 </bean>

(Continue reading)

rodolphio | 2 Aug 2012 08:47
Picon
Favicon

JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier

Hi,

 
I expanded the guvnor.war/WEB-INF/libs with new library demo.jar. 

In all rules the access on every Class in demo.jar is possible with
x.y.z.DemoClass.

 
But the access to a public subclass in the class x.y.z.DemoClass 
x.y.z.DemoClass.DemoSuclass does not work, causes "cannot resolve
identifier" on trying to build the package in guvnor.

 
Any idea?

Thanks for your feedback.

--
View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Bharadwaj N | 2 Aug 2012 08:58
Picon

Re: JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier

hi,


You can just upload the pojo model jar from guvnar and add dependency jars if required and build it.

no need to put pojo model jars inside  guvnor.war/WEB-INF/libs 
On Thu, Aug 2, 2012 at 12:17 PM, rodolphio <m.rindfleisch <at> gameartstudio.de> wrote:
Hi,


I expanded the guvnor.war/WEB-INF/libs with new library demo.jar.

In all rules the access on every Class in demo.jar is possible with
x.y.z.DemoClass.


But the access to a public subclass in the class x.y.z.DemoClass
x.y.z.DemoClass.DemoSuclass does not work, causes "cannot resolve
identifier" on trying to build the package in guvnor.


Any idea?

Thanks for your feedback.




--
View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
rodolphio | 2 Aug 2012 09:09
Picon
Favicon

Re: JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier

Hi bharadwaj2012,

thanks for your fast reply. I'm aware of the option uploading the jar via
guvnor web-interface, but I have to do it the way i described above for
several reasons.

Any ideas for my choosed option?

--
View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984p4018986.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

RulesUsers | 2 Aug 2012 09:14
Picon

Calling a function from When part

Hi All,

As per as my understanding, we cannot call a function from the when part of
a rule.
But my requirement is,

*/function boolean sampleFunction(){
//do something
return true/false;
}

rule "sample"
when
    sampleFunction();
then
    //Take some action
end/*

Thanks in advance.

Regards,
Sam

--
View this message in context: http://drools.46999.n3.nabble.com/Calling-a-function-from-When-part-tp4018987.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

rodolphio | 2 Aug 2012 09:48
Picon
Favicon

Re: JBoss As 7 with guvnor 5.4 - package build error: cannot resolve identifier

In the Jboss console, there comes  folloing log entry when recieving error
message in guvnor:

09:32:00,299 INFO  [org.jboss.as.controller] (MSC service thread 1-3)
Service status report
   New missing/unsatisfied dependencies:
      service jboss.data-source-config.java:jboss/datasources/ExampleDS
(missing)

09:32:00,301 INFO  [org.jboss.as.controller] (MSC service thread 1-1)
Service status report
   New missing/unsatisfied dependencies:
      service jboss.jndi-view.extension.registry (missing)

Maybe this can help for solving my problem?

--
View this message in context: http://drools.46999.n3.nabble.com/JBoss-As-7-with-guvnor-5-4-package-build-error-cannot-resolve-identifier-tp4018984p4018988.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Gmane