Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-user] Error processing attribute update

Thanks. I did indeed miss that bit. I have now fixed it and the rule works.

Many thanks,

Steffen

On 11/03/2016 15:22, Matthias Tichy wrote:
hi,

I haven't used Henshin much before, so this may well be a simple
beginner's error. Unfortunately, the error message I am provided with
isn't awfully helpful and I couldn't figure out what's going on.

I have created a simple transformation using the Henshin diagram editor.
This moves one object from one place to another and updates some
attributes. To express attribute updates, I have used the -> notation as
shown in the Bank tutorial. So, one of the attributes reads
"spaceRemaining=x->x+a.spaceRequired*a.quantity" where "a" refers to a
different node in my rule, which has the attributes mentioned.

> When I run this rule on a model, it is matched (as I would expect), but
> I get the following error:
>> java.lang.RuntimeException: ReferenceError: "x" is not defined in
>> <eval> at line number 1
>>     at
>> org.eclipse.emf.henshin.interpreter.impl.EngineImpl.evalAttributeExpression(EngineImpl.java:946)
>>

please add screenshots in the future, this helps to pinpoint problems.

My assumption based on your description is that you do not have added x as a parameter to the rule.

See the bank example (Rule transferMoney)

https://www.eclipse.org/henshin/examples.php?example=bank

Cheers,

Matthias




_______________________________________________
henshin-user mailing list
henshin-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-user

-- 
Dr. rer. nat. Steffen Zschaler AHEA
Senior Lecturer

King's College London
Department of Informatics

Email szschaler@xxxxxxx
Phone +44 (020) 7848 1513
WWW   http://www.steffen-zschaler.de/

Back to the top