Create edges between siblings [message #1549213] |
Tue, 06 January 2015 06:40  |
Eclipse User |
|
|
|
Hi there !
I recently got into Sirius in order to create a specific XML editor and I am having troubles with edge creation.
The part of my XML files I want to represent and edit looks like this :
<flow>
<action name="action1" />
<action name="action2" />
<action name="action3" />
<action name="action4" />
</flow>
I want to draw edges between contiguous <action> nodes, that is I want 3 edges which go from "action1" to "action2", from "action2" to "action3" and from "action3" to "action4". I was able to draw edges between all nodes using a target query like [thisEObject.siblings() /] but not to select only the next one.
Of course when I will be editing the edges I want the nodes to be put in the right order in the XML file.
The XML Schema which defines the files I have to edit is normalized and therefore I cannot change it if I want to remain compliant.
I am not sure if there is a solution to my problem but if yes I would be very happy if you could share it.
Thanks in advance,
Maxime
|
|
|
|
|
|
|
Re: Create edges between siblings [message #1565350 is a reply to message #1563632] |
Thu, 15 January 2015 03:16   |
Eclipse User |
|
|
|
Hi Maxime,
This is a known limitation of Java service with Acceleo, see warning at
the end of Sirius specifier manual [1].
[1]
https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html
Best Regards.
Le 14/01/2015 11:04, Maxime Pété a écrit :
> Hello again !
>
> I am still trying to reconnect those edges bt I am facing an issue I
> can't seem to correct.
>
> I have created a sample Java class to test the connections between the
> service and my Sirius model. The class looks like this :
>
> public class ContainerModificationServices {
> public String printFlow1(Flow flow) {
> return "Flow";
> }
>
> public String printFlow2(Flow flow, Integer index) {
> return "Flow";
> }
>
> public Flow insertAction(Flow flow, Integer sourceIndex, Integer
> targetIndex) {
> return flow;
> }
> }
>
>
> I wanted to stay simple to understand what's happening so I only used
> these to write the labels on my Flow containers. When I invoke those
> methods I get the following results :
>
>
> - [self.printFlow1() /] works
> - [self.printFlow2(0) /] doesn't work and I get a message in the console
> which says "!MESSAGE Compilation error for expression
> [self.printFlow2(0)/] : Cannot find operation (printFlow2(Integer)) for
> the type (Flow)"
> - [self.insertAction(1, 3).printFlow1() /] doesn't work and I get a
> message in the console which says "!MESSAGE Compilation error for
> expression [self.insertAction(1, 3).printFlow1()/] : Cannot find
> operation (insertAction(Integer, Integer)) for the type (Flow)"
>
>
> I guess I'm doing something wrong when I pass my Integer parameters but
> I didn't figure out what...
>
> Best regards,
>
> Maxime
--
Esteban Dugueperoux - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: Create edges between siblings [message #1565394 is a reply to message #1565350] |
Thu, 15 January 2015 03:52  |
Eclipse User |
|
|
|
Hi Esteban
I had read about this limitation before and I think I am using the Integer type the whole way long... Anyway, I changed the signature of my method so that it takes a String instead of an Integer (and then parsing the String in order to get an int in the Java code) but I still get this warning that my method is not found. It seems that the system somehow doesn't work when there is more than one parameter in the Java method.
Regards,
Maxime
|
|
|
Powered by
FUDForum. Page generated in 0.03198 seconds