[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [henshin-dev] put Model-object as parameter?
|
Am 13.11.2012 15:57, schrieb Christian Krause:
Hi Jens,
I am not sure whether I fully understand what you want to do.
If you
want to set a specific object to be matched, you should pass it as a
parameter or as part of a partial match to the RuleApplication.
Yes, this seems what I want to do, at least I managed to realize what I
want to do by creating a partialMatch with the desired object and doing
the match with it.
If you want to pass a "type" to a rule that should be used for matching
a particular node, then that is a different problem.
Right. This is a task I want to do as well, we already discussed this :)
[…]
you can easily do this by
a "dynamic rule adaptation" at runtime.
This seems to be the right way!
Say you have an EClass "clazz"
that you want to use as the type of a node called "x" in the left-hand
side of a rule. Then you can use this code to dynamically adapt your rule:
Node node = rule.getLhs().getNode("x");
node.setType(clazz);
Nice way and it seems to solve my problem at this point, too! The only
thing I ask myself is:
How do I get the EClass for, lets say my UML-Profile-Stereotype?
Instantiating the Stereotype by hand via plain Java code would be a way,
but this would be rather complex I think, because I would have to do all
the linking with Profile metamodel, and so on manually, right?
And again, thank you very much for your support!
Jens