[rules-users] Error Inserting events into drools fusion stream
Wolfgang Laun
wolfgang.laun at gmail.com
Fri Oct 22 04:30:07 EDT 2010
On 22 October 2010 09:14, Ayush <ayush.vatsyayan at alcatel-lucent.com> wrote:
>
> Thank you for your reply.
>
> I think I was heading into the wrong direction. Now when I've synchronized
> the function which is creating session, session is static and is only
> called
> once, and firing the rules it's working fine. I'm planning to use JMS
> wherein consumer will be syncronized. Is this the right way?
>
Should be OK.
>
> But I've following rule rule
>
> "TwoAlertsFromSameSource"
> no-loop true
> dialect "mvel"
> when
> $RA : AlertReceivedEvent( severity == 2, $entityA : entity )
> over
> window:time(60s) from entry-point NotificationStream
> $RB : AlertReceivedEvent( this != $RA, severity == 1,
> $entityB : entity )
> over window:time(60s) from entry-point NotificationStream
> $alertB : X733Alert(this.entity == $entityB,
> correlationState !=
> CorrelationStates.ROOT_CAUSE)
> $alertA : X733Alert(this.entity == $entityA,
> correlationState !=
> CorrelationStates.SYMPATHETIC)
> then
> System.out.println("#### Running TwoAlertsFromSameSource...
> ####");
> modify($alertB) {
> setCorrelationState("Main");
> }
>
> System.out.println("correlation state
> "+$alertB.getCorrelationState());
>
> modify($alertA) {
> setCorrelationState("Lower");
> }
> end
>
> In above rules it's unable to modify $alertB
This looks fine, and if $alertA is modified, $alertB will be, too - unless
s.th. else
is in error. One possibility is that $alertA and $alertB refer to the same
fact and the
2nd modify ovwrites the 1st.
-W
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101022/1f444ed7/attachment.html
More information about the rules-users
mailing list