[great-users] Abort a transformation
Achim Gädke
Achim.Gaedke at vuw.ac.nz
Tue Feb 22 14:55:05 CST 2011
On 23/02/11 05:07, Daniel Balasubramanian wrote:
> Hi Achim,
>
> If I understand correctly, what you're trying to do is exit the transformation based on some condition, such as a pattern match. Is this correct? If so, you could use Test/Case blocks. Insert a Test block, and put a Case block first that tests the condition for termination. If that Case is true, then don't have any output ports for that Case (use a "Cut" element, too). Otherwise, control will fall through to the next Case block in which you could just pass the input straight through to the next rule.
>
Hi Daniel!
Thanks for the answer. I use test blocks as desribed above frequently to
gain the complement of a match.
Unfortunately, this is not what I was aiming to.
Here is an example:
One might expect a forest structure given by a certain kind of
associations in a model. By labeling the objects successively from the
roots of the trees, one gains the tree-membership of each object. If
there are isolated cyclic structures, these objects have these
associations but won't get a label.
The following transformation might ignore these objects, but the
programmer might wish to abort the transformation - because the model
does not make sense.
Cheers, Achim
More information about the great-users
mailing list