Home
NEPTUNE II User Manual Version 1.0 17 January 2010
Contents
1. gt AssociationEnd gt AssociationEnd gt AssociationEnd gt AssociationEnd gt AssociationEnd gt AssociationEnd gt AssociationEnd gt AssociationEnd gt AssociationEnd gt AssociationEnd Fi 2 an Figure 4 Model browser and its menu The first one consists to select in model browser see Figure 4 9 the model you want to remove and to click on the Remove Model option see Figure 4 This opens the delete windows where the two text fields are deactivated Clicking on the Delete button opens a confirmation box where you confirms the removal After selecting yes the model is removed The second one consists in selecting the Remove Model option in the XMI menu see Figure 3 This opens the remove model window displyed in Figure 5 In this case the Name of the Metamodel and Name of the model drop down lists are activated You must first select the metamodel corresponding to your model then select the model in the list Name of the model Finally click on Delete to complete the deletion Name of the metamodel Name ofthe model libro estad transic 2 Delete Cancel Figure 5 Remove model window 5 30 Copyright IRIT How to generate a metamodel Generating a metamodel is a very delicate operation Indeed it requires having the metamodel description in XMI 1 5 or in Ecore format In addition the metamodel mus
2. n t n context Foundation Core Class query self outputText toto txt public class self name n tu t self feature gt select f f oclisKindOf Foundation Core Attribute gt iterate att Foundation Core Attribute BLI Y str att construireAtt att construireSetAtt n att construireGetAtt Example 16 serialisation rule for class diagram in text format public class private Integer age public void setAge Integer val this age val public Integer setAge return this age Example 17 example of a serialisation using rules defined Example 16 Example 17 shows the result of the rule defined in Example 16 performed on the class diagram of the Example 14 This rule generates a java class schema from the UML class diagram Others components can be implemented for serialisation of models in different formats java C Ada 25 30 Copyright IRIT Conformance ti ma foe e Navigating non navigable associations No The UML 2 0 Infrastructure and the MOF 2 0 Core specifications that were developed in parallel with this OCL 2 0 specification share a common core The OCL specification contains a well defined and named subset of OCL that is defined purely based on the common core of UML and MOF This allows this subset of OCL to be used with both the MOF and the UML while the full spec
3. or mmSysML uml ActivityFinalNode To specify models in OCL rule you must add the model between square brackets separated by commas When several models are specified the rule is executed on all models In allInstances is applied to all instances of the class mos RootDefinition in the models atv bdsl and atv bds2 Definition of functions on OCL datatypes NEPTUNE supports definition of new operations on OCL datatypes Example 3 illustrates the operation starts With that returns true if self starts with the string s context String def startsWith s String Boolean s size lt self size self substring l s size s Example 3 operation definition on OCL datatype Syntax extension A problem occurs when a model element has the same name as an OCL keyword lt eClassifiers xsi type ecore EClass name Comment eSuperTypes Element gt lt eStructuralFeatures xsi type ecore EAttribute name body ordered false eType String unsettable true gt eStructuralFeatures Example 4 XMI fragment of a metamodel In Example 4 a fragment of a metamodel defines a classifier with an attribute called body body is an OCL keyword defining the operation body 17 30 Copyright IRIT context mmSysML setstartrackertovacuumtemperaturecomp uml DecisionNode def estTemperature cfs Bag mmSysML uml ControlFlow cond
4. NEPTUNE ll User Manual Version 1 0 17 January 2010 Copyright IRIT Table of contents TABLE OF CONTENTS ENVIRONMENT VARIABLES HOW TO LOAD A MODEL HOW TO REMOVE A MODEL HOW TO GENERATE A METAMODEL HOW TO DELETE A METAMODEL GRAPHICAL USER INTERFACE DESCRIPTION THE BROWSERS THE INTERNAL FRAMES TOOLBARS TABS THE MENUS NEPTUNE MENUS EDITOR MENU CONTEXTUAL MENUS Metamodel browser menu Model browser menu Editor menu POCL EXTENSIONS EXTENSION TO WRITE MULTIMODEL OCL RULES DEFINITION OF FUNCTIONS ON OCL DATATYPES SYNTAX EXTENSION LIBRARY EXTENSIONS OCLVOID STRING COLLECTION DYNAMIC TYPING POCL EXTENSION FOR MODELS TRANSFORMATION POCL OPERATORS SEQUENCE SEMANTIC POCL EXTENSION FOR MODEL SERIALISATION XMI FORMAT TEXT FORMAT CONFORMANCE BIBLIOGRAPHY VERSION NOTES ILLUSTRATION TABLE EXAMPLE TABLE 2 30 Copyright IRIT Environment variables Before installing NEPTUNE you must Check for the existence of the environment variable If it does not exist you must define it with a valid path to the current java development kit NEPTUNE requires at least version 1 6 of the JDK in order to work correctly m JRE 1s insufficient because metamodels are compiled and you need a java version including java compiler Add to your path an access to the java and javac commands To access these executables you must add the variable JAVA_HOME bin windows form
5. String Boolean cfs guard gt select c mmSysML uml ValueSpecification c oclisKindOf mmSysML uml OpaqueExpression body gt flatten contains cond gt includes true Example 5 rule using keyword as model element name version 1 Example 5 is OCL definition using body In this operation definition the use of the metaelement body conflicts with the OCL keyword body In order to avoid such a conflict metaelements having the same name as an OCL keyword must be surrounded with underscores as in Example 6 context mmSysML setstartrackertovacuumtemperaturecomp uml DecisionNode def estTemperature cfs Bag mmSysML uml ControlFlow cond String Boolean cfs guard select c mmSysML uml ValueSpecification c ocilIsKindOf mmSysML uml OpaqueExpression _body_ gt flatten contains cond gt includes true Example 6 OCL rule using keyword as model element name version 2 Three new OCL keywords have been added to NEPTUNE In the pOCL editor these keywords are in blue and in italic query allows to define queries on a model It is then possible to define views and metrics All the results returned by a query have been correctly typed and this type 15 part of the returned result context mmodell 5fumlmodeli5 Foundation Core Class query Tuple className String self name numberOfAssociations Integer self association size AA
6. XMI content XMI Example 15 example of a serialisation using rules defined in Example 14 Example 15 shows an execution of the rules of the Example 14 on the trivial class diagram containing only one class Toto The result of this execution can be loaded in the NEPTUNE II platform Text format OclVoid int outputText OclVoid int file OclVoid_int text this operation creates a new text file whose name is contained in file and writes the text text in it This operation must be invoked first It returns the element on which the rule is applied OclVoid_int outputText OclVoid_int texte this operation writes the text text in the file previously created using the operation outputText OclVoid int file OclVoid int text This operation returns the elements on which the rule is applied When serializing in text mode the first operation used must always be outputText OclVoid int file OclVoid int text 1n order to create the file file 24 30 Copyright IRIT context Foundation Core Attribute def construireAtt String private self type name self name n def construireSetAtt String tpublic void set self name firstToUppercase self type name val n t n t this self name val n t n def construireGetAtt String tpublic self type name set self name firstToUppercase n t n t return this self name
7. illi mmMo8 gt iy mmMOSWeavin T gt Modeles The browsers Figure 4 shows the two browsers the metamodel browser on the top the model browser on the bottom Each of them uses icons showing the kind of elements handled E Ametaclass CE NEPTUNE 11 v2 0 Checker File XMI Language 7 l Options 1 Debug Graphical User Interface Description gt li MonMetamodele gj 1 context mmodell 5 Foundation Core Class 2 query Tuple 3 nom self name nbAttributs self feature gt select s mmodell 5 Foundation Core Feature s oclIsKindOf mmodell 5 Foundation Core Attribute 35ize s ocliIsRindOf mmodeli 2 Foundation Core Method size nbAssociaitions self association size 10 112 _ Printstacktrace _ Trace 4 5 6 nbMethodes self feature gt select s mmodell 5 Foundation Core Feature 7 8 a L Uniqueiteration Instance o _ Stricte Tuple nom self name nbAlftributs self feature gt select s mmodel1 5 Foundation Core Feature s ocliskindOf mmodel1 E gt Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple Tuple OCL request successfully executed in 0 531 s Figure 12 Neptune User Interface nbMethodes Integer n nbMethodes Integer n er nbMethodes Integer n nbdethodes Integer n nbMethodes
8. Core Generalization query Bag self gt outputRolexMI self Generalization child context Foundation Core Generalization query Bag selfj outputRoleXMI self Generalization parent context Foundation Core Generalization query self child outputXMI self Generalization child Bag xmi idref context Foundation Core Generalization query self parent outputxMI self Generalization parent Bag xmi idref Example 14 serialisation rule for class diagram in XMI format 23 30 Copyright IRIT Toto age Integer lire versions 0 encodging UTR e lt XMI xmlns UML xmi version 1 2 timestamp Sat Nov 28 22 13 50 CET 2009 xmlns UML org omg xmi namespace UML gt lt XMI header gt lt XMI documentation gt lt XMI exporter gt NEPTUNE vl 1 XMI exporter lt XMI exporterVersion gt 0 24 5 revised on SDate 2006 11 06 19 55 22 0100 Mon 06 Nov 2006 S lt XMI exporterVersion gt lt XMI documentation gt lt XMI metamodel xmi name UML xmi version 1 4 gt lt XMI header gt lt XMI content gt lt UML Model xmi id neptune metamodeles mmodell 5 ModelManagement ModelQ9b6bcd isLeaf false name untitledModel isRoot false isAbstract false UML Namespace ownedElement lt UML Class xmi id neptune metamodeles mmodell 5 Foundation Core ClassQ633c70 name Toto isActive false isLeaf false isRoot false gt UML Namespace ownedElement UML Model
9. Paste the text in the clipboard into the editor at the current cursor position 16 30 Copyright IRIT pOcl extensions Extension to write multimodel OCL rules The main extension of OCL is the capability to handle simultaneously several models conform to different metamodels To indicate a metamodel in an OCL rule you must prefix the path with the metamodel name package mmOZ2pl o2pl context mmOZpl o2pl Affectation_Contenu def let instruction Sequence OclAny Sequence self affContSuiv self paramCont self valCont def let registre Bag String mmMoslatv bdgdsl atv bdszl tmosteRootDerrznitronzsrolllnstances rechercheRegistre ccdTemp flatten estTerminal cfs Bag mmSysML uml ControlFlow Boolean cfs target gt select an mmSysML uml ActivityNode an oclisKindOf mmSysML uml ActivityFinalNode gt size cfs size Example 2 metamodel and model naming in an OCL rule Example 2 shows three use cases of the metamodel name In the metamodel name is used in a package definition in order to specify the metamodel where to find the package o2pl for example In the metamodel name is used in a context definition in order to specify the metamodel where to find the class for example o2pl Affectation Contenu In and the metamodel name is used in an expression definition for specifying the complete path to specific class for example mmMos atv_bds mos RootDefinition
10. numberOfAssociations numberOfAssociations 26_ a ie me mi 8 PL Sie ie D Y Tupe numberOfAss ociations 1 Classmamezrnunmiltera Example 7 pOCL rule using a query Example 7 shows a rule allowing to extract the name of each class and the number of its associations The result of this query contains an indication of the data structure used 0 the elements composing this structure and the type of each element showdef displays all the operations defined The context is only required to have OCL rule syntactically well formed Example 8 shows the additional operation defined to write rules An operation is defined on a context 0 and has a name context 2 1 showdef Y RESULTAT S REQUETE S showdet context String def starts Wit context OclAny def estie minal Fe context OclAny def seq context String def contains ae ure ial nirai Cee i Example 8 showdef command An operation can be used on an element having the same context as the operation or on an element having a type compatible with the context on which the operation is defined For example an operation defined on real is usable on integer Operations defined in NEPTUNE support overloading and dynamic binding undef removes an operation defined in a context 18 30 Copyright I
11. used to store the rule Close the current pOCL syntactic editor Contextual menus Metamodel browser menu Load Model Goto Copy Load Model Copy Ctri C Metamodel Generation Metamodel Destruction Figure 20 Metamodel contextual menu This opens the Load a model window displayed in Figure 2 In this case the Name of Metamodel drop down list is activated You must select metamodel corresponding to your model and click on the button see Figure 2 to open the File chooser dialog box then select the XMI file containing your model Goto allows to follow either an association end or an inheritance link Click on Goto to access the description of the class in association with the selected class or to the ancestor of the class if the considered link 1s an inheritance link Copy the path of the selected element in the browser 8 mmodel 5 li BehavioralElements Y Foundation Y f Core t EJ Abstraction Ej Artifact Association Ej AssociationClass Ej AssociationEnd gt Ej Attribute BehavioralFeature Binding Cti c Copy Metamodel Generation Example 1 Example of the copy option Example 1 shows an example of how to use the copy option In this case the information in the clipboard is mmodell_5 Foundation Core Class 15 30 Copyright IRIT Metamodel Generation Metamodel Destruction This opens the load metamo
12. Integer n nbMethodes Integer n nbMethodes Integer nbMethodes Integer n nbMethodes Integer n nbMethodes Integer n nbldethodes Integer n nbMethodes Integer nbMethodes Integer n nbldethodes Integer n Common icons for both metamodel and model browsers Aft metaclass or object attribute gt association between the metaclass and the specified metaclass Metamodel browser specific icons 10 30 As shown n Figure 12 the NEPTUNE GUI consists of two areas The first area on the left of the window contains two browsers allowing to navigate in metamodels and in models The second area contains internal frames for editing and executing pOCL rules Copyright IRIT An inheritance link between the metaclass and the specified metaclass An enumerative Model browser specific icons An object instance of the metaclass in which the object appears An object part of an opposite association end of the considered object If model is specified in OCL rule model selected in the model browser is used The internal frames Toolbars contains all the functionalities for creating saving editing pOCL rules vo m 1 Create a new tab to edit and to process pOCL rules Open a file containing a pOCL rule Clicking on this button displays a dialog box where you select a rule This dialog box is similar to t
13. RIT context String undef startsWith Example 9 undef command Example 9 illustrates a rule to remove the startsWith defined on the context String Library extensions The OCL library is compliant with the OCL 2 0 standard However the NEPTUNE OCL library for primary types and collections includes all the operations specified in the Object Constraint Language OMG Available Specification Version 2 1 ptc 09 05 02 In order to use NEPTUNE for different projects we add several new operations on String and Collection OclVoid oclUndefined operator returns oclUndefined object This operation is mainly used in transformation in order to provide a result when an assignment or a creation failed Example 13 9 String In order to analyse conditional expression used in decision nodes for example the String library includes an operation called scanner returning the sequence of tokens present in the expression where the scanner operation is applied This operation returns a sequence of tuple made of an attribute containing the token see Example 10 and another containing the type of the token keyword 99 66 literal symbol integer boolean string and real see Example 10 9 foo and 2 lt E RESULTAT S REQUETE S OCL Too and bar 2 scanner Sequence TupleftokenType Strin tokenType String toke ok
14. ancel Figure 2 Load a model window The second one consists in selecting the load Model option in the XMI menu see Figure 3 This opens the Load a model window displayed in Figure 2 In this case the Name of Metamodel drop down list is activated You must select the metamodel corresponding to your model and click on the button see Figure 2 to open the File chooser dialog box then select the XMI file containing your model You can modify the model name in the text field Name of the model ies NEPTUNE ii v1 1 OCL Checker File IM Language 7 Metamodel Generation Q9 gt Metamodel Destruction Load Model Remove Model L S rT rs Pr rr F 4 8 MonMetamo dele Figure 3 XMI menu When a model is loaded it appears in the model browser Figure 4 9 4 30 Copyright IRIT How to remove a model There are two options to remove a model c2 NEPTUNE Il v1 1 OCL Checker File XMI Language Y gj MetaModeles gt lil j mUML2 2 1 0 lini mmSysML gt mmO2p gt ij mmLangageC gt ij mmUML2_1_0_0 gt mmEcore gt mmMOS gt ij mmMOSWeaving gt Y AssociationEnd Y Copy Ctri C 4 Refresh Art orderinggEUNORDERED Art targetScope INSTANCE Art visibilityZ PUBLIC gt gt association mmodel1 5 F gt gt participantmmodel1 5 Fo
15. ation The second area contains all the options of the pOCL interpreter There are six options For performance reason it is impossible to process several rules simultaneously Indeed processing several rules simultaneously requires using synchronous collections which increase the access time significantly For huge model this increase is too prejudicial Debu Display in the console information about the nodes crossed by the interpreter 5 This option is only used expert to debug the interpreter Display in the console the runtime stack when errors are generated by the Printstacktrace SP interpreter This option is only used by expert to debug the interpreter Display in the console information for debugging NEPTUNE interpreter In Trace particular this option displays intermediate results This option is only used by expert to debug the interpreter This option indicates to the interpreter that the rule is only executed for the first instance processed After this first iteration the interpreter returns the result This option can be used for example for rules beginning by X allInstances Uniqueiteration This option indicates to the interpreter that the rule 1s only executed for the Instance selected instance The instance is selected in the model browser After this iteration the interpreter returns the result This option imposes to the interpreter to verify that each expression is Strict completely and correctl
16. attributs represents the mark s attributes The attribute xmi id is automatically generated This operation returns the element on which the rule 1s applied OclVoid int outputXMI OclVoid int grandfather OclVoid int father Bag int OclVoid int attributs This operation is similar to the previous one but references both the grandfather and the father of the mark The xmi idref is derived from the object invoking the operation In xmi idref references the xmi id calculated from self child This operation returns the element on which the rule is applied Collection int T outputRoleXMI OclVoid int pere OclVoid int role This operation creates attributes for association ends This operation is only applicable on collections containing the element referenced by the role This operation returns the elements on which the rule is applied context ModelManagement Model query Self outputXxMI apres xmi bagi xmi i1d z2sLeaf name zssSpecification isRoot tisAbsttaottJ 0 context ModelManagement Model query Bag selfj outputRoleXMI self Namespace ownedElement e context Foundation Core Class query self outputXMI Namespace ownedElement Bag i xmi id name visiDiIIty QT1sAOtive 85Loaf 35B ooE context Foundation Core Generalization query self outputXMI NNamespace ownedElement Bag xmi id isSpecification context Foundation
17. ave allows to save the result on disk and ok allows to continue the validation Either there are classes that have not namespace st be present in a package or an eCore metamodel and it must be linked with an other metamodel T a 7 T RESULTAT S REQUETE S OCL gt ifself namespace ocllsUndefined or not self namespace oc o Figure 9 NEPTUNE metamodel error or warning box In order to avoid conflicts between the metamodel name and a namespace available in the metamodel we recommend prefixing the metamodel name by mm For example the name of the C language metamodel could be mmLangageC The NEPTUNE metamodel validation tool is not able to detect all the errors in a metamodel So the compiling of the metamodel fail It is important to carry out the results of the compilation and to correct the metamodel In this case the partially compiled metamodel must be manually removed Ecore metamodels can have references to metaelements from other metamodels In this case the box below Figure 10 is displayed 7 30 Copyright IRIT Ouvrir Rechercher dans vj i8 joi EModelElement class Nom de fichier Fichiers du type Directory or Ecore ecore EModelElement Ouvrir Annuler Figure 10 Metaclasses selector This dialog box allows users to select the different elements required for
18. d metaclass This new instance is created in the model stated in the metaclass path or in the default model Example 13 is the assignment operator The behaviour of this operator depends on the left member type If the type is a data type or a metaclass this operator affects the result of the right expression in the left member Example 13 If the type is a collection this operator adds the result of the right expression in the collection specified in the left member Example 13 The evaluation of the assignment operator returns a boolean true if the assignment is correctly processed and false otherwise transform runs the transformation All assignments and creations are performed If a rule contains assignments or creations without using the transform operator an exception is generated indicating an inconsistency in the rule definition model new mmodell 5 modelClass context mmodell_5 libro BehavioralElements StateMachines SimpleState def StatezClass Sequence Boolean Sequence class lt new mmodeli1 b5 modelClass Foundation Core Class class name self name class generalization self Generalization class context mmodell_5 libro BehavioralElements StateMachines SimpleState def ClassPere mmodell1 5 modelClass Foundation Core Class if Sequence class lt new mmodell_5 modelClass Foundation Core Class class name State gt excludes false then cla
19. del generation window displayed in Figure 7 You must click on the button see Figure 7 to open the file chooser dialog box and select the XMI file containing your metamodel This opens the Metamodel Destruction window displayed in Figure 11 In this case the Name of the Metamodel drop down list is activated Select the metamodel you want to delete and click on the Destruction button Model browser menu Goto Remove model Copy Refresh Editor menu Select all Cut Copy Paste Refresh Figure 21 Model contextual menu Goto allows to follow an association Click on Goto to access the object in association with the selected objet This opens the remove model window displyed in Figure 5 In this case the of the Metamodel and Name of the model drop down lists are activated You must first select the metamodel corresponding to your model then select the model in the list Name of the model Copy the path of the selected element in the browser Refresh allows to display the models not displayed in the model browser This is useful when a user create a new model during a transformation Select all ef Cut 4 Copy Paste Figure 22 pOCL editor contextual menu Select all the text in the pOCL editor Cut the selected part of the rule and save it in the clipboard Copy the selected part of the rule and save it 1n the clipboard
20. enType lileral String String toke cenType String toke String toke T p tokenType String toke Example 10 scanner operation Collection A model can be considered as an oriented graph In this context 1t could be useful to calculate the whole path between two nodes of a model closure returns a collection resulting of the application of an OCL expression on the elements of a collection recursively until no new calculated element can be added This operation implements a fixed point algorithm context 11 5 umlmodellb5 Foundation Core Class query self name anc self gt closure c mmodell_5 Foundation Core Class c c generalization parent namej 19 30 Copyright IRIT LUT zahl TO J Y Tuple anc Bag String nom anc Hag String Element ModelElemen nom Call amp ction Example 11 closure operation Example 11 shows a rule allowing to complete all the ancestors of se f The result of this computing includes self Dynamic typing The NEPTUNE pOcl interpreter supports dynamic typing of expressions For each evaluated element the correct type is automatically computed In this context the OCL operator OclAsType is now useless because the dynamic type is always computed during an evaluation context 11 5 umlmodell5 Foundation Core Classifier query mmodell 5 Fo
21. generating a new metamodel O indicates the metamodel where the required metaclass is located and indicates the metaclass If different versions of a same metamodel co exist in NEPTUNE the user must select the correct one 6 30 Copyright IRIT How to delete a metamodel There are two options to delete a metamodel The first one consists in selecting in the metamodel browser see Figure 11 0 the metamodel you want to delete This opens the Metamodel Destruction window where the text field is deactivated Clicking on the Destruction button opens a dialog box asking for the confirmation of the destruction After selecting yes the metamodel is deleted The second one consists in selecting the Metamodel Destruction option in XMI menu see Figure 3 This opens the Metamodel Destruction window displayed in Figure 11 In this case the Name of the Metamodel drop down list is activated Select the metamodel you want to delete and click on the Destruction button Name ofthe metamodel MonMetamodelez Destruction Cancel Figure 11 Delete metamodel window In order to avoid problems it is recommended to exit from NEPTUNE to start it again 9 30 Copyright IRIT v 50 MetaModeles gt B 2_2_1_ gt mmSysML gt mmO2pl E mmLangagec d mmUuML2 1 0 mmodel1 5 gt ijj mmEcore
22. hose shown in Figure 10 Close the active tab If the rule currently edited 1s modified a dialog box where you save the rule before you closing the tab Save the active tab If it is the first save of the rule a dialog box is displayed where you select directory to save the rule and you provide the name of the file used to store the rule Save the active tab Clicking on this button always opens the dialog box where you select the directory to save the rule and you provide the name of the file used to store the rule Cut the selected part of the rule and save it in the clipboard Copy the selected part of the rule and save it in the clipboard Paste the text in the clipboard into the editor at the current cursor position undo redo 11 30 Copyright IRIT contains the button to process a rule and the button to save the result of this runtime on disc Process the rule currently edited Save the result of the runtime in text file A dialog box opens where you select the repository where to save the rule and you provide the name of the file used to store the result is displayed PN Tabs A tab consists of four zones constitute a tab The first one 8 1s the rule editor This editor supports the syntactic coloration OCL keywords are displayed in blue and bold italic style pOCL specific keywords are displayed in blue and italic style Strings are displayed in blue and comments in light gray Four characters replace tabul
23. ification can be used with the UML only The following compliance points are distinguished for both parts I Syntax compliance The tool can read and write OCL expressions in accordance with the grammar including validating its type conformance and conformance of well formedness rules against a model 2 XMI compliance The tool can exchange OCL expressions using XMI 3 Evaluation compliance The tool evaluates OCL expressions in accordance with the semantics chapter The following additional compliance points are optional for OCL evaluators as they are dependent on the technical platform on which they are evaluated allInstances pre values and oclIsNew in postconditions OclMessage navigating across non navigable associations accessing private and protected features of an object The following table shows the possible compliance points Each tool is expected to fill in this table to specify which compliance points are supported OCL06 Several tries have been realized in order to navigate non navigable associations We discard this feature due to the number of ambiguities generated by the lack of name of the association end no navigable Generating random names does not seem to be a useful solution 26 30 Copyright IRIT Bibliography OCLO6 Object Constraint Language OMG Available Specification Version 2 0 formal 06 05 01 May 2006 http www omg org spec OCL 2 0 PDF OCLO9 Object Constrain
24. ile containing your metamodel You can modify the metamodel name in the text field Metamodel name Metamodel name MonMetamodele XMI File Monldetamodele xmi Generate Cancel Figure 7 Metamodel generation window The second one consists in selecting the Metamodel Generation option in the XMI menu see Figure 3 O0 This opens the load metamodel generation window displayed in Figure 7 You must click on the button see Figure 7 to open the file chooser dialog box and select the XMI file containing your metamodel You can modify the metamodel name in the text field Metamodel name A partial validation 1s also performed by NEPTUNE before generating a metamodel Figure 8 shows the different steps of a metamodel validation If no error is detected the internal form of the metamodel is generated and compiled 6 30 Copyright IRIT Loading metamodel Checking inheritance graph Searching unpacked classes Figure 8 NEPTUNE metamodel validation Searching unpacked classes is only a warning When metamodels reference other metamodels some classes are not in a namespace because this namespace is part of an other metamodel If a warning or an error occurs the box below Figure 9 is displayed This box displayed the problem type error or warning a description of the problem 9 and the result of the test to find the element for which the test failed S
25. keyword as model element name version 2 Example 7 pOCL rule using a query Example 8 Example 9 Example 10 Example 11 Example 12 Example 13 Example 14 Example 15 Example 16 Example 17 showdef command undef command scanner operation closure operation dynamic typing transformation example serialisation rule for class diagram in XMI format example of a serialisation using rules defined in Example 14 serialisation rule for class diagram in text format example of a serialisation using rules defined Example 16 30 30 I3 17 17 17 18 18 18 18 19 19 20 20 22 23 24 25 23 Copyright IRIT
26. list Name of the model See section How to remove a model The third menu Figure 16 allows to change the current language used by the NEPTUNE interface Currently NEPTUNE supports French and English By default the English language is selected English i Francais Figure 16 Language menu The fourth menu Figure 17 contains additional functions as Help which displays help information not yet implemented and About which displays NEPTUNE contributors and NEPTUNE licence About Figure 17 menu Editor menu m OCL Syntactic Editor File Figure 18 pOCL Syntactic Editor menubar New a Open 63 Close E Save s Exit Figure 19 File pOCL editor menu New Create a new tab to edit and to process pOCL rules Open Open a file containing a pOCL rule Clicking on this button displays a dialog box where you select a rule This dialog box is similar to those shown in Figure 10 Close Close the active tab If the rule currently edited 1s modified a dialog box where you 14 30 Copyright IRIT Save Save as Exit save the rule before you closing the tab Save the active tab If it is the first save of the rule a dialog box 1s displayed where you select directory to save the rule and you provide the name of the file used to store the rule Save the active tab Clicking on this button always opens the dialog box where you select the directory to save the rule and you provide the name of the file
27. o clicking on the top right cross The second menu Figure 15 groups the options to handle models and metamodels Metamodel Generation IMetamodel Destruction Load Model Remove Model IEEE z Figure 15 XMI menu Metamodel This opens the load metamodel generation window displayed in Figure 7 You must Generation click on the button see Figure 7 to open the file chooser dialog box and select the XMI file containing your metamodel See section How to generate a metamodel Metamodel This opens the Metamodel Destruction window displayed in Figure 11 In this Destruction case the Name of the Metamodel drop down list is activated Select the metamodel you want to delete and click on the Destruction button See section 13 30 Copyright IRIT How to delete a metamodel Load Model This opens the Load a model window displayed in Figure 2 In this case the Name of Metamodel drop down list is activated You must select the metamodel corresponding to your model and click on the button see Figure 2 to open the File chooser dialog box then select the XMI file containing your model See section How to load a model Remove Model This opens the remove model window displyed in Figure 5 In this case the Name of the Metamodel and Name of the model drop down lists are activated You must first select the metamodel corresponding to your model then select the model in the
28. omplex it 1s necessary to create a new model Line in Example 13 will return an oclUndefined object oclUndefined is an instance of the bottom type OclVoid that can be substituted to all type and metaclasse used Sequence semantic To perform a transformation the semantic of the sequence collection has been modified in order to force the evaluation of the sequence s elements from the left to the right This addition to the sequence semantic does not interfere with the initial semantic because no information about the evaluation of sequence s elements is described in the OCL standard 22 30 Copyright IRIT pOcl extension for model serialisation As NEPTUNE delivers tools to transform models it is also necessary to provide functionalities for model serialisation In this version two serialisations are provided text serialisation and XMI serialisation To support serialisation the OclVoid and Collection have been enriched with new operations Three are required in order to serialise models in XMI format and two for serialisation in Text format This extension is experimental and no test has been performed yet format OclVoid_int outputXMI OclVoid int father Bag_int lt OclVoid_int gt attributs This operation creates a new XMI mark having the type of the context of the rule as name father provides either the name of the file if no name has been specified 0 or the name of the mark
29. or JAVA HOME bin Unix form to the path Examples In unix using sh shell you must declare JAVA HOME usr local jdki 6 export JAVA HOME path Spath SJAVA_HOME bin export path In windows XP you must Parameters system advanced Environment variables Create d new variable for a user JAVA HOME C Program Files Java jdki 6 0_13 Modify the path variable Add at the end of this path JAVA_HOME 3 30 Copyright IRIT How to load a model There are two options to load a model The first one to select in the metamodel browser see Figure 1 0 the metamodel to which the model is conform and to click on the Load Model option A dialog box opens see Figure 3 where the of Metamodel drop down list is deactivated Click on the button see Figure 2 to open the File chooser dialog box and select the XMI file containing your model You can modify the model name in the text field Name of the model CB NEPTUNE Il v1 1 Checker File XMI Language 7 v 8 MetaModeles E About Load Model ticipants O E Copy cuc m ow onm m of i Metamodel Generation 25 Destruction mee GNU GENERAL PUBLIC LICENSE Figure 1 Metamodel browser and its menu Load a model Name of the metamodel o Name of the model MonModele XMI File MonModele xmi C
30. ss else self oclUndefined endif 21 30 Copyright IRIT context mmodell_5 libro BehavioralElements StateMachines SimpleState def Generalization 115 mmodell 5 modelClass Foundation Core Class Sequence Boolean Sequence gen lt new mmodeli_5 modelClass Foundation Core Generalization if 11 5 modelClass Foundation Core Class alllinstances gt exists c 11 5 modelClass Foundation Core Class c name State then gen parent lt mmodell 5 modelClass Foundation Core Class alllInstances gt select c 11 5 modelClass Foundation Core Class c name State else gen parent lt self ClassPere endif gen child lt fils context mmodell 5 libro BehavioralElements StateMachines SimpleState transform self State2Class Example 13 transformation example Example 13 illustrated a transformation consisting in generating a class diagram from a state transition diagram using the design pattern state This example is focused on the creation of one class by state having common class ancestor called State The source model is called libro and the target model modelClass It is possible to make on place transformation However the lack of an operator removing an element of a collection limits this kind of transformation So on place transformation must be limited to punctually adding or modifying a property If the transformation is more c
31. t Language Beta 2 OMG Available Specification Version 2 1 ptc 09 05 02 May 2009 http www omg org spec OCL 2 1 Beta2 PDF 27130 Copyright IRIT Version notes 28 30 Copyright IRIT Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21 Figure 22 Illustration table Metamodel browser and its menu Load a model window XMI menu Model browser and its menu Remove model window Eclipse menu to validate Ecore metamodels Metamodel generation window NEPTUNE metamodel validation NEPTUNE metamodel error or warning box Metaclasses selector Delete metamodel window Neptune User Interface Neptune menubar File menu XMI menu Language menu menu Syntactic Editor menubar File pOCL editor menu Metamodel contextual menu Model contextual menu editor contextual menu 29 30 UNA A A OV X HX HX Copyright IRIT Example 1 Example 2 Example 3 Example 4 Example 5 Example 6 Example table Example of the copy option metamodel and model naming in an OCL rule operation definition on OCL datatype XMI fragment of a metamodel OCL rule using keyword as model element name version 1 OCL rule using
32. t be validated in order to be well formed If the metamodel is created using the Eclipse platform you must use the Validate option as illustrated in Figure 6 0 before generating a metamodel G C millan WEP TUNE lI 2_O Tests eCore memC ECHE Eclipse Platform Edt Navigate Search Project Run Sample Ecore Ed or Window Help T Project O 7 iis 152 aaaa file C millan NEPTUNE 2011 2 0 Tests eCore mmC ecore 9155 MyProject 8 gt org eclipse emf examples library f3 Ein New Chid E s 165 org eclipse em examples library edit Ei EBool unda Chile Lc org eclipse em examples library editor f Ren Culi le org eclipse emf acl exemples interpreter t3 EChar 1 ang echpse gef examples shapes Ej ERoal of Cul E Copy um Fate El Deste H decla declar Validate Q deda Cont or init declarator IRE B storeg Me H type Refresh er qualifier Properties View qualifier Figure 6 Eclipse menu to validate Ecore metamodels There are two options to generate a metamodel The first one consists to select in the metamodel browser see Figure 1 0 the option Metamodel Generation see Figure 1 This opens a dialog box see Figure 7 Click on the button see Figure 7 to open the File chooser dialog box and select the XMI f
33. undation Core Classifier alllInstances context 11 5 umlmodell5 Foundation Core Classifier query mmodell 5 Foundation Core Classifier alllnstances select cl cl ocliIsKindOf mmodell 5 Foundation Core Class context 11 5 umlmodell5 Foundation Core Classifier query mmodell 5 Foundation Core Classifier alllnstances select cl cl ocliIsKindOf mmodell 5 Foundation Core Class isActive Example 12 dynamic typing Example 12 shows three pOCL rules Evaluation returns as a set of Classifier while evaluatin returns a set of Class In this case the evaluation of the rule shown in is valid although the oclAsType operation is not used 20 30 Copyright IRIT pOcl extension for models transformation An OCL extension allows side effects in order to transform models This extension provides four operators and modifies the semantic of the OCL sequence pOcl operators model sets up the default model on which the rules will be evaluated To create a new model it 1s necessary to use a model operation followed by new and the metamodel and model name Example 13 9 Syntax model new MetamodelName ModelName The created model does not appear in the browser model Figure 4 To display it it is necessary to use the refresh item of the model browser contextual menu Figure 21 new creates a new instance of the mentione
34. y typed In particular this option forbids use of implicit variables in iterate expressions The third area 8 displays the result of the processed rule Each gray line displays the exact type of the rule processed on an instance This gray line is a node containing the value calculated by the interpreter If the result 15 a tuple each leaf corresponds to an attribute of the tuple If the result is a collection each leaf corresponds to a value contained in the collection The attributes or the values are displayed alternatively in white and in blue The fourth area displays the current position of the cursor in the editor and the duration of the runtime once terminated 12 30 Copyright IRIT is common to all tabs This progression bar indicates the amount of memory available for NEPTUNE Clicking on it runs the garbage collector The menus NEPTUNE menus Four menus are available in the main menubar of the NEPTUNE application see Figure 13 91 NEPTUNE Il v1 1 OCL Checker File AMI Language 7 Figure 13 Neptune menubar The first menu groups Figure 14 the option to open editor and consoles New Extern Console Stdout Extern Console Stderr Figure 14 File menu New Open a new pOCL editor Extern Console Stdout Open a console displaying the standard output messages Extern Console oe Open a console displaying the error messages in red Close Close the NEPTUNE tool This action is similar t
Download Pdf Manuals
Related Search
Related Contents
Benutzerhandbuch Cables Direct NLRB-399C PATA cable Fillflex™ Split Wall Operating and Service Manual Bonjour Bobigny 751 Anaïs & Thierry ILS SE MARIENT !! Copyright © NETASQ 2008 Page 1 sur 136 ENUG0810 Precautions on the Use of the YS1000 Series 3 controlli e manutenzione INSTALLATION MANUAL MANUAL DE INSTALACIÓN MANUEL D Copyright © All rights reserved.
Failed to retrieve file