Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Problem in simple rule

Hi Javier,

there are two possible solutions:

1) remove the stars and use a LoopUnit to translate one process after another. In this case, you need to use a <<forbid>> action to ensure that you are not translating the same process twice.

2) Keep the stars, remove the parameter from the rule, save the diagram and open the *.henshin file (in the tree-based editor). Then navigate to the the rule, unfold it and look for the multi-rule in this rule and add the parameter to this multi-rule.

I know that this is not really intuitive. It is compliant with the underlying concepts but there should be an easier syntax for this.

Cheers,
Christian



 


2014-04-13 17:52 GMT+02:00 Javier Scayola <javier.scayola@xxxxxxxxx>:
Hi Christian,

My tests already had the stars, but unfortunatelly is not working. 

I'm attaching an example with 4 rules (a1, a2, b1, b2).

Rule a1 Result: "The transformation could not be applied to the given model"
Rule a2 Result: Generates 3 classes but in order to make it work I had to remove the attributes, so it is not assigning class Names.

Rule b1 Result: "The transformation could not be applied to the given model"
Rule b2 Result: Generates 3 classes but in order to make it work I had to remove the attributes, so it is not assigning class Names.

In all my tests I'm ignoring the parameter.

Thanks for your time!

Cheers,
Javier


On Sun, Apr 13, 2014 at 11:55 AM, Christian Krause <henshin.ck@xxxxxxxxx> wrote:
Hi Javier,

if you set it to "Ignore", it should actually be applicable.

To translate all processes at once, you can change the rule in the following way: change all <<preserve>> actions to <<preserve*>>, and all <<create>> to <<create*>> (note the star). In the wizard, you can again ignore the procName parameter.

If you still cannot apply the rule using "Ignore", you can send us your example and we can check whether there problem is.

Cheers,
Christian 


2014-04-13 16:26 GMT+02:00 Javier Scayola <javier.scayola@xxxxxxxxx>:

Hi Christian,

Thank you very much for the quick response.

I tried that and now I can assign a value to the procName parameter and it works fine for one Process. 
For example if I assign a value to the parameter (shown in attachment ParameterSet.png) the result is what I would expect for one Process (as shown in ParameterSetResult.png).

But, what I need is the rule to create a class for each Process, that should be 3 classes, each with its corresponding name. So, in order to do that, I tried assigning "Ignore" to the parameter. But the result is again "The transformation could not be applied to the given model". 

Is there any value I can assign to the parameter to produce the behavior I expect?

Cheers,
Javier



On Sun, Apr 13, 2014 at 10:55 AM, Christian Krause <henshin.ck@xxxxxxxxx> wrote:
One more remark: you can also take a look at the bank example to see how parameters can be used:


Cheers,
Christian


2014-04-13 15:53 GMT+02:00 Christian Krause <henshin.ck@xxxxxxxxx>:

Hi Javier,

the problem here is that you are using a variable called "procName" which you haven't declared. The way to do it would be to add a parameter called "procName" to the rule. In the graphical editor, you can click on the rule name label in the top and change "aaaaa" to either:

aaaaa(procName)

or

aaaaa(procName : EString)

In both cases, a parameter "procName" is declared which the rule can then use to match the process name attribute. This parameter can (but does not have to be) typed, as shown in the second version.

I hope this helps.

Cheers,
Christian


2014-04-13 15:22 GMT+02:00 Javier Scayola <javier.scayola@xxxxxxxxx>:
Hi all,

I'm using henshin to do some basic transformations, but I'm having a problem I hope you can help me with.

I want to transform the model in the attachment ModelToTransform.png, applying the transformation in the attachment RuleToApply.png. But when I try to run the transformation, I receive the error: "The transformation could not be applied to the given model".

What I want to do is a rule to create a Class for each Process, assigning the process name to the created class name. There are 3 Processes in the model, so I expect the transformation to create 3 Classes with its process names.

Could you help me identify the problem?

Thanks in advance.

Regards,
Javier



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev




_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



Back to the top