[rules-users] fusion

rgupta12 rkgupta75 at gmail.com
Fri May 17 16:34:38 EDT 2013


any idea?

Rule Compilation error : [Rule name='check sev']
    drools/cookbook/Rule_check_
sev_0.java (14:699) : $ticket.totalCount cannot be resolved to a type
    drools/cookbook/Rule_check_sev_0.java (16:796) : $ticket cannot be
resolved

Rule Compilation error : [Rule name='check sev']
    drools/cookbook/Rule_check_sev_0.java (14:699) : $ticket.totalCount
cannot be resolved to a type
    drools/cookbook/Rule_check_sev_0.java (16:796) : $ticket cannot be
resolved




package drools.cookbook;

import drools.cookbook.model.Ticket


declare Ticket
    @role(event)
end



rule "check sev"
when

 accumulate( $ticket : Ticket() over window:time(5m) from entry-point
"csupport", $num : count( $ticket ))
then
  $ticket.totalCount = $num;
  System.out.println("num = " + $num);
  update($ticket);
end

rule "alert sev"
when
  Ticket(totalCount == 10)
then
  System.out.println("ALERT ALERT!!!");
end

*********************************************
package drools.cookbook.model;

public class Ticket {
    public int totalCount;

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int times;


    public int getTimes() {
        return times;
    }

    public void setTimes(int times) {
        this.times = times;
    }

    public String sev;

    public String getSev() {
        return sev;
    }

    public void setSev(String sev) {
        this.sev = sev;
    }


}





On Fri, May 17, 2013 at 2:49 PM, Matteo Cusmai <cusmaimatteo at gmail.com>wrote:

> You can use an accumulate function.
> On 17 May 2013 20:31, "Ravi Gupta" <rkgupta75 at gmail.com> wrote:
>
>>  How would one write a rule that checked if say Message has been
>> inserted into the stream 10 times over the last 30 days?
>>
>>
>>
>>
>> _______________________________________________
>> 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
>




--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-fusion-tp4023878p4023883.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130517/64d52f87/attachment.html 


More information about the rules-users mailing list