Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » MARTE NFP Types and static profile generation
MARTE NFP Types and static profile generation [message #662979] Fri, 01 April 2011 17:28 Go to next message
Stefano puri is currently offline Stefano puri
Messages: 3
Registered: April 2011
Junior Member
Hi all,

I am trying to generate a static version of our profile which uses Papyrus MARTE. In our profile we have some tags typed with predefined MARTE NFP types, e.g. NFP_Real.

So NFP types are defined in MARTE profile.

However when I generate code from our genmodel I have compilation errors for these types. In fact I have seen that in MARTE java generated code NFP types do not exist, they have been replaced by String type.

Should I remove all the references to NFP types from my profile? Do you know if there is a better way to manage this problem?

Thanks for the support.

Stefano.

Re: MARTE NFP Types and static profile generation [message #673422 is a reply to message #662979] Mon, 23 May 2011 15:28 Go to previous message
Ansgar Radermacher is currently offline Ansgar Radermacher
Messages: 16
Registered: March 2011
Junior Member
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();
Previous Topic:Profile modification for a Class Diagram
Next Topic:customize programatically
Goto Forum:
  


Current Time: Sat Nov 01 10:38:42 GMT 2014

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

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