[gme-users] OCL and GME Question
Burak Yolaçan
burak.yolacan at gmail.com
Fri Jul 9 00:42:20 CDT 2010
please remove my e-mail address from this list. thanks.
2010/7/9 Kyle Zielinski <zielins1 at seattleu.edu>
> I'm using XTeam (http://www-scf.usc.edu/~gedwards/xteam.html<http://www-scf.usc.edu/%7Egedwards/xteam.html>),
> and more
> specifically, extending the SafexADL paradigm on top of GME. I'm trying
> to add some constraints with my models, but am having problems
> understanding just what OCL is capable of in GME. (Not only that, but
> it's my first time attempting OCL.)
>
> We're using SafexADL to model and then simulate system architectures. I
> have a hierarchy (the general structure of which comes from XTeam) that
> goes like this:
>
> Root Folder
> Architecture Folder (Type: Folder Kind: Architecture)
> Architecture Folder (Type: Folder Kind: Architecture)
> Architecture (Type: Model, Kind: Architecture)
> Component1 (Type: Model, Kind: Component)
> Component2 (Type: Model, Kind: Component)
> Architecture2
> Component1
> Component2
> Elements Folder (Type: Folder, Kind: Elements)
> (more folders)
> ...
>
> What I'm trying to do is simply ensure that two components in the same
> Architecture (that's of Type: Model, Kind: Architecture, not folders)
> can't have the same component name. At first, I had:
>
> let mySet = project.allInstancesOf( Component ) in
> mySet->isUnique( c | c.name)
>
> I realized though, that this wouldn't work with the above example,
> because it gets all the components, period. So I tried this:
>
> let archBag = project.allInstancesOf( Architecture )->collect(
> oclAsType( Model )) in
> archBag->forAll( arch | let compSet = arch.models( Component ) in
> compSet->isUnique(v | v.name) )
>
> Which would catch the constraint ... and then crash GME.
>
> Any suggestions?
>
> Kyle Zielinski
>
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20100709/1f494927/attachment.html
More information about the gme-users
mailing list