[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-user] How to easily increment (add 1 to) a parameter?

Hi Benjamin,

as Steffen already said, doing increments is not a strength of Henshin.
The way you are doing this is the best workaround I know.
However, if you don't want to abuse elements of your current models you could use the Henshin Trace model and its name attribute as supplement. Obviously, in that case you might need to parse the EString of the name attribute.

Best wishes,

On 26.07.2018 15:35, Benjamin Heidelmeier wrote:
Dear Henshin Users,
in the process of creating a set of Henshin Units and Rules I stumbled upon a task, which ideally should be easy to deal with: I want to increment an integer parameter. I attached an image of the units and rules I set up to do this. It feels very bloated if you consider the only thing which should be done is incrementing a parameter.

The attached image shows the unit incrementHour which takes the IN parameter "hour" and outputs the OUT parameter "oneMore" which is hour+1. The object Temp you can see in the rules exists for the sole purpose to make incrementing possible. It has one attribute "tempInt" of type EInt, which temporarily stores the parameter value that is going to be incremented.

Do you have any idea how to do this "better"? E.g. one of the following properties:
- less rules/units,
- without an instance object,
- or whatever you consider smarter

I would be happy to hear any suggestions from you.

Kind regards,

_______________________________________________ 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