|
Re: MARTE NFP Types and static profile generation [message #673422 is a reply to message #662979] |
Mon, 23 May 2011 15:28 |
|
Dear Stefano,
you should not replace the NFP types with strings, since you would loose type information, i.e. the ability to enter syntactically correct expressions via the xtext based stereotype editor.
We use a patched variant of the org.eclipse.uml2.uml plugin to convert NFP data types to strings during the UML to ecore conversion. When you create the genmodel from the ecore file, make sure to reference the MARTE genmodel to avoid a re-generation of MARTE elements.
The patch is in the file UMLUtil.java, method "boolean isEDataType(Namespace namespace)"
@Override
public Boolean caseDataType(DataType dataType) {
// Chokri modif
return Boolean.FALSE;
} .
See below the code generated for an example of a stereotype, called FlowWCET having an attribute of type NFP_Duration. In the generated comments, you see that it is in fact an NFP_Duration on the model level, but the Java type is a String.
Please note that the generated impl classes have some references to classes of the static MARTE profile, i.e. you have to declare a dependency to the static profile in your plugin.
Best regards
Ansgar
public interface FlowWCET extends EObject {
/**
* Returns the value of the '<em><b>WCET</b></em>' attribute.
* @return the value of the '<em>WCET</em>' attribute.
* @see #setWCET(String)
* @see SCM.SCMPackage#getFlowWCET_WCET()
* @model unique="false" dataType="org.eclipse.papyrus.MARTE_Library.BasicNFP_Types.NFP_Duration" required="true" ordered="false"
* @generated
*/
String getWCET();
|
|
|
Powered by
FUDForum. Page generated in 0.91014 seconds