Home

Generic Modeling Environment User`s Manual

image

Contents

1. Example implementation of a Set How to specify what FCO s a Set Owns Connect the FCO to the Set Atom In the event of an ambiguity resolve it with the SetMembership connection type Generic Modeling Environment User s Manual Metamodeling Environment e 56 Make sure to aggregate the Set to the Model in which it will reside Model The Model may contain through the Containment connection type any other FCO and it associates a role name to each FCO it contains The Model has the Name Position and In Root Folder attributes How to contain a Model Model 1 in a Model Model 0 Connect Model 1 to Model 0 Note that it is applicable to have a Model contain itself the previous case where Model 1 Model 0 How to contain an Atom in a Model In the event that an FCO is used as a superclass for the Model then FCO may replace Model in the following sequence Atom may be replaced by Set Reference or Connection Create and configure the Atom and the Model Connect the Atom to the Model Attributes Attributes are represented by UML classes in the GME metamodeling environment There are three different kinds of Attributes Enumerated Field and Boolean Once any of these Attributes are created they are aggregated to FCO s in the Attributes Aspect The order of attributes an FCO will have is determined by the relative vertical location of the UML classes representing the attributes Inheritance
2. IMgaDecorator Functions HRESULT GetFeatures out feature_code features This method tells GME which features the decorator supports Available feature codes are can be combined using the bitwise OR operator F_RESIZABLE decorator supports resizable objects F_MOUSEVENTS decorator handles mouse events F_HASLABEL decorator draws labels for objects outside of the object F_HASSTATE decorator wants to save information in the MGA project F_HASPORTS decorator supports ports in objects F_ANIMATION decorator expects periodic calls of its draw method HRESULT SetParam in BSTR name in VARIANT value If there are some parameters specified for this decorator in the meta model GME will call this method for each parameter value pair HRESULT GetParam in BSTR name out VARIANT value The decorator needs to be able to give back all the parameter value pairs it got with the SetParam method HRESULT Initialize in IMgaProject project in IMgaMetaPart meta in IMgaFCO obj This is your constructor like function Read all the relevant data from the project and cache them for later use it is a better approach than querying the MGA project in your drawing method all the time GME will instantiate a new decorator if its MGA object changes Generic Modeling Environment User s Manual Decorators 48 HRESULT GetPreferredSize out long sizex out long sizey Your decorator can give GME a hint a
3. Children of P2 of Refl containig P2 of Ref2 and Ref3 p2_refl gt getChildPorts Get referred FCO i e p2_model P2 of Model of P2 of Refl P2_refl gt getFCO Get objects connected to P2 of Model directly or indirectly via reference ports It includes A Al A2 A3 and A4 p2_model gt getConnEnds W W true Get objects connected to P2 of Model directly without reference ports It includes only A p2_model gt getConnEnds W false Get objects connected to P2 of Refl directly or indirectly via descendant reference ports It includes Al A2 A3 and A4 A is not included p2_refl gt getConnEnds W W true Get objects connected to P2 of Refl directly without descendant reference ports It includes only Al p2_refl gt getConnEnds W W false It is good to know that the casting mechanism defined by the appropriate wrapper classes works transparently between BON ConnectionEnd BON FCO and its descendants and BON ReferencePort also For example to decide whether a connection end is a reference port we can do this in two ways if BON ReferencePort connectionend do something if connectionend gt isReferencePort do something Generic Modeling Environment User s Manual High Level Component Interface e 103 Type Inheritance in BON2 Type inheritance is special feature introduced in GME This issue is implemented by interf
4. Returns the appropriate MON Attribute of the attribute BON AttributeStatus getStatus const Returns the status of the value of the attribute If it is BON AS_ Here then the value is set in the attribute directly If it is BON AS Meta the value is the default value defined in the corresponding MON Attribute If the returned value equals to or is greater than 1 then it is inherited from an fco from which the attribute s fco derives directly or indirectly Generic Modeling Environment User s Manual Appendix C BON and MON e 210 Util Variant getValue const long getIntegerValue bool bTypeTolerant true const bool getBooleanValue bool bTypeTolerant true const double getRealValue bool bTypeTolerant true const std string getStringValue bool bTypeTolerant true const These operations returns the value set in the attribute directly or indirectly Those methods which have specific type can be used to obtain the typed value simply If bTypeTolerant is false and the type of the value mismatches the requested BON Exception is thrown otherwise if the types are not the same the methods try to convert the value to the requested type setValue const Util Variant value bool bTypeTolerant true setIntegerValue long lValue bool bTypeTolerant true setBooleanValue bool bValue bool bTypeTolerant true setRealValue double dValue bool bTypeTolerant true setStringValue con
5. denote which of the Atoms may participate as the source or destination of the connection There may be only one source and one destination connection to the Connector Atom Inheritance is a useful method to increase the number of sources and destinations since all child classes will also be sources and destinations Currently all possible FCO source destination combinations will be used in the production of the metamodel However in future revisions of the metamodeling environment the list of allowable connections may be modified at model building time to eliminate certain possibilities from ever occurring Generic Modeling Environment User s Manual Metamodeling Environment e 55 Thing1 lt lt atom gt gt dst Broom i RUTA Example of a Connection Set The Set is a more general case of the Reference Sets have the Icon name and Name Position attributes Figure 4 shows an example implementation of a Set The members of the Set are owned by the Set through the SetMembership connection kind when connecting the Reference to the Set the user will be prompted to choose between the SetMembership and ReferTo connection kinds Some underlying assumptions exist here such as all members of the Set must be members of the Model to which this set belongs Model lt lt model gt gt Atom lt lt atom gt gt Reference lt lt reference gt gt Model lt lt model gt gt
6. Visual Basic or Java The COM interface provides the means to access and modify the models their attributes and connectivity In short the user can do everything that can be done using the GUI of the GME There are two higher level C interfaces that take care of a lot of lower level issues and makes component writing much easier These high level C component interfaces are the focus of this chapter The first section discusses the first release of Builder Object Network the second elaborates the more sophisticated version of BON with the Meta Object Network Interpreters are typical but not the only components that can be created using this technology The other types are plug ins i e components that provide some useful additional functionality to ease working in GME These components are very similar to interpreters though they are paradigm independent For example a plug in can be developed to search or locate objects based on some user defined criteria like the value of an attribute The third types of these components are add ons i e components that can react to GME events sent by the COM Mga Layer These components are very useful to make GME a run time executional environment or to write more sophisticated paradigm dependent or independent extensions Builder Object Network version 1 0 What Does the BON Do The component interface is implemented on the top of the COM interface When the user initiates model interpretation
7. std string infoString bool bWithIdentifiers false bool bWithRef false const Generic Modeling Environment User s Manual Appendix C BON and MON e 187 MON Project project const MON Aspect aspect const MON Model model const MON AttributeAggregation Base Classes Methods std string infoString bool bWithIdentifiers false bool bWithRef false const MON Project project const MON FCO fco const MON Attribute attribute const Builder Object Network Classes In this section the BON2 implementation classes are discussed regarding their public interface The titles of the subsections are the names of the wrapper classes for the sake of simplicity all calls are accessible with gt operator Exceptions are BON Event BON EventListener BON EventListenerP ool and BON Visitor The static calls are static operation of the wrapper classes These calls throw Util Exception if the object is null All input parameters are checked whether they belong to the same project or the same meta project of the project In case of violation either BON Exception or MON Exception is thrown Before performing any operation which may or does require some kind of meta information MON object or string literal with the name of a MON object the supplied parameters are checked whether the meta project allows the appropriate relationship and the structure or not If it is invalid
8. A Generic Modeling Environment GME 5 User s Manual Version 5 0 Institute for Software Integrated Systems Vanderbilt University Copyright 2000 2005 Vanderbilt University This program is protected by U S and international copyright laws as described in the About Box Copyright 2000 2005 Vanderbilt University All rights reserved http www isis vanderbilt edu This manual was produced using Doc To Help by WexTech Systems Inc Contents What is new 6 What 18 NEW in version 5 0 aranna Geib tle ecacdund Gav R aah ation dbasendevieoedes 6 What is new in Version 4 0 00 ce ceseceseesseesceeseeeseeeeeeseceseceseceaeeeaecnaeceaecaeecaeeeseseneeeseeeeeeeseeeseneenaes 7 What is Mew in Version 3 0 00 eceseceeesceeceeseeeeceeceeseeesecsecseeeaecnaeceaecaeecaeeeaeeeseeeeeeereerenerenseenaes 8 Introduction 9 Modeling Concepts Overview 10 Model Integrated Program Synthesis cecesesecssecseeseceeeseceseeeceaecetesecseesesneesecsaeeeesaeeaeeseenees 10 The MultiGraph Architectttre lt s c5 4 chines shia Salis andi oan a a eaa 10 The Modeling Paradi midani e a e E aA EEE TEE E EES 11 Metamodels and Modeling Environment Synthesis sssesesseeeeseeesesesreerererrsrsrsrreres 11 The Generic Modeling Environment 12 GME 5 Main Editing Window ccsescsssscssseccssecseesecseesecnaeeecsaecassecaeesecneeseesaeeeeaecaeeseeners 12 GME Concepts circ eror aea aene ous EEE E EE E EEEE ETES EEOSE EN SNE E E EE EES obec
9. Atom Set Reference Model In root folder Boolean checkbox that determines whether or not this object can belong in the root folder Note that if an object cannot belong to the root folder then it must belong to a Folder or Model somewhere in its containment hierarchy that can belong to the root folder Default value Checked Contained in Folder Model Atom Set Reference Line end Enumeration of the possible end types of a line Possible types are Butt no special end Arrow and Diamond Default value Butt Contained in Connection Generic Modeling Environment User s Manual Metamodeling Environment 63 Line start Enumeration of the possible start types of a line Possible types are Butt no special end Arrow and Diamond Default value Butt Contained in Connection Line type Enumeration of the possible types of a line Possible types are Solid and Dash Default value Solid Contained in Connection Number of lines Integer field that gives the number of lines to display for this FieldAttr Default value 1 Contained in FieldAttr Menu items A text field that lists the items in an EnumAttr There are two modes for this text field which can also be called a text box because it has the ability for multiple lines In basic mode the field items are separated by carriage returns in the order in which they should be listed in the menu In this case the text used as the
10. CBuilderObjectList amp selected long param const CBuilderFolderList folds builder GetFolders POSITION foldPos folds gt GetHeadPosition while foldPos CBuilderFolder fold folds gt GetNext foldPos const CBuilderModelList roots fold gt GetRootModels POSITION rootPos roots gt GetHeadPosition while rootPos CBuilderModel root roots gt GetNext rootPos if root gt IsKindOf RUNTIME_CLASS CCompoundBuilder BUILDER_CAST CCompoundBuilder root gt Scan fold gt GetName IMPLEMENT_CUSTOMMODEL CCompoundBuilder CBuilderModel Compound void CCompoundBuilder Scan CString foldName AfxMessageBox GetName model found in foldName folder const CBuilderModelList models GetModels CompoundParts POSITION pos models gt GetHeadPosition while pos BUILDER_CAST CCompoundBuilder models gt GetNext pos gt Scan foldName Generic Modeling Environment User s Manual High Level Component Interface e 83 Meta Object Network What is MON Using the previous version of BON the users experienced that lots of implementation issues could be solved more simply if they had a simple and well defined interface to the metamodel of their domains The MON makes the paradigm available at the time of writing components All information covered by the metamodel are accessible from the aspect and valid connections between objects to
11. ConneGtiOn Bid a a a e aaa A aS 194 BON EATA O u AIEEE EE EAE EE CEEE E EE EEEE EEO 197 PON FCO 3503 a a E E a 198 1 BS J Boe 90 ii REAT E E AE EE EE 200 BONS Model a a aa a a E a NS 201 BON COANE O Ta a his a a a a a R 203 BON ET EE A EA E EA E E ASE 205 BON AIEA n S E EE E EA E 207 BON ReferencePortContainer cccececccccccesssssscsscceceesssssesseescessssssesseesceessesseesess 208 BON FypelnhOb ect ctorri opa ae passa cte a E EES E 209 LOIN EA T1 O SAA E S A E E ES 209 BON Type isate peia ee a EE e E E E EE EE S 209 BON AMADE minnanna E N EE e E T T 210 BON ResistryNode deee leis E E ee E T 211 BON FCOREgistryNode i setai avii ieai aai SEA Eea o EE Ei iN e Ens 213 BON FCOEXReiStryNOde sesirik iieii SEN enie t va ins 214 BON ModelRegistryNode sseseeseeseeeeeeesesesesesrrersrsseserterrersssesesrereerssssesesresrerreese 216 BON ConnectionRegistryNode scesssecssecssssecseeseceeeecsaeeeesaecseesecnereenaeeneeneeaes 216 PON Vei a Eg TS 217 PON Ve S E a a owe a N ees 218 BONSZEVentei1stenerPool a a O NERT 218 BONE VAS 1tOR S EEA S EEE A E E E EE ee eee Be 219 Appendix D References 220 Model Integrated Computing References sesesesssesesesssesesterersssestrttrrereersesrsrrerstserseseerreret 220 Glossary of Terms 221 Generic Modeling Environment User s Manual Contents e v What is new What is new in version 5 0 Among the significant improvements in this version are G
12. Contained in Connection 1 destination label String value that gives the name of the Attribute class to be displayed there The Attribute should also belong through aggregation to the Connection Then the value of that Attribute will be displayed in the first position at the end of the destination of the connection Contained in Connection 2 destination label String value that gives the name of the Attribute class to be displayed there The Attribute should also belong through aggregation to the Connection Then the value of that Attribute will be displayed in the second position at the end of the destination of the connection Contained in Connection Abstract Boolean checkbox that determines whether or not the FCO in question will actually be generated in the output paradigm If the checkbox is checked then no object will be created but all properties of the FCO will be passed down to its inherited children if any Default value Unchecked Contained in FCO Atom Model Set Connection Reference Author information A text field translated into a comment within the paradigm output file Contained in Paradigm Cardinality Text field that gives the cardinality rules of containment for an aggregation Default value 0 Contained in Containment FolderContainment Color String value that gives the default color value of the connection specified in hex ex OxFFO0000 Default value 0x0
13. Conte Name Expression Variables meta Atom HasAspect tC meta Atom HasAspect Line Expression meta Atom HasAspect 1 context meta Atom iny HasParent iC meta Atom UniqueName 2 rc meta Atom UniqueName 3 not self isAbstract implies not self nRootFolder implies self allModels gt size sel meta Atom UniqueN ame ic meta Connection HasAspect e meta Atom HasParent omre HasParent 4 gt o meta Atom HasParent meta Connection HasParent O meta Connector OnlySrcDst Signature 32 Expression evaluated to false meta Atom is bstract 3 Expression evaluated to false meta Atom InRootFolder 3 Expression evaluated to false operator gt ock Integer ock Integer i 3 Expression evaluated to false operator implies ocl Boolean ocl Boolean 3 Expression evaluated to false operator implies ock Boolean ock Boolean 1 Expression evaluated to false At root expression Previous Next Violation selector Tracking window Buttons to close buttons false values and exceptions retain or abort changes The dialog displaying the violated or failed constraints in both compact and detailed views Detailed View In addition to that compact view the detailed one displays all the information can be gathered during the evaluation Here we can see all violations at the left of the dialog The user can sort the content similarly to the Syntax and Semantic
14. LEMENT_BONEXTENSION Parameter InputParameter OutputParameter Parameter LEMENT_BONEXTENSION MainParameter MainParameter Multiple Inheritance It is a common scenario in whose case the implementor wants to use multiple inheritance in the context of BON extensions A tipical case is demonstrated in the next figure ProcessingUnit BON FCOlmpl lt lt FCO gt gt Virtual by the ser ProcessingUnitimpl Virtual by defan BON Model Virtual by defat ProcessingUnit BON Modellmpl Compound lt lt Model gt gt CompoundImpl Inheritance in Inheritance in the Inheritance in the The GME paradigm implementation layer wrapper layer Multiple inheritance with BON extensions At first the user wants to implement a BON extension which corresponds to a ProcessingUnit concept The metakind of ProcessingUnit is FCO therefore the class in the implementation layer must be abstract and cannot be instantiated Compound derives from ProcessingUnit in the particular domain so the implementation class extends ProcessingUnitlmpl Because the metakind of Compound is Model it has to derive from BON Modellmpl also The rules the user must comply with are the following e Abstract BON extensions If a user wants to mplement the common behaviour of classes in a base class but she does not want to or she cannot assign any kind containment to the extension to create the appropriate wra
15. circuit Constraint_to_XOR meta Circuit Constraint_to_OR NewcCircuit a OR meta Circuit Constraint_to_XOR meta Circuit Constraint_to_OR OB or Oe meta Circuit Constraint_to_XOR E meta circuit Constraint_to_OR Hii or Oe meta Circuit Constraint_to_XOR E meta circuit Constraint_to_OR Gi xor Ye meta Circuit Constraint_to_XOR D meta circuit Constraint_to_OR E AND Load all D H 1 SS 10_Gate dd SS Link SS Port_IO Remove Enable constraints restrict the context of constraints For each object and constraint pair the user may set a special enable flag If the constraint is disabled for an object then the constraint will be evaluated on the object only if the user checks it explicitly Nevertheless there are some exceptions when the enable flag cannot be changed e Critical constraints defined in the paradigm or in a library are always enabled e Flags cannot be changed for the objects residing in a library The user can change these flags in the Kinds and Types page of the Constraint Browser dialog The dialog displays this information in a tree whose root nodes are the kinds Subnodes of the kinds are types subtypes and instances according to the type inheritance chain Each object and each kind have subnodes representing the constraints Generic Modeling Environment User s Manual Constraint Manager e 127 In the beginning the tree contains sp
16. class CBuilderAtomReference public CBuilderObject const CBuilderObject GetReferred const Even though the GME deals with ports of models since models cannot be connected directly these are the objects that can be the component interface avoids using ports for the sake simplicity However model references mandate the introduction of a new kind of object model reference ports A model reference contains a list of port objects The GetOwner method of the CBuilderReferencePort class return the model reference containing the given port The GetAtom method returns the atom that corresponds to the port of the model that the model reference port represents class CBuilderReferencePort public CBuilderObject public const CBuilderModelReference GetOwner const const CBuilderAtom GetAtom const The CBuilderModelReference class provides the GetRefered function that returns the model or model reference referred to by the given reference The GetRefereePorts return the list of CBuilderReferencePorts class CBuilderModelReference public CBuilderObject const CBuilderReferencePortList amp GetRefereePorts const const CBuilderObject GetReferred const A CBuilderConnection instance describes a relation among three objects The owner is the model that contains the given connection i e the connection is visible in that Generic Modeling Environment User s Manual High Level Component Interface e 77 model Th
17. const Returns the status of the object The object exists if and only if BON OST_ Exists is returned otherwise the user has to consider it as a deleted object bool isReadOnly const Returns true if the object is read only i e its state cannot be modified and its pre existing relationships cannot be either deleted or altered Typical example when the object resides in a library It can be used in the project bool isInLibrary const Returns true if the objects resides in a library std string getName const It returns the name of the object void setName const std string amp strName It sets the name of the object Generic Modeling Environment User s Manual Appendix C BON and MON e 191 Methods BON Project getProject const It returns the project to which the object belongs std string getPath const std string amp strDelimiter bool bReverseOrder false bool bNeedRootFolder false const It returns the path of the object The path consists model and folder names In case of the default order it always starts with strDelimiter string and ends with name name of the object In default the name of the root folder is not included and for the root folder it is only the strDelimiter string BON Object getParent const This operation returns the parent of the object which can be a BON Model or a BON Folder In case of the root folder the result is null BON Folder
18. defined registry values BON Connection This class corresponds to the IMgaC onnection COM interface Base Classes Its base class is BON FCO Construction and Destruction static BON Connection attach IMgaConnection pConnection Creates a BON connection for the specified COM object Generic Modeling Environment User s Manual Appendix C BON and MON e 203 static BON Connection create const BON Model amp parent const std set lt BON Connection Pair gt amp ends const MON Connection amp meta MON Connection const std string amp strRole static BON Connection create const BON Model amp parent const std set lt BON Connection Pair gt amp ends const std string amp strConnection const std string strRole static BON Connection create const BON Model amp parent const BON ConnectionEnd amp srcEnd const BON ConnectionEnd amp dstEnd const MON Connection amp meta MON Connection const std string amp strRole static BON Connection create const BON Model amp parent const BON ConnectionEnd amp srcEnd const BON ConnectionEnd amp dstEnd const std string amp strConnection const std string amp strRole y3 The methods create a new connection according to the specified meta or strConnection The srcEnd and dstEnd provide the source and the destination for the connection and they must not be null Another form of the meth
19. mySet gt collect person Person person name mySet gt name In some circumstances attributes of the compound object and the contained object are ambiguous Then the decision is made i e which attribute is called depending on the member selection operator Generic Modeling Environment User s Manual Appendix B OCL and GME e 141 Methods Methods are the most generic feature of a type A method may have arguments which are evaluated before calling the method on an object Arguments may be optional as in many programming languages Optional arguments can be followed only bt other optional arguments Arguments omitted in a call are considered to be undefined Methods are defined by the type or by the meta type Only those methods which do not alter the state of the object can be used in OCL It is also possible that a method is not defined by either type or meta type but by a constraint method definition If a method has only one argument and belongs to a compound object then it is possible that it will be ambiguous with a predefined iterator which does not have any declarators In this case the member selection operator will be used to call either the method or the iterator wor yy lt expression gt lt expression gt gt lt methodName gt lt expression gt e g object isUndefined Associations Associations are usually defined by the types of a parad
20. role lt ocl String kind ocl String gme FCO D se onnectedrCOs role ocl String kind ocl String gme FCO D connectedFCOs role ocl String kind ocl Type gme FCO connectedFCOs kind ocl Type ocl Set gme FCO bagConnectedFCOs role ocl String kind ocl Type gme FCO bagConnectedFCOs kind ocl Type ocl Bag gme FCO Returns a set or a bag which contains all fcos that are associated with the fco If role is specified then it returns only those which have the same role in the link If kind is specified the kind of connections must be kind If the kind of kind i e the meta kind is not gme Connection then an exception is thrown and undefined is returned Generic Modeling Environment User s Manual Appendix B OCL and GME e 167 FCO connectedAs role ocl String kind ocl String Set gme FCO D FCO reverseConnectedFCOs role ocl String kind ocl String ocl Set gme FCO D FCO reverseConnectedFCOs role ocl String kind ocl Type ocl Set gme FCO FCO reverseConnectedFCOs kind ocl Type ocl Set gme FCO FCO bagReverseConnectedFCOs role ocl String kind ocl Type ocl Bag gme FCO FCO bagReverseConnectedFCOs kind ocl Type ocl Bag gme FCO Returns a set or a bag which contains all fcos
21. size but iterl1 context Box inv let boxes self elements gt collect iterl elements in boxes gt forAll not includes self and boxes gt exists one includes self or size 0 Generic Modeling Environment User s Manual Appendix B OCL and GME e 145 Expression Resolution In an OCL expression it is likely that a text can be resolved differently depending on the context e g declared implicit variables defined types existing features of types etc The rules of the resolution are described below These differ for different sort of texts and expressions In the description we assume that the paradigm is well formed and valid Resolving a text which looks like an identifier Check whether a type exists whose name is lt id gt If there is such a type resolution is stopped Check whether there is a variable called lt id gt If there is such a variable resolution is stopped Check whether an implicit object implicit variable has features which can look like lt id gt e Ifan implicit object has exactly one feature then resolution is stopped e If the object has more features then resolution is stopped and an exception is thrown because of ambiguity caused by features with the same names Resolution ends and an exception is thrown because lt id gt cannot be resolved Resolving a text which looks like a function Check whether there is a function matching lt fun
22. F older gme ConnectionPoint This kind corresponds to association end in GME Using this kind is not recommended because it serves meta kind information and is not defined well in standard OCL This kind will be likely eliminated and replaced by a standard type AssociationEnd in the new implementation of OCL Aliases Supertypes This kind can be accessed as ConnP oint or ConnectionP oint Its super type is ocl Any Operators operator cpl gme ConnectionPoint cp2 gme ConnectionPoint ocl Boolean operator lt gt cpl gme ConnectionPoint cp2 gme ConnectionPoint ocl Boolean The first operator returns true if cpl and cp2 have the same role are attached to the same fco and are connection points of the same connection If at least one of these conditions is not satisfied it returns false The second operator returns true if at least one of these conditions is not satisfied Attributes gme ConnectionPoint cpRoleName ocl String Returns the role of the connection point Generic Modeling Environment User s Manual Appendix B OCL and GME e 173 Methods gme ConnectionPoint cpRoleName ocl String D This method has the same functionality as the gme ConnectionP oint cpR oleName attribute gme ConnectionPoint target gme FCO Returns the fco to which this connection point is attached gme ConnectionPoint owner gme Connection Returns the
23. Generic Modeling Environment User s Manual Using GME 5 e 22 a BasicTypes la GeneratarBase ss Bf SubGenBase Bi SuperGen E GeneratorBase H SubGenBase tf SubGenBase if GeneretorB if GeneratorA Aggregate Inheritance Meta RootFolder lt a Folder Folder Compound Compound 34 CompoundParts Compound 3 DFC atatlowConn SignalFlow r If GeneratorA r GeneratorB InputParameters InputParam InputSignals InputSignal OutputParameters OutputParam s r Bf CompoundPars X OutputSignals OutputSignal Sr PrimitiveParts Parameters Param 1 Bin DataType x amp Out Global kr Mal SubGenBese Size r la SuperGen Value SS PC ParameterConn if PrimitiveParts Primitive Folder Folder lf Primitive Primitive Model Browser with each tab selected The Inheritance tab is used explicitly for visualizing the type inheritance hierarchy described in detail later It is entirely driven by the current model selection within the aggregate tree For example the current selection in the aggregate tree in the figure above is a model GeneratorBase It has one subtype called SubGenBase and two instances bearing the name GeneratorA and GeneratorB This type instance relationship is shown in the Inheritance tab We also have an instance model of the SubGenBase subtype called SubGenBase In the Aggregate tab the letter S denotes a sub
24. Icon directories can be set for system wide use or for the current user only GME 5 searches first in the user directories followed by the system directories Exit Closes GME 5 Once a model window is open the following additional items become available Run Interpreter As mentioned earlier model interpreters are used in the GME to extract semantic information from the models This menu choice invokes the model interpreter registered with the paradigm using the currently selected model as an argument Depending on the specific paradigm and interpreter such an argument may or may not be necessary A submenu makes it possible to select an interpreter if there is more than one interpreter available Run Plug Ins Plug ins are paradigm independent interpreters This command makes it possible to run the desired one Check Invokes the Constraint Manager to check the constraints for the current model Print Allows the user to print the contents of the currently active window It scales the contents to fit on one page Generic Modeling Environment User s Manual Using GME 5 e 27 Print Setup Standard Windows functionality After a project has been loaded or created the following menu items are active Edit Editing commands Undo Redo The last ten operations can be undone and redone These operations are project based not model window based The Browser Editor and interpreters share the same undo redo queue Clear Undo Queue
25. If strRole specified the containment role name will be the same within the model parent static BON Reference createAs const BON Model amp parent const std string strRole The methods create a new set in the specified model parent whose containment role is strRole If the containment role cannot be associated with any references in parent an exception is thrown Attributes Generic Modeling Environment User s Manual Appendix C BON and MON e 207 BON ReferencePtr getReferenceI const This call returns the corresponding IMgaReference COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations MON Reference getReferenceMeta const Returns the appropriate MON Reference of the reference Methods BON FCO getReferred const MON FCO amp meta MON FCO const BON FCO getReferred const std string amp strFCO const Returns the fco referred by the reference If meta is not null or strFCO is not empty then the returned fco s kind is the specified one void setReferred const BON FCO amp fco It sets fco to the referred object by the reference If fco is null then the reference will refer to null BON ReferencePortContainer getRefPortContainer const Returns the appropriate reference port container if the reference refers to a model directly or indirectly otherwise the r
26. InfoOptions usOptions Util IO_None const std string getInfoString const std set lt Util InfoOption gt amp setOptions const It returns a string describing the connection end The details and the format can be set be the options BON ReferencePort This class represents ports in model references a k a ReferencePortContainers Base Classes Its base class is BON ConnectionEnd Methods BON FCO getFCO const Returns the fco referred by the reference port BON ReferencePortContainer getContainer const Returns the container object in which the port resides BON ReferencePort getParentPort const If the container s corresponding reference refers to a model the result is null Otherwise the container s reference refers to another reference In this case the result is a reference port of that reference s container The returned reference port points to the same fco as this reference port does std set lt BON ReferencePort gt getChildPorts const The operation returns a set containing those reference ports whose containers reference refers to this reference port s container s reference The returned reference ports point to the same fco as this reference port does std set lt BON ReferencePort gt getDescedantPorts const The operation returns a set containing those reference ports whose containers reference refers to this reference port s container s reference
27. MON ConnectionRole Base Classes Attributes std string name const Methods std string infoString bool bWithIdentifiers false bool bWithRef false const MON Project project const Generic Modeling Environment User s Manual Appendix C BON and MON e 180 MON ConnectionSpecification specification const std set lt MON ConnectionEnd gt connectionEnds const std set lt MON Containment gt targetRoles const std set lt MON FCO gt targets const bool isTarget const MON Containment amp role const bool isTarget const MON FCO amp fco const MON Set Base Classes MON FCO Attributes MON SetPtr getSetI const Methods std set lt MON SetMembership gt memberships const std set lt MON Containment gt memberRoles const bool isMember const MON Containment amp role const MON Reference Base Classes MON Reference Attributes MON ReferencePtr getReferenceI const Methods std set lt MON ReferenceAssociation gt refAssociations const std set lt MON Containment gt targetRoles const Generic Modeling Environment User s Manual Appendix C BON and MON e 181 bool isTarget const MON Containment amp role const MON RegistryNode Base Classes Attributes MON RegNodePtr getRegNodeI const bool isRoot const std string name const std string value const long integerValue const
28. Models that can be potentially involved in an undo redo operation are locked in the database in case of a database backend as opposed to the binary file format so that no other user can have write access to them This command empties the undo queue and clears the locks on object that are otherwise not open in the current GME 5 instance Project Properties This command displays a dialog box that makes it possible to edit view the properties of the current project These properties include its name author creation and last modification date and time and notes The creation and modification time stamps are read only and are automatically set by GME 5 Items available only when a model Editor window is open Show Parent Active when the current model is contained inside another model Selecting this option opens the parent model in a new editing window Show Basetype Active when the current model is a type model but not an archetype i e it is not a root node in the type inheritance hierarchy This command opens the base type model of the current model in an editing window Show Type Active when the current model is an instance model This command opens the type model of the current model in an editing window Copy Paste Delete Select All Standard Windows operations Paste Special A submenu makes it possible to paste the current clipboard data as a reference subtype or instance Paste Special only works if the data source
29. The process of disposal consists of the destruction of all BON and MON objects releasing all references to BON objects and releasing the additional resources database connections e t c This can be completing the finalize operation of BON Component Of course additional resources include the additional references to BON objects also This must be done in the finalize operation of BON extensions and not in the BON Component The steps of finalization are the following these are done automatically e Call finalize of BON Component e Jterate over the set of the existing BON objects and call their finalize e Reference counting mechanism takes care of the BON objects disposal and everything is destructed Where the component core implementation must be included is different in case of add ons and interpreters The interpreters entry point is the invokeEx of BON Component and this is the main part Here is a descriptive example void Component invokeEx Project amp project FCO amp currentFCO const std set lt FCO gt amp setSelectedFCOs long lParam AfxMessageBox Project CString project gt getName c_str if Model currentFCO AfxMessageBox The context of the component must be a model return Generic Modeling Environment User s Manual High Level Component Interface e 92 CString strObjects Selected objects are r n for std set lt FCO
30. Therefore the use of association with stereotypes would be misleading B1 C1 B2 C2 lt lt model gt gt lt lt model gt gt lt lt model gt gt lt lt model gt gt lt lt model gt gt lt lt model gt gt x m lt lt model gt gt lt lt model gt gt Implementation and interface inheritance operators Aspect equivalence Since classes representing Aspects show up only in the Visualization aspect another operator is used to express the equivalence of aspects called the SameAspect operator While aspects can have proxies as well they are not sets any more they are references Hence they cannot be used to add additional objects to the aspect In this case a new aspect needs to be created New members can be added to it since it is a set Using the SameAspect operator and typically a proxy of another aspect the equivalence of the two aspects can be expressed Note that having two aspects with the same name without explicitly expressing the equivalence of them will result in two different aspect in the target modeling paradigm The name of the final aspect is determined by the following rules If an equivalence is expressed between a proxy and a UML class the name of the class is used If one Generic Modeling Environment User s Manual Metamodeling Environment e 59 of them is abstract and the other is not the name of the non abstract class or proxy
31. Thus if a feature has to be performed on or with an object that is undfined then the feature is skipped and undefined is returned for example the user cannot perform an attribute call on undefined or if a method gets undefined as argument then the method is not called There are only some features in which undefined can participate in i e the result is not always undefined e ocl Any isUndefined e operator ocl Any ocl Any e operator lt gt ocl Any ocl Any e operator ocl Any ocl Any e operator ocl Any ocl Any e operator or ocl Boolean ocl Boolean e operator implies ocl Boolean ocl Boolean Equality and Identity Two objects are identical if and only if they are stored in the same memory space Equality of two objects is defined by the objects types or meta types It is not absolutely necessary that two objects which are equal to each other are identical as well The ocl Any meta type defines an operator with which the user can test whether objects identities are the same This operator is available for all types used in OCL expressions For objects with meta type ocl Any practically only for undefined identity is the same as equality but for any other types we have to make a distinction In the OCL specification there is only one operator with which we can express an equality check There is no special one for identity
32. aspects are related to groups of parts The existence or visibility of a part within a particular aspect is determined by the modeling paradigm A given part may also be visible in more than one aspect For every kind of part there are two kinds of aspects primary and secondary Parts can only be added or deleted from the model from within its primary aspect Secondary aspects merely inherit parts from the primary aspects Of course different interconnection rules may apply to parts in different aspects When a model is viewed it is always viewed from one particular aspect at a time Since some parts may be visible in more than one aspect while others may visible only in a single aspect models may have a completely different appearance when viewed from different aspects after all that s why aspects exist The following are examples of aspects e Signal Flow and States aspects for a signal processing paradigm e Process Flow Sheet and Process Finite State Machine aspects for a chemical engineering paradigm e Component Assignment and Failure Propagation aspects of a fault modeling paradigm Models atoms references sets and connections can all have attributes An attribute is a property of an object that is best expressed textually Note that we use the word text for anything that is shown as text including numbers and a choice from a finite set of symbolic or numeric constants Gener
33. folder as a legal sub folder The folder contains 0 n of the associated FCO as a a folder and an FCO legal root object a model and an FCO plays a specified role a set and i an FCO an aspect Cardinality none An integer attribute for each end of the This end of the association has the cardinality association specified unspecified cardinality is assumed to be 1 MEULIT The class denotes an MGA aspect The class denotes an MGA folder The model represents a Project An MGA Project Inheritance UML Inheritance The class inherits from a superclass An attribute of the destination is the rolename to be used for the child class Groups of parts Atom reference port reference port The part may play a role in a connection Model atom reference connection set_ The part is a first class object Referenceable Model atom reference The part may be referenced Generic Modeling Environment User s Manual Metamodeling Environment e 68 High Level Component Interface Introduction to the Component Interface The process of accessing GME 5 models and generating useful information e g configuration files for COTS software database schema input for a discrete event simulator or even source code is called model interpretation GME provides two interfaces to support model interpretation The first one is a COM interface that lets the user write these components in any language that supports COM e g C
34. is used If both aspects are proxies or classes then the name of the SameAspect operator is used Currently the order of aspects in the target paradigm is determined by the relative vertical position of the aspect set icons in the metamodels Folder equivalence The equivalence of folders can be expressed using the SameFolder operator Generating the Target Modeling Paradigm Attribute Guide Once the Paradigm Model is complete then comes time to interpret the Model Interpretation can be initiated from any model After extensive consistency checking the interpreter displays a dialog box where aspect mapping information can be specified Aspect Mapping The dialog box contains as many tabs as there are distinct aspects in the target environment Under each tab a listbox displays all possible model role combinations in the first column The second column presents the available aspects for the given model and model reference i e in the specified role in a combo box The default selection is the aspect with the same name as the container models aspect For all other FCOs atoms sets connections this files shows N A The third column is used to specify whether the given the aspect is primary or not for the given FCO i e in the specified role In a primary aspect the given FCO can be added or deleted In a secondary aspect it only shows up but cannot be added or deleted Note that all the information provided by the user t
35. lt paramName gt lt paramType gt lt typeName gt defmethod lt expression gt e g context Person getYoungestPartner int defmethod Common OCL Expressions These expressions are common to every OCL of every meta paradigm As OCL is a query language it is true for all expressions that objects states i e values of their member variables and not modified It is always true that all expressions must return a value i e an object OCL is case sensitive Type casting As OCL is a typed language it is not allowed to simply call features of an object A type of the object and of course the meta type defines the kinds of expressions in which the object can participate In most cases the type of the object in a specific expression is enough to write the expression without type casting but there are some circumstances in which it is necessary An object always has dynamic and static type in an expression The static type is known at the time of writing the expression The dynamic type is determined at run time while the constraint is evaluating There are two known situations in which type casting is required e The static type of the object differs from the well known i e dynamic type of the object To write certain expressions the type must be downcast This is the case when an expression returns an object but its static type is the supertype of the ob
36. model integrated program synthesis tool for creating and evolving domain specific multi aspect models of large scale engineering systems The GME is configurable which means it can be programmed to work with vastly different domains Another important feature is that GME paradigms are generated from formal modeling environment specifications The GME includes several other relevant features e Itis used primarily for model building The models take the form of graphical multi aspect attributed entity relationship diagrams The dynamic semantics of a model is not the concern of GME that is determined later during the model interpretation process e It supports various techniques for building large scale complex models The techniques include hierarchy multiple aspects sets references and explicit constraints These concepts are discussed later e It contains one or more integrated model interpreters that perform translation and analysis of models currently under development In this document we describe the commonalities of GME that are present in all manifestations of the system Hence we deal with general questions and not domain specific modeling issues The following sections describe some general modeling concepts and the various functions of the GME Generic Modeling Environment User s Manual Introduction e 9 Modeling Concepts Overview Model Integrated Program Synthesis Model integrated program synthesis is
37. so in this case the other checkboxes are irrelevant In the X and Y input boxes you can specify the position of your annotation in a specific aspect or the default position You can also clear and set to default the position with setting the Default Pos check box Implementation issues Annotations are stored in the registry of the model All the registry keys and explanation of them can be found in the table below The visualization of annotations is handled by custom decorator COM objects Mga Decorator Annotator which use the very same infrastructure as other custom drawing objects Generic Modeling Environment User s Manual Using GME 5 e 30 Registry Key annotations Description This is the root registry key for annotations annotations lt AnnotationName gt The value of this key is the text of the comment annotations lt AnnotationName gt color This key stores the text color of the comment as a 24 bit hexadecimal number annotations lt AnnotationName gt bgcolor This key stores the background color of the comment as a 24 bit hexadecimal number annotations lt AnnotationName gt font The encoded form of the specified font Win32 LOGFONT structure annotations lt AnnotationName gt aspects The key stores the default position of the annotation annotations lt AnnotationName gt aspects If this key is defined the annotation is visible in all aspects annotations
38. the component interface creates the so called Builder Object Network BON The builder object network mirrors the structure of the models each model atom reference connection etc has a corresponding builder object This way the interface shields the user from the lower level details of the COM interface and provides support for easy traversal of the models along either the containment hierarchy the connections or the references The builder classes Generic Modeling Environment User s Manual High Level Component Interface e 69 provide general purpose functionality The builder objects are instances of these predefined paradigm independent classes For simple paradigm specific or any kind of paradigm independent components they are all the user needs For more complicated components the builder classes can be extended with inheritance By using a pair of supplied macros the user can have the component interface instantiate these paradigm specific classes instead of the built in ones The builder object network will have the functionality provided by the general purpose interface extended by the functionality the component writer needs Component Interface Entry Point The Builder h file in component source package defines the high level C component interface The entry point of the component is defined in the Component h in the appropriate subdirectory of the components directory Here is the file at the start of the component writing p
39. 110 3 Association gme FCO wrong_name does not exist g 104 4 Operator operator gme FCO ocl Integer does not exist Close Constraint Functions list Error descriptions Semantic errors in a Constraint Definition called Wrong Constraint After interpreting a paradigm when a user tries to use the interpreted meta model create or open a model all constraints and definitions are examined If errors exist the appropriate constraints definitions will be disabled and cannot be used Constraints depending on a failed Definition are not available as well Evaluating the constraints During modeling time the well formed and valid constraints are used to maintain the model s consistency Constraints can be evaluated in several ways These are the following 1 Event based constraints are evaluated if the appropriate event i e the event that triggers the constraint is performed on the objects These constraints may be evaluated even if they are not associated with the object which received the event see Depth attribute of Invariant 2 All existing constraints defined by either a library the model or the paradigm can be evaluated on demand executing the File Check Check All command 3 All constraints associated to the active and opened Model or associated to its immediate and indirect children can be evaluated on demand executing the File Check Check command Examining the children ma
40. Aspect amp meta bool bAsContained false const bool isVisible const std string amp strAspect bool bAsContained false const Returns true if the fco as child is visible in the model in aspect meta If meta is null then BON Exception is thrown If bAsContained is true the fco s current containment role otherwise all containment roles of the model and the fco are regarded Generic Modeling Environment User s Manual Appendix C BON and MON e 198 BON TypeInhObject getTypeInhObject const Returns the BON TypelnhObject of the fco std set lt BON ReferencePort gt getReferencePorts const MON Aspect amp meta MOM Aspect const Returns all reference ports of the fco If meta is not null only those ports are returned which are visible in aspect meta std set lt BON Attribute gt getAttributes const Returns a set of the attributes of the fco BON Attribute getAttribute const MON Attribute amp meta const BON Attribute getAttribute const std string amp strAttribute const Returns a BON Attribute corresponding to meta or strAttribute If meta is null strAttribute is empty then BON Exception is thrown BON Model getParentModel const MON Model amp meta MON Model const BON Model getParentModel const std string amp strModel const The first operation returns the parent model If the object is child of a folder then the result is null If m
41. Destruction static BON Object attach IMgaObject pObject Creates a BON object to the specified COM interface virtual void initalize This operation is called by the BON ExtensionX classes when the object is created The user must override this method manually if specific intialization must be done virtual void finalize This operation is called before the object destruction The user must override this method manually if specific finalization must be done or additional BON objects are cached by the object Generic Modeling Environment User s Manual Appendix C BON and MON e 190 void destroy The method removes the object from the project All links linked to the object and all possible exting children will be removed also Attributes BON ObjectPtr getObjectI const This call returns the corresponding IMgaObject COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations const MON Object amp getObjectMeta const This call returns a constant reference of the MON Object which real type can be MON FCO or MON Folder std string getID const Returns the ID of the object BON ObjectType getStereotype const Returns the stereotype of the object i e BON OT Atom BON OT Model BON OT_Connection BON OT_ Reference BON 0T_Set BON 0T Folder BON ObjectStatus getStatus
42. GME main editing window Q9 GME2000 SF Example Ea Titlebar Do ER on ie Menubar 7 7 Ee wex Arts BeVSI E ia Toolbar r Ecce i T Name Sytem Compound Aspect SronaFlonaspe z Base N A Modeb as Model Browser Q a PreProcessing Processing PostProcessing Fi Processing rE T Name Processng Compound Aspect SignaFlowAspe gt Base N A Model Editing Windows Branch1 Attribute Browser Partbrowser InputSignals OutputSignals PrimitveParts Statusbar EDIT 100 5F2000 11 39 AM 4 GME 5 Main Editing Window The GME main editing window has the following components e Titlebar Indicates the currently loaded project e Menubar Commands for certain operations on the model e Toolbar Icon button shortcuts for several editing functions Placing the mouse cursor over a toolbar button briefly displays the name action of the button e Modebar Buttons for selecting and editing modes Generic Modeling Environment User s Manual The Generic Modeling Environment e 12 GME Concepts e Editing area The main model editing area containing the model editing windows e Partbrowser Shows the parts that can be inserted in the current aspect of the current model e Statusbar The line at the bottom which shows status and error messages current edit mode e g EDIT CONNECT etc zoom factor paradigm name e g SF and current time e Attribute Browser Shows th
43. TEE 144 Predefined OCE Types nurin eea sive aia a aaa i e ae T Eaa A R RES 148 OCI AMY se cts n a a she R E S E A A A r S E 148 OCL SMIN eaa ee ennaa s a N EEEE E a RE TEES E aE ETa 149 otk ENUMEFATION eee e a E E E E R 152 OCH Boolean serea AEE T AREE E E A EER MIO IL 152 OCH Reales re ratae E KEE EA EA E ees EEEE r ATA TEE AAE E 153 CO MLE Peri EET slelurmnant selon se aroueu cy 155 OCL TYPE s osipe araea Eae EE S EAE E E E oh Gea SEE EE 156 OC Collecon EE A T 157 A EO A E E E E 159 oel Bag orate apes Er EEE E E E EEA E E i 161 OC SCQUENCE E T 162 GME Kinds and Meta Kinds cccecccescceseeesecseecseeeneeeceeeeesececcnseceseceaecaecaaecaeeeneeeaeeeneennees 164 pme ODE ten r A ae nae ae 164 faaam ELO 0 lE EEE ES OE E EE E OEE E EE Ree alee i eee 166 panaon PC O EE E E EE EE EE E EE 167 pme CONNECHON se E E E R E lee eae 170 ere Reference ionisasi aee iTe R E ai a Ea a E a E AER E Es 170 Pme Seia halite an nea ee ath A A E mine eae 170 pme ATOM r dee case ve e R A E A ceva R A r a eR 171 eme Mod l oiiire e A AE E RTE e R 171 omes Project eo rnn a e e R E R E R TO E R cusensecdens 172 pme ROOF ode a a ase R E nee AE E E Es 173 gme Conn ctonPomt sei ee iev neie pieces cotta seed ER E EE AE ER i 173 Appendix C BON and MON 175 Meta Object Network Classes MON Project nomne o E ie iti de E A a MON MetaObject MON ODJECt e einstein a E E SA EAE ei ee MON Folder oa iiio ni e E E E A E S MON FOO a hi ah didn E E Aida A a MON
44. arguments which are evaluated before calling the function Arguments may be optional as in many programming languages Optional arguments can be followed only by other optional arguments Arguments omitted in a call are considered to be undefined There are some predefined functions in OCL in particularly for ocl Real and ocl Integer lt functionName gt lt expression gt lt expression gt e g floor 3 14 Attributes The simplest features of a type are attributes Attributes are defined by the type or by the meta type It is also possible that an attribute is not defined by either type or meta type but by a constraint attribute definition Attributes are not typical of predefined types there is only one called size In OCL depending on the type of the elements a special feature can be applied to compound objects which looks like an attribute call This feature is a shortcut for the special usage of a predefined iterator collect It is introduced in OCL because of convenience We describe it with an example below These attributes exist if and only if the object contained by the compound object has them lt expression gt gt lt attributeName gt Assuming that there is a Set mySet which consists objects with type Person Person has an attribute called age The result is the same in both cases a Bag consisting integers age of persons
45. check Generic Modeling Environment User s Manual Appendix B OCL and GME e 135 As we mentioned earlier technically the operator of ocl Any is for testing identity but in a simple way this operator can only be used for testing equality because all types override it with a special meaning of equality In some cases we have to test identity definitely but it is not simple in standard OCL We have to up cast the objects to access the functionality defined by ocl Any This is why we introduced a simplification operator Operator and its negation operator always tests identity However operator and its negation operator lt gt always checks equality standard OCL The following are some examples which return true assuming that there is a variable var initialized with 5 let var 5 in var oclAsType ocl Any var oclAsType ocl Any 1 Standard way to test identity var oclAsType ocl Any var oclAsType ocl Any 2 Redundant complex but valid expression same as 1 var var 3 Same as 1 short and compact form of 1 not var var Meaning of operator var 5 Because 5 is stored in different memory space as var s value var 5 Equality of integers not var lt gt 5 Non equality of integers 5 5 Two fives are in different memory spaces During the evaluation of an OCL expression none of the objects are altered after
46. connection that has this connection point gme ConnectionPoint peer gme ConnectionPoint If the connection point is owned by a binary connection then it returns the other connection point of the connection otherwise it throws an exception and returns undefined gme ConnectionPoint usedReferences ocl Sequence gme FCO Returns a sequence which contains all references used by the connection point The first reference is farthest from the target of the connection point Generic Modeling Environment User s Manual Appendix B OCL and GME e 174 Appendix C BON and MON Meta Object Network Classes MON Project Base Classes Attributes MON ProjectPtr getProjectI const std string name const std string displayedName const std string author const std string comment const std string creationTime const Methods std string infoString bool bWithIdentifiers false const MON Folder rootFolder const Generic Modeling Environment User s Manual Appendix C BON and MON e 175 ON Folder gt folders const ON Atom gt atoms const Model gt models const Set gt sets const Connection gt connections const Reference gt references const Attribute gt attributes const Aspect gt aspects const FolderContainment gt folderContainments const ReferenceAssociation gt referenceAssociations const SetMem
47. const Returns a special root registry node which can be used to obtain fco specific pre defined registry values BON FCO copy const BON Folder amp parent BON FCO copy const BON Model amp parent const std string strRole The call copies the fco into specified parent as a child and returns the new one If the parent is a model the containment role may be specified with strR ole BON FCO move const BON Folder amp parent BON FCO move const BON Model amp parent const std string strRole The call moves the fco into specified parent returns the fco itself If the parent is a model the containment role may be specified with strRole BON Atom This class corresponds to the IMgaAtom COM interface Base Classes Its base class is BON FCO Construction and Destruction static BON Atom attach IMgaAtom pAtom Creates a BON atom for the specified COM object static BON Atom create const BON Folder amp parent const MON Atom amp meta MON Atom static BON Atom create const BON Folder amp parent const std string amp strAtom static BON Atom create const BON Model amp parent const MON Atom amp meta MON Atom const std string amp strRole static BON Atom create const BON Model amp parent const std string strAtom const std string amp strRole The methods create a new atom in the specified parent which kind will be
48. constraints The benefits are obvious e MON is the key to write paradigm independent interpreters or plug ins to GME avoiding to get into the details of COM e Fora user the definition of a GME metamodel sometimes could be very difficult to understand With MON GME developers and interpreter writers can examine the wellness of the paradigm easily and may get more familiar with rules how a GME paradigm is specified and interpreted e It made possible to implement BON2 on the base of well specified interface BON2 is developed on the basis of MON and it depends tightly to the classes defined in MON as you can see in the latter subsections e References to a metaobject can be done with the metaobject itself eliminating the mistakes came from misspelled names for example Whenever GME or the users execute a component the paradigm is always accessible to the component via MON The meta object network is read only and can be altered indirectly with reinterpretation only or modifing manually the xmp file containing the interpreted metamodel The meta object network is created during the initialization time of the components and it is already readable when the user s initialization code runs The time of the creation of the specific MON may take couple of seconds depending of the complexity of the paradigm Basic MON Classes The next figure shows clearly the inheritance chain between the core classes of MON MetaObject is the b
49. deleted is controlled by the checkbox in the lower right corner Important New paradigm versions are not always compatible with existing binary models If a model is reopened GME offers the option to upgrade it to the new paradigm If the upgrade fails XML export and re import is needed the previous generation of the paradigm is to be used for export XML is usually the more robust technique for model migration it only fails if the changes in the paradigm make the model invalid In such a situation the paradigm should be temporarily reverted to support the existing model edited to eliminate the inconsistencies and then reopened with the final version of the paradigm New Project Selecting the New Project item in the File menu displays the dialog box described in the previous section All the features mentioned are available plus an additional button Create New which is used to proceed with the creation of a new project Once the desired paradigm is selected pressing the OK button displays another small dialog where the user can specify whether to store the new project in MS Repository or a binary file Pressing OK creates and opens a new blank project At this point the only object available in the project is the root folder shown in the Model Browser Using the context menu right clicking the Project Name the user can add folders and other objects as defined in the paradigm Double clicking a model opens it up in a new Editor
50. directly or indirectly The returned reference ports point to the same fco as this reference port does Generic Modeling Environment User s Manual Appendix C BON and MON e 197 void accept BON Visitor pVisitor This operation is the standard implementation for BON Visitor It calls the visitor visitR eferenceP ort operation supplying the reference port itself BON FCO This class corresponds to the IMgaF CO COM interface Base Classes The class extends BON Object and BON ConnectionE nd classes Construction and Destruction static BON FCO attach IMgaFCO pFCO Creates a BON fco for the specified COM object Attributes BON FCOPtr getFCOI const This call returns the corresponding IMgaF CO COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations MON FCO getFCOMeta const Returns the appropriate MON FCO of the fco MON Containment getRole const Returns the containment role with which the fco is child of a model If the fco is child of a folder then the result is null Methods bool isPort const MON Aspect amp meta MOM Aspect const bool isPort const std string amp strAspect const Returns true if the fco is a port of a model If aspect is not null then the result is true if the model has aspect and the port is visible in aspect bool isVisible const MON
51. double realValue const bool boolValue const Methods MON Project project const MON MetaObject object const std string path const std string valueByPath const std string amp strPath const MON RegistryNode parent const std set lt MON RegistryNode gt children const MON RegistryNode child const std string amp strName const Generic Modeling Environment User s Manual Appendix C BON and MON e 182 MON RegistryNode childByPath const std string amp strPath const MON Constraint Base Classes Attributes MON ConstraintPtr getConstraintI const std string name const std string description const std vector lt std string gt equation const std string displayedName const std set lt MON ObjectEventType gt events const MON ConstraintPriority priority const MON ConstraintDepth depth const Methods MON Project project const MON Object object const MON Containment Base Classes MON MetaObject Attributes MON ContainmentPtr getContainmentI const Methods Generic Modeling Environment User s Manual Appendix C BON and MON e 183 MON Model parent const MON FCO child const std set lt MON ConnectionEnd gt connectionEnds const std set lt MON ConnectionRole gt targetOf const bool isTargetOf const MON ConnectionEnd amp end const std set lt MON ContainmentPa
52. due to the meta project MON Exception is thrown The validations discussed above are not mentioned at the descriptions of the specific operations BON Project This class corresponds to the IMgaP roject COM interface For each IMgaP roject there is only one singleton BON Project instance Generic Modeling Environment User s Manual Appendix C BON and MON e 188 Base Classes This class implements the BON EventListenerP ool interface Attributes BON ProjectPtr getProjectI const This call returns the corresponding MgaProject COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations const MON Project amp getProjectMeta const This call returns a constant reference of the MON P roject std string getName const It returns the name of the project void setName const std string amp strName It sets the name of the project std string getAuthor const It returns the author of the project void setAuthor const std string amp strAuthor It sets the author of the project std string getComment const It returns the project s comment string void setComment const std string amp strComment It sets the comment string of the project std string getCreationTime const It returns the time when the project was created std string getChangeTime const It retu
53. e the first time COM objects are retrieved in contrast with the previous version of BON where the whole project was mirrored and all BON objects were created at the time of the component initialization When the user writes an interpreter it is likely that she would like to use an object more than once and she would like to eliminate the time consumed by the construction and destruction again and again Thus in case of interpreters a BON object is cached remains in the memory until the component finishes to run It means that if an object is retrieved it will not be disposed even if there is no reference to it any more In case of add ons the behaviour is different because of the kind of the component Add ons associated with a project run and occupy memory in the whole time until the project is opened If we followed the previous rule of managing objects the memory would grow while the add on would run Therefore in case of add ons a BON object is immediatelly destructed after the last direct or indirect reference is released Aggregated Reference counting As we mentioned earlier wrapper classes are smart pointers they manages the references to an object and disposes a BON implementation instance if the last reference is released Generic Modeling Environment User s Manual High Level Component Interface 91 As we know objects are cached deeply in BON This caching mechanism means lots of cross references regarded the fact that the
54. getParentFolder const MON Folder amp meta MON Folder const BON Folder getParentFolder const std string amp strFolder const The first operation returns the parent folder If the object is child of a model then the result is null If meta is not null the result is null if the kind of the returned folder would not be meta The second form of the call behaves the same way as the first one Empty string means that there is no kind restriction BON RegistryNode getRegistry const It returns the root registry node for the object void accept BON Visitor pVisitor This is an abstract operation for BON Visitor This call is delegated to the appropriate accept of the object i e considering the dynamic type of the object std string getInfoString Util InfoOptions usOptions Util IO_None const std string getInfoString const std set lt Util InfoOption gt amp setOptions const It returns a string describing the object including the name kind and metakind by default The details and the format can be set be the options BON Folder This class corresponds to the IMgaF older COM interface Base Classes It inherits from BON 0 bject Generic Modeling Environment User s Manual Appendix C BON and MON e 192 Construction and Destruction static BON Folder attach IMgaFolder pFolder Creates a BON folder for the specified COM object static BON Folder create const BO
55. graphical editing environment It is configured to work within a particular modeling paradigm via a paradigm definition file Paradigm definition files are XML files that use a particular GME 5 specific Document Type Definition DTD Models cannot be created and edited until a paradigm definition file or its compiled binary version with mta extension has been opened Once a project has been loaded the GME opens a Model Browser window The Model Browser is primarily used to organize the individual models that make up an overall project while the graphical editor is used for actually constructing the project s individual models Aggregate inheritance Meta E SF2000 Gen Systems SignalFlow I GeneratorA i GeneratorB 5 SubGeneratorC Channel Frequency Output Signal Size SuperGen if GeneratorA i GeneratorA if GeneratorB amp In w Out Model Browser showing folders and models The most important high level features of the Model Browser are accessible through the three tabs displayed at the top of the Model Browser These tabs deal with the Aggregate Inheritance and Meta hierarchies The Aggregate tab contains a tree based containment hierarchy of all folders models and parts from the highest level of the project the Root Folder The aggregate hierarchy is ignorant to aspects and is capable of displaying objects of any kind More information on the aggregate hierarchy will be provided shortly
56. graphically by a UML inheritance icon containing a solid black dot This can be seen in the left hand side diagram in the figure below where implementation inheritance is used to derive class X1 from class B1 In this case X1 the association allowing objects of type C1 to be contained in objects of type B1 In other words X1 type objects can contain Cl type objects Because B1 type objects can contain other Bl type objects X1 type objects can contain objects of type B1 but not of type X1 Note that D1 type objects can contain objects of type B1 but not objects of type X1 Interface inheritance operator The right side of the figure shows interface inheritance between B2 and X2 the unfilled circle inside the inheritance icon denotes interface inheritance Interface inheritance allows no attribute inheritance but does allow full association inheritance with one exception containment associations where the base class functions as the container are not inherited Therefore in this example X2 type objects can be contained in objects of type D2 and B2 but no objects can be contained in X2 type objects not even other X2 type objects The union of implementation inheritance and interface inheritance is the normal UML inheritance It should also be noted that these operators could have been implemented using UML stereotypes However interface and implementation inheritance are semantically much closer to regular inheritance than to associations
57. gt iterator it setSelectedFCOs begin it setSelectedFCOs end it strObjects CString it gt getName c_str r n AfxMessageBox strObjects end of invokeEx Add ons and Events The entry point of an add on means the reaction to the specific event of a specific object and it can be accomplished different sort of ways The user may handle and react to all events in objectEventPerformed of BON Component Here is an example void Component objectEventPerformed Object amp object unsigned long event VARIANT v v in this version of BON2 is unused in the future it will contain appropriate event parameter s AfxMessageBox The context CString object gt getName c_str At the same time more than one event may be performed CString strEvents Events r n for MON ObjectEventType eType MON OET_ObjectCreated eType MON OET_Al1 eTypet strEvents CString toString eType c_str r n AfxMessageBox strEvents This way of handling events is the most general it is likely the user may prefer the BON EventListener interface This interface has the eventP erformed operation which is empty by default The operation has only a BON Event argument passed containing the context object the event type and the event parameters if they exist The BON EventListener interface must be implemented b
58. gt lt BASE CLASS gt LARE_CUSTOMATOMREF lt CLASS gt lt BASE CLASS gt LARE_CUSTOMCONNECTION lt CLASS gt lt BASE CLASS gt LARE_CUSTOMSET lt CLASS gt lt BASE CLASS gt LEMENT_CUSTOMMODEL lt CLASS gt lt BASE CLASS gt lt NAMES gt LEMENT_CUSTOMMODELREF lt CLASS gt lt BASE CLASS gt lt NAMES gt LEMENT_CUSTOMATOM lt CLASS gt lt BASE CLASS gt lt NAMES gt LEMENT_CUSTOMATOMREF lt CLASS gt lt BASE CLASS gt lt NAMES gt LEMENT_CUSTOMCONNECTION lt CLASS gt lt BASE CLASS gt lt NAMES gt LEMENT_CUSTOMSET lt CLASS gt lt BASE CLASS gt lt NAMES gt Here the lt CLASS gt is the name of the new class while the lt BASE_CLASS gt is the name of one of the appropriate built in class or a user derived class The user can create abstract base classes as discussed later The lt NAMES gt argument lists the names of the kinds of models the given class will be associated with It can be a single name or a comma separated list The whole names string must be encompassed by double quotes For example if we have a Compound model in our paradigm we can create a builder class for it the following way Generic Modeling Environment User s Manual High Level Component Interface e 80 Component h class CCompoundBuilder public CBuilderModel DECLARE_CUSTOMMODEL CCompoundBuilder CBuilderModel public virtual void Initialize virtual CCompoundBuilder more declara
59. gt lt BASE CLASS gt LEMENT_CUSTOMATOMREF BASE lt CLASS gt lt BASE CLASS gt LEMENT_CUSTOMCONNECTIONBASE lt CLASS gt lt BASE CLASS gt LEMENT_CUSTOMSETBASE lt CLASS gt lt BASE CLASS gt For casting use the BUILDER_CAST CLASS PTR macro for casting a builder class pointer to its derived custom builder object pointer Example Let s assume that our modeling paradigm has a model kind called Compound Let s write a component that implements an algorithm similar to the previous example In this case we ll scan only the Compound models Again the folder hierarchy is not considered Here is the Component h file ifndef GME_INTERPRETER_H define GME_INTERPRETER_H include Builder h define NEW_BON_INVOKE define DEPRECATED_BON_INVOKE_IMPLEMENTED class CComponent public CComponent focusfolder NULL CBuilderFolder focusfolder CBuilderFolderList selectedfolders void InvokeEx CBuilder amp builder CBuilderObject focus CBuilderObjectList amp selected long param he class CCompoundBuilder public CBuilderModel DECLARE_CUSTOMMODEL CCompoundBuilder CBuilderModel public void Scan CString foldName l endif whole file The component cpp file is shown below Generic Modeling Environment User s Manual High Level Component Interface e 82 include stdafx h include Component h void CComponent InvokeEx CBuilder amp builder CBuilderObject focus
60. is the current project and the current GME 5 instance Cancel Used to cancel a pending connect disconnect operation Preferences Shows the preferences available for the current model see detailed discussion in a separate section below Registry The registry is a property extension mechanism any object can contain an arbitrarily deep tree structure of simple key value pairs of data Selecting this menu item opens up a simple dialog box where the current object s registry can be edited Special care must be taken when editing the registry since it is being used by the GME 5 GUI to store visualization information and domain specific interpreters may use it too Synch Aspects The layout of objects in an aspect is independent of other aspects However using this functionality the layout in one source aspect can be propagated to multiple destination aspects A dialog box enables the selection of the source and destination aspects The objects that participate in this operation can also be controlled here The default selection is all the visible objects in the source aspect if none of them Generic Modeling Environment User s Manual Using GME 5 e 28 Annotations were selected in the editing window otherwise only the selected ones Two check boxes control the order in which objects are moved This is important in case objects compete for the same real estate Priority can be given to the selected objects and within the selected object
61. lt AnnotationName gt aspects lt AspectName gt If defined the annotation is visible in the specific aspect If it contains a position code this will be the position of your comment in this aspect Managing Paradigms The Register Paradigm item in the File menu displays a dialog box where the user can add or modify paradigms This dialog box is also displayed as the first step of the New Project command see below Like other items recorded in the Windows registry paradigms can be registered either in the current user s own registry HKEY_CURRENT_USER Software GME Paradigms or in the common system registry HKEY_LOCAL_MACHINE Software GME Paradigms If a paradigm is registered in both registries the per user registry takes precedence When changing the registration of paradigms it can be specified where the changes are to be recorded Non administrator users on Windows systems generally do not have write access to the system registry so they can only change the per user registration Paradigms are listed by their name status connection string and current version ID The name is what primarily identifies the paradigm The status is u user or s system depending where the paradigm is registered The connection string specifies the database access information or the file name in case of binary files Version ID is the ID of the current generation of the paradigm The registry access mode is selectable in the lower rig
62. menu will be the same as value of the menu In the expanded mode it is possible to list the definite values to be used for the menu elements This is done by separating the displayed value from the actual value with a comma Example NamePosition fay Attributes Preferences Properties Name position North 0 Northeast 1 East 2 Southeast 3 South 4 Southwest 5 Sample enumerated attribute specification Note that the displayed and actual value need not be of the same basic type character integer float etc because it will all be converted to text Contained in EnumAttr Generic Modeling Environment User s Manual Metamodeling Environment e 64 Name position Enumeration that lists the nine places that the name of an FCO can be displayed Default value South Contained in Atom Set Reference Model Object is a port Boolean checkbox that determines whether or not the FCO will be viewable as a port within the model Default value Unchecked Contained in Containment On The Constraint has many attributes which are similar except for the type of event to which they refer They are all boolean checkboxes that give the constraint manager the authority to check this constraint when certain events occur e g Model creation deletion connecting two objects For more information on the semantics of these events please refer to the constraint manager documentation
63. meta kind ocl Object is the super meta kind of all meta kinds of GME It can be contained by folders Aliases Super Meta Kind This meta kind can also be accessed as Object Generic Modeling Environment User s Manual Appendix B OCL and GME e 164 Operators operator objectl gme Object object gme Object ocl Boolean Returns true if objectl is the same as object2 This equality means that the objects IDs are the same operator lt gt objectl gme Object object gme Object ocl Boolean Returns true if objectl is not the same as object2 This equality means that the objects IDs are different Attributes gme Object name ocl String Returns the name of the object gme Object kindName ocl String Returns the name of the kind of the object gme Object metaKindName ocl String Returns the name of the meta kind of the object Methods gme Object name ocl String D This method has the same functionality as the gme 0 bject name attribute gme Object kindName ocl String D This method has the same functionality as the gme O bject kindName attribute gme Object parent gme Object Returns the parent of the object The result can be an object whose dynamic meta kind is either gme Folder or gme Model Returns null if the object is the root folder of the project gme Object isNull ocl Boolean Returns
64. meta or strAtom If strRole specified the containment role name will be the same within the model parent static BON Atom create const BON Folder amp parent const BON Atom amp baseType bool bAsInstance true static BON Atom create const BON Model amp parent const BON Atom amp baseType bool bAsInstance true const std string amp strRole ya The methods derive a new atom from the specified basetype If bAsInstance is true the derived object will an instance of basetype otherwise a type If strRole specified the containment role name will be the same within the model parent Generic Modeling Environment User s Manual Appendix C BON and MON e 200 static BON Atom createAs const BON Model amp parent const std string amp strRole The methods create a new atom in the specified model parent whose containment role is strRole If the containment role is associated with no atoms in the model an exception is thrown Attributes BON AtomPtr getAtomI const This call returns the corresponding IMgaAtom COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations MON Atom getAtomMeta const Returns the appropriate MON Atom of the atom Methods BON FCOExRegistryNode getRegistry const Returns a special root registry node which can be used to obtain atom specific pre defined
65. method cannot convert strings representing real numbers but an exponent Generic Modeling Environment User s Manual Appendix B OCL and GME e 150 ocl String toInteger ocl Integer Converts the string to ocl Integer If the conversion cannot be performed then an exception is thrown and the method returns undefined The method cannot convert strings representing integer numbers but an exponent Generic Modeling Environment User s Manual Appendix B OCL and GME e 151 ocl Enumeration The type ocl Enumeration represents types with a discrete and finite value domain Aliases Supertypes This type can be accessed as enum Its supertype is ocl Any Operators operator enuml ocl Enumeration enum2 ocl Enumeration ocl Boolean Returns true if enum is the same value as enum 2 operator lt gt enuml ocl Enumeration enum2 ocl Enumeration ocl Boolean Returns true if enum is not the same value as enum2 ocl Boolean The type ocl Boolean represents the logical type of OCL Aliases Supertypes This type can be accessed as bool Its supertype is ocl Any Operators operator booll ocl Boolean bool2 ocl Boolean ocl Boolean Returns true if booll equals to bool2 operator lt gt booll ocl Boolean bool2 ocl Boolean ocl Boolean Returns true if booll does not equal to bool2 operator and booll ocl Boolean enu
66. model from the specified basetype If bAsInstance is true the derived object will an instance of basetype otherwise a type If strRole specified the containment role name will be the same within the model parent static BON Model createAs const BON Model amp parent const std string strRole The methods create a new model in the specified model parent whose containment role is strRole If the containment role is associated with no models in parent an exception is thrown Attributes BON ModelPtr getModelI const This call returns the corresponding IMgaModel COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations MON Model getModelMeta const Returns the appropriate MON Model of the model Methods Sset lt BON FCO gt getChildFCOs const MON FCO amp meta MON FCO const Aspect amp aspect MON Aspect const Sset lt BON FCO gt getChildFCOs const std string amp strFCO const Aspect amp aspect MON Aspect const The operations return a set containing the child fcos of the model If meta is not null or strFCO is specified i e not empty string only those fcos are returned which satisfy the kind restriction If aspect is not null then the result set is filtered with aspect Generic Modeling Environment User s Manual Appendix C BON and MON e 202 std set lt B
67. models we have a case of model hierarchy In the GME each part atom model reference or set is represented by an icon Parts have a simple paradigm defined icon If no icon is defined for a model it is shown using an automatically generated rectangular icon with a 3D border Atoms Atoms or atomic parts are simple modeling objects that do not have internal structure i e they do not contain other objects although they can have attributes Atoms can be used to represent entities which are indivisible and exist in the context of their parent model imxi File Edit View Window Help Is e BWX N2 A x4 1 a3 SF ZA components HEE T Name SubGeneratorC Compound Aspect SignalFlowAspe X Output Frequency EDIT 100 SF 7 A primitive model SubGeneratorC containing four atoms Examples of atoms are as follows The Generic Modeling Environment e 15 e An output data port on a dataflow block in a signal processing paradigm e A connection link on a processor model in a hardware description paradigm e A process variable in a process model in a chemical engineering paradigm Model Hierarchy As mentioned above models can contain other models as parts models of the same or different kind as the parent model This is a case of model hierarchy The concept can be explained as follows models represent the world on different levels of abstraction A model that contains other models represents som
68. name the method throws an exception and returns undefined ocl Any isUndefined ocl Boolean Returns true if the object is undefined This method can be used to test whether an object is undefined or not and to handle exceptions thrown by an OCL expression ocl String The type ocl String represents ASCII strings as specified in OCL Aliases Supertypes This type can be accessed as string Its supertype is ocl Any Operators operator stringl ocl String string2 ocl String ocl Boolean Returns true if string is the same character sequence as string2 operator lt gt stringl ocl String string2 ocl String ocl Boolean Returns true if string is not the same character sequence as string2 operator stringl ocl String string2 ocl String ocl String Returns a string which is the concatenation of string and string2 operator lt stringl ocl String string2 ocl String ocl Boolean Returns true if string is ahead of string2 in lexicographical ordering operator lt stringl ocl String string2 ocl String ocl Boolean Returns true if string is ahead of or equal to string2 in lexicographical ordering Generic Modeling Environment User s Manual Appendix B OCL and GME e 149 operator gt stringl ocl String string2 ocl String ocl Boolean Returns true if string2 is ahead of string in lexico
69. ocl Set Connection Model referenceParts role ocl String ocl Set Reference Model setParts role ocl String ocl Set gme Set Model parts role ocl String ocl Set gme FCO Model atomParts kind ocl Type ocl Set gme Atom Model modelParts kind ocl Type ocl Set gme Model Model connectionParts kind ocl Type ocl Set gme Connection Model referenceParts kind ocl Type ocl Set gme Reference Model setParts kind ocl Type ocl Set gme Set Model parts kind ocl Type ocl Set gme FCO These methods return a set which contains the parts i e immediate children of the model For these methods we can specify a role name which is the containment role of the object as it is contained by the model This role may differ from the role that the user defined in the meta model This is the case if the role is defined as an abstract kind in the meta model Because the inheritance information is lost the interpreter has to create distinguishable roles for the objects by concatenating the kind and the role If the kind of kind i e the meta kind does not correspond to the method name then an exception is thrown and undefined is returned gme Project This kind is predefined in GME and has exactly one instance in all models It is introduced to facilitate writing constraint definitions whose context c
70. one folder can be organized hierarchically although standalone models can also be present The Model Browser is used to view or look at the entire project at a glance All models and folders can be shown and folders models and any kind of parts can be added moved and deleted using the Model Browser controls This is described in more detail below The Part Browser The Part Browser window shows the parts that can be inserted into the current model in the current aspect It shows all parts except for connections At the bottom of the Part Browser tabs show the available aspects of the current model Clicking on a tab will change the aspect of the current model to the selected one It also attempts to change the aspect of all the open models If a particular model does not have the given aspect its current aspect remains active The Part Browser can be used to drag a single object at a time and drop it either in any editor window or in the Model Browser If a reference is dragged a null reference is created because the target object is unspecified Remember that references null references included can be redirected at any time by dropping a new target on top of them see more detailed discussion where the drag and drop operations are described Note that the Part Browser window just like the Model Browser window is dockable it can float as an independent window or it can be docked to any side of the GME 5 Main window The At
71. or dst Contained in SourceToConnector ConnectorToSource Stereotype Enumeration field that specifies how a Constraint Function can be called e attribute e method Default value method Contained in ConstraintFunc Type displayed A boolean checkbox that decides whether the name of Type or Subtype of an Instance has to be displayed or not Default value Unchecked Contained in FCO Atom Model Set Typeinfo displayed A boolean checkbox that decides whether T S or T letter is displayed according to that the concrete model is Type Subtype or Instance A model does not have any sign if it is not in type inheritance Default value Checked Contained in Model Generic Modeling Environment User s Manual Metamodeling Environment 66 Version information A text field translated into a comment within the paradigm output file The user is responsible for updating this field Contained in Paradigm Viewable A boolean checkbox that decides whether or not to display the attribute in the paradigm If the state is unchecked then the attribute will be defined in the metamodel but not viewable in any Aspect regardless of the properties of the FCO This is useful if you want to store attributes outside the user s knowledge Default value Checked Contained in EnumAttr BooleanAttr FieldA ttr Semantics Guide to Metamodeling The following table displays the representation of
72. true if the object is null In GME null is differs from undefined gme Object isFCO ocl Boolean Returns true if the meta kind of the object is gme F CO or any descendant meta kinds Generic Modeling Environment User s Manual Appendix B OCL and GME e 165 gme Object isFolder ocl Boolean Returns true if the meta kind of the object is gme F older gme Folder The meta kind ocl Folder represents a folder A folder may contain objects which have meta kind gme 0 bject Aliases Super Meta Kind This meta kind can also be accessed as Folder Its super meta kind is gme 0 bject Method gme Folder folders ocl Set gme Folder Returns a set which contains all folders recursively contained by the folder gme Folder childFolders ocl Set gme Folder Returns a set which contains all folders contained by the folder gme Folder rootDescendants ocl Set gme FCO Returns a set which contains all feos which are either root objects in the folder or in all folders that the folder contains recursively gme Folder rootChildren ocl Set gme FCO Returns a set which contains all fcos which are root objects of the folder gme Folder models kind ocl String ocl Set gme Model D gme Folder models kind ocl Type ocl Set gme Model Returns a set which contains all models contained by the folder or by any child folder or mo
73. 00000 black Contained in Connection Generic Modeling Environment User s Manual Metamodeling Environment e 61 Composition role Text field that gives the rolename that the FCO will have within the Model Contained in Containment Constraint Equation Multiline text field that gives the equation for the constraint Contained in Constraint Context Text field that specifies the context of a Constraint Function Contained in ConstraintFunc Data type Enumeration that gives the default data type of a FieldAttr The possible values are String Integer and Double Default value String Contained in FieldAttr Decorator Test field that specifies the decorator component to be used to display the given object in the target environment Example MGA Decorator MetaDecorator Contained in Model Atom Reference Set Default True A boolean checkbox that describes the default value of a BooleanAttr Default value Unchecked Contained in BooleanAttr Default parameters Text field that gives the default parameters of the constraint Contained in Constraint Default menu item Text field that gives the displayed name of the menu item in the Menu items attribute to be used as the default value of the menu Contained in EnumAttr Description Text field that is displayed when the constraint is violated Contained in Constraint Generic Modeling Environment User s Manual Metamo
74. 13 Defining the Modeling Paradigm s sssseesesessseseeeeresersesrrrtereresrsesrrreereresrsesresesrereeree 13 MOE E E E A A A E E E E 14 TALOS a NOE TEE E A E E ees 15 Model Hierarch yec ae ae e areae ESE et Eea SEAE dds E TE ESEE E EEES 16 R AE A O E E EEE 17 Connections and LINKS esc sevac sexed avscuscpecetges alu eE ae a p A a E EREE Se 17 CLS EERE EE N EEEE EE EE OE E uegeesess 18 VENI OLE R aE EEEE os colons EEEE ENEE E EE EE E ES 19 PANG n EnA LIAE EEE A EE E EE E E E EE E E 19 Jaaa lea nea oTe EA eE AEE EEE E E EEE EE 20 Using GME 5 21 GME 5 Interfaces a R Pees Bisa Seek a A A ES N r 21 The Part Browser bereon a A e A A e a a a rie 21 The Attribute BOWS erana nae aR r AER A Aa S Eia 21 The Model Browser e a eaa aai R r E EA daveb a AAA a EY 22 Model Browser navigation ssrin eera n r a A EE a Et 23 Model Browser and Interoperation eseeeseeesssreessseeeresrsreereseterssesrrsresrenesreerenresreeres 25 Lockie e a e E Gade aE a Aa E A VENA Ea 25 The Model EditObrn iene nann a E A R r a R EE Ea iS 25 The Editig WNdO Wa a ara aea e ea teh a E EE a eSEE A Ea 25 GME Meni Sa ra n ae E E e E R are EN iY 26 JATINOTALIONS 3 45 45 a a E E R E E a R T 29 Creating ANNOAHONS i eiior eona EE EEE EAE EE EEE EErEE EN ss 29 Editing Annotations esera re ea E AE E EE E a E a 29 Implementation ISSues aaacisssisshahniaasiniiincssiielsacied hog a as 30 Generic Modeling Environment User s Manual Contents e i Managing Parad
75. 2 Functions abs int ocl Integer ocl Integer Returns the absolute value of int max intl ocl Integer int2 ocl Integer ocl Integer Returns the maximum of intl and int2 min intl ocl Integer int2 ocl Integer ocl Integer Returns the minimum of intl and int2 Methods ocl Integer abs ocl Integer Returns the absolute value of this ocl Integer max int ocl Integer ocl Integer Returns the maximum of this and int ocl Integer min int ocl Integer ocl Integer Returns the minimum of this and int ocl Type The type ocl Type represents the types and the meta types used in an OCL expression For the time being this type does not have features e g enumerating the attribute of the type but this type will be the foundation of obtaining meta kind Generic Modeling Environment User s Manual Appendix B OCL and GME e 156 information in OCL At the moment it is used only to refer to types and meta types with strings Aliases Supertypes This type can be accessed as Type Its supertype is ocl Any Operators operator typel ocl Type type2 ocl Type ocl Boolean Returns true if typel is equal to type2 operator lt gt typel ocl Type type2 ocl Type ocl Boolean Returns true if typel is not equal to type2 ocl Collection The type ocl Collection represents the supertype of ocl Set oc
76. 3 How to specify an Attribute for an FCO Create and configure the Attribute and the FCO Connect the Attribute to the FCO Now the Attribute belongs to the FCO Atom This class represents an Atom The Atom is the simplest kind of object in one sense because it cannot contain any other parts but it is complex to define because of the many different contributions it can make to a Model Reference etc An Atom has the Icon Name Port Icon Name and Name Position attributes How to set that an Atom is a Port Configure the Atom to be a member of a Model Click on the attributes of the Containment association between the Atom and the Model Assert the Object Is A Port attribute Reference To represent a Reference class two things must be specified the FCO to which this Reference refers and the Model to which the Reference belongs A Reference has the Icon Name and Name Position attributes How to specify containment of a Reference in a Model Connect the Reference to the Model Resolve the prompt for connection type as Containment How to specify the FCO to which a Reference refers Connect the Reference to the FCO If the FCO is of type Model an additional prompt is displayed exactly the same as when giving ownership to the Model as in the previous step This time choose the Refer type of connection If the FCO is not of type Model then no additional input is necessary When specifying the roles to which a R
77. A es ai es 120 Evaluating the constraints assis Aester eseis sores E eE E E E DI Eies 121 Altering the evaluation process csccssceesseseceesceeseeseceseceseceaecnaecaeecaeeeaeeeneeeneensees 122 Run time exceptions and constraint Violations ceseeeeeseceeeeeeseceeeeecnereeeeaeeees 123 Constraints inthe Model 6 soci e ianen eu a edad beets 125 Appendix A Database Setup 129 GME 5 Database Support osuneen bet eE reene rore rea EE en EE E AEE EEEE EEEE nea 129 Server Side installation eneeier strne e i E a a a a 129 Client sid SetUp c i 526se sieusestebeeschenidvececeunescvecnunecbouhounsbacntents sunedecuesbone EEE A EEEE 129 Preparing GME for multiuser access seseseeseeseeeeeeeseersesestrrerersrsrereeretseseseerrerse 130 Using GME with the ODBC backend eee ee eeeeceseeeeesecseeseceeeeeceaeeecaecaeeaeeneeaes 130 Appendix B OCL and GME 131 OCL Langas 88 dat teiies Shek Gti Reel Bios Aisi Aoi Ras A atk 131 Type Conformance tes etiese aee eeue ree Ea taoin ndtv EENE eens Galle eee ads 131 Context of a Constraintaa sctthd eed cAdsiei asthe i Ea aaa aas a eiea eii Ee 132 Types of Constraints Expressions sssseesesesssesrereeresserstsrsrtererssrstsreteeretsersrsrerrerst 132 Generic Modeling Environment User s Manual Contents e iii Common OCL Expression careieni a a a ara oe aiid eae eae 134 Type Related Ex pressions nenia a a e aa a AEA ame 140 Resolution RULES seee n e a a aa E E RR
78. Add a new Constraint to the model Load all Remove a user defined Add Constraint from the model e Remove Evaluate the selected Constraints Cancel OK Apply Constraints in the model Add and Remove constraints Identity Expression Events Constraint Properties Context a meta Circuit z Identity Expression Events Expression This constraint is dummy a true Constraint Properties On create E Identity Expression Events On connect Vv On new child a Name Constraint to XOR On refer r EEE r Description Dummy Constraint to XOR On derive a On change property r On change association E Default Parameters E Priority 1 7 Depth fi X Definition Project CircuitModel Property pages for a constraint Generic Modeling Environment User s Manual Constraint Manager e 126 With the Add and the Remove buttons the user may add and remove constraints from the model In the model constraints cannot be either added or removed from the libriaries and the paradigm Constraint Definitions can be created only in the paradigm Modeler constraints can be specified similarly to a paradigm s constraints The context can be only kinds rather than types subtypes or instances The set of the objects can be restricted with the constraint enabling mechanism Enable and disable constraints Constraints Kinds and Types Settings 3 RootFolder J A Circuit M1 meta
79. Aliases Supertypes This type can be accessed as Set Its supertype is ocl Collection Operators operator setl ocl Set set2 ocl Set ocl Boolean Returns true if the size of setl and set are the same and setl contains all elements of set2 and set contains all elements of setl operator lt gt setl ocl Set set2 ocl Set ocl Boolean Returns true if the size of setl and set are not the same or setl contains at least one element that set does not or setl contains at least one element that set does not Generic Modeling Environment User s Manual Appendix B OCL and GME e 159 operator setl ocl Set set2 ocl Set ocl Set operator set ocl Set bag ocl Bag ocl Bag Returns the union of setl and set2 or set and bag operator set ocl Set collection ocl Collection ocl Set Returns a set which contains all elements that are contained in set but not in collection operator setl ocl Set set2 ocl Set ocl Set operator set ocl Set bag ocl Bag ocl Set Returns the intersection of setl and Set2 or set and bag operator setl ocl Set set2 ocl Set ocl Set Returns a set which contains all elements that are contained by only setl or set2 Methods ocl Set union set ocl Set ocl Set ocl Set union bag ocl Bag ocl Bag Returns the union of th
80. E 5 implements a sophisticated locking mechanism There are four different types of locks from the perspective of a user An object can be not locked read only locked write only locked or exclusively locked When an object is read only locked then other users may access the same object but only in read only mode The read only lock guarantees that all information read from the object is up to date and cannot be modified by other users while the lock is held When an object is write only locked then others can still access the same object write only but not read only or exclusively The write only lock guarantees that the object is kept modifiable while the write only lock is held It gives no guarantee however that any information read from the object is up to date Reference objects are the prime reason for introducing the write only lock Multiple users must be allowed to make references to the same target model To make matters worse different users have different undo queues possibly containing modifications to the same objects Holding a write only lock on the target model and exclusive locks on the reference objects solves this problem Finally an exclusive lock is equivalent to holding read only and write only locks simultaneously In summary an object is either not locked at all read only locked by a few users write only locked by a few users or exclusively locked by a single user Note that the object lock states are visualized
81. E At OM eenei eisatiere daraka an iaa e aa a e E aaia RS eea Eeee MON M de iiaa E EEEN P E RE SE ee MON Connection MON ConnectionSpecification ssseseeseseseseseestereresesesrerreretssesesterrersessesesresrerrerse 180 MON Connection Rol sivisccs cides ds uutesce ickeda ca cates ce caine Besave etoesneeusdes 180 MON Set granes tuchvauety suites ea E a E R a soled EE ts Evbave E aee 181 MON Reference sarena e E E behave E E EEEE SE Tee 181 MON Resistry Node ronisin iekea aa bude annie EEEE SE ee 182 MON Cons train eseon n sheds A e E EEO E dee 183 MON Containment eein i EEE inhi E E EEEE Eae 183 MON ContainmentPart ressa e E a NE RER ERE Idee 184 MON ASPECT cunaca a e used E E E E E S E 185 MON Ati DUtE nena R AR e E AERE 185 MON FolderContainment cecccescceecsceeseeeseeesceeceeeeceseeeseceseeeaeenaeenaecneeeseeeenens 186 MON C nr ctionEnd eanna a e A AERE t 186 MON ReferenceASSOCiatiOn cceccesseesseeseesseeeeceecesecesceesecnaecaaecaeecaeeeaeeeneeeneennees 187 MON SetMermibershipy aiara iere a Ra indienne deena 187 MON ModelNA specto rer E E A a A R 187 MON AttributeA gores oNneni inana e e aa i Aa A N 188 Builder Object Network Clas sESr inrer eaa ari e E 188 Generic Modeling Environment User s Manual Contents e iv BON Projects fosesfescHiti fod saseey R R Seek Alas E ee este eehepast chee ESE 188 BON ODOC ahne areae e E EEA Suede E A E 190 15 8 1h otal EOI O 1 EE EEA EE E E E E 192 BON
82. Errors displaying dialog The content of the whole dialog is changing according to the selected item in the list At the right we can track and follow the constraint evaluation on a particular object regarded as the context of the constraint For the time being in this window we can see only those feature calls that returned false or undefined In lots of cases this information is enough to eliminate the unwanted errors or to find out where the problem occurred Generic Modeling Environment User s Manual Constraint Manager e 124 Selecting one line in the track window the Expression window and the list showing the defined variables are updated according to the context of the track line At this time tracking of the execution of Constraint Definitions is not available Constraints in the model Constraints types As GME had introduced the type inheritance concept it became essential that the user would be able to attach constraints to types and subtypes similarly to kinds In GME 5 the set of the rules expressed by constraints defined in the paradigm may be extended by constraints defined by the modeler These constraints can be associated to types subtypes even instances in a specific way If the modeler set the aim to create a model which will be imported as a libarary into other models then the constraints defined in the imported model become library constraints The types of constraints are the following Critical Constr
83. GME 5 while she modifies the metamodels in another GME 5 and regenerates the paradigm this command allows updating the models by automatically exporting toXML and importing from it Note that any changes that invalidate the existing models for example deleting a model kind that has instances in the project will cause this operation to fail However adding new kinds of objects attributes etc or deleting unused concepts will work Register Paradigms Registers a new modeling paradigm discussed in detail later Register Component Registers an interpreter DLL with the current paradigm A dialog box appears that makes it possible to register as many interpreters as the user wishes Check All Invokes the Constraint Manager to check all constraints for the entire project Display Constraints All the constraints defined in the meta model are displayed These constraints can be disabled globally or on object basis in this dialog Options of constraints evaluation are also available Settings Sets GME 5 specific parameters Currently the only supported options are to set the path where the icon files are located on the current machine and whether GME should remember the state of the docking windows For the paths the user can type in a semicolon separated list of directories the order is significant from left to right or use the add button in the dialog box to add directories one by one utilizing a standard Windows File Dialog box
84. HeadPosition while fPos CBuilderFolder fold folds gt GetNext fPos const CBuilderModelList roots fold gt GetRootModels POSITION rootPos roots gt GetHeadPosition while rootPos ScanModels roots gt GetNext rootPos fold gt GetName void CComponent ScanModels CBuilderModel model CString fName AfxMessageBox model gt GetName model found in the fName folder const CBuilderModelList models model gt GetModels POSITION pos models gt GetHeadPosition while pos ScanModels models gt GetNext pos Name Extending the Component Interface The previous example used the build in classes only The component writer can extend the component interface by her own classes In order for the interface to be able to create the builder object network instantiating the new added classes before the user defined interpretation actually begins a pair of macros must be used The derived class declaration must use one of the DECLARE macros The implementation must include the appropriate IMPLEMENT macro There is a pair of macros for models atoms model and atom references connections and sets The following list describes their generic form Generic Modeling Environment User s Manual High Level Component Interface e 79 LARE_CUSTOMMODEL lt CLASS gt lt BASE CLASS gt LARE_CUSTOMMODELREF lt CLASS gt lt BASE CLASS gt LARE_CUSTOMATOM lt CLASS
85. Inheritance is standard style for UML Any FCO may inherit from an FCO kind of class but an FCO may inherit only from other FCO s Kinds may inherit only from each other e g Model may not inherit from Atom When the class is declared as abstract then it is used during generation but no output FCO is generated No class of kind FCO is ever generated When multiple inheritance is encountered it will always be treated as if it were virtual inheritance For example the classic diamond hierarchy will result in only one grandparent class being created rather than duplicate classes for each parent How to Specify Inheritance It is assumed that Child and Parent are of the same kind e g Atom Model FCO is used in this example for brevity but note that any FCO may participate in the Child role if the Parent is of kind FCO Else they must match Connect the Parent FCO to the Inheritance Atom This creates a superclass Connect the Inheritance atom to the Child FCO This creates the child class Generic Modeling Environment User s Manual Metamodeling Environment e 57 Aspect This set defines the visualization that the Models in the destination paradigm will use Models may contain Aspects through the HasAspect connection kind This is visualized using the traditional UML composition relation using a filled diamond FCOs that need to be shown in the an aspect must be made members of the given Aspect set GME 5 supports aspect
86. N Folder amp parent const MON Folder amp meta MON Folder static BON Folder create const BON Folder amp parent const std string strFolder Creates a child folder in the specified folder parent which kind will be meta Attributes BON FolderPtr getFolderI const This call returns the corresponding IMgaF older COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations MON Folder getFolderMeta const Returns the appropriate MON F older of the folder Methods std set lt BON Object gt getChildObjects const MON Object amp meta MON Object const std set lt BON Object gt getChildObjects const std string amp strObject const The operations return a set containing the child objects of the folder including root fcos and child folders If meta is not null or strObject is specified i e not empty string only those objects are returned which satisfy the kind restriction set lt BON Folder gt getChildFolders const Set lt BON FCO gt getRootFCOs const set lt BON Atom gt getChildAtoms const Sset lt BON Model gt getChildModels const These calls return a set containing the child objects whose stereotype is defined in the name of the operation BON Object findByPath const std string amp strPath const std string amp strDelimiter b
87. New Builder Object Network BON2 BON2 is using STL instead of MFC Object creation is on demand enabling lightweight interpreters e New and enhanced Metalnterpreter along with skeleton code generator for BON2 BON2 is automatically extended based on the metamodel hence it automatically provides a domain specific API e Java BON framework is added Through our bi directional JAVA COM bridge now you can write your interpreters in Java Check out Lesson 8 of the Tutorial e External text editor support for multiline attributes configurable through the GME File menu Settings dialog e Periodic autosave feature added configurable through the GME File menu Settings dialog e Enhanced printing and print preview e Printing to Windows Metafile e Enhanced zooming mode In addition to discrete zoom levels arbitrary zooming of the selected area is also supported e Runtime event logging configurable through the GME File menvu Settings dialog Log files are placed under the lt USER PROFILE gt Application Data GME folder Please include the log file if possible e Application specific notifications can be sent through the MGA layer e The XML parser does signal the beginning and the completion of the import process thus your add on can disregard other events during importations e The GUI now supports OLE Automation See the type library in GME exe for further reference e Canonical XML dump of GME projects that is entitie
88. ON FCO gt getChildFCOsAs const std string amp strRole const MON Aspect amp aspect MON Aspect const The operation returns a set containing the child feos which reside in the model with containment role strRole If aspect is not null then the result set is filtered with aspect std set lt BON Atom gt getChildAtoms const MON Aspect amp aspect MON Aspect const std set lt BON Model gt getChildModels const MON Aspect amp aspect MON Aspect const std set lt BON Set gt getChildSets const MON Aspect amp aspect MON Aspect const std set lt BON Reference gt getChildReferences const MON Aspect amp aspect MON Aspect const std set lt BON Connection gt getChildConnections const MON Aspect amp aspect MON Aspect const These calls return a set containing the child fcos whose stereotype is defined in the name of the operation If aspect is not null then the result set is filtered with aspect BON Object findByPath const std string amp strPath const std string amp strDelimiter bool bReverseOrder false The call returns an object whose path is strPath If there is such an object null is returned The direction of the path and the separator can be specified with bReverseOrder and strDelimiter BON ModelRegistryNode getRegistry const Returns a special root registry node which can be used to obtain model specific pre
89. ON and MON e 178 Attributes MON AtomPtr getAtomI const MON Model Base Classes MON FCO Attributes MON ModelPtr getModelI const Methods Containment gt childContainments const FCO gt childFCOs const Atom gt childAtoms const Model gt childModels const Reference gt childReferences const Connection gt childConnections const Set gt childSets const bool isFCOChild const MON FCO amp fco const std set lt MON ModelInAspect gt modelInAspects const std set lt MON Aspect gt aspects const bool hasAspect const MON Aspect amp aspect const MON Connection Base Classes MON FCO Attributes MON ConnectionPtr getConnectionI const bool isSimple const Generic Modeling Environment User s Manual Appendix C BON and MON e 179 bool isBidirectional const Methods int specificationCount const std set lt MON ConnectionSpecification gt specifications const MON ConnectionSpecification specification int iNum const MON ConnectionSpecification Base Classes Attributes int number const Methods std string infoString bool bWithIdentifiers false bool bWithRef false const MON Project project const MON Connection connection const std set lt MON ConnectionRole gt roles const MON ConnectionRole role const std string amp strRole const
90. On disconnect The user disconnects the fco to another FCO e On change registry The user modifies the object s registry Object Not implemented e On change attribute The user changes the value of an attribute of the fco FCO e On change property The user changes the value of a property of the object Object e On change association The user changes the association of the connection Connection e On refer The user refers to the fco with a reference FCO e On unrefer The user removes a reference that points to the fco FCO e On include in set The user includes the fco into a set FCO e On exclude from set The user excludes the fco from a set FCO Priority evaluation order of constraints The higher priority an invariant has the earlier it will be evaluated The highest priority 1 has special meaning When an object violates an invariant with priority 1 a critical violation occurs If a constraint was performed by an event the changes will be aborted This prevents a model instance of the paradigm form having an inconsistent state For lower priorities the user decides whether the modification may be committed or aborted The default value is 2 Depth extension of the invariant s context When a modification is made and it generates an event a constraint may be evaluated even if the constraint is not attached to the kind whose instance generated the event This c
91. References and Sets As mentioned before references can be redirected with some restrictions and set membership can be changed in subtypes and instances The propagation of settings along the dependency chain is true here too Changing the settings breaks the dependency chain for the given object However the setting can be easily reset by selecting the Reset item in the appropriate context menu References can also be reset to null by using the Clear item in the context menu However this is only allowed if the container model is an archetype or if the inherited value of the reference is null itself otherwise it would violate the rules of inheritance in GME 5 Decorator enhancements Since GME 5 the default decorator is able to display more information about objects regarding the type inheritance The user may turn off or on these information in meta modeling time or modeling time too e On models T S or I letter is displayed according to the object type information e For instances below the name of the object the name of the type or subtype is shown with small font Generic Modeling Environment User s Manual Type Inheritance e 44 Libraries Model library support Starting with v 2 0 GME supports model libraries an important mechanism for reusing design artifacts Libraries are ordinary GME projects indeed every GME project including the ones that import libraries themselves can be imported in a project as a library Th
92. Returns true if the fco is not a type which case it would be an instance gme FCO folder gme Folder Returns the closest folder which contains this fco recursively over models gme FCO referencedBy kind ocl String ocl Set gme Reference D gme FCO referencedBy kind ocl Type ocl Set gme Reference Returns a set of references which refer to this fco If kind is specified then only those references whose kind is kind will be returned If the kind of kind i e the meta kind is not gme Reference then an exception is thrown and undefined is returned gme FCO memberOfSets kind ocl String ocl Set gme Set D gme FCO memberOfSets kind ocl Type ocl Set gme Set Returns a set of sets of GME that contains this fco If kind is specified then only those sets of GME whose kind is kind will be returned If the kind of kind i e the meta kind is not gme Set then an exception is thrown and undefined is returned Generic Modeling Environment User s Manual Appendix B OCL and GME e 169 gme Connection The meta kind gme Connection corresponds to the well known UML meta type called Association Class Aliases Super Meta Type This meta kind can also be accessed as Connection Its super meta kind is gme FCO Methods gme Connection connectionPoints role ocl String ocl Set gme ConnectionPoint gme Connection conn
93. The modeling paradigm defines the family of models that can be created using the resultant MIPS environment Both domain and MGA experts participate in the task of formulating the modeling paradigm Experience has shown that the modeling paradigm changes rapidly during early stages of development becoming stable only after a significant amount of testing and use A contributing factor to this phenomenon is the fact that domain experts are often unable to initially specify exactly how the modeling environment should behave Of course as the system matures the modeling paradigm becomes stable However because the system itself must evolve the modeling paradigm must change to reflect this evolution Changes to the paradigm result in new modeling environments and new modeling environments require new or migrated models Metamodels and Modeling Environment Synthesis Metamodels are models of a particular modeling environment Metamodels contain descriptions of the entities attributes and relationships that are available in the target modeling environment Once a metamodel is constructed it is used to configure GME This approach allows the modeling environment itself to be evolved over time as domain modeling requirements change Generic Modeling Environment User s Manual Modeling Concepts Overview e 11 The Generic Modeling Environment GME 5 Main Editing Window The figure below shows various features and components associated with the
94. V to Paste may also be used A copy operation the default when dragging from the Part Browser is indicated by the small symbol attached to the mouse cursor during the left click drag operation Parts and models may be moved and or copied between models too Here the normal left click dragging operation causes a move operation instead of a copy To copy parts and models between or within models hold down the Ctrl key before dropping New parts and models are given a default name defined in the modeling paradigm Right clicking a part even connection brings up a context menu Choose Properties to edit view an object s properties Choose Attributes to edit its paradigm specific attribute values Right clicking on the background of a model window brings up another context menu that makes it possible to insert any part that is legal in the current aspect of the given model As mentioned earlier reference parts act as pointers to objects providing a reference to that part or model References are created by holding down Ctrl Shift while dropping parts into a new model from another model window or from the Browser When dragging a reference from the Part Browser it is not necessary to hold down any keys because the source already specifies that a reference is to be created In this case however a null reference is created since there is no target object specified similar to using the context menu to insert a reference Re
95. a UML based formal description of the modeling environment s model construction semantics The metamodel defines what types of objects can be used during the modeling process how those objects will appear on screen what attributes will be associated with those objects and how relationships between those objects will be represented The metamodel also contains a description of any constraints that the modeling environment must enforce at model creation time These constraints are expressed using the standard predicate logic language Object Constraint Language OCL with some additional features and limitations according to metamodeling environment of GME Note that as mentioned earlier metamodels are merely models of modeling environments and as such can be built using the GME A special metamodeling paradigm has been developed that allows metamodels to be constructed using the GME Once a metamodel has been created it is used to automatically generate a domain specific GME The GME is then made available to one or more domain experts who use it to build domain specific models Typically the domain expert s initial modeling efforts will reveal flaws or inconsistencies in the modeling paradigm As the modeling paradigm is refined and improved the metamodel is updated to reflect these refinements and new GMEs are generated Once the modeling paradigm is stable i e the MGA and domain experts are satisfied that the GME allows consistent v
96. a new set in the specified model parent whose containment role is strRole If the containment role cannot be associated with any sets in parent an exception is thrown Attributes BON SetPtr getSetI const This call returns the corresponding IMgaSet COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations MON Set getSetMeta const Returns the appropriate MON Set of the set Methods std set lt BON FCO gt getMembers const MON FCO amp meta MON FCO const MON Aspect amp aspect MON Aspect const std set lt BON FCO gt getMembers const std string amp strFCO const MON Aspect amp aspect MON Aspect const These calls return a set containing fcos which are members of the set If meta is not null or strFCO is not empty then the returned fcos kind is the specified one If aspectis not null then the result set is filtered with aspect void addMember const BON FCO amp fco It adds fco into the set as a new member If the set already contains the fco nothing happens void removeMember const BON FCO amp fco It removes fco from the set If the set does not contain the fco nothing happens Generic Modeling Environment User s Manual Appendix C BON and MON e 206 BON FCOExRegistryNode getRegistry const Returns a special root registry node which can be us
97. a set containing the connection ends of the connection If meta is not null or strFCO is not empty then the kind of the fcos or the fcos referred by the reference ports must be the specified one Generic Modeling Environment User s Manual Appendix C BON and MON e 204 BON ConnectionEnd getConnEnd const std string amp strRole const MON FCO amp meta MON FCO const BON ConnectionEnd getConnEnd const std string amp strRole const std string amp strFCO const Returns the connection end of the connection which has the connection role strRole If strRole is empty then BON Exception is thrown If meta is not null or strFCO is not empty then the kind of the fco or the fco referred by the reference port must be the specified one ConnectionEnd getSre const MON FCO amp meta MON FCO const ConnectionEnd getSre const std string amp strFCO const ConnectionEnd getDst const MON FCO amp meta MON FCO const ConnectionEnd getDst const std string amp strFCO const These operations has the same functionality as getConnEnd has getSrc supplies src connection role getDst supplies dst connection role implicitly BON ConnectionRegistryNode getRegistry const Returns a special root registry node which can be used to obtain connection specific pre defined registry values BON Set This class corresponds to the IMgaSet COM interface Base Classes Its base class i
98. ables this mode InvokeEx must be implemented anyway as NEW_BON_INVOKE is still defined IMPLEMENT_OLD_INTERFACE ONLY this constant can be included in old Component h files only to fully disable support for the IMgaComponentEx COM interface GME invokes to the old interface if the InvokeEx is not supported Using this constant is generally not recommended If none of the above constants are defined the BON framework interface is compatible with the old Ccomponent classes Censequently older BON code Component h and Component cpp can replace the corresponding skeleton example files provided in the new BON When using such a component however a warning is message is displayed to remind users to upgrade the component code to one fully compliant with the new BON Although it is strongly recommended to update the component code i e converting CComponent Invoke to CComponent InvokeEx this warning can also be supressed by disabling the new COM component interface through the inclusion of the define IMPLEMENT_OLD_INTERFACE_ONLY definition into the old Component h file Plung Ins are paradigm independent components The example Noname plug in displays a message The implementation is in the component cpp file shown below include stdafx h include Component h void CComponent InvokeEx CBuilder amp builder CBuilderObject focus CBuilderObjectList amp selected long param AfxMessageBox Plug In Sample The c
99. absolute value of real floor real ocl Real ocl Integer Returns the largest integer which is less than or equal to real round real ocl Real ocl Integer Returns the closest integer to real If there are two of them then it returns the largest one max reall ocl Real real2 ocl Real ocl Real Returns the maximum of reall and real2 min reall ocl Real real2 ocl Real ocl Real Returns the minimum of reall and real2 Methods ocl Real abs ocl Real Returns the absolute value of this ocl Real floor ocl Integer Returns the largest integer which is less than or equal to this Generic Modeling Environment User s Manual Appendix B OCL and GME e 154 ocl Real round ocl Integer Returns the closest integer to this If there are two of them then it returns the largest one ocl Real max real ocl Real ocl Real Returns the maximum of this and real ocl Real min real ocl Real ocl Real Returns the minimum of this and real ocl Integer The type ocl Integer represents the mathematical concept of integer Aliases Supertypes This type can be accessed as int or long Its supertype is ocl Real Operators operator intl ocl Integer int2 ocl Integer ocl Boolean Returns true if intl is equal to int2 operator lt gt intl ocl Integer int2 ocl Integer ocl Boole
100. ace called BON TypelnhObject BON Type and BON Instance These are interface and an fco always implements one of BON Type and BON Instance In order to obtain the type inheritance interface the user has to use the getT ypelnhObject of BON FCO After a simple cast the user may obtain the type of the instance or the subtypes of the type Obtaining the type inheritance interfaces the user implicitly holds a reference to the fco itself e object root 1 7 RegistryNode parent children or FCORegistryNode baseType instances Instance ConnectionRegistryNode FCOExRegistryNode e ModelRegistyNode Relationships of Attributes Type Inheritance Objects and RegistryNodes Registry Attributes and Object Preferences The registry of a BON2 object is implement similarly to the registry of MON The root RegistryNode can be accessed with the getRegistry of BON Object The root registry node is defined in order to separate the interfaces the real and existing root nodes are children of the dummy root node Using registry it is important to know that caching registry nodes are not recommended e Ifthe user uses at least one registry node even the dummy root she holds a reference to the appropriate object implicitly So that the object Generic Modeling Environment User s Manual High Level Component Interface e 104 could be disposed all nodes must be released This i
101. aint in the paradigm Non critical Constraint in the paradigm Critical Constraint in the model Non critical Constraint in the model Critical Constraint in a library Non critical Constraint in a library Attribute Definition in the paradigm Method Definition in the paradigm Icons for types of Constraints and Definitions Constraint Browser Exceuting the File Display Constraints command the user can browse all constraints available in the model in the page Constraints of the Constraint Browser The page displays the state i e not avaiable because of errors well formed and valid the type and the full name for each constraint Selecting the items in the list and clicking on the Check button make the user able to evaluate specific constraint on demand Double clicking on a constraint the user is able to look at its expression and its other attributes If the constraint is neither a paradigm constraint nor a library constraint its definition can be changed easily with the exception of the context and the name Generic Modeling Environment User s Manual Constraint Manager e 125 Constraint Browser j Constraints Kinds and Types Settings M meta AND InConnectionCount meta NOT InConnectionCount oe meta NOT OnlyOneInConnection MQ meta Circuit Constraint_to_XOR He meta Circuit Constraint_to_OR ine ba Constraint full names Constraint types Constraint states
102. alid models to be built the task of interpreter writing begins Interpreters are model translators designed to work with all models created using the domain specific GME for which they were designed The translated models are used as sources to analysis programs or are used by an execution environment Once the interpreters are created environment users can create domain models and perform analysis on those models Note however that model creation usually begins much sooner Modelers typically begin creating models as soon as the initial GME is delivered As their understanding of the modeling environment and their own systems grows the models naturally become more complete and complex We now discuss the modeling components in greater detail Models By model we mean an abstract object that represents something in the world What a model represents depends on what domain we are working in For instance e a Dataflow Block is the model for an operator in the signal processing domain e a Process model represents a functionality in a plant in the chemical engineering domain e a Network model represents a hardware interconnection scheme in the multiprocessor architecture domain A model is in computational terms an object that can be manipulated It has state identity and behavior The purpose of the GME is to create and manipulate these models Other components of the MGA deal with interpreting these models and using them in var
103. all ocl Real real2 ocl Real ocl Boolean Returns true if reall is equal to real2 operator lt gt reall ocl Real real2 ocl Real ocl Boolean Returns true if reall is not equal to real2 operator lt reall ocl Real real2 ocl Real ocl Boolean Returns true if reall is less than real2 operator lt reall ocl Real real2 ocl Real ocl Boolean Returns true if reall is less than or equal to real2 operator gt reall ocl Real real2 ocl Real ocl Boolean Returns true if reall is greater than real2 operator gt reall ocl Real real2 ocl Real ocl Boolean Returns true if reall is greater than or equal to real2 operator real ocl Real ocl Real Returns a real which is the opposite of real or 0 0 if real is 0 0 Generic Modeling Environment User s Manual Appendix B OCL and GME e 153 operator reall ocl Real real2 ocl Real Returns a real which is the addition of reall and real2 operator reall ocl Real real2 ocl Real Returns a real which is the subtraction of reall and real2 operator reall ocl Real real2 ocl Real Returns a real which is the multiplication of reall and real2 operator reall ocl Real real2 ocl Real Returns reall divided by real2 Functions abs real ocl Real ocl Real Return the
104. already return any type not only ocl Boolean but it must be the same or a descendant of the type specified in the Return type attribute This attribute can hold only simple and not compound types For example ocl Set gme FCO cannot be written only ocl Setis valid In order to facilitate the call of a Definition which does not have any parameters the Definition s Stereotype can be set to attribute Generic Modeling Environment User s Manual Constraint Manager e 119 For the time being the Context is an attribute rather than an association so it must be supplied explicitly The intention is that the user will be able to write more generic Constraint Definitions supplying a GME meta kind as the Context of the Definition With this solution the difficulties caused by the inheritance information loss is easily solved because the constraint writer can use the commonalities of different kinds without casting objects type explicitly to the appropriate kinds It is good practice to specify the context as a meta kind or gme P roject if a Constraint Definition must or can be associated with more than one kind The context of the Definition can be accessed as self If the Context is gme P roject then Self and project point to the same object i e singleton project object Constraint Definitions can be called from other Definitions or Constraints even being recursive Q GME2000 MetaGME2000 FCOs Oo x File Edit V
105. amodels together an equivalence operator an implementation inheritance operator and an interface inheritance operator Equivalence operator The equivalence operator is used to represent the full union between two UML class objects The two classes cease to be two separate classes but form a single class instead Thus the union includes all attributes and associations including generalization specialization and containment of each individual class Equivalence can be thought of as defining the join points or composition points of two or more source metamodels Implementation inheritance operator The semantics of UML specialization i e inheritance are straightforward specialized i e child classes contain all the attributes of the general parent class and can participate in any association the parent can participate in However during metamodel composition there are cases where finer grained control over the inheritance operation is necessary Therefore we have introduced two types of inheritance operations between class objects implementation inheritance and interface inheritance Generic Modeling Environment User s Manual Metamodeling Environment 58 In implementation inheritance the subclass inherits all of the base class attributes but only those containment associations where the base class functions as the container No other associations are inherited Implementation inheritance is represented
106. an Returns true if intl is not equal to int2 operator lt intl ocl Integer int2 ocl Integer ocl Boolean Returns true if int is less than int2 operator lt intl ocl Integer int2 ocl Integer ocl Boolean Returns true if intl is less than or equal to int2 operator gt intl ocl Integer int2 ocl Integer ocl Boolean Returns true if intl is greater than int2 operator gt intl ocl Integer int2 ocl Integer ocl Boolean Returns true if intl is greater than or equal to int2 operator int ocl Integer ocl Integer Returns an integer which is the opposite of int or 0 if intis 0 Generic Modeling Environment User s Manual Appendix B OCL and GME e 155 operator intl ocl Integer int2 ocl Integer ocl Integer Returns an integer which is the addition of intl and int2 operator intl ocl Integer int2 ocl Integer ocl Integer Returns an integer which is the subtraction of intl and int2 operator intl ocl Integer int2 ocl Integer ocl Integer Returns an integer which is the multiplication of intl and int2 operator div intl ocl Integer int2 ocl Integer ocl Integer Returns the number of times that int2 fits completely within intl operator mod intl ocl Integer int2 ocl Integer ocl Integer Returns the modulo of intl and int
107. an input The Search checks for any role names that have patterns specified by this field e Kind Name used to specify the kind name of the object It takes a Regular Expression as an input The Search checks for any kind names that have patterns specified by this field e Attribute used to specify the attribute name appearing in the object It takes a Regular Expression as an input The Search checks for any attributes with names that have patterns specified by this field e Type specifies the type of the attribute that is being searched for e Value specifies the value of the attribute being searched for It can take in String Integer Float and Boolean 0 or 1 values Meta Kind Search The user can search for objects specifying the meta kinds These can be Atoms Models References Sets Connections are not supported Special Reference Search The Search for NULL References option is used to look for references pointing to null More restrictions can be applied specifying the search criteria When you conduct any search clicking on a search result object will change the NULL into the name of that object Then the user may search for references pointing to that object with the special search checkbox Select the Special Reference Search then deselect it to set it back to NULL Regular expressions The Name Role Kind amp Attribute fields can be specified using the regular expressions This section documents th
108. annot be any of the kinds defined in the paradigm Aliases Supertypes This kind can be accessed as Project Its supertype is ocl Any Operators operator projectl gme Project project2 gme Project ocl Boolean operator lt gt projectl gme Project project2 gme Project ocl Boolean These operators are defined because of consistency But since there is only one instance of gme Project in all projects these features are useless Attributes gme project name Returns the name of the project This attribute can be used to check whether the project is included as a library in another project Generic Modeling Environment User s Manual Appendix B OCL and GME e 172 Methods gme project allInstancesOf kind ocl Type ocl Set gme Object Returns a set which contains all objects in the project whose kind is kind If kind is not defined in the paradigm an exception is thrown and undefined is returned gme project rootFolder gme RootFolder Returns the root folder of the project gme RootFolder This kind is predefined in GME and has exactly one instance in all projects It is introduced because at meta modeling time this folder has to be referred to somehow It does not have special features regarding its meta kind gme F older Aliases Supertypes Meta Type This kind can be accessed as RootFolder Its super type is ocl Any Its meta kind is gme
109. ardware software allocation assignments As mentioned above the icon used to represent the reference part is user defined Model or model reference references that do not have their own icon defined have an appearance similar to the referred to model but without 3D borders Connections and links Generic Modeling Environment User s Manual Merely having parts in a model is not sufficient for creating meaningful models there are relationships among those parts that need to be expressed The GME uses many different methods for expressing these relationships the simplest one being the connection A connection is a line that connects two parts of a model Connections have at least two attributes appearance to aid the modeler in making distinctions between different types of connections and directionality as distinguished by the presence or absence of an arrow head at the destination end of the line Additional connection attributes can be defined in the metamodel depending on the requirements of the particular modeling paradigm The actual semantics of a connection is determined by the modeling paradigm When the connection is being drawn the GME checks whether the connection is legal or not All legal connections are defined in the metamodel Two checks are made to determine the legality of a connection First a check is made to determine if the two types of objects are allowed to be connected together Second the direction of t
110. are Generic Modeling Environment User s Manual Glossary of Terms e 221 Generic Modeling Environment A configurable multi aspect graphical modeling environment used in the MultiGraph Architecture interpreters See Model interpreters Link See Link parts Link parts Atomic parts contained within a model that are visible and can participate in connections when the container model appears inside other models MCL MGA constraint language A subset of OCL with MGA specific additions Metamodel A model that contains the specifications of a domain specific MIPS environment DSME Metamodels contain syntactic semantic and presentation specifications of the target DSME metamodeling environment A domain specific MIPS environment DSME configured to allow the specification and synthesis of other DSMEs MGA See MultiGraph Architecture MGK MultiGraph Kernel Middleware designed to support real time MultiGraph execution environments MIC Model Integrated Computing MIPS Model Integrated Program Synthesis Model interpreters High level code associated with a given modeling paradigm used to translate information found in the graphical models into forms executable code data streams etc useful in the domain being modeled Generic Modeling Environment User s Manual Glossary of Terms e 222 Model translators See Model interpreters modeling paradigm The syntactic semantic and presentation informat
111. are visible or not to facilitate alignment of the objects e Refresh Clicking the paintbrush button forces GME 5 to repaint all the windows In the current model Editpr window there is a selected list of objects highlighted by little frames Using the Arrow keys on the keyboard these objects can be nudged by one grid cell in the selected direction provided that there are no collisions Note that GME 5 does not allow overlapping objects Connections in GME 5 are automatically routed The user only needs to specify the end points of a connection and an appropriate route will be automatically generated that will avoid all objects and try to provide a visually pleasing connection layout The built in context sensitive help functionality is described in the next section Help System GME 5 provides context sensitive user defined help functionality This is facilitated by the Help URL preference of objects This preference is inherited from the paradigm definition and through the type inheritance hierarchy exactly like any other object preference For more information on this inheritance see the separate chapter on type inheritance When the user selects help on a context menu or the Help menu Help item for the current model also the F1 key GME 5 looks up the most specific help URL available for the given object If no help URL is found the program defaults to the appropriate section of the User s Manual located on the ISIS web ser
112. ase class for all classes whose instances have unique identifier MetaReferenceID This MON class corresponds to the IMgaMetaBase COM interface which has common meta properties identifier mentioned above name string identifier displayed name Among the basic classes there are only three which do not have ancestors Project corresponds to the IMgaMetaProject which is the root of the object network Because it contains directly or indirectly all metaobjects i e all MON classes have the method project to access the project Project offers methods with which the user can obtain all instances of a specific metakind or a meta relation and she can find the MetaObject correspondent to a MetaReferenceID to the name of a metakind or to name of an Aspect Generic Modeling Environment User s Manual High Level Component Interface e 84 MetaObject RegistryNode N Oo IOO T ee 1L lt IN Oo TILO ZN oe Hom e foeon Raterence MON classes which have corresponding COM interfaces RegistryNode corresponds to the IMgaMetaRegNode COM interface which is simply a name value pair with the extension that the nodes are organized into a tree called Registry A MetaObject always has this Registry even it is absolutely empty For the sake of clarity the MetaObject s registry returns a dummy RegistryNode object from which all root nodes may be accessed Constraint is associated with class Object Object c
113. ass Methods void performEvent const BON Event amp event const The event pool dispatches the supplied event to the stored active event listeners Generic Modeling Environment User s Manual Appendix C BON and MON e 218 void addListener BON EventListener pListener It adds pListener to the stored listeners void removeListener BON EventListener pListener It removes pListener from the stored listeners BON Visitor This class is the standard base class of visitors Base Classes There is no base class Methods void visitFolder const Folder amp folder void visitAtom const Atom amp atom void visitModel const Model amp model void visitConnection const Connection amp connection void visitSet const Set amp set void visitReference const Reference amp reference void visitReferencePort const ReferencePort amp port These methods are called by the appropriate accept operations Here is the template method design pattern is used For example visitReference calls the following operations which may be overridden by the user visitObjectlmpl visitC onnectionEndimpl visitF COlmpl visitR eferencelmpll visitObjectImpl const Object amp object visitConnectionEndImpl const ConnectionEnd amp end visitFCOImpl const FCO amp fco visitFolderImpl const Folder amp folder visitAtomImpl const Atom amp atom visitMo
114. ause this sort of information will be obtained by accessing kinds and meta kinds as predefined types of the new version of OCL implementation or else the features will be mapped to standard OCL features e g gme F CO connectedFCOs to association ends Another important issue is that these features are not secure however their implementation and signature are improved and modified For example connectedFCOs of gme FCO expected two arguments in the former version of the GME constraint language the name of the role and the name of the connection The result can be an empty ocl Set even if the specific object does not have any connection or any role specified in the arguments These kinds of methods should be mapped to secure feature calls i e association ends Generic Modeling Environment User s Manual Constraint Manager e 113 The modifications of these methods are as follows e The features are reorganized and are associated with specific and most appropriate meta kinds For example method refersTo can be called on objects whose meta kind is gme Reference This was required because MCL is not a typed language in contrast to OCL e Wherever a method expected the name of a kind as an argument typed as ocl String the feature now expects the kind typed as ocl Type i e identifier according to the new signature With this slight modification mis spelled names can be filtered immediately after writing the expression and the expre
115. bership gt setMemberships const Containment gt containments const ConnectionEnd gt connectionEnds const ModelInAspect gt modelInAspects const ContainmentPart gt containmentParts const AttributeAggregation gt attributeAggregations const MetaObject findByRef long 1lRef const MetaObject findByName const std string strName const MON MetaObject Base Classes Attributes MON ObjectPtr getObjectI const std string name const std string displayedName const long ref const MON ObjectType type const Methods std string infoString bool bWithIdentifiers false bool bWithRef false const Generic Modeling Environment User s Manual Appendix C BON and MON e 176 MON Project project const MON RegistryNode registry const MON Object Base Classes MON MetaObject Methods std set lt MON FolderContainment gt parentFolderContainments const std set lt MON Folder gt parentFolders const bool isFolderParent const MON Folder amp folder const std set lt MON Constraint gt constraints const MON Folder Base Classes MON Object Attributes MON FolderPtr getFolderI const Methods std set lt MON FolderContainment gt childFolderContainments const std set lt MON Object gt childObjects const std set lt MON Folder gt childFolders const std set lt MON FCO
116. bout the size of the object to be drawn You can compute this information based on the inner structure of the object or based on a bitmap size or even you can read these values from the registry of the object However GME may not take this information into account when it calls your SetLocation method All the size and location parameters are in logical units HRESULT GetPorts out retval IMgaFCOs portFCOs If your decorator supports ports it should give back a collection of MGA objects that are drawn as ports inside the decorator GME uses this method along with successive calls on GetPortLocation to figure out where can it find port objects HRESULT SetLocation in long sx in long sy in long ex in long ey You have to draw your object exactly to this position in this size There is no exemption to this GME always calls this method before Draw HRESULT GetPortLocation in IMgaFCO fco out long sx out long sy out long ex out long ey See description of GetPorts Position coordinates are relative to the parent object HRESULT GetLabelLocation out long sx out long sy out long ex out long ey If you support label drawing you have to specify the location of the textbox of your label This can reside outside of the object GME will call SetLocation before this method HRESULT GetLocation out long sx out long sy out long ex out long ey Return the coordinates you go
117. c Modeling Environment User s Manual Appendix A Database Setup e 130 Appendix B OCL and GME OCL Language In this section we discuss the standard OCL 1 4 structures and expression can be used in GME We summarize all issues which writing constraints in GME based on Type Conformance OCL as specified is a typed language The types that can be used in OCL are organized in a type hierarchy This hierarchy as well as the type inheritance and special properties of meta types correspond to conformance rules describing if and how a type conforms to another These rules include the following Common rules e A type conforms to itself e A type conforms to its supertypes direct or indirect supertypes e A type conforms to its meta type e A type conforms to supermeta types of its meta type Compound meta type related additional rules applies to Collection Set Bag and Sequence e Acompound type conforms to another compound type if its contained type conforms to another s contained type Record meta type related additional rules applies to Tuple e A tuple conforms to another tuple if its contained member types conforms to another s contained member types and these members names are the same Paradigm types related additional rules e A type defined in a meta model paradigm conforms to another type from which it is derived This rule is applicable if and only if inheritance is defined for these types Thes
118. c Modeling Environment User s Manual Appendix C BON and MON e 185 std vector lt MON Attribute Namevalue gt enumItems const Methods std set lt MON AttributeAggregation gt attributeAggregations const std set lt MON FCO gt FCOs const bool isContainedBy const MON FCO amp fco const MON FCO owner const MON FolderContainment Base Classes Methods std string infoString bool bWithIdentifiers false bool bWithRef false const MON Project project const MON Folder parent const MON Object child const MON ConnectionEnd Base Classes Methods std string infoString bool bWithIdentifiers false bool bWithRef false const MON Project project const MON ConnectionRole role const Generic Modeling Environment User s Manual Appendix C BON and MON e 186 MON Containment target const MON ReferenceAssociation Base Classes Methods std string infoString bool bWithIdentifiers false bool bWithRef false const MON Project project const MON Reference reference const MON Containment target const MON SetMembership Base Classes Methods std string infoString bool bWithIdentifiers false bool bWithRef false const MON Project project const MON Set set const MON Containment member const MON ModellnAspect Base Classes Methods
119. can check the equality of two BON object with the operator and operator It must be emphasized that this equality means two COM objects equality and the wrappers It is not necessary to obtain the implementation pointers to check whether two objects are equal or not The operator lt makes possible that the objects may be included into any kind of STL container including sets and maps also These operators can be used for all BON objects e g BON Project is comparable with BON ReferencePort The last important feature of wrappers is the casting mechanism This is implemented via the copy constructors and assignment operators If the cast succeeds then the pointer held by the appropriate wrapper will be valid otherwise it will be null To understand this let s see the following example Model child Let s assume child is valid Object parent child gt getParent parent AfxMessageBox This is always valid Model model object model AfxMessageBox The parent is a model BON Folder object AfxMessageBox The parent is a folder These facilites are implemented in the wrapper classes the operations related with specific metakinds are implemented in the implementation classes in case of BON For details see the Appendix about BON invocations and classes Generic Modeling Environment User s Manual High Level Component Interface e 90 Objects Lifecycle in Components H
120. ce in a type can be redirected in any way that the paradigm allows down the dependency chain A reference to a type in a type model can only be redirected to subtypes or instances of the referred to type or any instances of any its subtypes A reference to an instance model in a type model cannot be redirected at all down the hierarchy Obviously a reference in an archetype can be redirected in any way the paradigm allows To avoid multiple dependency chains between any two objects in version 1 1 or older only root type models could be explicitly derived or instantiated This restriction has been relaxed Now if none of a type model s descendants and ascendants are derived or instantiated then the model can be derived or instantiated This means for example that a model that has nor subtypes or instances itself can contain a model type AND its instances This relaxed restriction still does not introduce multiple dependency chains Generic Modeling Environment User s Manual Type Inheritance e 43 Attributes and Preferences The Attributes and the Preferences tabs each show the items either in gray color or in black color Items with gray color have the default or inherited value which means that the value is not given explicitly for this object If the user assigns a new value to an attribute or preference the item will be show in black color An item can be reset to the inherited value by pressing Ctrl D while the item is active
121. ch this problem can be solved Enable Disable Constraints This is a special feature of GME with which the user may disable constraints defined in the paradigm This disabling has a limitation constraints which have priority one and are defined in the meta model or included libraries cannot be disabled The user interface allows the user to change this flag by kind type and subtype as well as by instances This flag can be set for objects directly or implicitly i e the value of the flag is inherited taking advantage of type inheritance Constraints at Modeling Time and In Libraries In GME a special inheritance called type inheritance is introduced at modeling time To learn about more this feature see chapter Type Inheritance This solution raises a question about how to specify constraints whose context is a type a subtype or a sole instance The answer is the user defined constraint which does not differ from the constraint defined at meta modeling time meta defined constraint except that the user defined constraints are stored in the registry of the model rather than in the paradigm Although the context of user defined constraints can only be a kind with constraint disabling this context can be tightened into specific types or even instances As an expert GME user knows libraries can be defined and attached to a designated folder i e to the RootFolder A library will be a read only part of the model therefore a
122. constraint has further properties with which the invariant closes to post condition constraints In standard OCL an invariant constraint is defined if both the type of the context and the equation of the constraint are specified However a constraint is defined completely if the user names the invariants and sets the additional properties values These properties are the following Event special interpretation of messages of OCL 2 0 A constraint by default can be evaluated on demand If the user associates events for a constraint it will be evaluated as well when the context s object receives such kind of events With these properties if at least one is set an invariant constraint can be considered as a post condition If the constraint has no events associated then the constraint is evaluated on demand only The events are the following e On close model The user closes the model Model e On create The user creates an object Object e On delete The user deletes an object Object e On new child The user creates an object in a model or folder Model Folder e On lost child The user removes an object in a model or folder Model Folder e On move The user moves an object Object e On derive The user creates a subtype or an instance of a type Model Generic Modeling Environment User s Manual Constraint Manager e 116 e On connect The user connects the fco to another FCO e
123. ction gt If there is such a function resolution is stopped Check whether an implicit object implicit variable has features which can look like lt function gt e Ifan implicit object has exactly one feature then resolution is stopped e If the object has more features then resolution is stopped and an exception is thrown because of ambiguity caused by features with the same signatures Resolution ends and an exception is thrown because lt function gt cannot be resolved Resolving an expression which looks like an attribute call Check whether the object has an attribute called lt attribute gt Check whether the object has access to an association end whose role or type considered as role looks like lt attribute gt If the object is compound check whether the contained objects have an attribute called lt attribute gt If the object comes from an implicit variable e If exactly one feature is found resolution is stopped e If more features are found then resolution is stopped and an exception is thrown because there are more features which can be accessed in the same way Generic Modeling Environment User s Manual Appendix B OCL and GME e 146 Resolution ends and an exception is thrown because lt attribute gt cannot be resolved If the object comes from an expression i e member selection operator is Resolving an used If exactly one feature is found resolution is stopped If two attribute
124. d for easily inserting new objects based on the current selection or for capturing the contents of current selections for Edit functions Copy Paste Delete etc Generic Modeling Environment User s Manual Using GME 5 e 23 Aggregate Inheritance Meta GeneratorBase SF2000 Gen Systems ag BasicTypes ji i r Properties wif Su Attributes 5 4 Signal Preferences Hr Wi Registry Eer W Attach Library i Refresh Library E purarametes 3 Insert Model gt InputSignals Hex f Ha t Undo OutputParameters el dale OutputSignals Parameters Copy Paste Delete Constraints r Interpret Help Tree Browser Options Model Browser context menus Based on the Aggregate tab selection shown above five different kinds of atoms are available for insertion Models can also be inserted but within this Model we have specified that the paradigm not allow any References or Sets Note that connections cannot be added using the Browser Similarly several Edit options are available in the form of Undo Redo Copy Paste etc Sorting options allow for the all of the objects and their children to be sorted by a specific style The Tree Browser Options menuitem displays a dialog used for specifying the types of objects to be displayed in the Aggregate tab For example the user can choose not to view connections in the browser To preserve the state of the aggregate tree eg expanded objects in the Window
125. d in the next subsection a_i RegistryNode BON classes which have the corresponding COM interface GME Metakinds in the Project It is obvious that objects in projects have metakinds according to the paradigm and they can play only the roles and can take part in the relationships that come from the appropriate metakind For example if an object is a model i e it is a BON Model whose meta is MON Model the user may obtain the children contained by the object The childrens are BON FCO objects The specific model kind i e MON Model objects tells the user what the childrens kinds can be i e Compound model may contain Primitive or Compound models among others If somebody is familiar a bit with GME all the well known GME concepts are understandable except of a new one called ReferenceP ortContainer with ReferenceP ort and ConnectionEnd Generic Modeling Environment User s Manual High Level Component Interface e 100 Connection connection 1 ends 2 ConnectionEnd Folder parent Folder 0 1 memberOf 0 parenthtodel 0 1 members 0 children 0 children 0 BON classes with their specific relationships ConnectionEnds and ReferencePorts Let s clarify with the previous and the next figure what ReferenceP ort means During the explanation we assume that there is only one Aspect in the paradigm in order not to deal with relationships between objects ports and as
126. d models std set lt BON Model gt temp getChildModels for std set lt BON Model gt iterator it temp begin it temp end itt if it gt getObjectMeta name Compound amp amp it gt getChildFCOs size gt 2 mySet insert it void finalize mySet clear important to avoid reference cycles std set lt BON Model gt getMyCompounds return mySet private std set lt BON Model gt mySet end of class Create the Wrapper Class After the implementation is ready the user has to generate an appropriate wrapper class to the implementation class and assign it to a specific kind defined by the paradigm These go with to macros DECLARE BONEXTENSION and IMPLEMENT BONEXTENSION DECLARE _BONEXTENSION macro stands for creating the appropriate wrapper and it always has to preceed the macros defining the classes which derive from this class The parameters are the following e Base wrapper class This class has to be the wrapper class of the base class of the user defined implementation class In our case it is BON Model e Implementation class This is the user defined implementation class In our case it is Compoundimpl e Wrapper class This is the class which has to be generated to the specified implementation class This will be the user defined wrapper class In our case it is Compound Generic Modeling Environment User s Man
127. d tedious typing creating territories passing them to over to BeginTransaction etc simple parameterless BeginTransaction and CommitTransaction methods of the it object are provided Connect and ConnectFCO methods are used to connect object in one model Two objects have to be specified by their name or the pointers and the connection role may be given optionally If an empty string is given as connection role then the object are connected if one possible connection role exists between the source and destination ConnectThruPort method is provided to establish connections between ports referenceports The connection role again can be left empty The source and destination are identified by specifying two roles for each The first one is the name of the container the second is the name of the port The container might be a model or a reference If one port is involved in the intended connection for example only at the source side the destination must be specified by leaving the second role parameter empty Using ShowFCO method the user can jump to another model making that the new active model using a path syntax similar to that used on Unix slashes as delimiters to step one model up in the hierarchy The path used must identify uniquely an fco otherwise the command will not succeed The Prev and Next methods can be used to cycle through the already opened models PresAspect and NextAspect cycle through the aspects of the curr
128. d your own members here EUP Beside this the source and destination kinds will have two additional get methods one for inquiring the connection links starting or ending at that particular kind another for inquiring the kinds connected to the object through a particular connection class SignalImpl public AtomImpl public connection end getters std multiset lt Signal gt getDataflowConnSrcs std multiset lt Signal gt getDataflowConnDsts connection link getters std set lt DataflowConn gt getDataflowConnLinks std set lt DataflowConn gt getInDataflowConnLinks std set lt DataflowConn gt getOutDataflowConnLinks BUP bool isMyParentPrimitive std string className return Signal EUP Furthermore all FCOs which have attributes will have special get methods generated with corresponding return types to their specification in case of EnumAttribute an enumeration type definition will be generated based on the items declared in the Menu items field Ordering The classes are generated into the header file based on the following principles groups are formed by classes which have inheritance relationship among themselves The groups are ordered based on how many model kinds they contain in descending order Such a group is dumped in top down order based on inheritance The methods inside a class are categorized as attribute connection get methods and role get
129. del that the folder contains recursively If kind is specified then the set returned will contain objects with kind kind If the kind of kind i e the meta kind is not gme Model then an exception is thrown and undefined is returned gme Folder atoms kind ocl String ocl Set gme Atom D gme Folder atoms kind ocl Type ocl Set gme Atom Returns a set which contains all atoms contained by the folder or by any child folder or model that the folder contains recursively If kind is specified then the set returned will contain objects with kind kind If the kind of Kind i e the meta kind is not gme Atom then an exception is thrown and undefined is returned Generic Modeling Environment User s Manual Appendix B OCL and GME e 166 gme FCO The meta kind gme FCO represents a first class object gme FCO can be contained by a gme Model or a gme Folder be associated to any gme FCO inherit properties by either standard or interface or implementation inheritance only in time of meta modeling have attributes be contained by a gme Set and last but not least be referred by a gme Reference Aliases Super Meta Type This meta kind can also be accessed as FCO Its super meta kind is gme 0 bject Attributes gme FCO roleName ocl String Returns the name of the role of the fco which is contained by a model Methods FCO roleName ocl String D se onnected
130. delImpl const Model amp model visitConnectionImpl const Connection amp connection visitSetImpl const Set amp set visitReferenceImpl const Reference amp reference visitReferencePortImpl const ReferencePort amp port In these protected operations the user may implement specific behaviour In default the operations do nothing With the abstract visit operations visitObjectlmpl visitC onnectionEndimpl visit COlmpl common behaviour may be implemented for the derived classes Generic Modeling Environment User s Manual Appendix C BON and MON e 219 Appendix D References Model Integrated Computing References The following references provide detailed information on Model Integrated Computing technology development and application S White et al Systems Engineering of Computer Based Systems IEEE Computer pp 54 65 November 1993 J Sztipanovits et al MULTIGRAPH An Architecture for Model Integrated Computing Proceedings of the IEEE ICECCS 95 pp 361 368 Nov 1995 D Oliver T Kelliher J Keegan Jr Engineering Complex Systems with Models and Objects New York McGraw Hill 1997 J Sztipanovits Engineering of Computer Based Systems An Emerging Discipline Proceedings of the IEEE ECBS 98 Conference 1998 Ledeczi A Maroti M Bakay A Karsai G Garrett J Thomason IV C Nordstrom G Sprinkle J Volgyesi P The Gener
131. deling Environment 62 Displayed name String value that gives the displayed name of a Folder or Aspect This will be the value that is shown in the model browser or aspect tab respectively A blank value will result in the displayed name being equal to the name of the class Contained in Folder Aspect Field default Text field that gives the default value of the FieldAttr Contained in FieldAttr General preferences Text field multiple lines that allows a user to enter data to be transferred directly into the XML file This is a highly specific text area and is normally not used The occasions for using this area is to configure portions of the paradigm that the Metamodeling environment has not yet been developed to configure Contained in FCO Atom Model Set Connection Reference Global scope A boolean checkbox that refers to the definition scope of the attribute In most cases it is sufficient to leave this attribute in its default state true The reason for giving the option of scope is to be able to include attributes with the same names in different FCO s and have those attributes be different In this case it is necessary to include local scoping i e remove the global scope or the paradigm file will be ambiguous Default value Checked Contained in EnumAttr BooleanAttr FieldA ttr Icon Text field that gives the name of a file to be displayed as the icon for this object Contained in
132. derObject public const CBuilderObjectList GetChildren const const CBuilderModelList GetModels const const CBuilderModelList GetModels CString partName const const CBuilderAtomList GetAtoms CString partName const const CBuilderModelReferenceList GetModelReferences CString refPartName const const CBuilderAtomReferenceList GetAtomReferences CString refPartName const const CBuilderConnectionList GetConnections CString name const const CBuilderSetList GetSets CString name const void GetAspectNames CStringList amp list Generic Modeling Environment User s Manual High Level Component Interface e 76 ilderModel CreateNewModel CString partName ilderAtom CreateNewAtom CString partName ilderModelReference CreateNewModelReference CString refPartName BuilderObject refTo ilderAtomReference CreateNewAtomReference CString refPartName CBuilderObject refTo BuilderSet CreateNewSet CString partName BuilderConnection CreateNewConnection CString connName CBuilderObject src CBuilderObject dst virtual void TraverseModels void pointer 0 virtual void TraverseChildren void pointer 0 The CBuilderAtom class does not provide any new public methods class CBuilderAtom public CBuilderObject public dF The CBuilderAtomReference class provides the GetReferred function that returns the atom or atom reference referred to by the given reference
133. diately after the user modifies and leaves one field of the Constraint or Definition If it is fully defined the Syntax and Semantic Error Dialog is shown Because one constraint can be connected to more than one kind the dialog enumerates all constraint and kind pairs In the list violations can be sorted by Constraint s type context or name Generic Modeling Environment User s Manual Constraint Manager e 120 Selecting an association the text of the Constraint is shown on the left of the dialog with all primary errors i e errors that do not come from other Choosing an error the line is selected in the expression window where the error is detected If a constraint is parsed successfully then a semantic check is performed That is the reason why syntax errors are displayed first yellow icons If there are no syntax errors then semantic errors are shown red icons Global error description Expression lines Constraint Syntax and Semantic Errors r Errors description The following Constraints and ConstraintD efinitions have errors These Constraints and ConstraintDefinitions cannot be used and evaluated Type Context Name oO gme FCO WrongConstraint Line _Expression 1 context gme FCO WrongConstraint bool defmethod WrongConstraint 2 Se let value self wrong_name in 4 self 5 string Message Y 108 3 Attribute gme FCO wrong_name does not exist g
134. e Returns and set the line type of the connection with which it is rendered BON LineEndType getSrcLineEndType const void setSrcLineEndType BON LineEndType eType Returns and sets the decoration of the source of the connection Generic Modeling Environment User s Manual Appendix C BON and MON e 216 BON LineEndType getDstLineEndType const void setDstLineEndType BON LineEndType eType Returns and sets the decoration of the destination of the connection std string getLabel const void setLabel const std string amp strFormat Returns and sets the label format string of the connection std string getSrcLabell const void setSrcLabell const std string amp strFormat Returns and sets the primary label of the source connection end In default this corresponds to the connection role name std string getSrcLabel2 const void setSrcLabel2 const std string amp strFormat Returns and sets the secondary label of the source connection end In default this corresponds to the cardinality number std string getDstLabell const void setDstLabell const std string amp strFormat Returns and sets the secondary label of the destination connection end In default this corresponds to the connection role name std string getDstLabel2 const void setDstLabel2 const std string amp strFormat Returns and sets the secondary label of the destination conn
135. e Connection members ocl Set gme FCO Returns a set of fcos that are contained by the set of GME gme Atom The meta kind gme Atom is the meta kind of those objects which are not abstract and have no more feature than gme FCO Aliases Super Meta Type This meta kind can also be accessed as Atom Its super meta kind is gme FCO gme Model The meta kind gme Model is the abstraction of containers which can contain fcos Aliases Super Meta Type This meta kind can also be accessed as Model Its super meta kind is gme FCO Methods models kind ocl String ocl Set gme Model D models kind ocl Type ocl Set gme Model atoms kind ocl String ocl Set gme Atom D atoms kind ocl Type ocl Set gme Atom These methods have the same functionality as parts has the exception that they return objects whose meta kind is the same as the method s prefix These methods return the set of contained objects which are contained recursively by the model its immediate children and its descendants models children The returned set will contain objects that have the appropriate meta kind Generic Modeling Environment User s Manual Appendix B OCL and GME e 171 Model atomParts role ocl String ocl Set gme Atom Model modelParts role ocl String ocl Set gme Model Model connectionParts role ocl String
136. e Onclose model e On new child e On delete e On disconnect e On connect e On derive e On change property e On change assoc e On exclude from set e On include in set e Onmove e Oncreate e Onchange attribute e On lost child e Onrefer e On unrefer Default value Unchecked Contained in Constraint Port icon Text field that gives the name of a file to be displayed as the port icon for this object If no entry is made for this field but the object is a port then the normal icon will be scaled to port size Generic Modeling Environment User s Manual Metamodeling Environment e 65 Contained in Atom Set Reference Model Priority 1 High Enumeration of the possible levels of priority of this constraint For more information on constraint priority refer to the constraint manager Contained in Constraint Prompt A text field translated into the prompt of an attribute It is in exact WYSIWYG format i e no or is appended to the end Contained in EnumAttr BooleanAttr FieldAttr Return type Text field that specifies the type a Constraint Function returns Contained in ConstraintFunc Rolename Text field that gives the rolename that the FCO will have in the Connection There are two different possible default values src and dst depending upon whether the connection was made from the Connector to the FCO or the FCO to the Connector Default value sre
137. e a new component run CreateNewComponent exe that comes as part of the GME distribution A dialog box Create New Component is presented to specify the target directory and the component technology to be used To work with the interfaces described above select Builder Object Network or Builder Object Network II The second dialog box Component Configurator lets you specify the most important characteristics of the component e Its type Interpreter Plugin or AddOn AddOns are not available when using Builder Object Network version 1 0 e The component name e The name of the paradigm s this component is associated with Multiple paradigms can be specified in a space separated list e The component progID e The component classname and the component type library name e The UUID s associated with the component class and its type library e The location of the GME 5 interface files IDL files this component is to be compiled to Generic Modeling Environment User s Manual High Level Component Interface e 105 The resulting configuration is a ready to compile Visual Studio workspace Component dsw BonComponent dsw or BON2Component dsw If the BON is selected simple Component cpp and Component h files are generated in case of BON these files are BON2Component h and BON2Component cpp The user is expected to implement the component by modifying these two files and adding other files if necessary The other files in the workspace are
138. e and its appropriate subnode according to described relationships above Constraints in a library Constraints residing in a library are the same as the constraints in a model but according to the library s definition the constraints are read only Good to know that if a library i e the included model is changed it has to be included again into the model after deletion or refreshed After including the library the model has to be closed so that its new constraints will be available for evaluating Generic Modeling Environment User s Manual Constraint Manager e 128 Appendix A Database Setup GME 5 Database Support The GME application provides optional ODBC based database backend for storing projects The benefits of this feature are robustness centralized project repository and concurrent access However one should expect slower performance and increased maintenance overhead when using OBDC based storage media Although we are using the generic ODBC interface currently only Microsoft SQL Server 7 0 or later is supported Server side installation On the MS SQL server the database administrator should perform the following steps 1 Create a new dedicated database for the GME project one database for each project 2 Create or select database users 3 Give create permissions to each user within this database Client side setup On the client machine s the user should set up an ODBC DSN data source name descripti
139. e attributes and preferences of an object e Model Browser Shows either the aggregation hierarchy of the project the type inheritance hierarchy of a model or a quick overview of the current modeling paradigm These features will be described in detail in later sections As mentioned above the GME is a generic programmable tool However all GME configurations are the same on a certain level simply because only the domain specific modeling concepts and model structures have changed Before describing GME operation we briefly describe the domain independent modeling concepts embodied in all GME instances Defining the Modeling Paradigm To properly model any large complex engineering system a modeler must be able to describe a system s entities attributes and relationships in a clear concise manner The modeling environment must constrain the modeler to create syntactically and semantically correct models while affording the modeler the flexibility and freedom to describe a system in sufficient detail to allow meaningful analysis of the models Issues such as what is to be modeled how the modeling is to be done and what types of analyses are to be performed on the constructed models must be formalized before any system is built Such design choices are represented by the modeling paradigm Therefore creating the modeling paradigm is the first and most important step in creating a DSME A modeling paradigm is defined by
140. e only prerequisite is that both the library and the target project are based on the same version of the same paradigm When a library is imported it is copied into the target project in whole so that the root folder of the library becomes an ordinary non root folder in the target The copy is indicated with a special flag that warrants read only access to this part of the target project The primary way of using libraries is to create subtypes and instances from the library objects It is also possible to refer library objects through references Apart from being read only objects imported through the library are equivalent to objects created from scratch Library objects can easily be recognized in the tree browser The library root is indicated with a special icon and if the browser displays access icons all library objects are marked to indicate read only access To import a library in a project the Attach library command of the Model Browser context menu is used Evidently it is possible to attach libraries to folders only The folder that receives the library must be a legal container in the root folder according to the paradigm Since many paradigms do not allow the root folder to be instantiated at other points in the model tree the root folder of any project is exempt from this rule i e it is possible to attach a library to the root folder even if the paradigm does not allow that If the original library project changes i
141. e rules are extended because the next version of OCL will introduce the feature to access meta kind information Generic Modeling Environment User s Manual Appendix B OCL and GME e 131 Context of a Constraint As we mentioned earlier an OCL constraint is always written in the context of a specific type In this implementation the type can be only a type defined in the paradigm The context is always accessible anywhere in a constraint as a special variable called Self This is also a reserved keyword of OCL A constraint can be evaluated to objects which are instances of the type of the context If a constraint evaluates to false the object violates the constraint If a constraint evaluates to undefined then one or more exceptions were thrown while the constraint was evaluating A constraint can be named In some circumstances this is a requirement rather than an option in order to make a distinction between constraints of a type The constraint s defined name will be the concatenation of the type of the context and the name of the constraint In this implementation each constraint expression has to have context declaration The context declaration differs from constraint type to constraint type Types of Constraints Expressions Invariants A constraint can be an Invariant An invariant must be true for all instances of the type of the context at any time In the case of invariants the special variable self can be
142. e set and set or bag ocl Set subtract collection ocl Collection ocl Set Returns a set which contains all elements that that are contained in set but not in collection ocl Set intersection set ocl Set ocl Set ocl Set intersection bag ocl Bag ocl Set Returns the intersection of the set and Set or bag ocl Set symmetricDifference set ocl Set ocl Set Returns a set which contains all elements that are contained by only the set or set ocl Set including any ocl Any ocl Set Returns a set containing any ocl Set excluding any ocl Any ocl Set Returns a set not containing any lterators Generic Modeling Environment User s Manual Appendix B OCL and GME e 160 ocl Set select boolExpr ocl Boolean ocl Set Returns a sub set of the set containing all elements for which boolExpr evaluated to true ocl Set reject boolExpr ocl Boolean ocl Set Returns a sub set of the set containing all elements for which boolExpr evaluated to false ocl Set collect anyExpr ocl Any ocl Bag Returns a bag containing values which are returned by anyExpr applied to each element of the set ocl Bag The type ocl Bag represents the mathematical concept of multi set set containing elements multiple times Aliases Supertypes This type can be accessed as Bag Its supertype is ocl Collection Operators opera
143. e source destination is always an atom or a reference port If it is an atom then it is either contained by the owner or it corresponds to a port of a model contained by the owner So in case of atoms either the source destination or its parent is a child of the owner In case of a reference port its owner must be a child of the owner of the connection class CBuilderConnection public CBuilderObject public CBuilderModel GetOwner const CBuilderObject GetSource const CBuilderObject GetDestination const The CBuilderSet class member function provide straightforward access to the different components of sets class CBuilderSet public CBuilderObject public const CBuilderModel GetOwner const const CBuilderObjectList GetMembers const bool AddMember CBuilderObject part bool RemoveMember CBuilderObject part Example The following simple paradigm independent interpreter displays a message box for each model in the project For the sake of simplicity it assumes that there is no folder hierarchy in the given project The component cpp file is shown below Generic Modeling Environment User s Manual High Level Component Interface e 78 include stdafx h include Component h void CComponent InvokeEx CBuilder amp builder CBuilderObject focus CBuilderObjectList amp selected long param const CBuilderFolderList folds builder GetFolders POSITION fPos folds gt Get
144. e them if we can there is a precedence defined among the names In the following enumeration the first is the highest precendence e Containment rolename defined by the paradigm e g CompoundP art e Kindname defined by the paradigm e g Compound e Metakindname defined by GME e g BON Model BON FCO The rules are the following There is containment role assigned e Only one containment role create appropriate BON extension e More than one containment role throw an exception There is kind assigned e Only one kind create appropriate BON extension e More than one kind throw an exception There is metakind assigned e Only one metakind and it complies with the implementation create appropriate BON extension e Throw an exception Generic Modeling Environment User s Manual High Level Component Interface e 96 There is no assignment e Create the appropriate generic BON implementation A more sophisticated example is the following The user creates an AtomEx BON extension with additional functionality extending the generic GME concept Atom After that she extends the AtomEx with Parameter and Parameter is extended with MainParameter which is assigned to a specific role LARE_BONEXTENSION BON Atom AtomExImp1 AtomEx LARE_BONEXTENSION AtomEx ParameterImpl Parameter LARE_BONEXTENSION Parameter MainParameterImpl MainParameter LEMENT_BONEXTENSION AtomEx BON Atom
145. e valid input kinds that the Search tool shall accept Regular expressions are case sensitive Generic Modeling Environment User s Manual Using GME 5 e 36 Check the Match Whole Word Only if you don t want a Regular Expression based search for the first four fields Syntax of the expressions e Any permutation of characters numbers amp symbols such as _ is valid A few special symbols that are used are C S Tr mile eeN R i kd kd T S e The regular expression should be well formed i e all the opening brackets should have corresponding closing brackets e Writing GME will mean all the string containing the letters GME will be returned e Writing GME will return all strings containing GM GME GMEE GMEEE and so on e Writing GME is the same as GME with the exception of only GM e Writing GME is the same as GME Defaults The Search functionality has been implemented assuming certain default conditions On invocation the search tool has the following default inputs e All the Search for options are selected e The Match Whole Word Only option is not checked The inputs can be specified in the following ways e Any of the input boxes being empty implies that the all the objects will be returned without checking that input e The attribute Type amp Value fields require the attribute Name t
146. e wants to do it as fast as it is possible she does not want to deal with typical programming issues i e object disposal compexity of COM etc and she would like to face only with task came from specific domain If an interpreter writer follows the rules discussed in these subsections and she is familiar with GME she almost has to know nothing about C and COM to achieve the goal simply and very fast BON defines three layers four layers based on each other e COM layer 0 layer Simply to say this is the programmable interface of GME the lowest layer which should be absolutely hidden for the user because of its complexity and in the case of interpreters the superfluous knowledge to use COM properly Correspondent files are meta idl mga idl Example IMgaF CO COM interface e Implementation layer 1 a layer This layer is the core of BON2 in which all easy to use calls using MON are translated into COM operations This is the place where BON objects are cached also and where the basics of BON2 extensions are implemented Correspondent files are MONImpl h BONImpl h Example BON FCOImpl implementation class e Interface layer 1 b layer This constints of those classes and operations which are exported to the user i e they have public visibility These are discussed in the Appendix of MON and BON In the current state of BON2 this layer is built into the previous one Correspondent files are MON h BONImpl h Examp
147. ecial icons instead of checkboxes These icons are for telling the user that there is no information gathered regarding the kinds Selecting them or clicking on the Load All button will cause the information to become available Checkboxes may have different colors The meaning of the colors are the following e Grey the flag is disabled e Cyan the flag s value is inherited the value is implicit e Black the flag s value is set explicitly not inherited The checkboxes can enable or disable the constraints in different sort of ranges depending on what kind of nodes they are reside before e At kinds enable all constraints for all objects of the kind at the same time not stored e At types subtypes or instances enable all constraints for the specific object at the same time not stored e At constraint subnodes of kinds enable the specific constraint for all objects of the specific kind not stored e At constraint subnodes of objects enable the specific constraint for the specific object stored It is likely that the user changes a flag for an object e g for a type then the color of the checkboxes of the descendant objects will change using the advantage of type inheritance in the regisrty In order to facilitate the context definition the right and left buttons of the mouse can be used e Left button set the flag only for the specific node e Right button set the flag for the specific nod
148. eclarator gt lt declarationType gt lt accumulator gt lt accumulatorType gt lt expression gt lt expression gt 5 n e g let mySet Set 1 2 3 10 in Expressing the functionality of exists predefined iterator mySet gt exists i i size 2 mySet gt iterate i accu false accu or i size 2 Expressing the functionality of isUnique predefined iterator mySet gt isUnique i i mySet gt forAll il i2 il i2 implies il lt gt i2 mySet gt iterate il accul true accul and mySet gt iterate i2 accu2 true accu2 and il i2 implies il lt gt i2 Generic Modeling Environment User s Manual Appendix B OCL and GME e 139 Type Related Expressions Operators In OCL there are a bunch of operators defined by predefined types In both OCL 1 4 and OCL 2 0 logical operators are not defined completely as the specification does not define precedence between these operators This small lack would make writing OCL expressions more difficult because the user would have to use parenthesis even if it was not necessary In this implementation we define the precedence and the associative rules of operators as they are defined in well known programming languages Operators can be overloaded and defined for types of paradigms as well This extension is adopted from the C language The over
149. ection end In default this corresponds to the cardinality number BON Event This class wraps the events sent by the Mga Layer Base Classes There is no base class Attributes MON ObjectEventType getType const Returns the type of the event MON Object getContext const Returns the context of the event Generic Modeling Environment User s Manual Appendix C BON and MON e 217 Methods std string getInfoString Util InfoOptions usOptions Util I0_ None const std string getInfoString std set lt Util InfoOption gt setOptions const They return a user friendly description about the event BON EventListener This class is intended for user specific event handling Base Classes There is no base class Attributes virtual bool isActive const Returns true if the listener handles events The operation may be overridden by the user In default it returns true virtual MON ObjectEventTypes getAssignments const Returns the OR ed event types to which the listener reacts In default it return MON OET_None therefore it must be overridden by user Methods virtual void eventPerformed const BON Event amp event const The user has to override this operation to implement the specific behavior handling the event BON EventListenerPool This class is intended to implement a pool for event listeners and predefined dispatching of events Base Classes There is no base cl
150. ectionPoint role ocl String gme ConnectionPoint The first call returns a set of connection points association ends of the connection If role is specified then the role of the points has to match role The second call ease the access only one connection point gme Reference The meta kind gme Reference is a special meta kind of GME It can be considered to be a pointer to an fco Aliases Super Meta Type This meta kind can also be accessed as Reference Its super meta kind is gme FCO Methods Reference usedByConnPoints kind ocl String ocl Set ConnectionPoint D Reference usedByConnPoints kind ocl Type ocl Set ConnectionPoint Returns a set of connection points association ends of the reference in which the reference participates With kind we can filter those points which are only parts of connections having the same kind If the kind of kind i e the meta kind is not gme Reference then an exception is thrown and undefined is returned gme Reference refersTo gme FCO Returns the fco to which the reference refers The return object can be null if the reference points to null gme Set The meta kind gme Set corresponds to a set which can contains fcos Aliases Super Meta Type This meta kind can also be accessed as Set Its super meta kind is gme FCO Generic Modeling Environment User s Manual Appendix B OCL and GME e 170 Methods gm
151. ed to obtain set specific pre defined registry values BON Reference This class corresponds to the IMgaR eference COM interface Base Classes Its base class is BON FCO Construction and Destruction static BON Reference attach IMgaReference pReference Creates a BON reference for the specified COM object static BON Reference create const BON Folder amp parent const MON Reference amp meta MON Reference static BON Reference create const BON Folder parent const std string amp strReference static BON Reference create const BON Model amp parent const MON Reference meta MON Reference const std string amp strRole E static BON Reference create const BON Model amp parent const std string amp strReference const std string strRole The methods create a new null reference in the specified parent which kind will be meta or strReference If strRole specified the containment role name will be the same within the model parent static BON Reference create const BON Folder amp parent const BON Reference amp baseType bool bAsInstance true static BON Reference create const BON Model amp parent const BON References amp ww baseType bool bAsInstance true const std string amp strRole J The methods derive a new null reference from the specified basetype If bAsInstance is true the derived object will an instance of basetype otherwise a type
152. eeeceeseecseeecsaccaeesecaeesecneseecsaeeeeaesaeeaeenees 69 Generic Modeling Environment User s Manual Conients e ii What Does the BON Do wesc cccccicnckeaceeecsecatick n e a a e aa a a r E A E 69 Component Interface Entry Point seeerssssssesreeserscserseseseerteesreeeseeeereesresseseeseseserseee 70 Component Interface seinri npa a e p tas E Rea r S EEn 72 Example nnn a a aed eta test idtaeestadiey E E A E austere s 78 Extending the Component Interface seseseseeeeeeeeeseesesesreeressrsererresretersesresrsrereeree 79 EXA Mpe s rrt enpe eis sane E E EEE E E A E EE REA E 82 Meta Object Network svis c0 sssssesscheues gtpsssescasss apts castactecbehes qasbios babi assess seks taassupsbeassehastane es 84 Whatis MON iiccus ainsi dint oneiaiau tonsa E E E TEN 84 Basic MON Classe Sheni T encanta A E E E E E EEN 84 Meta Kinds MON enG eent E e E E E E ETNE 85 Specific GME Cnceptsa eee iioa E i aa EEE EE EE ay 86 How to Use MON asees eetri eae R E EE ESE RE ds 88 Builder Object Network version 2 0 nps riea oa A EE E A aN a 89 Architectur of BON eae dit AIEEE EAEE E EEE EE TE OR 89 Wrapper Classes iise esans tarne ei a E R E TE 89 Objects Lifecycle in Components ssessesesseeseseeseeesrstsesttererersererteersrersesresrsrereerse 91 Extending Interpreters si cosine a a aya E A T e 92 Add nsand Events eien a EE nw E E EEA EE 93 BON Extension Classes inn eee ee Wale eu EE R 93 Essential Classes of BON2 pense
153. eference may refer that is if the referred FCO may play more than one kind of role in a particular Model the current solution is that it may refer to all roles of that particular kind However in the future this list may be modified during paradigm construction through the help of an add on Generic Modeling Environment User s Manual Metamodeling Environment e 54 Do lt lt model gt gt Pointer lt lt reterence gt gt 0 Tree lt lt atom gt gt Example implementation of a Reference Connection In order for a Connection to be legal within a Model it must be contained through aggregation in that Model The Connection is another highly configurable concept The attributes of a Connection include Name Position 1 destination label zm destination label 1 source label 2 source label Color Line type Line end and Line Start How to specify a connection between two Atoms In addition to Atoms a Reference to an Atom may also be used as an endpoint of the Connection Note that Connection is also usable as an endpoint but there is currently no visualization for this concept Drag in a Connector Atom the name of the Connector was deleted in the example figure Connect the source Atom to the Connector Connect the Connector to the destination Atom Connect the Connector to the Connection Resolve the Connection type to AssociationClass The rolenames of the connections srce and dst
154. en the result is true if both of them are undefined the result is false Methods ocl Any oclIsTypeOf type ocl Type ocl Boolean Returns true if any is an instance of type type can be a simple name but not a compound name So far this method cannot be used to check type conformity ocl Set ocl Any as argument is invalid only ocl Set is valid If the specified type is invalid or if there is no type having this name the method throws an exception and returns undefined ocl Any oclIsKindOf type ocl Type ocl Boolean Returns true if any is an instance of type or if any descendants of type For further information see ocl Any ocllsTypeOf Generic Modeling Environment User s Manual Appendix B OCL and GME e 148 ocl Any oclAsType type ocl Type This is actually a static typecast operator It returns the same object with type i e it does not create a new object the result is identical to the object itself The object s type has to conform to the type or vice versa This method can be used to access overridden and overloaded features defined by ascendants of a type up cast or it can be used for the well known down cast type can be a simple name but a compound name So far this method cannot be used to check type conformity ocl Set ocl Any as an argument is invalid only ocl Set is valid If the specified type is invalid or if there is no type having this
155. ender First age is resolved as self age because there is only one implicit variable called self dogs is resolved as self dogs because there is only one implicit variable called self Iterator called forAll creates a new implicit variable We refers to that as iterl These variables are not accessible in the expression directly gender is resolved self gender because iterl which is a Dog does not have any feature called gender Second and third age is resolved as iterl age because iterl is defined latter than self i e the examination started with iterl owner is resolved as if it had been written iterl owner where iterl is an implicit declarator created by the iterator context Person inv age lt 4 implies dogs gt forAll if gender male then age lt 1 else age lt 0 5 endif Assuming that Box is defined by the paradigm Box has a containment with roles container and elements Box has a query method called includes with one argument with type Box The example does not make sense it demonstrates the resolution only First elements is resolved as self elements because there is only one implicit variable called self Iterator called collect creates a new variable We refe
156. eneric Modeling Environment User s Manual Updated STLport C library resulting performance enhancements GME is now developed and compiled with Microsoft Visual Studio NET 2003 Reliability improvements in Constraint Manager and in Expression Checker Mga dtd is no longer needed to be present in the project folder for XSL translations New preference setting added for annotations control whether to inherit them in Subtypes Instances or not Copy Smart feature refined for better cross project copying File drag and drop allowed to main GME window Default Zoom level per application preference setting introduced Port label length can be changed for models and for model references see Miscellaneous Preferences Port Label Length setting Active Scripting enriched with it object represents the active model Documentation on the scirpting feature added to this manual BonExtender supports classes with up to 6 baseclasses in BON2 BON2 CREATED_EVENT handling improved for add ons BON2 connection methods are fixed to work properly regarding whether reference port or fco is connected Several JavaBON problems fixed What is new e 6 What is new in version 4 0 Among the significant improvements in this version are e Bugzilla bug tracking Please report problems with GME at http bugzilla isis vanderbilt edu query cgi e Mailing list for GME users Sign up at http list isis vanderbilt edu mailman listinfo gme users e
157. ent gme project and it The first object gme represents the running GME application instance and implements the IGMEOLEApp interface as defined in the Gme idl file This interface allows the user to access various user interface elements of the modeling environment i e panels like ActiveBrowser and ObjectBrowser or to execute project related commands like invoking an interpreter on the currently opened model if any hiding the ActiveBrowser window gme panels 0 Visible 0 check the constraints gme CheckAl1Constraints invoking an interpreter gme RunComponent Mga Interpreter ComponentC The lifetime of the gme object is the same as that of the application The project variable is valid while a project is opened in the main application window This variable implements the MgaProject interface defined in Mga idl For accessing the inner elements inside an MGA project transactions must be used Generic Modeling Environment User s Manual Using GME 5 e 38 gme OpenProject MGA f sf sample mga terr project CreateTerritory None None None project BeginTransaction terr mf project RootFolder ChildObject MainFolder mf Name main_folder mf ChildFCO MainCompound Name main_compound project CommitTransaction gme CloseProject 1 In the code snipped above a sample SF model is opened the Folder named MainFolder and the Compound named MainCompound a
158. ent model Generic Modeling Environment User s Manual Using GME 5 e 40 Type Inheritance Type Inheritance Concepts The type inheritance concepts in GME 5 closely resemble those of object oriented programming languages The only significant difference is that in GME model types are similar in appearance to model instances they too are graphical have attributes and contain parts By default a model created from scratch is a type A subtype of a model type can be created by dragging the type and dropping it while pressing the Alt Shift key combination An instance is created in similar manner but only the Alt key needs to be used A subtype or an instance of a model type depends on the type There is one significant rule that is different for subtypes and instances New parts are allowed in a subtype but not in an instance Otherwise parts can be renamed set membership can be changed and references can be redirected in both subtypes and instances Parts cannot be deleted and connections cannot be modified in either subtypes or instances Any modification of parts in a type propagates down the inheritance hierarchy For example if a part is deleted in a type the same part will be automatically deleted in all of its instances and subtypes and instances of subtypes all the way down the inheritance hierarchy Types can contain other types as well as instances as parts The mixture of aggregation and type inheritance introduces anothe
159. equently inheritances only act as operators at meta modeling time This situation requires us to ease some strict rules of standard OCL These rules include the following e Some well defined abstractions which were made by the modeler disappear because all information is lost For example if in future the standard OCL rules about accessing an association end are allowed then it is likely that meny association ends cannot be used due to ambiguity Generic Modeling Environment User s Manual Constraint Manager e 112 e For a kind which is defined in the paradigm if either its kind is gme FCO or its Is Abstract flag is set then it cannot be referred in OCL expressions because these types will not appear in the interpreted meta e Inheritance information cannot be acquired between two kinds defined by the paradigm because this knowledge is lost during the interpretation e Although standard OCL says that meta kind information cannot be obtained in expressions referring to meta kinds is allowed For the time being this is the only way to get some common information about kinds e If a constraint is associated with a kind then the kind and all of its descendants will get a constraint object which is the same as the defined one but is a distinct entity This problem grows in size along with the sizes of the XMP and XML files e Ifthe modeler would like to write a Constraint Definition and attach it to the kind then the definit
160. er true false Boolean literals Compound types literals are a bit more complex than primitive types literals The user has to write the name of the compound type followed by the list of expressions enclosed by braces the list can be empty Objects returned by the expressions will be the elements of the compound object In standard OCL range of object using operator can be specified In this implementation it is not supported yet Compound types are so far limited to Collection ocl Collection Set ocl Set Bag ocl Bag Sequence ocl Sequence lt compoundType gt lt expression gt lt expression gt y e g Sequence 0 1 2 23 true Let expression A Let expression performs variable declaration and initialization This expression has two parts The first part declares and initializes the variable the second part declares where this variable is accessible Let expression s return type is the same type as the second expression Variables in OCL can be used to make the constraint more readable or to improve the performance of constraint evaluation If we want to use a result of an expression more than once it is better to compute the result only once and store it in a variable Let expression may have a type declaration as well let lt variableName gt lt declarationType gt lt expression gt in lt expression gt e g
161. er was missing that association end would not accessible from Box b container Cannot be used in any cases because of recursive containment b boxContainment Returns in ocl Set BoxContainment If container was missing that association class would not be accessible from Box as container b boxContainment container Returns in BoxContainment If elements was missing that association class would not be accessible from Box as element b boxContainment elements Cannot be used in any cases because of recursive containment bc box Returns in Box If elements was missing that association end would not accessible from BoxContainment bc elements Returns in Box If container was missing that association end would not accessible from BoxContainment bc container Generic Modeling Environment User s Manual Appendix B OCL and GME e 143 Assuming that p is a Person d is a Dog hd is a HasDog If Person Dog HasDog had further association which has owner or dogs roles then these roles could not be used because of ambiguity If these classes have further association between them then the name of the appropriate classes cannot be used as role If role exists then the role has to be used to navigate otherwise the name of class has to be used Returns in ocl Set Dog p dogs p dog Returns in Person d owner d pe
162. es necessary for one model to directly access parts contained in another For example in one dataflow diagram a variable may be defined and in another diagram of the system one may want to use that variable In dataflow diagrams this is possible only by connecting that variable via a dataflow arc going up in the hierarchy until a level is reached from where one can descend and reach the other diagram a rather cumbersome process GME offers a better solution reference parts Reference parts are objects that refer to i e point to other modeling objects Thus a reference part can point to a model an atomic part of a model a model embedded in another model or even another reference part or a set A reference part can be created only after the referenced part has been created and the referenced part cannot be removed until all references to it have been removed However it is possible to create null references i e references that do not refer to any objects One can think of these as placeholders for future use Whether a particular reference can be established i e created or not depends on the particular modeling paradigm being used Examples of references are as follows e References to variables in remote dataflow diagrams in a signal processing paradigm e References to equipment models in a process model in a chemical engineering paradigm e References to nodes of a multiprocessor network in a paradigm describing h
163. esponds to IMgaMetaPart COM interface tells the user which containment roles are visible in the particular aspect ModellnAspect ContainmentPart 1 localAtnibute 0 How the MetaProject relates to other classes Generic Modeling Environment User s Manual High Level Component Interface e 87 In GME there are two kind of attributes local and global attributes Local attributes are defined directly in the context of an fco Global ones may be associated with more than one fco AttributeAggregation Constraint is contained by Object which corresponds to metakind and the last concept is the RegistryNode mentioned earlier That is shown in the last figure Project contains MetaObject and all associations which mean many many relationships between metaobjects How to Use MON We mentioned earlier BON2 is based on MON thus it is obvious there are a lot of similarities between the two object network Because for an interpreter writer the architecture of BON2 is more important than MON we will mention the specific usage and differencies during the discussion of BON2 Generic Modeling Environment User s Manual High Level Component Interface e 88 Builder Object Network version 2 0 Architecture of BON2 So that the user will use and extend BON2 appropriately she must understand the architecture and the essential concepts implemented by default in the object network When somebody would like to write an interpreter sh
164. esult is null BON FCOExRegistryNode getRegistry const Returns a special root registry node which can be used to obtain reference specific pre defined registry values BON ReferencePortContainer This class represents the interface of those references which currently refer to a model directly or indirectly Base Classes There is no base class Methods BON Project getProject const It returns the project to which the reference port container belongs BON Reference getReference const Returns the corresponding reference Generic Modeling Environment User s Manual Appendix C BON and MON e 208 std set lt BON ReferencePort gt getReferencePorts const Returns the set of the contained reference ports BON ReferencePort getReferencePort const BON FCO amp fco const Returns the reference port which points to the specified fco If fco is null BON Exception is thrown BON TypelnhObject This class is the base class of BON Type and BON Instance classes For each fco in a project there is a BON Type or BON Instance object with which the user can obtain information about the fco regarding the type inheritance Base Classes There is no base class Attributes bool isInstance const Returns true if the object s dynamic type is BON Instance Methods BON Project getProject const It returns the project to which the type inheritance object belongs BON FCO getFCO c
165. et of a chemical engineering paradigm e Connections between failure modes indicating failure propagation in a fault modeling paradigm Connections can be seen between atomic parts and models as in the case of the Input Signal atomic part connecting to the ports labeled In on each of the Generator models shown earlier and between ports of models as in the case of the Out ports of each Generator model connecting to the In port of another Generator model Notice that in this paradigm connections are directional used to indicate information flow between the models Models containing objects and connections show a Static system In some cases however it is necessary to have a model of a dynamic system that has an architecture that changes over time From the visual standpoint this means that depending on what state the system is in we should see different pictures These states are not predefined by the modeling paradigm in that case they would be aspects but rather by the modeler The different pictures should show the same model containing the same kinds of parts but some of the parts should be present while others should be missing in a certain states In other words the modeler should be able to construct sets and subsets of particular objects even connections In GME each set is represented by an icon user defined or default When a particular set is activated only the object
166. eta is not null the result is null if the kind of the returned model would not be meta The second form of the call behaves the same way as the first one Empty string means that there is no kind restriction BON Model getParentModelAs const std string amp strRole const Returns the parent model if the fco is child of a model with containment role str ole otherwise the result is null std set lt BON Set gt getMemberOf const MON Set amp meta MON Set const MON Aspect amp aspect MON Aspect const std set lt BON Set gt getMemberOf const std string amp strSet const MON Aspect amp aspect MON Aspect const Returns a set of those sets which the fco is included into If meta is not null or strSet is not empty then the kind of the returned sets has to be the specified one If aspect is not null then the result set is filtered with aspect std set lt BON Reference gt getReferredBy const MON Reference amp meta MON Reference const std set lt BON Reference gt getReferredBy const std string amp strReference const Returns a set of those references which refer to the fco If meta is not null or strReference is not empty then the kind of the returned references has to be the specified one If aspect is not null then the result set is filtered with aspect Generic Modeling Environment User s Manual Appendix C BON and MON e 199 BON FCORegistryNode getRegistry
167. ething on a higher level of abstraction since many details are not visible A model that does not contain other models represents something on a lower level of abstraction This hierarchical organization helps in managing complexity by allowing the modeler to present a larger part of the system albeit with less detail by using a higher level of abstraction At a lower level of abstraction more detail can be presented but less of the system can be viewed at one time Examples where hierarchy is useful are as follows e Hierarchical dataflow diagrams in a signal processing paradigm e Process model hierarchy in a chemical engineering paradigm e Hierarchically organized networks of processors in a paradigm describing multiprocessors QQ GME2000 SF Example lol x File Edit View Window Help v a A 4 rA Ala HS SB A BE components P SuperGen ioi xi x T Name SuperGen Compound Aspect SignalFlowAspe gt Base NA F AASB GeneratorB GeneratorA EDIT 100 SF2000 04 44 PM 74 Compound model SuperGen containing several Generator models Generic Modeling Environment User s Manual The Generic Modeling Environment e 16 Default icon for references pointing to null References References are parts that are similar in concept to pointers found in various programming languages When complex models are created containing many different kinds of atomic and hierarchical parts it is sometim
168. f connections The function returns the leaf nodes Basically these functions find paths to from the given object without the component writer having to write the traversal code The TraverseChildren virtual functions provide a ways to traverse the builder object network along the containment hierarchy The implementation provided does not do anything the component writer can override it to implement the necessary functionality As we ll see later the CBuilderModel class does override this function It enumerates all of its children and calls their Traverse method Generic Modeling Environment User s Manual High Level Component Interface e 73 class CBuilderObject public CObject const CString amp GetName const bool SetName CString newname void GetNamePath CString amp namePath const const CString amp GetKindName const const CString amp GetPartName const const CBuilderModel GetParent const CBuilderFolder GetFolder const bool GetLocation CString amp aspectName CRect bool SetLocation CString aspectName CPoint void DisplayError CString amp msg const void DisplayError char msg const void DisplayWarning CString amp msg const void DisplayWarning char msg const GetAttribute CString amp name CString amp val const GetAttribute char name CString amp val const GetAttribute CString amp name int amp val const GetAttribute char name int amp val const GetAttribute CSt
169. f the fco has to match role If kind is specified the kind of the regarded connections must be kind If the kind of kind i e the meta kind is not gme Connection then an exception is thrown and undefined is returned FCO isConnectedTo fco gme FCO role ocl String kind sSt ing amp oGlisBool an D FCO isConnectedTo fco gme FCO role ocl String kind Type ocl Boolean FCO isConnectedTo fco gme FCO kind ocl Type ocl Boolean Returns true if fco is connected to the fco If role is specified then the role of fco has to match role If Kind is specified the kind of regarded connections must be kind If the kind of kind i e the meta kind is not gme Connection then an exception is thrown and undefined is returned Generic Modeling Environment User s Manual Appendix B OCL and GME e 168 gme FCO subTypes ocl Set gme FCO Returns a set which contains all fcos that are subtypes of the fco Returns an empty set if the fco is not a type gme FCO instances ocl Set gme FCO Returns a set which contains all fcos that are instances of this fco as a type Returns an empty set if the fco is an instance Returns the type of this fco gme FCO baseType gme FCO Returns the base type of this fco gme FCO isType ocl Boolean Returns true if the fco is a type gme FCO isInstance ocl Boolean
170. ferences can be redirected i e the object they refer to can be changed Simply drop an object on top of an existing reference and if the object kind matches the reference is redirected Note that the type hierarchy places restrictions on this operation as well see later in the Type Inheritance chapter Subtypes and instances of models can be created by holding down Alt Shift and Alt keys respectively during the drop operation Type inheritance is described in a separate chapter Generic Modeling Environment User s Manual Using GME 5 e 33 Parts and models may be removed by left clicking to highlight them and either selecting Delete from the Edit menu or by pressing the Delete key Note that any connections attached to an object will also be deleted when that part or model is deleted Also remember that parts can only be deleted after all references to them have already been deleted Add Connection Mode This mode allows connections to be made between modeling objects Connections may exist between two atomic parts between two model ports think of these as connection points on models or between an atomic part and a model port Remember however that connections are a paradigm specific notion and will only be allowed between objects specified by the paradigm definition file as being allowed to be connected together Remember that connections are inherently directional in nature Connections are made by first placing the editor i
171. file must be generated on one of the client machines and must be distributed to all clients 1 Start the GME application on one of the client machines 2 From the File menu select Register Paradigms 3 Click on Add from File and select the xmp file which contains the paradigm information The parser will generate a file with extension mta in the same directory where the xmp file resides 4 Distribute copy the generated mta file to all client machines On the client machines register the distributed paradigm file using the process above use the mta file instead of the xmp now Using GME with the ODBC backend When one creates or opens projects on SQL servers the only difference is that ODBC data instead of Project file must be chosen in the proper dialog box and the previously created DSN must be selected instead of a regular file GME does not provide facilities to purge ODBC projects To delete a database project the database on the SQL server must be emptied manually drop all user tables If you do not know how to do this or you do not have the privilege to drop these tables ask your SQL server administrator for help Though the database tables created by GME can be easily interpreted it is highly discouraged to operate on them outside of modeling environment The schema of these tables may change between different versions of GME Therefore we do not provide documentation on the internal format of these tables Generi
172. gUnit IMPLEMENT_BONEXTENSION Compound Compound Using the extensions void print const BON FCO amp fco if BON Model fco AfxMessageBox It is a model ProcessingUnit unit fco LE UML unit gt doSomething if Compound unit AfxMessageBox It is a Compound else AfxMessageBox It is another descendant of ProcessingUnit end of method Essential Classes of BON2 As we noted discussing how to use MON classes there are a lot of similarities between BON2 and MON regarding the usage and the architecture This is because BON2 bases on MON Examining the figure about BON2 classes which has the appropriate COM interface we find that these classes are almost the same For all BON2 classes the user can find the proper operation with which she can obtain the meta information e g the operation BON FCOlmpl getF COMeta returns MON FCO Generic Modeling Environment User s Manual High Level Component Interface e 99 role Containment 0 1 le metaAttribute fs Relationship between the Project and BON Objects associations to MON classes Looking at the next figure carefully there are only two exceptional classes which do not have the correspondent COM interface i e ConnectionEnd and ReferenceP ort The concept of the ReferencePort may look familiar to whom had used the previous version of BON but there are essential differencies which will be discusse
173. garding the aspects the setter method sets the passed co ordinates for all aspects Generic Modeling Environment User s Manual Appendix C BON and MON e 214 BON NamePosition getNamePosition const void setNamePosition BON NamePosition pos Returns and sets the enumeration value which describes where the name of the fco is displayed unsigned short getNameWrap const void setNameWrap unsigned short usWrap Returns and sets the number of characters which is the base 5 char of the name wrapping Value 0 means that the name wrapping is off bool getHotspotEnabled const void setHotspotEnabled bool bEnabled The first operation returns true if hotspots are shown for the fco The second one sets this value bool getTypeNameEnabled const void setTypeNameEnabled bool bEnabled Returns and set the flag for displaying the name of the type This type is displayed only for instances in case this flag is true bool getTypeInfoEnabled const void setTypeInfoEnabled bool bEnabled Returns and sets the type has to be shown For types T for Subtypes S and for Instances I letter is displayed std string getDecorator const void setDecorator const std string amp strName Returns and sets the COM descriptor of the decorator assigned to this fco std string getIcon const void setIcon const std string amp strName const Returns and sets the filename of the icon of the fc
174. gm has been established the MIPS environment itself can be built A MIPS environment consists of three main components 1 a domain aware model builder used to create and modify models of domain specific systems 2 the models themselves and 3 one or more model interpreters used to extract and translate semantic knowledge from the models The MultiGraph Architecture MultiGraph is a toolset for creating domain specific modeling environments The MultiGraph Architecture MGA is a toolset for creating MIPS environments As mentioned earlier MIPS environments provide a means for evolving domain specific applications through the modification of models and re synthesis of applications We now discuss the creation of a MIPS environment Generic Modeling Environment User s Manual Modeling Concepts Overview e 10 A modeling paradigm defines the family of models that can be created using the resultant MIPS environment A metamodel is a formalized description of a particular modeling language and is used to configure GME itself The Modeling Paradigm The process begins by formulating the domain s modeling paradigm The modeling paradigm contains all the syntactic semantic and presentation information regarding the domain which concepts will be used to construct models what relationships may exist among those concepts how the concepts may be organized and viewed by the modeler and rules governing the construction of models
175. graphical ordering operator gt stringl ocl String string2 ocl String ocl Boolean Returns true if string2 is ahead of or equal to stringl in lexicographical ordering Attributes ocl String size ocl Integer Returns the length of the string Methods ocl String coneat string ocl String ocl String Returns a string which is the concatenation of this and string This is the same as the operator ocl String toUpper ocl String Returns a string containing only uppercase characters ocl String toLower ocl String Returns a string containing only lowercase characters ocl String substring start ocl Integer length ocl Integer ocl String Returns the sub string of this beginning at start and having a specified length If length is not specified the substring continues to the end of this If length is zero or negative an empty string is returned The first position is 0 The result is undefined and an exception is thrown if lower is less than 0 ocl String trim ocl String Returns a string that neither starts nr ends with white space characters t r t and characters u0000 to u0020 are considered to be white space ocl String toReal ocl Real Converts the string to ocl Real If the conversion cannot be performed then an exception is thrown and the method returns undefined The
176. gt childFCOs const std set lt MON Atom gt childAtoms const std set lt MON Model gt childModels const bool isObjectChild const MON Object amp object const MON FCO Generic Modeling Environment User s Manual Appendix C BON and MON e 177 Base Classes MON Object Attributes MON FCOPtr getFCOI const Methods std set lt MON Containment gt parentContainments const std set lt MON Model gt parentModels const bool isModelParent const MON Model amp model const std set lt MON ConnectionEnd gt connectionEnds const std set lt MON ConnectionRole gt targetOf const bool isTargetOf const MON ConnectionRole amp role const std set lt MON ReferenceAssociation gt referenceAssociations const std set lt MON Reference gt referencedBy const bool isReferencedBy const MON Reference amp reference const std set lt MON SetMembership gt setMemberships const std set lt MON Set gt memberOf const bool isMemberOf const MON Set amp set const std set lt MON AttributeAggregation gt attributeAggregations const std set lt MON Attribute gt attributes bool bLocalsAlso true const std set lt MON Attribute gt localAttributes const bool hasAttribute const MON Attribute amp attribute const MON Atom Base Classes MON Atom Generic Modeling Environment User s Manual Appendix C B
177. he connection needs to be checked The Generic Modeling Environment e 17 BLP Su gw GME edit mode bar with the Connections selected Sets Default Generic Modeling Environment User s Manual icon mode button for sets To make connections the modeler must place the GME in the Add Connections mode This is done by clicking on the Connections mode button see figure to left on the Modebar A connection always connects two parts If the part is an icon that represents a model it may have some connection points or links Logically a link is a port through which the model is connected to another part within the parent model Links on a model icon represent specific parts contained in the model that are involved in a connection In these cases when the connection is established care should be taken to build the connection with the right link The link shows up on the icon of the model part as a miniature icon with a label When the connection is built the system uses these miniature icons as sensitive pads where connections may start or end Moving the mouse cursor over one of the pads shows the complete name of the link part Furthermore not only atoms but models sets and references except for connections can act as a ports Some examples of connections and links are as follows e Connections between dataflow blocks in a signal processing paradigm e Connections between processes on a process flow she
178. hem If meta is null strConnection is empty or strRole is empty BON Exception is thrown These operations can be used only for simple connections i e connections having exactly two connection ends otherwise BON Exception is thrown std multiset lt BON ConnectionEnd gt getDirectInConnEnds const MON Connection amp meta bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const std multiset lt BON ConnectionEnd gt getDirectInConnEnds const std string strConnection bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const std multiset lt BON ConnectionEnd gt getDirectOutConnEnds const MON Connection amp meta bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const std multiset lt BON ConnectionEnd gt getDirectOutConnEnds const std string amp strConnection bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const These operations has the same functionality as getDirectConnEnds has getDirectInConnEnds supplies dst role getDirectOutConnEnds supplies src role implicitly Generic Modeling Environment User s Manual Appendix C BON and MON e 196 void accept BON Visitor pVisitor This is an abstract operation for BON Visitor This call is delegated to the appropriate accept of the object i e considering the dynamic type of the object std string getInfoString Util
179. hildren i e two immediate reference ports This relationship might be important for the component implementor if she wants to handle the connections between objects in advanced way ConnectionEnd and Connection Connections in BON2 is implement in a different way comapring to the previous implementation In both ends of a connection only ConnectionEnds can stand A ConnectionEnd can be an object itself to be more precize an fco or reference Generic Modeling Environment User s Manual High Level Component Interface e 102 ports ReferenceP ort derives from ConnectionEnd because this concept is not placable into the set of metakinds and it has different meaning only in the case if it stands for an end of a connection Let s see the following examples considering the previous figure to understand the described issues the model called Model in the figure BON Model model P2 of Model we omit the aquiring operations BON Atom p2_model Refl refers to Model BON Reference refl model gt getReferredBy PortContainer of the model reference BON ReferencePortContainer rpc_refl refl gt getRefPortContainer Find the ReferencePort referring to P2 BON ReferencePort p2_refl rpc_refl gt getReferencePort p2_model Parent of the ReferencePort is null p2_refl gt getParentPort Descendants of P2 of Refl containig P2 of Ref2 Ref3 and Ref4 p2_refl gt getDescendantPorts
180. hrough this dialog box is persistent It is stored in the metamodel in the registry of the corresponding objects A subsequent invocation of the interpreter will show the dialog box with the information specified by the user the previous time Each attribute of any given FCO in the Metamodeling environment has a specific meaning for the output paradigm This section describes each attribute and lists the FCO s in which the attribute resides Attributes are listed by the text prompted on the screen for their entry The section also gives what special instructions if any are necessary for filling out the attribute For fields if the default value of the field is then no default value is specified in the description All other attributes list the default value 1 source label String value that gives the name of the Attribute class to be displayed there The Attribute should also belong through aggregation to the Connection Then the value of that Attribute will be displayed in the first position at the end of the source of the connection Generic Modeling Environment User s Manual Metamodeling Environment 60 Contained in Connection 24 source label String value that gives the name of the Attribute class to be displayed there The Attribute should also belong through aggregation to the Connection Then the value of that Attribute will be displayed in the second position at the end of the source of the connection
181. ht corner of the dialog box Pressing the Add from file button displays a file dialog where the user can select compiled binary files mta or XML documents It is possible to store paradigm information in MS Repository as well The Add from DB is used to specify paradigms stored in a database like MS Access Generic Modeling Environment User s Manual Using GME 5 e 31 If the new paradigm specified was not yet registered it will be added the list of paradigms If however the paradigm is an update to an existing paradigm it will replace the existing one but the old paradigm is also kept as a previous generation The only exception is when the paradigms are specified in their binary format i e not XML and the file or connection name of the new generation corresponds to that of the previous one This way existing models can still be opened with the legacy paradigms they were created with For new models however the current generation is used always Paradigms can be unregistered using the Remove button Note that the paradigm file is not deleted Different generations of an existing paradigm can be managed using the Purge Select button This brings up another dialog showing all the generations of the selected paradigm One option is to set the current generation the one used for creating new models The other option allows unregistering or also physically deleting one or several of the previous generations Whether the files are
182. i ms s jccsesies th ccksnstenscrt he oun a See euaeh ys death A RRE h 31 New Projects i aieia rE a A S e a AE A E 32 Editor Operat onsin eee nuts Sas A aE A a aa Gh a A N S a as 32 Editne Modes a reren a a e e A a E a Wea ether Ea 32 Miscellaneous Operations snenie eee R Eae REA E RENE 35 Help Syste Mpina e aaia r E aE E aE R EE S AEEA ES EEEE EEE Se 35 Searching Objects eee a ae e REEE EE a EEEE E EEE E a E as 35 Types Of thesearchine cniin t ea EE E TAE E E EE E Raa 36 Regular eXpresSionS eiei oaeen r E E Ae REEE SEE E TE OEE E Na 36 D fa liS mrn E E E E E E 37 Scripting IN GME wo sta sista neat E EA E E E il oben a ea aa 37 Type Inheritance 41 Type Inheritance Concepts eiernes Ea oen aa eiaa ea aaie EAr E ETE E eE A E 41 Attributes anid PrE fe O OS e E E E EEEE eT EE EES 44 Ref renc s and O EAS e castes e te E E Ea E EE aE 44 Decorator nhancements irci riri e etri aa Ea E oo REE sss aa VERES 44 Libraries 45 Model library SUppott eeens e E Ra R E EENE 45 Decorators 47 TintrO GUC th ON soci cored ccetas eed ateess Specens dodieds cdedenay EnS Oe EERE EE EE EO EERS 47 The IMgaDecorator interface ccecceecceescessceescesecesecenecseecaeeeseeeeeeeeeeeeeseeeseeeseceaeenaeeeaecaeeaeeeas 47 TMgaDecorator FUnctions csccesecesecseeeseeeseesecesecesecesecseceaeceaeceaecaeeeneeeseeeeenaeenaes 48 Using the Decorator skeleton eeececesecescecseceeeeeceeceeneecsaeceeeeesaeceeeeeenaecesaeessnees 50 Assig
183. ic Modeling Environment Workshop on Intelligent Signal Processing accepted Budapest Hungary May 17 2001 Ledeczi A Nordstrom G Karsai G Volgyesi P Maroti M On Metamodel Composition IEEE CCA 2001 CD Rom Mexico City Mexico September 5 2001 Ledeczi et al Metaprogrammable Toolkit for Model Integrated Computing Proceedings of the IEEE ECBS 99 Conference 1999 Additionally many other MIC related journal articles conferences papers and other reference materials are available from the ISIS web site accessible via the following URL http www isis vanderbilt edu Generic Modeling Environment User s Manual Appendix D References e 220 Glossary of Terms aspects The parts contained within a GME model are partitioned into viewable groups called aspects Parts may be added or deleted only from their primary aspects but may be visible in many secondary aspects CBS Computer Based System Compound model A model that can contain other objects connection A line with a particular appearance and directionality joining two atomic parts or parts contained in models In the GME connections can have domain specific attributes accessed by right clicking anywhere on the connection CORBA Common Object Request Broker Architecture COTS Commercial off the shelf software DSME Domain Specific MIPS Environment GME See Generic Model Environment GOTS Government off the shelf softw
184. ic Modeling Environment User s Manual The Generic Modeling Environment e 19 Typically objects have multiple attributes which can be set using non graphical means such as entry fields menus buttons etc The attribute values are translated into object values e g numbers strings etc and assigned to the objects The modeling paradigm defines what attributes are present for what objects the ranges of the attribute values etc Interpreting these values is left to the model interpreters though the users may create constraints using OCL for the attributes to ensure that their values are valid Examples of attributes are as follows e Data type of parameters in a signal processing paradigm e Units for process parameters in a chemical engineering paradigm e Mean time between failure specifications for components in a fault modeling paradigm Pi ic Attnbutes Preferences Properties The attribute box associated with a Parameter atom called Pi An object s attributes can be accessed by right clicking on the object and selecting Attributes from the menu causing the Attribute Browser activated Preferences Preferences are paradigm independent properties of objects The five different kinds of first class objects model atom reference connection set each have a different set of preferences The most important preference is the help URL Others include color text color line type etc Preferences are inherited fr
185. ication If the paradigm is in the testing phase it is recommended that none of the constraints are critical in order to examine constraints simply Compact view In the compact view the most important properties are shown of the current violation These are the following e Full name The concatenation of the context name with namespace and the constraint name e Description Description of the violation i e the meaning of the constraint Generic Modeling Environment User s Manual Constraint Manager e 123 e Variables Variables that are defined in the constraint it always contains the self and the project variables If there are more violations at the same time then the user can iterate over those violations using the Previous and Next buttons Constraint s name and its description Compact or detailed view gt Constraint Violations Violation Constraint meta Atom HasParent A Description Objects must have at least one parent Folder or Model Variable Object self Atom kind meta Atom path asdasd NewParadigmSheet project gme Project name asdasd Previous Next Close Abort List of violated Context sensitive and failed Constraints variable list Expression window Constraint Violations NY Violation A i Constraint qeta Atom HasParent Collapse A Description bjects must have at least one parent Folder or Model Type
186. ich equal to any lterators ocl Bag select boolExpr ocl Boolean ocl Bag Returns a bag containing all elements of the bag for which boolExpr evaluated to true ocl Bag reject boolExpr ocl Boolean ocl Bag Returns a bag containing all elements of the bag for which boolExpr evaluated to false ocl Bag collect anyExpr ocl Any ocl Bag Returns a bag containing values which are returned by anyExpr applied to each element of the bag ocl Sequence The type ocl S equence represents the mathematical concept of sequence Aliases Supertypes This type can be accessed as Sequence Its supertype is ocl Collection Operators operator sequencel ocl Sequence sequence2 ocl Sequence ocl Boolean Returns true if the size of sequencel and sequence2 are the same and if at each position the elements are equals to each other Generic Modeling Environment User s Manual Appendix B OCL and GME e 162 operator lt gt sequencel ocl Sequence sequence2 ocl Sequence ocl Boolean Returns true if size of sequencel and sequence are not the same or if at least one position exists in which elements are not equal operator sequencel ocl Sequence sequence2 ocl Sequence ocl Sequence Returns the concatenation of sequencel and sequence2 Methods ocl Sequence union sequence ocl Sequence ocl Sequence Returns the conca
187. identify objects by RelID s The identification based on RelID s works sufficiently by itself in most cases There may be exceptional situations however when RelID s need to be manually changed to provide a suitable mapping e g when an object is inadvertently deleted from a library and must be restored manually The object Properties dialog boxes available through the context menu can be used to manually change individual object RelID s When changing RelID s be aware that setting RelID s incorrectly may corrupt a whole project Generic Modeling Environment User s Manual Libraries e 46 Decorators Introduction GME v1 2 and later implements object drawing in a separate plugable COM module making domain specific visual representation a reality In earlier versions of GME one could only specify bitmap files for objects This method is still supported by the default decorator component shipped with GME 5 Replacing the default implementation basically consists of two steps First we have to create a COM based component which implements the IMgaDecorator COM interface Second we have to assign this decorator to the classes in our metamodel or for the objects in our model s if we want to override the default decorator specified in the metamodel GME instantiates a separate decorator for each object in each aspect so we have to keep our decorator code as compact as possible Decorator components always have to be in process ser
188. iew Window Help 15 x s lda axala ANBWeYS AM BMSH 2 components ge r T Name FC0s ParadigmSheet Aspect Constraints v Base N A a rN KB cropProxy isNameUnique UniqugName NotEmptyName Validilame HasPlarent HasAspect isAbstract identities FCOConstraintBase lt lt FCO gt KEY Cda NY identity gt cropProxy F forKind x identity I forKind Attributes Preferences Properties Attributes Preferences Properties Parameter list kind string if self ocllsKindOf gme Reference then Definition if kind size lt 5 then self ocldsType gme Reference J refersT of else self endif in else if kind substring kind size 5 Proxy then kind substring 0 kind size 5 else kind endif endif Context gme FCO gme FCO Context gme Project Return type string Stereotype ethod Ready EDIT 100 MetaGMEZ000 02 32 PM 4 identity and cropProxy constraint definitions in the paradigm MetaGME Syntax and semantic errors User defined constraints and constraint definitions may have syntax and semantic errors Misspelled keywords unclosed brackets missing or superfluous elements in OCL expression lead to syntax errors Semantic errors can be invalid or non existent feature calls variable redefinitions wrong or invalid parameter list or non conformant types and so on These errors are displayed imme
189. if the collection contains all elements of collection ocl Collection excludesAll collection ocl Collection ocl Boolean Returns true if the collection does not contain any elements of collection ocl Collection sum lt innerType gt This method is not implemented yet It returns the sum of all elements of the collection Operator must be defined between each element ocl Collection asSet Returns a set which contains the same elements as the collection without multiplicity If the collection is an instance of ocl Set then the method returns the set itself without creating a new set ocl Collection asSequence ocl Sequence Returns a sequence which contains the same elements as the collection The order of the elements in the returned sequence is indefinite If the collection is an instance of ocl Sequence then the method returns the sequence itself without creating a new sequence ocl Collection asBag ocl Bag Returns a bag which contains the same elements as the collection If the collection is an instance of ocl Bag then the method returns the bag itself without creating a new bag lterators ocl Collection exists boolExpr ocl Boolean ocl Boolean Returns true if boolExpr evaluates to true for at least one element of the collection Returns undefined if boolE xpr evaluates to undefined for all elements of the collection If the collection is empty it
190. igm In OCL associations appear as association ends The result of navigation over an association depends on the multiplicity of another association end and on the ordered stereotype of the association If the multiplicity is 0 1 or 1 the result is one object Otherwise the result is an ocl S equence or an ocl S et depending on whether the association is ordered or not The user can navigate from an object to the other side of the association using the role of the association end If the role is missing then the name of the type at the association end starting with a lowercase character is used as role In standard OCL if a navigation using role is ambiguous then the association end can be accessed by the name of the type at the association end If the names of the types are ambiguous as well then this navigation is not available From an association end the association class es can be accessed using the name of the association class starting with a lowercase character If the association is recursive then the role of the starting point i e association end has to follow the name of the association class in brackets If the roles are ambiguous then the association class is not accessible To navigate from the association class to association end the role of the association end has to be used If it is ambiguous then the name of the type at the association end must be used The ambiguity rules are the same as before Naviga
191. in GME n let dogs persons connectedFCOs src Partners in If Then Else Expression This expression is the well known if feature of languages with a limitation that it always has an else branch Otherwise if the condition is not satisfied the result would be unknown The If expression consists of three expressions e The condition which has to return ocl Boolean or any of its descendants if they exist Generic Modeling Environment User s Manual Appendix B OCL and GME e 137 e Two expressions with the same return type i e then and else branches If the condition evaluates to true then only the first expression will be evaluated otherwise only the second will be evaluated if lt condition gt then lt expression gt else lt expression gt endif e g if mySet gt isEmpty then 0 else mySet gt size endif lterators Although Iterator is a special feature defined by ocl Compound meta type it is discussed in this subsection because ocl Compound is defined by OCL and not by meta paradigms and because there is a special generic iterator called iterate Only ocl Collection and its descendant types have this feature An iterator can be considered to be a cycle which iterates over the elements of a compound object while it evaluates the expression obtained as an argument for each element and returns a value accumulated during the iteration Itera
192. in case the current model is an instance GME Menus On the GME Menubar the following commands are available File Project and model related commands The File menu is context sensitive with choices depending on whether or not a paradigm definition file and or project has been loaded and whether there is at least one model window open If no model window is open the following items show New Project Creates a new empty project and allows registering a new modeling paradigm discussed in detail later Open Project Opens an existing project from either a database or a binary file with the mga extension discussed in detail later Close Project Saves and closes the currently open project if any Save Project Saves the current project to disk Save Project As Saves the current project with a new name Abort Project Aborts all the changes made since last save and closes project Generic Modeling Environment User s Manual Using GME 5 e 26 Export XML GME 5 uses XML with a specific DTD as a export import file format This command saves the current project in XML format Import XML Loads a previously exported XML project file Note that the file must conform to the DTD specifications in the mga dtd file If no paradigm is loaded GME 5 tries to locate and load the corresponding paradigm definitions Update through XML Allows updating the current model in case of a paradigm change If the user has a project open in one
193. in the Model Browser The Model Editor The Editing Window When a model is selected for editing an Editor window opens up to allow editing of that model The Editor window shows the contents of the selected model in one aspect at a time Generic Modeling Environment User s Manual Using GME 5 e 25 Ri System lol x T Name System Compound Aspect SignalFlow spe Base N A Properties Attributes Preferences Annotations Registry PreProcessing Processing Insert New Model Insert New Atom Insert Ne eference Insert Insert Annotation Show Basetype Show Type Paste Paste Special A typical model Editing window with an open context menu A typical Editor window is shown above The status line near the top begins with an icon indicating whether the current model is a type T or instance I Next to it is a field indicating the model s name System in this case Next to the model s name is the kind field indicating the kind of model e g Connector Compound Network etc being edited Continuing to the right the Aspect field indicates that this model is being viewed in the SignalFlowAspect Remember a model s appearance included parts and connection types can change as different aspects are selected Finally the right side of the status line shows the base type of this model in case it is a model type if it is an archetype it does not have a base type so the field shows N A or the type model
194. inition The definition of Constraint Definitions requires that the context the return type and the expression must always be defined Due to this extension the Meta Interpreter of GME had to be slightly altered in order to better interpret the extended Constraint Functions Of course XML files exported before this modification and XMP files interpreted by the former Meta Interpreter can still be imported and used These Constraint Functions will be recognized as Method Definitions with the context of the singleton gme Project and with ocl Boolean as the return type Errors may occur however because these methods cannot be called in expressions as a function rather as a method of the predefined variable called project Therefore only these slight modifications must be made manually Using Constraints in GME As an expert metamodeler knows in the paradigms there are rules that cannot be expressed only with class diagrams These constraints used to be written in informal language i e annotations and the modeler interpreted it freely even she might have misunderstood the semantics and or the syntax In GME 5 we support a constraint language which is compliant with OCL 1 4 Because of this more sophisticated rules can be written and built into the paradigms Constraints defined by the Paradigm Constraints can be associated only to kinds In order to do this we have to switch to the Constraints aspect in the Metamodeling Envir
195. ion necessary to create models of systems within a particular domain MultiGraph Architecture A toolset for creating domain specific modeling environments OCL Object Constraint Language a companion language to the UML paradigm See modeling paradigm POSIX Portable Operating System Interface An IEEE standard designed to facilitate application portability Primitive model A model that cannot contain other models Reference parts Objects that refer to i e point to other objects atomic parts or models References See Reference parts Generic Modeling Environment User s Manual Glossary of Terms e 223
196. ion will be associated only with that kind and not with its descendants This is because there is no such a mechanism mentioned in the previous point Therefore if the modeler wants to have a definition attached to more than one kind she must define a meta kind as the context of the definition Though the propagating mechanism can be implemented the usage of Constraint Definitions would be clumsy the user always would have to cast because of the lost inheritance information Retained Meta Kind Features For the time being all features particularly methods that are defined by the former language of GME constraints called MCL are retained in this implementation with some improvements The reason for this decision was that the semantic checking of OCL expressions always requires a well formed and valid paradigm naturally during the time of meta modeling the paradigm is neither well formed nor valid During meta modeling the task of gathering all the information that the checking would require either writing a new component that always serves the valid and well formed part of the paradigm or integrating the Expression Checker and Meta Interpreter In the latter case only syntax checking would be performed at meta modeling time and the semantic checking only could be done after the interpretation In case a solution exists all features except for some e g gme Object name gme Object isNull will be obsolete as well bec
197. ious contexts e g analysis software synthesis etc Some modeling paradigms have several kinds of models For instance The Generic Modeling Environment e 14 Model with atomic parts as link Time Freq Default icon for K Generic Modeling Environment User s Manual ports atoms e in a signal processing paradigm there can be Primitive Blocks for simple operators and Compound Blocks which may contain both primitive blocks and other compound blocks for compound operators e in a multiprocessor architecture modeling paradigm there can be models for computational Nodes and models for Networks formed from those nodes A model typically has parts other objects contained within the model Parts come in these varieties e atoms or atomic parts e other models e references which can be thought of as pointers to other objects e sets which can contain other parts and e connections If a model contains parts we say that the model is the parent of its parts Parts can have various attributes A special attribute associated with atomic parts allows them to be designated as link parts Link parts act as connection points between models usually used to indicate some form of association relationship or dataflow between two or more models Models containing other models as parts are called compound models Models that cannot contain other models are called primitive models If a compound model can contain other
198. is not really a constraint It can be considered an extension of a type in the aspect of constraints An attribute definition is an attribute of a type that can be accessed only in OCL constraints It has the same properties as a well known attribute It always has a name and the returned type The name must not conflict with other attributes definitions attributes of the type or roles and names of types which can be accessed through navigation Generic Modeling Environment User s Manual Appendix B OCL and GME e 133 context lt typeName gt lt attributeName gt lt typeName gt defattribute lt expression gt e g context Person friendNames Set defattribute Method Definition This feature of OCL is included here because constraint types must be dealt with in a uniform way However a Method Definition is not really a constraint It can be considered as an extension of a type in the aspect of constraints A method definition is a method of a type that can be accessed only in OCL constraints It has the same properties as a well known method It always has a name and the returned type and it may have parameters The names of the parameters must be unique and cannot be Self The name must not conflict with other method definitions and methods of the type context lt typeName gt lt methodName gt lt paramName gt lt paramType gt
199. is required she may set the constraint to critical setting Priority value to 1 In this case the constraint will be evaluated when an appropriate event is sent and the modeler can only abort the last operation if the constraint is not satisfied amp cmez000 5F2000 15 x 4 Ele Edit view Window Help 18 x s P BAK NAA HABE S AIMB MBO 2 _ components 4 R T Name SF2000 ParadigmSheet Aspect Constraints 7 Base N A ia a AtLeastOnePart I for Kind Folder Processing P z taf oldars eeModalss Attributes Preferences Properties v Compounds must have parts 4 self parts gt size gt 0 8 Primitive Compound lt lt Model gt gt lt Model gt Firing enum AtLeastOnePart Script field Priority field Signal DataflowConn lt lt Atom gt gt lt lt Connection gt ParameterConn s lt Connection gt gt InputSignal OutputSignal lt sAtom gt gt lt lt Atom gt gt EDIT 100 MetaGME2000 12 35 PM Constraint associated to the Compound kind in the SF paradigm Constraint Definitions Functions In GME 5 the former Constraint Function is improved to comply with Constraint Definitions introduced by OCL 2 0 The two attributes of a Constraint Function called Parameter list and Definition are retained and have the same syntax and functionality The expression of the Definition can
200. isplayed in the model editor window The second operation sets the name visibility std string getHelpURL const void setHelpURL const std string amp strURL Returns and sets the Help URL std set lt BON AutoRouterPref gt getInAutoRouterPref const void setInAutoRouterPref const std set lt BON AutoRouterPref gt amp setPrefs Returns and sets the AutoRouter preference of the fco for those connections whose source connection end is the fco std set lt BON AutoRouterPref gt getOutAutoRouterPref const void setOutAutoRouterPref const std set lt BON AutoRouterPref gt amp setPrefs Returns and sets the AutoRouter preference of the fco for those connections whose destination connection end is the fco BON FCOExRegistryNode This class represents the registry node for atoms models sets and references Base Classes The base class is BON F COR egistryNode Methods BON Point getLocation const MON Aspect amp aspect MON Aspect const BON Point getLocation const std string amp strAspect const void setLocation const BON Point amp point const MON Aspect amp aspect MON Aspect void setLocation const BON Point amp point const std string amp strAspect Return and sets the location of the fco considering the passed aspect if it is not null If aspect is null or strAspect is empty then the first operation returns the first valid location re
201. ith the standard OCL 1 4 specification Here we enumerate the features of the Constraint Manager without delving Standard OCL features The following features are new regarding the language MCL which was used earlier to write constraints in GME e The language is a typed language e Undefined is introduced as a value e Variable declaration is supported Performance and readability can be taken into consideration e All OCL operators are implemented e Operators have the right precedence and associativity e All features of predefined primitive types are implemented e Types can be referred as ocl Type and not as ocl String Namespaces can be used e Typecast is implemented e All compound types of OCL are implemented e Almost all predefined iterators exception is sortedBy as well as the generic iterate are supported e Implicit variables are implemented e More sophisticated features and expression resolution are supported e Short circuit operators and iterators are supported e Features defined by MCL are improved More security is provided but these calls remain insecure e The meta kind features are linked to the appropriate meta kinds Generic Modeling Environment User s Manual Constraint Manager e 111 e Predefined OCL types are extended with some useful features e Standard access of attributes is supported New and Improved features in GME 5 The following features are new considering the functi
202. ject s dynamic type e The type of the objects overloads or overrides a feature of a supertype in a certain way e g by inheritance To access the supertype s functionality the type of the object must be up cast Generic Modeling Environment User s Manual Appendix B OCL and GME e 134 Type casting is defined by the meta type ocl Any It declares the type cast operator to be a method called oclAsType This method returns the same object but with the type it obtains as an argument To cast one object s type to another the former type has to conform to the new type up casting or the new type has to conform to the former type down casting When these types cannot conform it is a type conformance error and an exception is thrown and undefined is returned The explicit use of oclAsType is not required because some expressions have it implicitly e g let expressions and iterators Undefined In OCL 1 4 undefined is a special object which cannot be written as literal in this implementation During evaluation undefined can be returned if the result of a feature call is undefined or if an exception is thrown These two aspects of undefined must be distinguished in the new version i e undefined is the sole instance of ocl Object and a new type called ocl Error must be introduced in order to denote exceptions thrown during the evaluation In this implementation undefined is considered first and foremost as an error
203. l Integer ocl Sequence Returns the sub sequence of the sequence starting at position lower up to position upper if upper is specified otherwise up to the end of the sequence The first position is 0 Returns undefined and an exception is thrown if lower is less than 0 lower greater than upper or if lower or upper are equal to or greater than the size of the sequence ocl Sequence ineluding any ocl Any ocl Sequence Returns a sequence containing any the position of insertion is indefinite ocl Sequence excluding any ocl Any ocl Sequence Returns a sequence which does not contain any objects which are equal to any Iterators ocl Sequence select boolExpr ocl Boolean ocl Sequence Returns a sequence containing all elements for which boolE xpr evaluated to true ocl Sequence reject boolExpr ocl Boolean ocl Sequence Returns a sequence containing all elements for which boolE xpr evaluated to false ocl Sequence collect anyExpr ocl Any ocl Sequence Returns a sequence containing elements which are returned by anyExpr applied to each element of the sequence GME Kinds and Meta Kinds This section discusses the meta kinds and predefined kinds of GME and all features are described in detail Features which are already deprecated are marked with D and colored to red All features throw an exception if the object is null gme Object The
204. l Sequence and ocl Bag Aliases Supertypes This type can be accessed as Collection Its supertype is ocl Any Attributes ocl Collection size ocl Integer Returns the number of elements in the collection Methods There are methods which depend on the equality In these methods equality is used rather than identity Some methods return different types depending on the context For example if the user includes a real in a collection containing integers then the method returns a collection of real numbers because the common ascendant type of ocl Real and ocl Integer is ocl Real This effect comes from OCL 1 4 inconsistency In OCL 2 0 this aspect of collections is better defined ocl Collection isEmpty ocl Boolean Returns true if the collection does not contain any elements ocl Collection notEmpty ocl Boolean Returns true if the collection contains at least one element ocl Collection ineludes any ocl Any ocl Boolean Returns true if the collection contains any Generic Modeling Environment User s Manual Appendix B OCL and GME e 157 ocl Collection excludes any ocl Any ocl Boolean Returns true if the collection does not contain any ocl Collection count any ocl Any ocl Integer Returns the number of times that any occurs in the collection ocl Collection includesAll collection ocl Collection ocl Boolean Returns true
205. l found in Visual Studio e Give a new value to COCLASS_NAME at least replace the string between the parenthesis e Give a new value to COCLASS_PROGID at least replace the last tag of the string e Give anew value to DECORATOR NAME e Set GME_INTERFACES_BASE to point to the interfaces directory of your GME installation You have to make these modifications only once When you are upgrading your decorator SDK create a backup of your DecoratorConfig h and restore it after the upgrade Assigning decorators to objects You can assign decorators to objects in your meta model or even later in your model s In the MetaGME environment there is a Decorator attribute for each non connection FCO where you can specify a ProgID along with optional parameter value pairs for a class The format of this string is as follows Generic Modeling Environment User s Manual Decorators 50 ProgID paraml valuel param2 value2 e g MGA Decorator MetaDecorator showattributes false showabstract true In your models all the non connection FCOs have a preference setting called Decorator The format of this string is identical to the one in the meta model Generic Modeling Environment User s Manual Decorators e 51 Metamodeling Environment Introduction The metamodeling environment has been extended with a new decorator component in version 1 2 or later It displays UML classes including their stereotypes and attributes Proxies also
206. le should be BON FCOInt interface class but it is th same BON FCOImpl e Wrapper layer 2 layer The top most layer consists the wrappers which handles the objects references instead of the user and serves pointer like interface When a user uses BON2 she always has to deal with these classes Correspondent files are MON h BON h Example BON FCO wrapper class Wrapper Classes The wrappers are created in order to ease to implement components and let the user concentrate only the interpreter writing First of all wrappers should be considered as special pointers i e in the programming terminology smart pointers which hold a pointer to a real object and if all direct or indirect references are released to the real object they disposes the object automatically Consequently in the aspect of a component implementor there is no difference between to wrapper object if they hold pointer to the relevant real object That is why in lots of cases there is no point to create wrapper objects dinamically or get the address of them However it is not prohibited it is not recommended because if the user did not dispose only one wrapper pointer memory leak will be the result because of the dependencies it can be very serious Generic Modeling Environment User s Manual High Level Component Interface e 89 Of course wrapper classes make available the relevant object s pointers because they serve the specific interface of the class it
207. lized classes will be instantiated when your interpreter executes The output consists of the skeleton class definitions and their implementation in two files The filenames are formed based on the paradigm name appended with the string BonExtension A skeleton visitor class and a log file is generated also in the same directory which has the name of the paradigm appended by the Visitor and BonExt log strings respectively We will discuss in detail the content of the class extensions header file Naming convention used The plain names will be used for FCOs and Folders Attributes Since GME checks the names of the fore mentioned objects these names are usually valid identifiers for C compilers However in case of EnumAttributes the enumerated items will be encapsulated by a C enumeration type These fields may be defined without too many restrictions during meta modeling so a name validation takes place converting non alphanumeric characters to underscores If the enumeration value starts with a digit a leading underscore will be inserted In order to avoid name conflicts e g in case default name is used a Connection kind may be named Connection the specialized classes will be part of a namespace generated based on the validated paradigm name appended by the _BON string Generic Modeling Environment User s Manual High Level Component Interface e 106 Below are some examples generated based on the SF paradig
208. ll user defined constraints are fixed and cannot be changed This allows the user to create libraries that force additional well formedness or validity as well Types and Constraints Expressions In GME all types of available constraints equation of a constraint or a constraint definition contain another predefined variable called project in addition to self Through project the user can obtain all instances of a kind and attach constraint definitions to them The instances should be associated with the paradigm itself rather than with the particular kind of the paradigm Generic Modeling Environment User s Manual Constraint Manager e 115 Type Resolution In GME namespaces are used to refer to kinds meta kinds predefined OCL types and predefined GME kinds unambiguously If the user does not use namespace than the type resolution is well defined The order of resolution e Look for a kind defined in the paradigm e Look for a meta kind defined by MetaGME e Look for a predefined OCL type For example be careful when using ocl Set without namespace because it is first resolved in a meta kind gme Set The following is a list of pre existing namespaces e Predefined OCL types are in the ocl namespace e Predefined meta kinds of GME are in the gme namespace e Kinds defined in the paradigm can be referred to unambiguously using the namespace meta Invariants In GME only invariant constraints can be written although a GME
209. m Processing and Compound are model kinds in this paradigm namespace SF_BON DECLARE_ABSTRACT_BONEXTENSION Model ProcessingImpl Processing DECLARE_BONEXTENSION Processing CompoundImpl Compound class ProcessingImpl public ModelImpl public std set lt InputSignals gt getInputSignals std set lt OutputSignals gt getOutputSignals std set lt Signals gt gets class CompoundImpl public ProcessingImpl public kind and role getters std set lt Processing gt getParts i end namespace Processing with Model stereotype has no ancestors in the metamodel so it derives from the BON ModelImpl class Compound derives from Processing so this will be reflected in the generated skeleton as well Container kinds like Models Sets and Folders will have specialized get methods returning the contained roles in case of models and kinds in case of sets folders The Compound class getParts method returns a set of Processing instances model kind so users don t have to deal with the conversion from BON Model to SF_BON Processing type since the method does this task The method name is based on the role name Parts see containment relation between Compound and Processing The Processing class has three get methods which are related two get methods getInputSignals getOutputSignals which return the contained objects having InputSignals and OutputSignals role and an aggrega
210. m2 ocl Boolean ocl Boolean operator amp amp booll ocl Boolean bool2 ocl Boolean ocl Boolean Returns true if booll and bool2 are true Returns undefined if booll or bool2 are undefined Operator amp amp is a short circuit operator If booll is false or undefined bool2 will not be evaluated operator or booll ocl Boolean enum2 ocl Boolean ocl Boolean operator booll ocl Boolean bool2 ocl Boolean ocl Boolean Returns true if booll or bool2 are true Returns undefined if booll and bool2 are undefined Operator is a short circuit operator If booll is true bool2 will not be evaluated Generic Modeling Environment User s Manual Appendix B OCL and GME e 152 operator implies booll ocl Boolean enum2 ocl Boolean ocl Boolean operator gt booll ocl Boolean bool2 ocl Boolean ocl Boolean Returns true if booll is false or if both operands are true Returns undefined if booll or bool2 are undefined Operator gt is a short circuit operator If booll is false or undefined bool2 will not be evaluated operator not bool ocl Boolean ocl Boolean Returns true if bool is false Returns undefined if bool is undefined ocl Real The type ocl Real represents the mathematical concept of real Aliases Supertypes This type can be accessed as real or double Its supertype is ocl Any Operators operator re
211. mapping providing precise control over what aspect of a model is shown in an aspect of the containing model This is advanced rarely used usually feature is typically applied in case a container and a contained models have disjoint aspect sets Specifying aspect mapping would be to cumbersome in a UML like graphical language The metamodeling interpreter allows specifying this information in a dialog box described in detail later Composing Metamodels The composable metamodeling environment released with GME v1 1 supports metamodel composition First it supports multiple paradigm sheets Unlike most UML editors where boxes representing classes are tied together by name GME 5 uses references They are called proxies Any UML class atom can have multiple proxies referring to it These references are visualized by a curved arrow inside the regular UML class icon The atom and all its proxies represent the same UML class Operators In addition to improving the usability of the environment and the readability of the metamodels the primary motivation behind composable metamodeling is to support the reuse of existing metamodels and eventually to create extensive metamodel libraries However this mandates that existing metamodels remain intact in the composition so that changes can propagate to the metamodels where they are used The above requirement and limitations of UML made it necessary to develop three operators for use in combining met
212. methods for models set member get methods for set The pup and Eup standing for begin user part end user part comments are intended to provide a space where the user may add her own methods and members If the user decides to regenerate the skeleton i e the paradigm changes she won t have to insert once again her own method and member definitions into the skeleton class definitions The BON Extender interpreter will parse for these special comments inside class definitions and it will insert the user defined part into the new generated header file This header file contains two global BUP EUP pairs which are intended to give a place for the user s class definitions if any These global comments have to start on the first character of the line The BUP EUP comments inside a class are not limited such way These special comments are inserted only in the generated header file Generic Modeling Environment User s Manual High Level Component Interface e 108 Limited extension It can happen that the user doesn t intend to work with all classes generated for a paradigm i e the hardware definition part may be indifferent for implementer since her interpreter is concentrating on the dataflow part The Select classes to extend dialogue that appears during generation is intended for such cases It has listed all the classes which will be generated by default If an object kind is selected for extension
213. n case of root this pointer is null bool isRoot const Returns true if the node is root std string getName const Returns the name of the registry node if the node is root it is an empty string BON RegistryNodeStatus getStatus const Returns the status of the value The result is similar to BON Attribute get tatus std string getValue const long getIntegerValue const double getRealValue const bool getBoolValue const Returns the value of the registry node std string setValue const std string amp strValue long setIntegerValue long lValue double setRealValue double dValue bool setBoolValue bool bvalue The operation sets the registry value void clear It sets the value to undefined Methods BON Project getProject const Returns the project to which the node belongs Generic Modeling Environment User s Manual Appendix C BON and MON e 212 BON Object getObject const Returns the object to whose registry tree the node resides in std string getPath const Returns the path of the registry node std string getValueByPath const std string amp strPath const It returns the value of the appropriate descendant registry node strPath must be a relative path to this node void setValueByPath const std string amp strPath const std string amp strValue i It sets the value of the appropriate descendant registry node strPa
214. n the Add Connection Mode then left clicking the source object followed by left clicking on the destination object It is not necessary to go to this mode to create a connection Instead in Edit mode right clicking on the desired source of a new connection and selecting Connect in the context menu changes the cursor to the connect cursor A connection will be made to the object that is left clicked next Or by selecting the Connect command on the destination object as well Note that any other operation such as mode change window change new object creation cancels the instant connection operation Remove Connection Mode By placing the graphical editor in the Remove Connection Mode connections between objects can be removed by simply left clicking on the connection itself or the source and or destination parts Set Mode Set parts are added to a model just like any other part However their members can only be specified when the editor is in Set Mode Once the editor is in this mode right clicking a set will cause all parts even connections in the model that are not part of the given set to be grayed out Left clicking object toggles their membership in the set As they are added removed to the set they regain lose their color and appearance Zoom Mode The Zoom Mode allows the user the view the models at different levels of magnification The supported range is between 10 and 300 Left clicking anywhere in a model wind
215. nSignal cloning clonedInSignal object 4 times with different names for i in range 5 it DuplicateFCO clonedInSignalPtr twiceClonedInSignal str i cloning twiceClonedInSignal2 object using the it Child method it DuplicateFCO it Child twiceClonedInSignal2 thriceClonedInSignal Some other MGA related operations the user may use are Create Refer Include Connect ConnectThruPort SetAttribute SubType Instantiate as well as their FCO suffixed counterparts The name based Duplicate method requires that InSignal must be present in the active model the pointer based DuplicateFCO method does not enforce this allowing the clonable object to be in a different model in the same project Exception to this rule is IncludeFCO requiring that the set object and its to be member must be in the same model All these operations i e Duplicate IncludeFCO Connect etc use methods defined in IMgaFCO or IMgaModel interfaces that require to be executed inside transactions That is why if no user transaction was active the method does the duplication or connecting task between Begin and CommitTransaction calls If the Generic Modeling Environment User s Manual Using GME 5 e 39 user initiates this command from a transaction it is detected and another transaction is not started and when the method exits the transaction remains open However to help users manage transactions and let them avoi
216. ng kindName The CBuilderObject is the base class for several other classes It provides a set of common functionality for models atoms references sets and connections Some of the functions need some explanation The GetAttribute functions return true when their successfully retrieved the value of attribute whose name was supplied in the name argument If the type of the val argument does not match the attribute or the wrong name was provided the function return false For field and page attributes the type matches that of specified in the meta for menus it is a CString and for toggle switches it is a bool The GetxxxAttributeNames functions return the list of names of attributes the given object has This helps writing paradigm independent components plug ins Generic Modeling Environment User s Manual High Level Component Interface e 72 The GetReferencedBy function returns the list of references that refer to the given object renamed in v1 2 from GetReferences The GetInConnections GetOutConnection functions return the list of incoming outgoing connections from the given object The string argument specifies the name of the connection kind as specified by the modeling paradigm The GetInConnectedObjects GetOutConnectedObjects functions return a list of objects instead The GetDirectInConnections GetDirectOutConnections build a tree The root of the tree is the given object the edges of the tree are the given kind o
217. ning decorators to objects cecceecceesceecceesceseeesecenecseecaeeeaeeeneeseeseeeeeeseceseceseenaeeaecneeeneeses 50 Metamodeling Environment 52 TintrO due thm s ja vess deen sits Sevk pace eawoes chan seuate ee ceeidadews a outs cies E AA EOAR NENES EN 52 Step by step guide to basic metamodeling eseeseeseeeeeseseeretststerersrststerreteesstserrterersrsesrerreree 52 Para Qi otis oine ire ee snra ra AEE shies rE A Ea RA EAT 52 Foldet en r E A E e E NR 32 AE O A R E A E utinaainion at 53 PATON ENEA EAE EEEE S E SEE 54 AE aa Te S A E A 54 Cone NON e r e E E a T E E E R 55 DEt EEE A A E A aee om tanta poaedanaon at 56 Model sanana esr e Ea TEA oie vietgent shay io E T AEA EAA E TEE 57 AtDUES aeneae Eee EE T EAE E A EET E E EE 57 MHEtAN CO ss5 e E E at aad E E a E 57 a e A E E E ened aches laeesess 58 Composing MetamodelS s in heel due dain ais din AEE AA 58 QOPELALOLS issar heas EE aE Sebvhes Ea T Ee E E AEE SE aE 58 Generating the Target Modeling Paradigm eseeesesesseeereeesiessssrsrrerrsrsrsesrererstsesesrerrereees 60 Aspect Mapping wsish ie tition aE E e E E E E E E TR E a 60 A Oe GUE a a a a 60 Semantics Guide to Metamodeling sseeeseesesessseseeesresesrststerreretsseststerststsseserterretsesseseerreret 67 High Level Component Interface 69 Introduction to the Component Interface ee eeesseeecseeeecsseeeceaeceeesecseesecneeecsaeeeesaesaeeseenees 69 Builder Object Network version 1 0 0 ceeceeesescssecse
218. nnLinks const std string amp strConnection bIncludeRefs true const MON Aspect amp aspect MON Aspect const These operations have the same behaviour as getConnLinks except of that no connection role can be specified getInConnLinks supplies dst role getOutConnLinks supplies src role implicitly These operations can be used only for simple connections i e connections having exactly two connection ends otherwise BON Exception is thrown std multiset lt BON ConnectionEnd gt getConnEndsAs const MON Connection amp meta MON Connection const std string amp strRole bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const std multiset lt BON ConnectionEnd gt getConnEndsAs const std string amp strConnection const std string amp strRole bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const These operations are implemented for the sake of convenience They return a multiset containing those connection ends which are connected to this connection end If strRole is specified then only those connections are regarded in which the connection end takes part with connection role strRole meta strConnection blncludeRefs and aspect parameters are used in the same way as getConnLinks operations use them std multiset lt BON ConnectionEnd gt getConnEnds const MON Connection amp meta MON Connection const std string am
219. normally not modified by the user and for this reason they are generated with read only attribute ConfigureComponent exe the application that brings up the Component Configurator dialog box can be run any time to change component attributes The output is generated to the file specified by the f command line argument It defaults to ComponentConfig h The appendix describes the procedure in detail After you completed the steps outlined there you can build the new component dll This component dll is registered and associated with the paradigms you specify When you edit a model using one of these paradigms and press the interpret button you launch this component if there are more than one components associated with the given paradigm a menu will pop up to choose from The dll will be located and loaded at this time Extending the Component Interface using the BON Extender interpreter After writing a few interpreters one can realize that the extension of the Component Interface as shown above is a repetitive and boring task The BON Extender interpreter is aimed to automate this process Based on a specific metamodel a domain specific skeleton code is generated Thus when you write your interpreter in the specific paradigm you will have only to enrich the generated classes with the functionalities you want The BON Extender interpreter creates specialized class definitions for all object kinds even for abstract ones These specia
220. nts to create a BON class which extends the model s functionality with an operation The operation returns a set containing Compound objects having at least two children Realize the Implementation Class The realization of a BON extension must be done in the extension layer i e the implementation class must be derived In order to do this the following rules are important e Although the implementor extends the implementation class e The user always must use the appropiate wrapper classes and not the implementations e If some initialization is required then the initialize method must be overridden e In case of interpreters in lost of cases there is no point to cache the immediate and unfiltered result of a generic call because only the wrappers are always created the objects exist while the component runs e If BON objects are cached by the extension additionally it counts as additional resource and the containers has to be emptied and objects must be set to null in the overriden finalize method e It is good practice to concatenate Impl string to the name of the implementation class The used appropriate wrapper class uses the name without Impl Here is our Compound implementation Generic Modeling Environment User s Manual High Level Component Interface e 94 class CompoundImp1l public BON ModelImpl extending the implementation class public void initialize cache the proper chil
221. o std string getPortIcon const void setPortIcon const std string amp strName const Returns and sets the filename of the port icon of the fco std string getSubTypeIcon const void setSubTypeIcon const std string amp strName const Returns and sets the filename of the icon of the fco which is used only for subtypes Generic Modeling Environment User s Manual Appendix C BON and MON e 215 std string getInstanceIcon const void setInstanceIcon const std string amp strName const Returns and sets the filename of the icon of the fco which is used only for isntances BON ModelRegistryNode This class represents the registry node for models only Base Classes The base class is BON F COExRegistryNode Methods COLORREF getBorderColor const void setBorderColor COLORREF color Returns and sets the border color of the model COLORREF getBackgroundColor const void setBackgroundColor COLORREF color Returns and sets the background color of the model with which the model editor is filled when the model is open COLORREF getPortNameColor const void setPortNameColor COLORREF color Returns and set the color of the label of the ports BON ConnectionRegistryNode This class represents the registry node for connections Base Classes The base class is BON F COR egistryNode Methods BON LineType getLineType const void setLineType BON LineType eTyp
222. o be specified e The Value field shall not be considered as a regular expression for searching the attribute value The value specified has to be exact e Taking everything to the extreme as soon as the search tool is invoked on pressing the Search button all the eligible objects will be returned if no extra inputs are specified Scripting in GME Beginning GME version 5 scripting has been introduced In the bottom part of the console window the user can type in her instructions programs The user preferred scripting language can be set in the File Settings menu The default scripting engine is JScript however in this document Python script samples will be used Python AXScript 2 Generic Modeling Environment User s Manual Using GME 5 e 37 Scripting pee sciptengine VBScrpt VBScrpt Encode Python AXScript 2 JScript JScript Encode Per cipt SignedlavaS cript Signedy BS cript X Script Engine selection The scripting feature enables the user to automate several operations in the GME world These may include GUI related operations i e Export XML or MGA related model inquires modifications operating on the currently opened model gme ConsoleMessagef Hello World 1 Ready EDIT 100 SF 12 18 PM Hello World in GME Beside the features provided by the selected scripting language built in methods variables or packages three GME specific objects are available in the GME scripting environm
223. o the set whose kind matches to the specified one If strRole is not empty then the connection role with which the connection is attached to the connection end must match to strR ole If bincludeR efs is false then only those connections are included which are attached to only this connection end If the value is true then the result set is wider If the connection end is an fco those connections are included which are attached directly to the fco or to one of its reference ports If the connection end is a reference port the connections which are attached to the port or to one of its descendant reference ports are returned If aspect is not null then the result is filtered with the aspect i e the connections must have a containment role with which the connection is visible in the aspect or they must be child of a folder Generic Modeling Environment User s Manual Appendix C BON and MON e 194 set lt BON Connection gt getInConnLinks const MON Connection amp meta Connection bool bIncludeRefs true const MON Aspect amp aspect Aspect const set lt BON Connection gt getInConnLinks const std string amp strConnection bIncludeRefs true const MON Aspect amp aspect MON Aspect const set lt BON Connection gt getOutConnLinks const MON Connection amp meta Connection bool bIncludeRefs true const MON Aspect amp aspect Aspect const set lt BON Connection gt getOutCo
224. object is retrieved itself and what kind of relationships they can take part in When we retrieve an object e g the root folder of the project at the first time we create the first reference to the object Because the singleton project contains all objects in the project we create an indirect reference to the project via the object The projects will be disposed if and only if all references direct and indirect are disposed As we can see later this type of object management works only if the references do not form a directed cycle In BON by default there are only DAGs Directed Acyclic Graphs in which the destruction of the BON objects are garanteed However when a user extends BON classes she may store wrapper instances i e references to BON implementation instances thus it is likely that reference cycles will occur To avoid this the user has to set everything to null manually in the finalization Extending Interpreters The lifecycle of GME components is the same After they are intialized they start to run do their tasks and terminates disposing the acquired resources During the initialization all additional resources of the component of the user must be obtained and created This can be done completed the initialize method of BON Component class When this code part runs the singleton project for the IMgaProject and the whole meta object network are already created During the finalization all resource must be released
225. ods requires a set of pairs of the connection role name and the connection end static BON Connection createAs const BON Model amp parent const std set lt BON Connection Pair gt amp ends const std string amp strRole static BON Connection createAs const BON Model amp parent const BON ConnectionEnd amp srcEnd const BON ConnectionEnd amp dstEnd const std string amp strRole The methods create a new connection in parent as a child If strRole is an empty string and the model cannot contain connections or connections with the specified containment role strRole cannot be placed into the model exception is thrown The srcEnd and dstEnd provide the source and the destination for the connection and they must not be null Another form of the method requires a set of pairs of the connection role name and the connection end Attributes BON ConnectionPtr getConnectionI const This call returns the corresponding IMgaConnection COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations MON Connection getConnectionMeta const Returns the appropriate MON Connection of the connection Methods std multiset lt BON ConnectionEnd gt getConnEnds const MON FCO amp meta MON FCO const std multiset lt BON ConnectionEnd gt getConnEnds const std string amp strFCO const Returns
226. ol Car by changing an attribute Should an attribute change in V6 in Car propagate down to V6 in Cool Car and below No that attribute has been overridden and the dependency chain broken with respect to that attribute However if the same attribute is changed in V6 in Cool Car that should propagate down to V6 in My Car unless it has already been overridden there The same logic applies to preferences The figure below shows the same set of models but only from the pure type inheritance perspective Generic Modeling Environment User s Manual Type Inheritance e 42 IT Engine Car ee ian cer ACar IT I ABS My Car ra TERN ST I SubTypeOf ass ABSi reS I ABSXj Type Inheritance Hierarchy Let s summarize the rules of type inheritance in GME 5 Parts cannot be deleted in subtypes or instances Parts can be added in subtypes only Part changes in a type model propagate down the type inheritance hierarchy unconditionally Aggregation and type inheritance introduce dependency chains between models Attribute and preference changes set membership modification and reference redirection propagate down the dependency chain If a particular setting has been overridden in a certain model in the dependency chain that breaks the chain for that setting Changes up in the chain do not propagate to the given model or below The rules for reference redirection are as follows A null referen
227. om the paradigm definition through type inheritance unless this chain is explicitly broken by overriding an inherited value For more details see the chapter on type inheritance Preferences are accessible through the context menus and for the current model through the Edit menu Default preferences can be specified in the paradigm definition file XML User settings can be applied to either the current object or the kind of object globally in the project The checkbox in the preferences dialog box specifies this scope information If the for Kind checkbox is set the information is stored in the compiled binary paradigm definition file not in the XML document This means that a subsequent parsing of the XML file overwrites preference settings This limitation will be eliminated in a later release of GME 5 Even when the global scope is selected this only applies to objects that themselves or any of their ancestors have not overridden the given preference Generic Modeling Environment User s Manual The Generic Modeling Environment e 20 Using GME 5 GME 5 Interfaces The GME interacts with the user through two major interfaces e the Model Browser and e the Graphical Editor Models are stored in a model database and are organized into projects A project is a group of models created using a particular modeling paradigm Within a project the models are further organized into modeling folders Folders themselves and models in
228. omponent h and component cpp files are the ones that the component writer needs to expand to implement the desired functionality Generic Modeling Environment User s Manual High Level Component Interface e 71 Component Interface CBuilderObject CBuilder CBuilderFolder I I l CBuilderModel CBuilderAtom CBuilderModelReference CBuilderAtomReference Ceuli tanadon amas P AEEA Class diagram of Builder Object Network The simple class structure of the component interface is shown below Note that each class is a derivative of the standard MFC CObject class As noted before the single instance of the CBuilder class provides a top level entry point into the builder object network It provides access to the model folders and supplies the name of the current project The public interface of the CBuilder class is shown below class CBuilder public CObject public CBuilderFolder GetRootFolder const const CBuilderFolderList GetFolders const CBuilderFolder GetFolder CString amp name const CString GetProjectName const The CBuilderFolder class provides access to the root models of the given folder It can also be used to create new root models class CBuilderFolder public CObject public const CString amp GetName const const CBuilderModelList GetRootModels const const CBuilderFolderList GetSubFolders const CBuilderModel GetRootModel CString amp name const CBuilderModel CreateNewModel CStri
229. on of the database connection to the database created above A DSN identifies the server machine and the name of the database along with the username and password and some communication parameters An ODBC DSN can be stored as a regular file User DSN or in the registry System DSN It is recommended to create a system wide DSN 1 Open Control Panel Administrative Tools Data Sources ODBC 2 Select the System DSN or User DSN tab on the dialog box 3 Click Add and select the SQL Server driver Give a name and optionally a description to your DSN and specify the SQL server insance you want to connect to Press Next 4 Based on the server setup you should select Windows NT or SQL server authentication GME was tested primarily with SQL based Generic Modeling Environment User s Manual Appendix A Database Setup e 129 authetication Specify the username and password if SQL server authentication is selected Click Next 5 If at this point you cannot continue due to some error ask your SQL server administrator for help 6 Set the Default database to the database containing the project Proceed through the next few dialog boxes by accepting the default options Test the data source when given the choice and complete the setup of the DSN Preparing GME for multiuser access With multiuser access it is essential to use exactly the same paradigm on each client machine To achieve this an mta binary paradigm description
230. onality of the former version of Constraint Manager e All former features and functionality are still available although they are either deprecated or improved e New kind gme Project is introduced New predefined variable called project is available in expressions e The Constraint Function is made to be compliant with Constraint Definitions defined by OCL 2 0 e More sophisticated error detection at syntax and semantic checking e More detailed report about constraint violations e User friendly dialogs reporting errors and violations e The state of the evaluation process is visible however it cannot be interrupted yet e The Constraint Browser displays all constraints even if a constraint has errors e The model is maintained in a clean state deleted user constraints and enabling information are always eliminated e The interface of constraint enabling functionality fits the concept of kinds types subtypes and instances i e type inheritance Limitations and Special Issues Due to some special properties of the GME Meta Modeling environment certain extensions and limitations exist These are discussed below Inheritance at Meta Modeling Time GME specifies three kinds of inheritance standard implementation and interface inheritance But none of these are part of GME Meta i e meta information generated by Meta Interpreter Inheritance is defined only to help the meta modeler and to facilitate her work Cons
231. ondition depends on the value of the Depth attribute This attribute applies only to Models only e 0 the constraint will be evaluated if and only if the context s object receives events specified by the events attributes e 1 the constraint will be evaluated if the context s object and or its immediate children receive events specified by the events attributes This is the default value e any the constraint will be evaluated if the context s object and or any of its descendants receive events specified by the events attributes Constraint Definitions In the former version of the Constraint Manager only Constraint Functions could be defined They were similar to Constraint Method Definitions with the limitation that they only could return ocl Boolean In this implementation the Constraint Function is updated to be compliant with the Constraint Definitions specified by OCL 2 0 The set of the attributes of the former Constraint Function is extended The attributes include the following Generic Modeling Environment User s Manual Constraint Manager e 117 e Stereotype Stereotype of the definition it can be either method or attribute e Return type The returned kind or meta kind of the definition e Context The context of the definition It can be either a kind or a meta kind e Parameter list The parameters of the method definition separated by acomma e Equation The expression of the def
232. onditions A constraint can be a Post condition A post condition can be associated with any behavioral feature In order to define the context of the constraint the user has to specify the name the parameters and the returned type of the feature In a post condition the parameters of the feature can be accessed as variables and the returned value can be accessed via a special variable called result Although the original OCL does not allow the renaming of self in preconditions this implementation does allow it The names of the parameters must be unique and cannot be either self result or the name of the context The special postfix operator pre may only be used in a post condition This feature is not implemented yet For the time being this constraint type is not fully implemented because so far it has not been a requirement for GME and UDM context lt contextName gt lt typeName gt lt featureName gt lt paramName gt lt paramType gt lt paramName gt lt paramType gt lt typeName gt post lt constraintName gt lt expression gt ege context Person GetSalary month int real post ValidSalary context p Person CheckIn post Attribute Definition This feature of OCL is included here because constraint types must be dealt with in a uniform way However an Attribute Definition
233. one method of performing model integrated computing One approach to MIC is model integrated program synthesis MIPS A MIPS environment operates according to a domain specific set of requirements that describe how any system in the domain can be modeled These modeling requirements specify the types of entities and relationships that can be modeled how to model them entity and or relationship attributes the number and types of aspects necessary to logically and efficiently partition the design space how semantic information is to be represented in and later extracted from the models analysis requirements and in the case of executable models run time requirements In MIPS formalized models capture various aspects of a domain specific system s desired structure and behavior Model interpreters are used to perform the computational transformations necessary to synthesize executable code for use in the system s execution environment often in conjunction with code libraries and some form of middleware e g CORBA the MultiGraph kernel POSIX or to supply input data streams for use by various GOTS COTS or custom software packages e g spreadsheets simulation engines When changes in the overall system require new application programs the models are updated to reflect these changes the interpretation process is repeated and the applications and data streams are automatically regenerated from the models Once a modeling paradi
234. onment of GME and we may drag amp drop a new Constraint to the Model Editor Constraints can be connected to any kind in the paradigm In this case the context of the constraint will be the appropriate kind otherwise i e the constraint is stand alone its context will be the singleton instance of gme RootF older Constraints can be connected to more than one kind if it expresses common rules for them If a constraint is associated with a base kind then all descendants will have that constraint as well After defining the context the user has to Name the constraint The names must be unique within kinds Thus a kind cannot have constraints inherited from the base kind and associated directly with the same name It is not required that the name include the text constraint or any form of it Generic Modeling Environment User s Manual Constraint Manager e 118 If the constraint is violated then the content of the Description will be shown thus this field must be very descriptive so that the user can fix the problem The expression i e the equation of the constraint will be evaluated on all objects of a kind and it must return true of false in case of an exception it returns undefined The context can be accessed through the self variable As we mentioned earlier the GME project itself is also available as project After the properties of the constraint are filled in the user may enable the event based evaluation If it
235. onst Returns the corresponding fco BON Type getType const Returns the appropriate type for this type inheritance object from which this object derives If the type inheritance object corresponds to an fco which is a type and it does not have base type then null is returned BON Instance This class corresponds to type inheritance instances Base Classes Its base class is BON TypelnhO bject BON Type This class corresponds to type inheritance types Generic Modeling Environment User s Manual Appendix C BON and MON e 209 Base Classes Its base class is BON TypelnhO bject Methods std set lt BON TypeInhObject gt getDerivedObjects const It returns the set containing all derived type inheritance objects of the type i e sub types and instances std set lt BON Type gt getSubTypes const It returns the set containing all direct sub types of the type std set lt BON Instance gt getInstances const It returns the set containing all direct instances of the type BON Attribute This class corresponds to the IMgaAttribute COM interface Base Classes There is no base class Attributes BON AttributePtr getAttributeI const This call returns the corresponding IMgaAttribute COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations MON Attribute getAttributeMeta const
236. ontainer contains reference ports Generic Modeling Environment User s Manual High Level Component Interface e 101 BON ReferencePort is retained in BON2 but its primary ancestor is not the same as the ancestor of BON FCO The explanation is that primarily fco is a metakind and reference port is another concept defined because of connections Relationship Between ReferencePorts In the next figure we find a model called Model and four references called Refl Ref2 Ref3 and Ref4 referring directly or indirectly to the model Models contains two atoms called P1 and P2 which are ports Ref2 gt Ref Ref4 gt Ref3 Relationship between References and the Model Relationship between Reference ports and the FCO Relationship between References ports Relationships of Model references and Reference ports Because the references refers to a model they implements the ReferenceP ortContainer interface and they contains reference ports with the same names P1 and P2 Reference ports refer to the port contained by the model blue lines in the figure There is a relationship between reference ports refering to the same port according to their containers We say that the reference ports are the descendants of the port Ref2 refers to Model via Refl P2 of Refl is the parent of P2 of Ref2 The parent of P2 of Refl is null because Refl refers to Model directly P2 of Refl has three descendant reference ports and two c
237. ool bReverseOrder false The call returns an object whose path is strPath If there is such an object null is returned The direction of the path and the separator can be specified with bReverseOrder and strDelimiter Generic Modeling Environment User s Manual Appendix C BON and MON e 193 BON ConnectionEnd This class is the base class of BON FCO and BON ReferencePort It is used BON Connection related calls only The reason why it introduced is that the ends of a connection can be an fco itself or a reference port referring to the fco directly or indirectly Base Classes There is no base class Attributes bool isReferencePort const It returns true if the connection end is a reference port Methods MON Project getProject const It returns the project to which the connection end belongs std set lt BON Connection gt getConnLinks const MON Connection amp meta MON Connection const std string amp strRole bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const std set lt BON Connection gt getConnLinks const std string amp strConnection const std string amp strRole bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const The operations return a set containing the connections whose at least one end is this connection end If meta is not null or strConnection is not empty then only those connections are included int
238. orresponds to metakind i e Folder FCO and descendants of FCO This class is introduced only by MON it does not have the appropriate COM interface The not mentioned classes will be discussed in the following subsections Meta Kinds in MON In this subsection the meta kinds and their specific relationships are discussed These meta kinds are the following Folder and FCO which is the base of Atom Model Connection Set and Reference In the context of UML these meta kinds are stereotypes denoting what kind of relationships they can take part in These are shown in the next figure without the meta kind Atom because this concept means a simple undividable entity class in UML which does not have any special and additional properties that FCO has Folder is similar to package or namespace but compairing with the package concept in UML in the same paradigm more than one Folder may exist they can contain different kinds Because of this fact each folder can have different semantics and they are considered as kinds and must have unique names with fcos In GME Model is the most important concept because it specifies with Containment the hierarchical structure of the objects in a GME project As it is shown in the figure Containment is a Model FCO pair with a unique name in the context of the Model In contrast to UML regarding the relationships instead of class GME deals Generic Modeling Environment User s Manual High Level Component In
239. ow zooms in while right clicking zooms out The zoom level is window specific Visualization Mode The Visualization Mode allows single objects and collections of objects neighborhoods of objects to be visually highlighted with respect to other modeling objects This is useful when examining and or discussing complex models To enter the Visualization Mode select the Visualization Mode button on the GME editing mode bar see picture above This will cause all visible parts and connections to become grayed out Next the user may click on objects using either Generic Modeling Environment User s Manual Using GME 5 e 34 the left or right mouse buttons to make them fully visible again Left and right clicking have different effects as described below Left clicking on any part toggles the visibility of the object For connections their source and destination objects are toggled The user may continue to select parts in this manner highlighting hiding more and more objects Right clicking on a part will toggle the visibility of the object and the objects at the ends of its connections Note that exactly those connections are highlighted at any one time that connect highlighted objects Miscellaneous operations The following operations are only accessible from the toolbar e Toggle grid At zoom levels 100 or higher a grid can be displayed in the model editor window GME objects always snap to this fine grid whether they
240. owever the user does not have to deal with the construction and destruction of BON objects it is good to know how it is implemented and what are the guidelines regarding this issue A BON object is always created at the first time when the user obtain a reference to a COM entity In most cases but not necessarily an instance of a BON implementation class is assigned to the appropriate COM object and the BON object is cached Because BON makes the COM architecture more user friendly it is obvious that more than one BON object BON interface may exist and is assigned to the same COM object It is the reason why the usage of wrappers are recommended Simply to say they have the responsibility to decide when a BON object must be erased from the cache The time of disposal of objects depends on two essential factors and these are more complicated than they seem to be the component s type the number of references to a BON implementation object The whole meta object network all MON objects is created when the component starts to run and it is destructed when the component accomplish its task Objects in Add ons and in Interpreters The time when objects are freed differs in case of add ons and interpreters plug ins are regarded here as paradigm independent interpreters The difference is based on the usual process of the components As we mentioned above BON objects are created if and only if they are required to be constructed i
241. p strRole bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const std multiset lt BON ConnectionEnd gt getConnEnds const std string amp strConnection const std string amp strRole bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const These operations are implemented for the sake of convenience They return a multiset containing those connection ends which are connected to this connection end If strRole is specified then only those connection ends are returned whose connection role is strRole meta strConnection blncludeRefs and aspect parameters are used in the same way as getC onnLinks operations use them Generic Modeling Environment User s Manual Appendix C BON and MON e 195 std multiset lt BON ConnectionEnd gt getInConnEnds const MON Connection amp meta MON Connection bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const std multiset lt BON ConnectionEnd gt getInConnEnds const std string amp strConnection bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const std multiset lt BON ConnectionEnd gt getOutConnEnds const MON Connection amp meta MON Connection bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const std multiset lt BON ConnectionEnd gt getOutConnEnds const std string amp strConnection bool bIncludeRef
242. pects ReferencePort and Its Container If a reference referred to a model then this reference was called BuilderModelR eference in the previous version of BON Model references were special in the aspect they might contain reference ports the model referred by the special reference contained ports If an fco contained by the model played the port role there was a reference port contained by the model reference referring to the fco The port i e the fco and the reference port were different objects In BON2 these concepts are retained but they are clarified Consequently has essential differencies BuilderModelR eference of BON is called ReferenceP ortC ontainer in BON2 GME allows that a reference may refer to models an other objects which are not models It is obvious a reference may contain reference ports if and only if it refers to a model If the user changes the referred object from a model to an atom then the reference cannot contain reference ports any more Because of these facts ReferenceP ortContainer is an interface in contrast with BuilderModelR eference object of BON which is implemented by the reference in the time it refers to a model That means references can contain reference ports indirectly through the ReferenceP ortContainer interface which always has to be obtained froim the reference before usage and which is not recommended to cache by the component implementor Consequently only ReferenceP ortC
243. pper class she must use DECLARE ABSTRACT BONEXTENSION IMPLEMENT ABSTRACT BONEXTENSION macros Generic Modeling Environment User s Manual High Level Component Interface e 97 The example Generic Modeling Environment User s Manual Public inheritance In the context of BON only public inheritances may be used Metakind compliance In an inheritance chain of BON the user cannot mix the metakinds except of FCO e g all descendants of a BON extension having Atom metakind will have Atom metakind Virtual inheritances During the realization of the implementation classes in case of diamond inheritance virtual inheritance must be used see how ProcessingUnitImp extends BON FCOImpl In case of wrapper classes all inheritances all virtual Multiple inheritance In these cases DECLARE _BONEXTENSION2 or DECLARE_BONEXTENSION3 can be used codes High Level Component Interface e 98 Realization of the implementation classes class ProcessingUnitImpl virtual public BON FCOImpl Note BON FCOImpl is an abstract class by default void doSomething b class CompoundImpl public BON ModelImpl public ProcessingUnitImpl Declare BON extensions DECLARE_ABSTRACT_BONEXTENSION BON FCO ProcessingUnitImpl ProcessingUnit DECLARE_BONEXTENSION2 BON Model ProcessingUnit CompoundImpl Compound Implement BON wrappers assignment if it is required IMPLEMENT_ABSTRACT_BONEXTENSION Processin
244. r annotations You can open the Annotations dialog from the main menu bar Edit Annotations or from the context menu Annotations You can also launch this dialog with double clicking on one of your annotations Generic Modeling Environment User s Manual Using GME 5 e 29 Name UML Kind ParadigmSheet Role NIA Name Text Annotation1 We are using OCL for describing constrai On this diagram you can find the definitio Annotation Name Annotation Text AnnotationO Annotation ClassCopies enable us to describe obja On this diagram you can find the definition of the basic entities in a UML model Cor EE x e16 MClassDiagram O Visualization yy 266 O Constraints O Attributes I Default Pos Arial 12 Regular Font Visibility Annotation editor On the left side of the dialog in the figure above all the annotations in the active model are available On the right hand side panel you can customize the selected commentary The Name Text Color Background and Font settings are self explanatory The Visibility sub panel enables you to fine tune the position and visibility in an aspect based manner All the aspects of the active model and a special DEFAULT aspect are listed on the left side The checkboxes represent the visibility information in the proper aspect if an annotation is visible in the DEFAULT aspect it is visible in all the others
245. r kind of relationship between objects This is best illustrated through an example In the figure below there are two root type models the Engine and the Car The car contains an instance of an engine V6 and an ABS type model V6 is an instance of the Engine this relationship is indicated by the dash line Aggregation is depicted by solid lines Generic Modeling Environment User s Manual Type Inheritance 41 ST Cool Car w ee x L T Type ha A ST SubType ba I Instance Composition Dependency Model Dependency Chains When we create a subtype of the Car Cool Car above we indirectly create another instance of the Engine V6 and a subtype of the ABS type This is the expected behavior as a subtype without any modification should look exactly like its base type Notice the arrow that points from V6 in Cool Car to V6 in Car Both of these are instances but there is a dependency between the two objects If we modify V6 in Car V6 in Cool Car should also be modified automatically for the same reason if we don t modify Cool Car it should always look like Car itself The same logic applies if we create an instance of Cool Car My Car above It introduces a dependency among others between V6 in My Car and V6 in Cool Car As the figure shows this forms a dependency chain from V6 in My Car through V6 in Cool car and V6 in Car all the way to the Engine type model What happens if we modify V6 in Co
246. r selection operator is then the method is resolved otherwise the iterator is resolved Resolution ends and an exception is thrown because lt method gt cannot be Generic Modeling Environment User s Manual resolved Appendix B OCL and GME e 147 Predefined OCL Types For the time being ocl Any is considered to be a type and further meta types are not defined In the next version these meta types will be accessible as well as meta kind information The types enumerated below are accessible in all OCL expressions ocl Any The type ocl Any is the supertype of all types used in OCL expressions Features associated with ocl Any can be used for all types This type has only one instance which is undefined Aliases Supertypes This type can also be accessed as Any Operators operator anyl ocl Any any2 ocl Any ocl Boolean operator anyl ocl Any any2 ocl Any ocl Boolean Returns true if anyl is the same as any2 This equality means identity anyl or any2 may be undefined If only one of them is undefined then the result is false if both of them are undefined the result is true operator anyl ocl Any any2 ocl Any ocl Boolean operator lt gt anyl ocl Any any2 ocl Any ocl Boolean Returns true if anyl is not the same as any2 This equality means identity anyl or any2 may be undefined If only one of them is undefined th
247. re renamed Operations accessing the objects inside a project are enclosed in a transaction In case the transaction commit fails AbortTransaction must be used Beware that during a user initiated transaction another transaction should not be started This means that during scripting if a transaction has begun user interface operations like selection of an object in the View or ActiveBrowser with the mouse pointer must be suspended by the user untill the transaction is committed or aborted The it variable represents the currently active model window It is accessible only while a project is opened and at least one model window is opened Should the active model window be closed the variable automatically will refer to the newly selected active window if any The it object implements the IGMEOLEIt interface defined in Gme idl The main benefit of using this object is the ease of use of MGA related operations on a higher level than that offered by the IMgaObject IMgaFCO and IMgaFolder interfaces see Mga idl and it allows the user to automate some repetitive tasks The methods it provides require either object names or IMgaFCO pointers as incoming parameters the latter method names being suffixed with FCO The code sample below shows duplicating clone of objects clones object if any named InSignal renames the clone to ClonedInSignal and returns it clonedInSignalPtr it Duplicate InSignal ClonedI
248. registry values void accept BON Visitor pVisitor This operation is the standard implementation for BON Visitor It calls the visitor visitAtom operation supplying the atom itself BON Model This class corresponds to the IMgaModel COM interface Base Classes Its base class is BON FCO Construction and Destruction static BON Model attach IMgaModel pModel Creates a BON model for the specified COM object Generic Modeling Environment User s Manual Appendix C BON and MON e 201 static BON Model create const BON Folder amp parent const MON Model meta MON Model static BON Model create const BON Folder amp parent const std string amp strModel static BON Model create const BON Model amp parent const MON Model amp meta MON Model const std string amp strRole static BON Model create const BON Model amp parent const std string amp strModel const std string amp strRole The methods create a new model in the specified parent which kind will be meta or strModel If strRole specified the containment role name will be the same within the model parent static BON Model create const BON Folder amp parent const BON Model amp baseType bool bAsInstance true static BON Model create const BON Model amp parent const BON Model baseType bool bAsInstance true const std string amp strRole The methods derive a new
249. renamed in this case Self is not accessible context lt contextName gt lt typeName gt inv lt constraintName gt lt expression gt e g context Person inv DontHaveDogs context p Person inv Pre conditions A constraint can be a Pre condition A pre condition can be associated with any behavioral feature In order to define the context of the constraint the user has to specify the name the parameters and the returned type of the feature In a pre condition the parameters of the feature can be accessed as variables Although the original OCL does not allow the renaming of self in pre conditions this implementation does allow it The names of the parameters must be unique and cannot be either self or the name of the context For the time being this constraint type is not fully implemented because so far it has not been a requirement for GME and UDM Generic Modeling Environment User s Manual Appendix B OCL and GME e 132 context lt contextName gt lt typeName gt lt featureName gt lt paramName gt lt paramType gt lt paramName gt lt paramType gt lt typeName gt pre lt constraintName gt lt expression gt e g context Person GetSalary month int real pre ValidMonth context p Person CheckOut pre ou Post c
250. returns false Generic Modeling Environment User s Manual Appendix B OCL and GME e 158 ocl Collection forAll boolExpr ocl Boolean ocl Boolean Returns true if boolExpr evaluates to true for all element of the collection Returns undefined if boolExpr evaluates to undefined for at least one element of the collection If the collection is empty it returns true ocl Collection isUnique anyExpr ocl Any ocl Boolean Returns true if anyExpr evaluates to a different value for each element of the collection ocl Collection any boolExpr ocl Boolean lt innerType gt Returns any element of the collection for which boolExpr evaluates to true If there is more than one element than one in the collection for which the condition is fulfilled then one of them will be returned If there are no elements then undefined is returned ocl Collection one boolExpr ocl Boolean ocl Boolean Returns true if the collection contains exactly one element for which boolExpr evaluates to true ocl Collection sortedBy anyExpr ocl Any ocl Sequence This iterator is not implemented yet OCL 1 4 specification has mistyped information about this iterator It returns a sequence which contains all elements of the collection where the order of the elements is determined by the value returned by anyExpr for the element ocl Set The type ocl S et represents the mathematical concept of set
251. ridden operators can be accessed by applying the oclAsType method of ocl Any Exceptions to this rule are the primary operators first row of the table below The precedence from the highest to lowest and associativity are shown in the following table pre gt Left to right sign Right to left div mod Left to right t Left to right lt lt gt gt Left to right Not Right to left and amp amp Left to right Xor Left to right or Left to right Implies gt Right to left In this implementation we allow short circuit logical operators amp amp gt They can be useful when the user wants to alter the process of the evaluation lt expression gt lt binaryOperator gt lt expression gt lt unaryOperator gt lt expression gt e g This forms a string not person isRetired Functions Although OCL is based on the object oriented concept functions can be defined to make OCL more convenient Generic Modeling Environment User s Manual Appendix B OCL and GME e 140 There are two examples for this e We write max a b instead of a max b Of course both forms of these calls are available e In extensions of OCL it is good practice to somehow separate the extending features from the standard ones This issue can be solved very well with functions though it is not necessary Functions may have
252. ring amp name bool amp val const GetAttribute char name bool amp val const SetAttribute CString amp name CString amp val SetAttribute CString amp name int val SetAttribute CString amp name bool val void GetStrAttributeNames CStringList amp list const void GetIntAttributeNames CStringList amp list const void GetBoolAttributeNames CStringList amp list const void GetReferencedBy CBuilderObjectList amp list const const CBuilderConnectionList GetInConnections CString amp name const const CBuilderConnectionList GetInConnections char name const const CBuilderConnectionList GetOutConnections CString name const const CBuilderConnectionList GetOutConnections char name const Generic Modeling Environment User s Manual High Level Component Interface e 74 bool GetInConnectedObjects const CString amp name CBuilderObjectList amp list bool GetInConnectedObjects const char name CBuilderObjectList amp list bool GetOutConnectedObjects const CString amp name BuilderObjectList amp list bool GetOutConnectedObjects const char name CBuilderObjectList amp list bool GetDirectInConnections CString amp name CBuilderObjectList amp list bool GetDirectInConnections char name CBuilderObjectList amp list bool GetDirectOutConnections CString amp name CBuilderObjectList amp list bool GetDirectOutConnections char name CBuilderObjectList amp lis
253. rns the time when the project was last modified Methods Generic Modeling Environment User s Manual Appendix C BON and MON e 189 BON Folder getRootFolder const This call returns the root folder of the project BON Object findByID const std string amp strID bool bNeedExc false const This operation returns the BON Object which has the ID striD If the ID is invalid i e there is no object in the project with this ID null object is returned in default If bNeedE xc is true then BON Exception is thrown std set lt BON Object gt findByKind const MON Object amp meta const std set lt BON Object gt findByKind const std string amp strKind const The first operation returns all objects in the project whose kind is the supplied MON Object meta object If meta is null or the meta project of the project does not have MON Object called strKind MON Exception is thrown std string getInfoString Util InfoOptions usOptions Util I0_ None const std string getInfoString const std set lt Util InfoOption gt amp setOptions const It returns a string describing the project including the name creation time etc The details and the format can be set be the options BON Object This is the base class of BON FCO and BON Folder It implements common features of objects in a project Base Classes This class implements the BON EventListenerP ool interface Construction and
254. rocess ifndef GME_INTERPRETER_H define GME_INTERPRETER_H include Builder h define NEW_BON_INVOKE define DEPRECATED_BON_INVOKE_IMPLEMENTED class CComponent public CComponent focusfolder NULL CBuilderFolder focusfolder CBuilderFolderList selectedfolders void InvokeEx CBuilder amp builder CBuilderObject focus CBuilderObjectList amp selected long param void Invoke CBuilder amp builder CBuilderObjectList amp selected long param endif whole file Before GME version 1 2 this used to be simpler but not as powerful The Invoke function of the CComponent class used to be the entry point of the component When the user initiates interpretation first the builder object network is created then the above function is called The first two parameters provide two ways of traversing the builder object network The user can access the list of folders through the CBuilder instance Each folder provides a list of builder objects corresponding to the root models and subfolders Any builder can then be access through recursive traversal of the children of model builders The CBuilderModelList contains the builders corresponding to the models selected at the time interpretation was started If the component was started through the main window either through the toolbar or the File menu then the list contains one model builder the one corresponding to the active window If the interpretation
255. rs to that as iterl These variables are not accessible in the expression directly Second elements is resolved as iterl elements because iterl precedes self during the resolution and it is a Box Type of boxes will be ocl Bag ocl Set Box In the third line boxes and self are not subject of resolution because they are known variables Iterator called forAll creates a new implicit variable We refers to that as iterl Former iterl exists in the context of collect only First includes resolved as iterl includes ocl Any because type of iterl is ocl Set Box and ocl Set has a method called includes Iterator called exists creates a new implicit variable We refers to that as iterl Former iterl exists in the context of forAll only u one is resolved as iterl one ocl Boolean because type of iterl is ocl Set Box and ocl Set has an iterator called one The resolved iterator called one creates a new implicit variable We refers to that as iter2 Second includes resolved as iter2 includes Box because iter2 precedes iterl and the type of iter2 is Box size is resolved as iterl size because the type of iter2 Box does not have any feature called
256. rson Returns in ocl Set HasDog p hasDog Returns in HasDog d hasDog Returns in Dog hd dogs hd dog Returns in Person hd owner hd person Resolution Rules Implicit Variables In standard OCL implicit variables are introduced These variables are similar to this in C or Java thus they can be omitted to prevent writing long expressions The variable of the context in many cases self is always implicit Other implicit variables are created by iterators which do not have any declarators Because of this property of the language the resolution of features i e expressions gets more complicated In an expression all available implicit variables are marked and stored in a sequence If an expression has to be regarded as a feature of a type i e attribute association end method iterator then all implicit variables are examined to determine which variable the feature belongs to This examination starts at the end of the sequence and goes to the beginning i e the variable declared last is examined first If a feature is resolved even if it is ambiguous then resolution is stopped Generic Modeling Environment User s Manual Appendix B OCL and GME e 144 Assuming that Person and Dog are defined by the paradigm They have an association called HasDog with roles owner and dogs Both classes have an attribute called age Person has an attribute called g
257. rt gt parts const std set lt MON Aspect gt aspects const bool isVisibleIn const MON Aspect amp aspect const std set lt MON ReferenceAssociation gt referenceAssociations const std set lt MON Reference gt referencedBy const bool isReferencedBy const MON Reference amp reference const std set lt MON SetMembership gt setMemberships const std set lt MON Set gt memberOf const bool isMemberOf const MON set amp set const MON ContainmentPart Base Classes MON MetaObject Attributes MON PartPtr getPartI const bool isLinked const bool isPrimary const Methods Generic Modeling Environment User s Manual Appendix C BON and MON e 184 MON Containment containment const MON Aspect aspect const MON Aspect Base Classes MON MetaObject Attributes MON AspectPtr getAspectI const Methods std set lt MON ModelInAspect gt modelInAspects const std set lt MON Model gt models const bool isContainedBy const MON Model amp model const std set lt MON ContainmentPart gt parts const std set lt MON Containment gt containments const bool hasContainment const MON Containment amp role const MON Attribute Base Classes MON MetaObject Attributes MON AttributePtr getAttributeI const Util Variant defaultValue const MON AttributeType valueType const Generi
258. s true const MON Aspect amp aspect MON Aspect const These operations have the same behaviour as getConnEndsAs except of that no connection role can be specified getInConnEnds supplies dst role getO utC onnE nds supplies src role implicitly These operations can be used only for simple connections i e connections having exactly two connection ends otherwise BON Exception is thrown std multiset lt BON ConnectionEnd gt getDirectConnEnds const MON Connection amp meta const std string amp strRole bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const std multiset lt BON ConnectionEnd gt getDirectConnEnds const std string amp strConnection const std string amp strRole bool bIncludeRefs true const MON Aspect amp aspect MON Aspect const These operations are implemented for the sake of convenience They return a multiset containing those connection ends which are leafs in a specific connection tree The root of the tree corresponds to this connection end The tree s directed edges correspond to those connections whose kind is meta or whose kind s name is strConnection and whose source is a connection end to which the connection attached with connection role strRole The nodes of the tree correspond to connection ends meta strConnection strRole bincludeRefs and aspect parameters are used in the same way as getConnLinks operations use t
259. s BON FCO Construction and Destruction static BON Set attach IMgaSet pSet Creates a BON set for the specified COM object static BON Set create const BON Folder amp parent const MON Set meta MON Set static BON Set create const BON Folder amp parent const std string amp strSet i static BON Set create const BON Model parent const MON Set amp meta MON Set const std string amp strRole static BON Set create const BON Model amp parent const std string amp strSet const std string amp strRole The methods create a new set in the specified parent which kind will be meta or strSet If strRole specified the containment role name will be the same within the model parent Generic Modeling Environment User s Manual Appendix C BON and MON e 205 static BON Set create const BON Folder amp parent const BON Set amp baseType bool bAsInstance true static BON Set create const BON Model amp parent const BON Set amp baseType bool bAsInstance true const std string amp strRole ee The methods derive a new set from the specified basetype If bAsInstance is true the derived object will an instance of basetype otherwise a type If strRole specified the containment role name will be the same within the model parent static BON Set createAs const BON Model amp parent const std string amp strRole The methods create
260. s are found i e an attribute of the compound object and an attribute of the contained objects then resolution is stopped If the member selection operator is then the compound object s attribute is resolved otherwise the other attribute is resolved If an attribute and an association end are found in this case the object is not compound because it cannot have associations then resolution is stopped and an exception is thrown because of ambiguity Resolution ends and an exception is thrown because lt attribute gt cannot be resolved expression which looks like a method call Check whether the object has a method which can be called as lt method gt If the object is compound check whether the object has an iterator which can be called as lt method gt If the object comes from an implicit variable If exactly one feature is found the resolution is stopped If more features are found then the resolution is stopped and an exception is thrown because there are more features which can be accessed in the same way Resolution ends and an exception is thrown because lt method gt cannot be resolved If the object comes from an expression i e member selection operator is used If exactly one feature is found the resolution is stopped If a method and an iterator are found in this case the object is compound because only compound objects can have iterators then the resolution is stopped If the membe
261. s are now ordered in the XME files e New Table Editor plug in is introduced to use it open File Register Components select the GME Table Editor and press Toggle Afterwards it can be launched from the component toolbar or the File menu run Plugins command Generic Modeling Environment User s Manual What is new e 7 What is new in version New default decorator is included providing nicer visualization Type instance visualization is enhanced and configurable through model preferences The old decorator is still available in the release Object and connection autorouter preference settings are now available from the context menus Dispatch based add ons are supported Many other features improvements and bug fixes 3 0 Among the significant improvements in this version are Generic Modeling Environment User s Manual A new OCL compatible constraint manager with a graphical user interface enabling among many things the specification of project or model specific constraints Advanced search utility in its own modeless dialog box Improved look and feel Builder Object Network BON is in a shared directory now making interpreter migration a breeze Many other features improvements and bug fixes What is new e 8 Introduction m The Generic Modeling Environment GME 5 is configurable model integrated program synthesis tool The Generic Modeling Environment GME 5 is a Windows based domain specific
262. s belonging to that set are visible all other parts in the model are dimmed or grayed out Parts may belong to a single set to more than one set or to no set at all The Generic Modeling Environment e 18 ALA ws wr GME edit mode bar with the Set mode button selected Aspects Attributes To add or remove parts from sets the set must first be activated by placing the graphical editor into Set Mode This is done by clicking the Set Mode button see left on the edit mode bar Next a set is activated by right clicking the mouse on it Once the set has been activated parts even connections may be added and or removed using the left mouse button To return to the Edit Mode click the Normal Mode button on the edit mode bar The following examples of using sets e State dependent configuration of processing blocks in a signal processing paradigm e State dependent process configuration in a chemical engineering paradigm e State dependent failure propagation graphs in a fault modeling paradigm As mentioned earlier we use hierarchy to show or hide design detail within our models However large models and or complex modeling paradigms can lead to situations where even within a given level of design hierarchy there may be too many parts displayed at once To alleviate this problem models can be partitioned into aspects An aspect is defined by the kinds of parts that are visible in that aspect Note that
263. s registry the checkbox in bottom of the options dialog must be set Interpreting Constraint Checking and context sensitive Help are also available Drag and drop is implemented in the standard Windows manner Multiple selection items may serve as the source for drag and drop Modifiers are important to note for these operations e No modifier Move operation e Ctrl Copy signified by plus icon over mouse cursor e Ctrl Shift Create reference signified by link icon over mouse cursor e AIt Create Instance signified by link icon over mouse cursor e Alt Shift Create Sub Type signified by link icon over mouse cursor If a drop operation fails then a dialog will indicate so Drop operations can occur within the Browser itself allowing this to be an effective means to restructuring a hierarchy Drop operations can only be performed onto a Model or a Folder Generic Modeling Environment User s Manual Using GME 5 e 24 Model Browser and Interoperation Double clicking on any model in the tree or pressing the Space or Enter key when a model is selected will open that model for editing in the graphical model editor Double clicking an atom reference or set will open up the parent model select the given object and scroll the model so that the object becomes visible Locking Using the MS Repository or ODBC backends distributed multi user access is allowed to the same project To ensure consistency GM
264. s the ones that are visible in the source aspect View Allows the toggling on and off of the Toolbar the Status Bar bottom of the main window the Browser window the Attribute Browser and the Part Browser window Window Cascade Tile Arrange Icons Standard Windows window management functions Help Contents Accesses the ISIS web server and shows the contents page of this document Help Shows context sensitive user defined help if available or defaults to the appropriate page of this document See details in a subsequent section About Standard Windows functionality GME 5 provides annotations for attaching notes to your models These multi line textual annotations are paradigm independent and available in all of your models Annotations are not aligned to the model grid as opposed to real modeling entities and they can overlap each other but they are always lower in the Z order than normal objects Like every model contained artifact the visibility and position of annotations are aspect dependent Creating Annotations You can create a new annotation in an opened model from the context menu Insert Annotation if you right click on an empty area in the model GME generates a name for your annotation and normally there is no need to modify this It also opens the Annotations dialog where you can customize the text and appearance of your comment Editing Annotations There are several methods for editing you
265. s true for BON Attribute also This is true for BON Attribute also e If the component not only reads the project but it may modify the registry of an object or if the component is an add on reacting to events then modifying or erasing at least one registry node all registry nodes of the object will be invalid and the user has to obtain them again As we know objects in the project has predefined properties defined by GME Mainly this properties are related to visualization and implemented in the registry of the object The appropriate access including the type integer string long etc and the registry path of these values varies Using them manually via the generic registry interface is very error prone and difficult to memorize This is the reason why special root registry nodes are introduced extending the RegistryNode interface These are the following FCORegistryNode FCOExRegistryNode ConnectionRegistryNode and ModelRegistryNode Except of FCOExRegistryNode which can be obtained from fcos which are not connections the further ones are obvious Some example Get the color of the portnames of the port COLORREF crPort BON ModelRegistryNode model gt getRegistry gt getPortNameColor Obtaining the position of an FCO in the Aspect Aspect BON Point pt BON FCOExRegistryNode fco gt getRegistry gt getLocation Aspect How to create a new component project To creat
266. self For example BON FCO let access to the pointer BON FCOImpl because the implementation class has the proper operations of FCO Considering BON classes this indirection goes with operator gt in contrary MON wrappers use the simple operator Here is an example demonstrate the mentioned above BON FCO fco Here is an fco fco isPort This wiould result a compiler error because the wrapper does not have this operation fco gt isPort The operator gt will result a BON FCOImpl pointer MON FCO metafco fco gt getFCOMeta obtain the definition of the FCO std string strKindName metafco name get the name of the meta the kindname of the object It is important to mention that although advanced programmers may get the pointer of the implementation object and may store it outside of wrappers it is not recommended also because they have to be sure somehow the pointer is valid and not disposed already With the wrappers the validity of a BON object can be decided easily thanked to operator bool and to operator BON Project project Let s assume the project is valid BON Folder root project gt getRootFolder Get the root folder if root AfxMessageBox RootFolder always exists BON Folder parent root gt getParentFolder Get the parent of the root which is NULL if parent AfxMessageBox RootFolder never has parent The user
267. show this information It resizes UML classes accordingly Note that the figures below show the old appearance of metamodels GME 5 adds a OCL syntax checker add on to the metamodeling environment Every time a constraint expression attribute is changed this add on is activated Note that the target paradigm information is not available to this tool therefore it cannot check arguments and parameters such as kindname These can only be checked at constraint evaluation time in your target environment Step by step guide to basic metamodeling The following sections describe the concepts that are used to model the output Paradigm Paradigm The Paradigm is represented as the model that contains the UML class diagram The name of the Paradigm model is the name of the paradigm produced by the interpreter The attributes of the Paradigm are Author Information and Version Information Folder A Folder is represented as a UML class of stereotype folder Folders may own other Folders FCO s and Constraints Once a Folder contains another container it by default contains all FCO s Folders and Constraints that are in that container Folders are visualized only in the model browser window of GME 5 and therefore do not use aspects A Folder has the Displayed Name and In Root Folder attributes Generic Modeling Environment User s Manual Metamodeling Environment e 52 How to specify containment for a Folder Folder containment applies
268. some special features with which predefined OCL types are extended but they are not part of OCL specification These are in order e oct String intValue This feature exists because of backward compatibility thus it is deprecated Standard ocl String tolnteger must be used instead e ocl String doubleValue This feature exists because of backward compatibility thus it is deprecated Standard ocl String toR eal must be used instead e ocl String match ocl String This method is introduced so that regular expression can be used to test whether a string matches a Generic Modeling Environment User s Manual Constraint Manager e 114 specific format This feature can be used well for example to test whether the value of a string attribute has a special format or not e oct Collection theOnly This method exists because of backward compatibility but it is not deprecated It returns the sole element of a compound object If the collection either contains more than one element or is empty undefined is returned Multiplicity In the interpreted meta model the multiplicity of containments membership of sets and association ends is omitted and lost The cardinality is forced by constraints generated by the Meta Interpreter The consequence is that all features that have multiplicity i e the features mentioned above return ocl Set In GME there is a method ocl Collection theOnly with whi
269. ssion is more readable On the other hand features can be overloaded as ambiguity is avoided For example gme Model parts role ocl String vs gme Model parts kind ocl Type e If a method expects the name of a kind the kind of the kind i e the meta kind is specified too The implementation of the method checks whether the name is the name of a kind defined in the paradigm and whether the kind conforms to the expected meta kind If these conditions are not satisfied the proper exception is thrown and undefined is returned e The implementation of all features before performing checks whether the object is null If it is null exception is thrown and undefined is returned The benefits of these features are e The cautious modeler has free rein in writing expressions because the features are not fully checked e A constraint can already be attached to different kinds without dealing with difference and conformance because the features are defined by meta kinds We strongly recommend that the special feature gme FCO attribute should not be used In MCL this method returns objects with different types depending on the type of the attribute This feature is also not very secure in the expression oclAsType it returns ocl Any in this implementation It is better to somehow cast the kind itself and use the standard access of attributes defined by OCL Special Features of Predefined OCL Types In GME there are
270. st std string amp strValue bool bTypeTolerant true These operations set the value directly Those methods which have specific type can be used to set the typed value simply If bTypeTolerant is false and the type of the value mismatches the type of the supplied one BON Exception is thrown otherwise if the types are not the same the methods try to convert the value to the type of the attribute bool isUndefined const Returns true if the value is undefined void clear Clears the value directly i e set the value to undefined It means that the value will be inherited i e the value is set indirectly Methods BON Project getProject const It returns the project to which the attribute belongs BON FCO getFCO const It returns the fco in which the attribute resides BON RegistryNode This class corresponds to the IMgaRegNode COM interface except of the root registry node whose COM interface pointer is null Root registry nodes for objects are introduced to separate the BON RegistryNode functionality from BON 0 bject Generic Modeling Environment User s Manual Appendix C BON and MON e 211 Base Classes There is no base class Attributes BON RegNodePtr getRegNodeI const This call returns the corresponding IMgaRegNode COM interface This call is intended for advanced users who are familiar with the architecture of BON2 It may be used for special and or unimplemented operations I
271. st violation Evaluation ends after the first violated priority level Evaluation ends after 2 violations Evaluation ends after all constraints evaluated Load ai r Depth of on demand evaluation Model is in focus C Evaluate only constraints of the Model Add Evaluate the constraints of the Model s children also Evaluate the constraints of the Model s not immediate children as well Settings of the evaluation Short circuit evaluation As OCL is a predicate and query language during the execution of the constraints nothing is altered in the underlying model In some cases for example the model is quite huge and the evaluation would be time consuming logical operators and iterators may be switched to short circuit mode if the result is already available and the further operation will not modify the model these features can return earlier With these options the performance may be improved Generic Modeling Environment User s Manual Constraint Manager e 122 Evaluation Tracking If this option is off constraints evaluation is not debugged and only the context and the result false or undefined are shown in the Constraint Violations dialog This option may be turned on if the user would like to test the paradigm i e constraints Termination of evaluation With these options the user can manage when the evaluation process must terminate If the there were a lot of con
272. straints and the model was too large the Check All command would take too mush time In this case the user can shorten the evaluation to concentrate on the first violations Depth of on demand evaluation If the user wants to evaluate all constraints on the currently selected model she may choose which constraints have to be checked The default is that the constraints of the model and its immediate children are executed Run time exceptions and constraint violations If constraints are evaluated they can result in true false or undefined depending on whether the constraint is satisfied or not or during the execution some exceptions were thrown In the two latter cases a Violation Dialog pops up displaying the violations and or exceptions The dialog has two views in the compact view only one violation is shown in contrast to the detailed view in which all violations are enumerated at the left of the dialog The user may switch between the views with the Expand Collapse button Both of the views have the close buttons at the bottom left corner of the dialog e Close button is used to close the dialog simply If the violation dialog appeared because of an event this button means that the user approves the violating modifications at that time e Abort is enabled only if at least one event based and critical Priority 1 constraint is not satisfied In these cases Close button is disabled to force the user so that she aborts the modif
273. t virtual void TraverseChildren void pointer 0 The CBuilderModel class is the most important class in the component interface simply because models are the central objects in the GME They contain other objects connections sets they have aspects etc The GetChildren function returns a list of all children i e all objects the model contains models atoms sets references and connections The GetModels method returns the list of contained models If a role name is supplied then only the specified part list is returned The GetAtoms GetAtomReferences and GetModelReferences GetSets functions work the same way except that a part name must be supplied to them The GetConnections method return the list of the kind of connections that was requested These are the connections that are visible inside the given model The GetAspectNames function return the list of names of aspects the current model has This helps in writing paradigm independent components Children can be created with the appropriate creation functions Similarly connections can be constructed by specifying their kind and the source and destination objects Please see the description of the CBuilderConnection class for a detailed description of connections The TraverseModels function is similar to the TraverseChildren but it only traverses models Generic Modeling Environment User s Manual High Level Component Interface e 75 class CBuilderModel public CBuil
274. t in SetLocation HRESULT SetActive in VARIANT_BOOL isActive GME calls this method with VARIANT_FALSE if your object must be shown in gray color Eg GME was switched into set mode By default the decorator should paint its object with the active color HRESULT Draw in HDC hdc You have all the required information when this method is called Because a Windows HDC is supplied the decorator has to be an in process server Saving and restoring this DC in the beginning and at the end of your Draw method is highly recommended Generic Modeling Environment User s Manual Decorators 49 HRESULT SaveState Because this is the only method your decorator is in read write transaction mode it has to backup all the permanent data here HRESULT Destroy A destructor like function Releasing here all your MGA COM pointers is a good practice Using the Decorator skeleton You can find a decorkit zip file in the GME 5 distribution It contains a skeleton project for Visual C that implements a dumb decorator Modifying the DecoratorConfig h file would be your first step when using the skeleton The following modifications have to be made e Give a new value to TYPELIB_UUID a new ID can be generated by the guidgen tool found in Visual Studio e Give a new value to TYPELIB_NAME at least replace the string between the parenthesis e Give a new value to COCLASS_UUID a new ID can be generated by the guidgen too
275. t is not automatically reflected in the projects that import it It is possible however to refresh the imported library images through the Refresh library function in the browser context menu It is possible to specify an alternate name for the library in case it has been moved for example When a library is refreshed changes in the library are propagated to the library image and to the subtypes and instances created from the library objects During this process complex scenarios can occur First objects may have been deleted from the library which means that images of these objects and associations references connections to them need to be deleted Another typical case is when an association is changed in the library which requires changing of the associations that depend on Generic Modeling Environment User s Manual Libraries e 45 the changed object and may also require changing other associations like connections going through references as well Generally it is recommended to carefully check the models after a refresh operation especially if non trivial changes were applied to the library Mapping the old and new library objects is based on the relative ID s RelID s Relative ID s are unique identifiers of objects belonging to the same parent i e folder or model When an object is deleted its RelID is not reused for a long time until the RelID space of about 100 million is not running out so it is practically safe to
276. te ne cuteness alee EE EAS E T EVERA 99 GME Metakinds in the Project esseseeeeeeseeeeeseeeereesesesrerreressstsesrerrerssrsesreresrerreree 100 ConnectionEnds and ReferencePorts e eseeeeeeeeeeieesrsrsestererersrsrereererseesesrerreree 101 Type Inheritance in BON onten ae ia ai a E ASER Ea Eavan 104 Registry Attributes and Object Preferences eseeeesseereresssrsrsrerrersrrsesrrrrsrerreree 104 How to create a new component PLOJeCt ee eee cece eee eeeceeecesecesecaecaecsaecaeecseseaeeeeeeeees 105 Extending the Component Interface using the BON Extender interpreter e eee eee 106 Constraint Manager 111 Features of the new Constraint Manager ccescssesccseesecsseeecsseceeesecseeseceaeeecsaeceeeaesneeeeens 111 Standard OCL features nisiye e ae i E AE E aN Ei 111 New and Improved features in GME 5 esseeesseeeiesesssrsisrerrerersrsrsrerrersrsesreresrerreree 112 Limitations and Special Issues 000 cecesesccesecsessecseeseceeeeceaeeeesaecaeesecneseecaeeseeneeaes 112 Types and Constraints Expressions ssesesssecseesecseeseceseeeeeseceeesecneveeeaeenecneeees 115 Using Constrammts in GME ascento arici eeaeee ete a a irer ease oh ei aae eiri 118 Constraints defined by the Paradigm ce ceeeeecsecssseeesseceeeeceseecsaeeecsaeeateaeeneeees 118 Constraint Definitions Functions ccccecsseceeeceeseceeececssecseeeecsaeceeeeecsseseeseeeesaeees 119 Syntax and semantic ETOYS saie RA gerade eE de EEE E
277. ted get method gets which returns all objects derived from the Signal base The suffix s comes from the role name specified in the SF metamodell for the containment between Processing and Signal If this rolename had been empty then the getSignal name would have been used Sometimes name conflicts happen because of these naming conventions therefore the following distinction is made by the BonExtender the aggregated get methods may get an int dummy parameter If the Signal atom had been non abstract and the rolename empty in the meta model the following get methods would have been generated class ProcessingImpl public ModelImpl public std set lt InputSignals gt getInputSignals std set lt OutputSignals gt getOutputSignals std set lt Signals gt getSignals role getter std set lt Signals gt getSignals int dummy aggregated Connections will have specialized source and destination get methods However when a connection can have a reference port as its end the return value will be simply BON ConnectionEnd In the case below no reference ports are involved based on best knowledge of the BON Extender interpreter so a specialized class like Signal will be returned by the get methods Generic Modeling Environment User s Manual High Level Component Interface e 107 class DataflowConnImpl public ConnectionImpl public connectionEnd getters Signal getSrc Signal getDst BUP ad
278. tenation of the sequence and sequence ocl Sequence append any ocl Any ocl Sequence Returns the sequence whose last element is any ocl Sequence prepend any ocl Any ocl Sequence Returns the sequence whose first element is any ocl Sequence first lt innerType gt Returns the first element of the sequence If the sequence is empty an exception is thrown and undefined is returned ocl Sequence last lt innerType gt Returns the last element of the sequence If the sequence is empty an exception is thrown and undefined is returned ocl Sequence at pos ocl Integer lt innerType gt Returns the element at the position pos of the sequence If pos is less than 0 or if it is greater than or equal to the size of the sequence an exception is thrown and the result is undefined ocl Sequence insertAt pos ocl Integer any ocl Any ocl Sequence Returns the sequence which contains any at position pos If pos is less than 0 or if it is greater than or equal to the size of the sequence an exception is thrown and the result is undefined ocl Sequence indexOf any ocl Any ocl Integer Returns the first position of the sequence where any is found If there is no element which equals to any then return 1 Generic Modeling Environment User s Manual Appendix B OCL and GME e 163 ocl Sequence subSequence lower ocl Integer upper oc
279. terface e 85 with Containment which corresponds to the containment role and IMgaMetaR ole COM interface With this concept more sophisticated paradigms may be created without further constraints e g in a class only that student may take part in a golf club whose all grades are A Class Model Student FCO Excellent Containment GolfClub Set That is why Set and Reference are associated with Containment instead of FCO These associations simiralry to FolderContainment are blue colored denoting that they are introduced only in MON FolderContainment 1 2 Containment MON classes with their specific relations Connection is more complicated than Reference or a Set The meaning of the classes is described well with a bidirectional connection in whose case a connection has two specifications regarding the two directions how two containment usually fcos with their all containments can be connected In the metamodelling environment only binary connections can be created with src and dst ConnectionRole Except of Connection and Containment all classes are blue colored because COM objects cannot be assigned to the instances unambiguously Specific GME Concepts Via MON all information related with aspects can be obtained ModellnAspect association describes which Model in which Aspect can be opened in the model editor Generic Modeling Environment User s Manual High Level Component Interface e 86 ContainmentP art which corr
280. th must be a relative path to this node std set lt BON RegistryNode gt getChildren bool bVirtualsAlso false const BON RegistryNode getChild const std string amp strName const The first operation returns a set containing all children of the node If bVirtualsAlso is true it includes those registry nodes as well whose value s status is not BON RNS_Here BON RegistryNode getDescendantByPath const std string amp strPath const Returns a registry node by strPath which is the child of this node directly or indirectly strP ath must be a relative path to this node void removeTree It clears and removes all descendant registry nodes of this node including itself BON FCORegistryNode This class is an extension in order to introduce a easy to use interface for those registry values which are predefined in GME and are associated with fcos Although the class inherits from BON RegistryNode only the root node support this interface Base Classes The base class is BON RegistryNode Methods COLORREF getColor const void setColor COLORREF color Returns and sets the color of the fco Generic Modeling Environment User s Manual Appendix C BON and MON e 213 COLORREF getNameColor const void setNameColor COLORREF color Returns and sets the color of the name of the fco bool getNameEnabled const void setNameEnabled bool bEnabled Returns true if the name of the fco is d
281. that are associated with this fco If role is specified then only the links in which the fco takes part as role are regarded If kind is specified the kind of connections must be kind If the kind of kind i e the meta kind is not gme Connection then an exception is thrown and undefined is returned gme FCO attachingConnPoints role ocl String kind ocl String ocl Set gme ConnectionPoint D gme FCO attachingConnPoints role ocl String kind ocl Type ocl Set gme ConnectionPoint gme FCO attachingConnPoints kind ocl Type ocl Set gme ConnectionPoint Returns a set which contains all connection points association ends of the fco If role is specified then the role of the connection point has to match role If kind is specified the kind of connections must be kind If the kind of kind i e the meta kind is not gme Connection then an exception is thrown and undefined is returned gme FCO attachingConnections role ocl String kind ocl String ocl Set gme Connection D gme FCO attachingConnections role ocl String kind ocl Type ocl Set gme Connection gme FCO attachingConnections kind ocl Type ocl Set gme Connection Returns a set which contains all connections instances of association class that is a link of the fco If role is specified then the role of the connection point in the side o
282. the concepts of GME 5 and how they translate semantically into core MGA concepts Generic Modeling Environment User s Manual Metamodeling Environment 67 Stereotype name Context Semantics amp T First Class Objects FCO s The class is an MGA model atom o The class is an MGA atom connection A class The class is an MGA connection must be used as an Association Class The class is an MGA reference The class is an MGA set A class abstract only The class is a base type of another FCO Associations Containment An association with diamond between The model contains the specified FCO as a part a model and an FCO AssociationClass An association between a connection The connection contains all of the roles that the class and an Association Connector Association Connection has models the connection join ReferTo A directed association between a The instances of the reference class will refer to reference and a model atom or the instances of the model atom or reference reference class Association Classes connection An association between a src dst pair The connection class represents the src dst pair s or an n ary connection in the general as an MGA connection note the connection is an sense that is attributed by a FCO connection class Containment The folder contains 0 n of the associated folder a folder and a
283. the kind of models that can be built using it how they are organized what information is stored in them etc When GME is tailored for a particular application domain the modeling paradigm is determined and the tool is configured accordingly Typically the end users do not change these paradigm definitions and they are fixed for a particular instance of GME of course they may change as the design environment evolves Examples of modeling paradigms are as follows e Paradigms for modeling signal flow graphs and hardware architecture for high performance signal processing domains e Paradigms for process models and equipment models used in chemical engineering domains e Paradigms for modeling the functionality and physical components of fault modeling domains e Paradigms that describe other paradigms These are referred to as meta paradigms and are used to create metamodels These metamodels are Generic Modeling Environment User s Manual The Generic Modeling Environment 13 Metamodels descriptions domain environments are formal of concrete specific With Interpreters users can perform analysis on models or translate them Default models Generic Modeling Environment User s Manual icon in representing GME then used to automatically generate a modeling environment for the target domain Once an initial modeling paradigm has been formulated an MGA expert constructs a metamodel The metamodel is
284. then its ancestors are positively extended too and if it is deselected then its descendants are deselected too If you want to limit the set of generated classes then it is recommended to select no for each root object staying on top of the inheritance hierarchy in the domains you don t want to deal with There is another way of using this feature if you would like to extend the classes only to some extent not all classes down the inheritance hierarchy you may like to handle some derived classes together i e you want to handle InputSignals and OutputSignals together as Signal In such cases you can select the base class Signal and deselect the derived classes InputSignal OutputSignal When your interpreter will execute a base class instance will be generated for each derived object in the model This has consequences for the generated get methods of containers models sets folders if a container is extended Processing and some of its contained objects are not InputSignal then the specific getter getInputSignals which is intended to give back a set of the specific kinds contained will return with these objects cast to the nearest extended ancestor Signals There is a similar mechanism for connections too class ProcessingImpl public BON ModelImpl public std set lt Signal gt getInputSignals di Since FCO as stereotype objects are extended too and may not be instantiated at modeling time no abs
285. they receive a value i e they are initialized This is a consequence of query languages In OCL all features of types return a different object not identical even if it is possible for them to return the same object identical For example method ocl Set including receives an object adds it to the set and returns a set The two sets are not identical but the object which is included in the new set is identical to the argument of the method because it was not altered We must note here that in all features depending on identity or equality check equality is always applied We will indicate explicitly if an identity check is used or if the identity of an object is not changed during the evaluation i e a new object is not created in memory Literals For the time being two kinds of literals exist literals of data types predefined by OCL and literals of compound types Because basic primitive types are well known their literals are discussed through examples Generic Modeling Environment User s Manual Appendix B OCL and GME e 136 shrine Vrant lt GRs lt ire We String literals 0 0 1 0 5 232 234 232 Real literals reals are represented as 64bit long signed floating point numbers 0 c 1 5 62131 Integer literals integers are represented as 64bit long signed integer numbers enabled disabled unknown Enumeration literals enumeration values begins with charact
286. ting from the association class always results in one object a consequence of the definition of the association class Composition is considered to be a special association but there is no difference in OCL Generic Modeling Environment User s Manual Appendix B OCL and GME e 142 In extensions of OCL it is likely that features defined by meta types are mapped to special associations with special roles The ambiguity rules can be eased by extensions of OCL but it may lead to errors in those implementations because they follow the strict rules of OCL lt expression gt lt roleName gt lt expression gt lt typeName gt lt roleName gt Here are some examples to facilitate the understanding of navigation over associations telements Box Person owner tdogs Dog 0 7 0 1 i 0 7 j container HasDog Example for associations Regarding these parts of a paradigm the following OCL expression can be written Assuming that b is a Box bc is a BoxContainment If Box had further association which has elements or container roles then these roles could not be used because of ambiguity Cannot be used in any cases because of recursive containment b box Returns in ocl Set Box If elements was missing that association end would not be accessible from Box b elements Returns in Box If contain
287. tions Component cpp IMPLEMENT_CUSTOMMODEL CCompoundBuilder CBuilderModel Compound void CCompoundBuilder Initialize code that otherwise would go into a constructor CBuilderModel Initialize CCompoundBuilder CCompoundBuilder the destructor more code The macros create a constructor and a Create function in order for a factory object to be able to create instances of the given class Do not define your own constructors use the Initialize function instead You have to call the base class implementation These macros call the standard MFC DECLARE_DYNCREATE and IMPLEMENT DYNCREATE macros If you want to define abstract base classes that are not associated with any of your models use the appropriate macro pair from the list below Note that the lt NAMES gt argument is missing because there is no need for it Generic Modeling Environment User s Manual High Level Component Interface 81 LARE_CUSTOMMODELBASE lt CLASS gt lt BASE CLASS gt LARE_CUSTOMMODELREFBASE lt CLASS gt lt BASE CLASS gt LARE_CUSTOMATOMBASE lt CLASS gt lt BASE CLASS gt LARE_CUSTOMATOMREFBASE lt CLASS gt lt BASE CLASS gt LARE_CUSTOMCONNECTIONBASE lt CLASS gt lt BASE CLASS gt LARE_CUSTOMSETBASE lt CLASS gt lt BASE CLASS gt LEMENT_CUSTOMMODELBASE lt CLASS gt lt BASE CLASS gt LEMENT_CUSTOMMODELREFBASE lt CLASS gt lt BASE CLASS gt LEMENT_CUSTOMATOMBASE lt CLASS
288. to Folders and Models that may be contained in a Folder In the figure below the UML diagram outlines the containment scheme of a paradigm for a sports season To specify containment for a Folder follow these steps Create the Folder and item it contains through insertion or dragging from the parts menu Connect the item to the Folder Now the Folder contains the item o a Senge o a Senge ay Tasca Postseason PA lt lt folder gt gt ee Example of a Folder containment FCO This is a class that is mandatorily abstract The purpose of this class is to enable objects that are inherently different Atom Reference Set etc to be able to inherit from a common base class To avoid confusion with the generalization of modeling concepts Model Atom Set Connection Reference called collectively an FCO and this kind of object in the metamodeling environment which is called an FCO the metamodeling concept that would actually be dragged into a Paradigm model will be shown in regular font while the generalization of types will be in italics as FCO An FCO has the Is Abstract and General Preferences attributes All FCO s will also have these attributes How to create an FCO An FCO like all FCO s is created by dragging in the atom corresponding to its stereotype or inserting the atom through the menu Generic Modeling Environment User s Manual Metamodeling Environment e 5
289. tor bagl ocl Bag bag2 ocl Bag ocl Boolean Returns true if the size of bagl and bag2 are the same and bag contains all elements of bag2 with the same times and bag2 contains all elements of bagl with the same times operator lt gt bag ocl Bag collection ocl Collection ocl Boolean Returns true if the size of bagl and bag2 are not the same or bag1 does not contain all elements of bag2 with the same times or bag2 does not contain all elements of bagl with the same times operator bag ocl Bag set ocl Set ocl Set operator bagl ocl Bag bag2 ocl Bag ocl Bag Returns the union of bag and set or bagl and bag2 operator bag ocl Bag set ocl Set ocl Set operator bagl ocl Bag bag2 ocl Bag ocl Bag Returns the intersection of bag and set or bagl and bag2 Methods Generic Modeling Environment User s Manual Appendix B OCL and GME e 161 ocl Bag union set ocl Set ocl Bag ocl Bag union bag ocl Bag ocl Bag Returns the union of the bag and Set or bag ocl Bag intersection set ocl Set ocl Set ocl Bag intersection bag ocl Bag ocl Bag Returns the intersection of the bag and Set or bag ocl Bag including any ocl Any ocl Bag Returns a bag containing any ocl Bag excluding any ocl Any ocl Bag Returns a bag not containing elements wh
290. tors may have e A typed expression which will be evaluated for each element mandatory e A return type which is the type of the accumulated object mandatory It is not necessary for this type is to match the type of the argument e Declarators which are variables that refer to the current element of the iteration process optional e A declaration type which is simply an implicit type cast optional These are true only for predefined iterators discussed in a later section lt expression gt gt lt iteratorName gt lt declarator gt lt declarator gt lt declarationType gt lt expression gt e g let mySet Set 1 2 3 10 in mySet gt forAll eleml elem2 int eleml lt gt elem2 mySet gt one size 2 Here we discuss only the generic iterator of OCL called iterate terate always has a variable that is regarded as the accumulator of the iteration The iterator s return type is the type of the accumulator The accumulator is always initialized The expression has to include the accumulator variable so that the iteration will be meaningful but it is not required lterate may have exactly one declarator Iterate is the foundation of all predefined iterator Generic Modeling Environment User s Manual Appendix B OCL and GME e 138 we lt expression gt gt iterate lt d
291. tract FCO object is visible some limitations exist which are enforced by the dialogue If an object which inherits directly from an FCO is deselected then not only the objects below it but the whole inheritance tree is deselected If an FCO object is selected then not only its ancestors but all of its FCO descendants and their immediate non fco children are selected too In other words the extension selection deselection is limited to non fco sections of the inheritance trees If the user would like to extend some of the classes from the hierarchy below then ModelBase AtomBase and SetBase classes are definitely needed Their descendants may be selected or deselected at the user s choice Generic Modeling Environment User s Manual High Level Component Interface e 109 Modell A lt lt Model gt gt Model Model2 Atomi lt lt hlodel gt gt lt lt hlodel gt gt lt lt Atom gt gt FCORase lt lt FCO gt gt FCORz rived FCODe rived lt lt FCO gt gt lt lt FCO gt gt pcan AtomBase SetBase lt lt Atom gt gt lt lt Set gt gt Seti lt lt Set gt gt lt lt ftom gt gt Model1B lt lt Model gt gt Example metamodel for the BONExtender interpreter Generic Modeling Environment User s Manual High Level Component Interface e 110 Constraint Manager Features of the new Constraint Manager GME 5 contains the improved constraint manager which is fully compliant w
292. tribute Browser Attributes and Preferences are available in a modeless dialog box called the Attribute Browser Since there is no OK button changes are updated immediately More precisely changes to toggle buttons combo boxes i e menus and color Generic Modeling Environment User s Manual Using GME 5 e 21 pickers are immediate Changes to single line edit boxes are updated when either Enter is hit on the keyboard or the edit box loses the input focus i e you click outside the box The only difference for multiline edit boxes is that they use the Enter key for new line insertion so hitting it does not updated the value The object selection for the attribute browser works as follows The context menu access to Attributes and Preferences now even from the Model Browser works Furthermore simply selecting an object or inserting dropping or pasting it selects that object for the Attribute browser If more then one object is selected in the Model Browser or in the Model Editor the attribute browser will allow only the common attributes of these objects At the top of the dialog there are three tabs one for the attributes one for the preferences and another for the properties Note that the Attribute Browser window just like the Model Browser window is dockable it can float as an independent window or it can be docked to any side of the GME 5 Main window The Model Browser As mentioned earlier the GME is a configurable
293. type while a letter T can be found in front of instances The Meta tab shows the modeling language at a glance it displays the legally available array of Folders and objects that can be added at any level within the aggregate hierarchy For example at the Root Folder level we can add Folder folders Within these folders we can add models Primitive and Compound From these models more parts can be added Model Browser navigation Arrow keys can navigate the selection in vertical directions The Backspace key moves the selection to the parent object The Delete key allow for deletion of the current selection Object name editing is achieved through delayed clicking on an object s name Multiple selection is achieved through Shift or Control clicks Incremental searching is offered for all three tabs through the text entry field immediately below the Aggregate Inheritance and Meta tab selections The search is limited to the currently expanded section of the tree to avoid time consuming search in a potentially large database If a global search is desired pressing the Asterisk key when the root folder is selected fully expands the tree and the search becomes project wide Most hidden functionality offered within the GME 5 Browser is available through contextual menus and drag and drop operations Currently contextual menus are only offered for selections found within the Aggregate tab Contextual information is primarily use
294. ual High Level Component Interface e 95 DECLARE_BONEXTENSION BON Model CompoundImpl Compound IMPLEMENT_BONEXTENSION macro residing in a cpp file is for assigning the BON extension to a kind or a containment defined by the paradigm or to a meta kind defined by GME It is allowed that the implementor specifies more than one kind even it is valid to assign a concept to a kind and a containment at the same time The parameters are the following e Wrapper class The name of the BON extension which must be assigned In our case it is Compound e Assignment string This is a string literal containing a space separated list of kind names containment rolenames or meta kind names In our case it is simply Compound IMPLEMENT_BONEXTENSION Compound Compound After this step the BON extension to the Compound concept defined by the paradigm is ready to use everywhere Of course all rules are true for the extension also e g only the generated Compound wrapper class is permitted to use and it behaves as other wrapper classes do It is not required that the name of the wrapper class is the same as the kindname It is only good practice Assigning BON Extensions As we mentioned above not only kinds can be specified for a BON extension but containment roles even metakinds as well However it is possible that for one COM object more than one BON extension could be created In order to avoid collisions and resolv
295. ver When the appropriate URL is located GME 5 invokes the default web browser on the current machine and displays the contents of the URL If no network connection is available the help system will be unable to display the information unless the web server is running on the current machine or the URL refers to a local file Searching objects The Search facility in GME 5 has been updated from a plugin to a full ActiveX component This allows you to click or double click on a search result and go Generic Modeling Environment User s Manual Using GME 5 e 35 directly to that object in GME Also the search can stay open while you go back and forth from GME to the search window Types of the search A snapshot of the Search screen is shown below Whenever the Search is invoked the search screen pops up The Search window can be opened by executing the Edit Find command using the CTRL F shortcut or clicking the binocular icon in the toolbar The Search provides for three types of searches General Search This search option is used for finding Models Atoms Sets and or Reference objects in the project It has the following options which are AND relation with each other e Name used to specify the name of the object It takes a Regular Expression as an input The Search checks for any names that have patterns specified by this field e Role Name used to specify the role name of the object It takes a Regular Expression as
296. vers Using C ATL or MFC is the recommended way to develop decorators The IMgaDecorator interface The following diagram shows the method invocation sequence on the IMgaDecorator interface Understanding the protocol between GME and the decorators is the key to developing decorators All the methods on the decorator interface are called by GME there is no callback mechanism The direction column in the diagram shows the direction of the information flow GME always calls your methods in a read only MGA transaction You must not initiate new transactions in your decorator SaveState method is the only exception to this rule This method is called in a read write transaction therefore this is the only place where you can store decorator specific information in the MGA project Generic Modeling Environment User s Manual Decorators e 47 Decorator decorator class constructor _ GetFeatures out features SetParam in name in value GetParam in name out value Initialize in mgaproject in mgametapart in mgafco _ GetPreferredSize out sizex out sizey _GetPorts out portFCOs SetLocation in sx in sy in ex in ey GetPortLocation in fco out sx out sy out ex out ey GetLabelLocation out sx out sy out ex out ey GetLocation out sx out sy out ex out ey SetActive in isActive Draw in hDC SaveState Destroy
297. was started through a context menu i e right click then the list contains items for all the selected objects in the given window If the interpretation was started through the Generic Modeling Environment User s Manual High Level Component Interface e 70 context menu of the Model Browser then the list contains the builders for the selected models in the browser Using this list parameter of the Invoke function makes it possible to start the interpretation at models the user selects The long parameter is unused at this point In version 1 2 Invoke has been replaced by InvokeEx which clearly separates the focus object from the selected objects Depending on the invocation method both of these parameters may be empty To maintain compatibility with existing components the following preprocessor constants have been designated for inclusion in the Component h file NEW_BON_INVOKE if defined in Component h indicates that the new BON is being used If it is not defined e g if the Component h from an old BON is being used the framework works in compatibility mode DEPRECATED_BON_INVOKE_IMPLEMENTED In most cases only the CComponent InvokeEx needs to be implemented by the component programmer and the ImgaComponent Invoke method of the original COM interface also results in a call to InvokeEx If however the user prefers to leave the existing Component Invoke method to be called in this case the define of this constant en
298. window Editor Operations Using the Editor window the user can edit the models graphically Menus and editing operations are context sensitive preventing illegal model construction operations Note however that even a syntactically correct model can be invalid semantically This section gives a brief overview of common editor operations such as changing editing modes creating and destroying models placing parts etc Editing Modes The graphical editor has six editing modes Normal Add Connection Delete Connection Set Mode Zoom Mode and Visualization The Editing Modebar Generic Modeling Environment User s Manual Using GME 5 e 32 located by default just to the left of the main editing window is used to change between these modes Normal ___ ir Delete ___ Connection Connection Set Mode Zoom 4 amp Visualization GME Editing Mode Bar The figure above indicates the buttons used to select different editing modes The Editing Modebar is a dockable Windows menu button bar It can be dragged to different positions in the editor floated on top of the editing window or docked to the side of the editor Normal Mode Normal mode is used to add delete move copy parts within editing windows Models from the Model Browser and parts from the Part Browser may be copied by left click dragging the objects into the Editor window Standard Windows keyboard shortcuts Ctrl C to Copy Ctrl
299. y a class and the instance of the appropriate class has to be passed to the BON project or to a BON object theirs addEventListener operation An event listener may specify the type of the events it can react to It can be done with overriding the getAssignments operation of the listener it reacts to all events by default The order of event handling EventListeners attached to the project are called if they active EventListeners attached to the context object are called if they active objectE vent erformed of the BON Component is called BON Extension Classes So that the user can write an interpreter which is simple enough to modify and create the new version of BON must provides an easy to use base By default only the generic implementation is available i e BON FCO and BON FCOImpl implementing the default functionality of the feo concept and this must be used to Generic Modeling Environment User s Manual High Level Component Interface e 93 realize extensions according to a specific paradigm Following a few rules and implement the specific behaviour as well as using some not too complicated macros the task is accomplished quickly The extendable classes are BON FCO BON Atom BON Model BON Connection BON Set and BON Reference Of course a user extension can be derived also We will demonstrate the extension with a simple example Let us assume that there is a model whose name is Compound and the user wa
300. y be excluded at the Constraint Browser dialog s Settings page Generic Modeling Environment User s Manual Constraint Manager e 121 4 A specific constraint can be evaluated for all objects to which it applies at the Constraint Browser dialog s Constraints page 5 For a specific object all constraints can be evaluated at the Constraint Browser dialog s Kinds and Types page or executing the Constraint Check command of the context menu of the Model Browser Before interpreting a model it is highly recommended that the user execute the Check All command because it is likely that the paradigm or a library contains pure on demand constraints which are evaluated only if the user would like to Altering the evaluation process In GME 5 the user may change some settings to alter the evaluation process This can be done by opening the Constraint Manager s main dialog File Display Constraints and by clicking on the Settings page Constraint Browser Constraints Kinds and Types Settings Short circuit evaluation IV Enable short circuit logical operators Operators amp amp gt can change the evaluation IV Enable short circuit predefined iterators lterators terminates immediately after result is available r Evaluation tracking IV Enable tracking i e debuging of evaluation Reporting exceptions false values returned by features Termination of evaluation Evaluation ends after the fir

Download Pdf Manuals

image

Related Search

Related Contents

CentreCOM 9812T/9816GB リリースノート  Remisión Electrónica  HP 15 15-g134ds  Manual Forno de Pizza  Benutzerhandbuch  Toshiba SD-P2000 Portable DVD Player  《S30830T-CPE》 取扱説明書 (第3版): CPE83SUJ  Compact Industrial Doors  LevemirTM Penfill® insulina detemir I. Identificação do  la déclaration d`utilité publique  

Copyright © All rights reserved.
Failed to retrieve file