[rules-users] Is it possible to leave the "then" block empty?

Aleksandar Toshovski balex4o at gmail.com
Tue May 21 13:12:57 EDT 2013


How? When I try something like this:

rule "AttributeChange EAttribute id"
    when
        diff: IDiff( operationType == OperationType.ADD, differenceType == DiffType.ATTRIBUTE, parameter=="id", !oldValue.equals(newValue) )
end

I get the following error:

Error: [12,0]: [ERR 102] Line 12:0 mismatched input 'end' in rule "AttributeChange EAttribute id"
Error: [0,0]: Parser returned a null Package


Also I get an error when I try to use something like this:

rule "AttributeChange EAttribute id"
    when
        diff: IDiff( operationType == OperationType.ADD, differenceType == DiffType.ATTRIBUTE, parameter=="id", !oldValue.equals(newValue) )
    then
end


Error: Rule Compilation error : [Rule name='ReferenceChange EClass add Attribute/Reference']


Can you give me an example?

On May 21, 2013, at 7:07 PM, Wolfgang Laun wrote:

> On 21/05/2013, Aleksandar Toshovski <balex4o at gmail.com> wrote:
>> Hello,
>> 
>> I have many rules, which have exactly the same "then" block. Is it possible
>> to leave the then cause empty?
> 
> Yes.
> -W
> 
>> I only need to know is if a rule was
>> activated or not and for this reason I'm using
>> WorkingMemoryConsoleLogger.activationCreated().
>> 
>> Best Regards,
>> Aleksandar Toshovski
>> 
>> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130521/76a21ce7/attachment.html 


More information about the rules-users mailing list