2 years ago

#41098

test-img

Lordao

Parametrize the after operator in drools

i have a fairly simple question, i have this rule

rule 'Rule1'
    when  
        $inMess : MetaMessage()
        not(MetaMessage(this after[0, 10000] $inMess, this != $inMess))
    then  
        log.info("Message id:"+ $inMess.getId());
end

It works perfectly (in the after operand, if you use only a number it assumes milliseconds), i have only one other thing to do, parametrize the after operator so it can accept a property of the MetaMessage.

Something like this

rule 'Rule1'
    when  
        $inMess : MetaMessage($delay : delay)
        not(MetaMessage(this after[0, $delay] $inMess, this != $inMess))
    then  
        log.info("Message id:"+ $inMess.getId());
end

Is there a way to do this?

drools

0 Answers

Your Answer

Accepted video resources