Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Unexpected getAction() behavior

Hi Sebastian,

On 09/02/2014 01:51 PM, Sebastian Gabmeyer wrote:
> Hi!
>
> I stumbled over some unexpected behavior, well at least from my
> perspective ;) Here are the details: I'm iterating over the nodes
> of the RHS graph and would like to check whether the node is
> preserved or created. So I call the GenericActionHelper.getAction()
> method which - unfortunately - returns null if the node is
> preserved. Is this behavior intended or is it a bug?

You should use Node.getAction(). But that's not the main point. Yes, the returned action can be null. This is because it is important for us that we always have a unique "action node" that we can refer to in the editor. In the case of preserve-nodes, this would be the LHS node (not the RHS node).

You can use NodeActionHelper.INSTANCE.getActionNode() to find the corresponding action node (with a non-null action).

An alternative to iterating over the RHS is to call Rule.getActionNodes(). You can either specify the action, or pass null to get all action nodes.

>
> BTW, the comment in line 97 of GenericActionHelper in method
> getAction() should probably read
>
> // If it doesn't have an origin in the LHS, it is a CREATE-action:
>
> instead of
>
> // If it has an origin in the LHS, it is a CREATE-action:
>

You are right. Thanks for giving this feedback.

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

- --
Sebastian Gabmeyer
Business Informatics Group (BIG)
Vienna University of Technology

http://www.big.tuwien.ac.at/staff/sgabmeyer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJUBbJUAAoJELSN8YoN2kNZ3nQIAJWTCrwBOEJfk4iGl/OYiBVR
wir46kMdzcZ1S3BuY+LjtnoiDtlP2UU+PRZj/yCly2FgvB6eB8EV42jAJzIQbJ1A
RzJJY2uoi0YVNxM4BM5Ht4HgrA5zPI70Q3fF7G270DHHS/ob1nVt2GzhFx5gafpa
DqMgaU7XtKVOYhKoCYyu/jhqvYIy3/nxvh18k+5Fd9tCaOMnxm6dQdmFoxMRW8YC
+U/n/I5gwLUMX9uC1JCsKgHFNXLGFdm0jLKgMBdOwV2b09K+dQ/H8Bv8S2JF37v5
poORnwcEpK55qvO7bbWNT/l5aTzLOMVsa7+azOsju8fjx16ht9+7AWA/qZzvj0Y=
=glAf
-----END PGP SIGNATURE-----

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


Back to the top