Filter contents of suggestion drop down menu in editor

Hi,

I'm experimenting a little bit with MPS regarding testing languages. In doing so, I intend to in the beginning create a simple language allowing me to define Testcases and Testsuites, whereas the latter ones must contain at least one Testcase and may contain other Testsuites. For now, defining the concepts for the Testcase and the Testsuite and also its according editors worked smoothly. However, as already mentioned, my Testsuites may reference other Testsuites, yet, not itself. So right now, I'm stuck at defining some kind of constraint on the TestsuiteReference concept (built according to the Calculator tutorial's InputFieldReference) or a filter in the Testsuite's editor (applied on a horizontal child node cell list), sorting out the very Testsuite and thereby preventing self references. Maybe anyone can give me a hint on how to do that, I hope my explanations suffice for understanding, otherwise just please let me know.

Thanks in advance,

lamilton
0
15 comments
Hi,

as far as i understand your Problem, you should create a constraints-aspect for your concept (concept structure - green models, concept constraints - blue models). In the constraint you can specify a search scope for your reference.

Please refer to http://code.google.com/p/mps-lwc11/wiki/lwc11step9At14 for further explanations ...

Dan
0
Hi Dan,

thanks a lot for your reply, it was exactly what was I was looking for and worked immediately.

cheers,

lamilton
0
Hi again,

just for curiosity, as I tried it, how would it be possible to modify the contents of the drop down menu in an editor when selecting a new Testsuite, as currently it allows to add Testsuites multiple times. Doing it like for preventing self-references does not work, as this also removes already referenced test stories from the search scope, hence indicating errors in the editor. Maybe again, someone has a hint for me.

Thanks a lot again,

lamilton
0
Hi Phil,

i do not understand your question in detail. However, you can access a parent concept in a constraint-code with " referenceNode.parent" (or "enclosingNode.parent" if it is a smart reference).

This allows you to do some checks in the "environment" of your reference, like checking if another reference was already instantiated  ... and so on

Dan
0
Hi Dan,

thanks for your answer and sorry for responding so late, been a little busy lately. To make it more clear what i want to attempt to do, in the drop down menu, where i can select new teststories or testsuites to reference, i want to filter out already reference. I'll try your suggestions and let you know how I did it finally.

phil
0
Hi Phil,

ok i see. I understood you correctly. You can simply access the containing collection of your references with  .partent : "CAST OPERATION TO PARENT CONCEPT".<collection-name> .. thats how you can figure out, which references you already have .

Best from Austria,
Dan
0
Hi Dan,

thanks for your answer. Yet, the point about the whole thing is that I already found out how to get the list of already referenced stories, yet, what I'm stuck with is, where exactly to put the logic for this filter. I somehow could not find any example or hint on where to place it. I think the rest should be quite trivial.

Best from Innsbruck,

Phil
0
Well,

maybe you just bring your laptop with you and come over to Völs. It would be very interesting for me to meet you personally ....

Dan
0
Hi,

well yeah, sounds good. Maybe we can meet next week? Also for me it'd be interesting meeting you.

Phil
0
Hi Phil,

sound s good. What a coincident, isn´t it? Is Cafe Sailer ok for you? Tuesday evening?

Best,
Dan
0
Hi,

definitely! Never been in Cafe Sailer but i think I'll find it. And Tuesday evening sounds fine. Maybe somewhen around 18:00?

Cheers,

Philipp


PS: as it just came to my mind, you're not probably studying or working at the university in Innsbruck? maybe we could meet there, as I'm working there. Just an idea...
0
Hi Phil,

18:00@sailer sounds good to me. Some of my friends are at uibk, but i m not. I m really wondering how you get to MPS.

See you at tuesday,
Dan
0
Hi,

well, actually it was my supervisor (Ruth B.) who first mentioned it and then one of my co-workers, Matthias F., a german guy you know. One thing led to the other and now I'm kinda into MPS and definitely fascinated. As for me, I'm working in the area of software testing and we're always looking for ways to abstract, i.e.: test definitions and the like, and well, MPS is quite attractive for this purpose. By the way, how will I recognize you in the cafe? As for me, I'm tall and wearing a black/white patterned jacket.

See you on tuesday,

Philipp

PS: I've just been googling for the cafe sailer in Völs, but I can't find it somehow. I only can find one in Innsbruck, Wattens or Rinn...is it the on in ibk in the Fischerhäuslweg 14?
0
Hi Phil,

ok i see. Cafe sailer is next to the airport. I ll be there at 18:00. It´s not crowded at all..

Dan
0
Hi Dan,

great! See you then!

Cheers,

Phil
0

Please sign in to leave a comment.