Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [n] Multiplicity problem in EMFATIC file
[n] Multiplicity problem in EMFATIC file [message #516598] Wed, 24 February 2010 14:25 Go to next message
Zied is currently offline Zied
Messages: 26
Registered: February 2010
Junior Member
Hi,

I have generated a flowchart diagram from the EMF file below, but the multiplicity in ContainerClass is not respected
I can put many instance of innerClasses


@gmf.node(label="name", label.icon="false")
class ContainerClass extends IShape {
@gmf.compartment(foo="bar")
val IShape[*] shapes;
val ClassNoGetMultiSend[*] shapesNGMS;
val ClassNoSendMultiGet[*] shapesNSMG;
val ContainerClass[1] innerClasses;
}


EMF FILE:
@namespace(uri="flowchart", prefix="flowchart")
package flowchart;

@gmf.diagram(foo="bar")
class FlowChartDiagram {
  val ClassNSMG[*] NSMG; // No send Multiple get (link)
  val ClassNGMS[*] NGMS; // No get multiple send
  val IShape[*] shapes;
  val ISLink[*] links;
  val TestShape[*] testsNodes;
  val STARTNode[1] startNode;
  val FinalNode[*] finalnodes;
}

//////////////////////  Abstract  //////////////////////////
abstract interface IShape extends ClassNoSendMultiGet, ClassNoGetMultiSend,ILabelNamed {

}

abstract interface ILabelNamed{
   attr String name;
}

abstract interface  ClassNoGetMultiSend{
  ref ISLink#source outcoming;
}

abstract interface ClassNoSendMultiGet {
  ref ISLink#target incoming;
}
// simple Link type
abstract interface ISLink {   //Interface Simple Link
  ref ClassNoGetMultiSend#outcoming source;
  ref ClassNoSendMultiGet#incoming target;
}
// complex link type
abstract interface ICLink extends ISLink{
	ref ContainerClass#incoming targets;
	ref ContainerClass#outcoming sources;
   
} 


///////////////////////// Standard Nodes and links ////////////////////
@gmf.node(label="TestName", label.icon="false")
class TestShape extends ClassNoSendMultiGet {
  attr String TestName = "TEST";

  @gmf.link(label="Yes", target.decoration="arrow", style="dash")
  ref ClassNoSendMultiGet yesAction;

  @gmf.link(label="No", target.decoration="arrow", style="dash")
  ref ClassNoSendMultiGet noAction;
}

@gmf.link(label="description", source="source", target="target", target.decoration="arrow")
class Link extends ICLink {
  attr String description;
}
// start Node
@gmf.node(label="name", label.icon="false")
class STARTNode extends ClassNoGetMultiSend {
	attr String name="START";
}
@gmf.node(label="name", label.icon="false")
class FinalNode extends ClassNoSendMultiGet{
   attr String name="END";
}
//////////////////////////////////////////////
@gmf.node(label="name", label.icon="false")
class ContainerClass extends IShape {
  @gmf.compartment(foo="bar")
  val IShape[*] shapes;
  val ClassNoGetMultiSend[*] shapesNGMS;
  val ClassNoSendMultiGet[*] shapesNSMG;
  val ContainerClass[1] innerClasses;
}

//
@gmf.node(label="name", label.icon="false")
class ClassNGMS extends ClassNoGetMultiSend {
	attr String name="NGMS";
}

//
@gmf.node(label="name", label.icon="false")
class ClassNSMG extends ClassNoSendMultiGet {
	attr String name="END";
}

// simple Node type 
@gmf.node(label="name", label.icon="false")
class ClassMGMS extends IShape {
}

Re: [n] Multiplicity problem in EMFATIC file [message #516635 is a reply to message #516598] Wed, 24 February 2010 16:05 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Zied,

The compartment of ContainerClass holds [*] instances of IShape and
ContainerClass is an IShape so that's the expected behaviour. What you
probably need is to create one compartment per val reference.

Cheers,
Dimitris

Zied wrote:
> Hi,
>
> I have generated a flowchart diagram from the EMF file below, but the
> multiplicity in ContainerClass is not respected
> I can put many instance of innerClasses
>
> @gmf.node(label="name", label.icon="false")
> class ContainerClass extends IShape {
> @gmf.compartment(foo="bar")
> val IShape[*] shapes;
> val ClassNoGetMultiSend[*] shapesNGMS;
> val ClassNoSendMultiGet[*] shapesNSMG;
> val ContainerClass[1] innerClasses;
> }
>
>
> EMF FILE:
>
> @namespace(uri="flowchart", prefix="flowchart")
> package flowchart;
>
> @gmf.diagram(foo="bar")
> class FlowChartDiagram {
> val ClassNSMG[*] NSMG; // No send Multiple get (link)
> val ClassNGMS[*] NGMS; // No get multiple send
> val IShape[*] shapes;
> val ISLink[*] links;
> val TestShape[*] testsNodes;
> val STARTNode[1] startNode;
> val FinalNode[*] finalnodes;
> }
>
> ////////////////////// Abstract //////////////////////////
> abstract interface IShape extends ClassNoSendMultiGet,
> ClassNoGetMultiSend,ILabelNamed {
>
> }
>
> abstract interface ILabelNamed{
> attr String name;
> }
>
> abstract interface ClassNoGetMultiSend{
> ref ISLink#source outcoming;
> }
>
> abstract interface ClassNoSendMultiGet {
> ref ISLink#target incoming;
> }
> // simple Link type
> abstract interface ISLink { //Interface Simple Link
> ref ClassNoGetMultiSend#outcoming source;
> ref ClassNoSendMultiGet#incoming target;
> }
> // complex link type
> abstract interface ICLink extends ISLink{
> ref ContainerClass#incoming targets;
> ref ContainerClass#outcoming sources;
> }
>
> ///////////////////////// Standard Nodes and links ////////////////////
> @gmf.node(label="TestName", label.icon="false")
> class TestShape extends ClassNoSendMultiGet {
> attr String TestName = "TEST";
>
> @gmf.link(label="Yes", target.decoration="arrow", style="dash")
> ref ClassNoSendMultiGet yesAction;
>
> @gmf.link(label="No", target.decoration="arrow", style="dash")
> ref ClassNoSendMultiGet noAction;
> }
>
> @gmf.link(label="description", source="source", target="target",
> target.decoration="arrow")
> class Link extends ICLink {
> attr String description;
> }
> // start Node
> @gmf.node(label="name", label.icon="false")
> class STARTNode extends ClassNoGetMultiSend {
> attr String name="START";
> }
> @gmf.node(label="name", label.icon="false")
> class FinalNode extends ClassNoSendMultiGet{
> attr String name="END";
> }
> //////////////////////////////////////////////
> @gmf.node(label="name", label.icon="false")
> class ContainerClass extends IShape {
> @gmf.compartment(foo="bar")
> val IShape[*] shapes;
> val ClassNoGetMultiSend[*] shapesNGMS;
> val ClassNoSendMultiGet[*] shapesNSMG;
> val ContainerClass[1] innerClasses;
> }
>
> //
> @gmf.node(label="name", label.icon="false")
> class ClassNGMS extends ClassNoGetMultiSend {
> attr String name="NGMS";
> }
>
> //
> @gmf.node(label="name", label.icon="false")
> class ClassNSMG extends ClassNoSendMultiGet {
> attr String name="END";
> }
>
> // simple Node type @gmf.node(label="name", label.icon="false")
> class ClassMGMS extends IShape {
> }
>
>


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: [n] Multiplicity problem in EMFATIC file [message #516822 is a reply to message #516635] Thu, 25 February 2010 09:53 Go to previous messageGo to next message
Zied is currently offline Zied
Messages: 26
Registered: February 2010
Junior Member
Hi Dimitris,

thanks,
Problem resolved. Smile
Re: [n] Multiplicity problem in EMFATIC file [message #586709 is a reply to message #516598] Wed, 24 February 2010 16:05 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Zied,

The compartment of ContainerClass holds [*] instances of IShape and
ContainerClass is an IShape so that's the expected behaviour. What you
probably need is to create one compartment per val reference.

Cheers,
Dimitris

Zied wrote:
> Hi,
>
> I have generated a flowchart diagram from the EMF file below, but the
> multiplicity in ContainerClass is not respected
> I can put many instance of innerClasses
>
> @gmf.node(label="name", label.icon="false")
> class ContainerClass extends IShape {
> @gmf.compartment(foo="bar")
> val IShape[*] shapes;
> val ClassNoGetMultiSend[*] shapesNGMS;
> val ClassNoSendMultiGet[*] shapesNSMG;
> val ContainerClass[1] innerClasses;
> }
>
>
> EMF FILE:
>
> @namespace(uri="flowchart", prefix="flowchart")
> package flowchart;
>
> @gmf.diagram(foo="bar")
> class FlowChartDiagram {
> val ClassNSMG[*] NSMG; // No send Multiple get (link)
> val ClassNGMS[*] NGMS; // No get multiple send
> val IShape[*] shapes;
> val ISLink[*] links;
> val TestShape[*] testsNodes;
> val STARTNode[1] startNode;
> val FinalNode[*] finalnodes;
> }
>
> ////////////////////// Abstract //////////////////////////
> abstract interface IShape extends ClassNoSendMultiGet,
> ClassNoGetMultiSend,ILabelNamed {
>
> }
>
> abstract interface ILabelNamed{
> attr String name;
> }
>
> abstract interface ClassNoGetMultiSend{
> ref ISLink#source outcoming;
> }
>
> abstract interface ClassNoSendMultiGet {
> ref ISLink#target incoming;
> }
> // simple Link type
> abstract interface ISLink { //Interface Simple Link
> ref ClassNoGetMultiSend#outcoming source;
> ref ClassNoSendMultiGet#incoming target;
> }
> // complex link type
> abstract interface ICLink extends ISLink{
> ref ContainerClass#incoming targets;
> ref ContainerClass#outcoming sources;
> }
>
> ///////////////////////// Standard Nodes and links ////////////////////
> @gmf.node(label="TestName", label.icon="false")
> class TestShape extends ClassNoSendMultiGet {
> attr String TestName = "TEST";
>
> @gmf.link(label="Yes", target.decoration="arrow", style="dash")
> ref ClassNoSendMultiGet yesAction;
>
> @gmf.link(label="No", target.decoration="arrow", style="dash")
> ref ClassNoSendMultiGet noAction;
> }
>
> @gmf.link(label="description", source="source", target="target",
> target.decoration="arrow")
> class Link extends ICLink {
> attr String description;
> }
> // start Node
> @gmf.node(label="name", label.icon="false")
> class STARTNode extends ClassNoGetMultiSend {
> attr String name="START";
> }
> @gmf.node(label="name", label.icon="false")
> class FinalNode extends ClassNoSendMultiGet{
> attr String name="END";
> }
> //////////////////////////////////////////////
> @gmf.node(label="name", label.icon="false")
> class ContainerClass extends IShape {
> @gmf.compartment(foo="bar")
> val IShape[*] shapes;
> val ClassNoGetMultiSend[*] shapesNGMS;
> val ClassNoSendMultiGet[*] shapesNSMG;
> val ContainerClass[1] innerClasses;
> }
>
> //
> @gmf.node(label="name", label.icon="false")
> class ClassNGMS extends ClassNoGetMultiSend {
> attr String name="NGMS";
> }
>
> //
> @gmf.node(label="name", label.icon="false")
> class ClassNSMG extends ClassNoSendMultiGet {
> attr String name="END";
> }
>
> // simple Node type @gmf.node(label="name", label.icon="false")
> class ClassMGMS extends IShape {
> }
>
>


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: [n] Multiplicity problem in EMFATIC file [message #586790 is a reply to message #516635] Thu, 25 February 2010 09:53 Go to previous message
Zied is currently offline Zied
Messages: 26
Registered: February 2010
Junior Member
Hi Dimitris,

thanks,
Problem resolved. :)
Previous Topic:[EVL] CritiqueLevel
Next Topic:GMF-Epsilon transformations
Goto Forum:
  


Current Time: Thu Oct 23 15:25:22 GMT 2014

Powered by FUDForum. Page generated in 0.02230 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software