Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mdt-papyrus.dev] MARTE NFP Types and static profile generation

Dear Ansgar,

I have updated my plugin dependency to use MARTE 0.7.3, so I have changed the referred MARTE.genmodel and now it works; maybe I was using a bad genmodel... The generated code for stereotype attributes typed with NFP's is exactly the same as you have posted below.

Thank you very much for your support.

Best regards,
Stefano.

Il 05/05/2011 11.38, RADERMACHER Ansgar 206501 ha scritto:

Dear Stefano,

sorry for the late reply - I have been in holidays.

I have an example of a stereotype, called FlowWCET which has an attribute of type NFP_Duration. The generated code is shown below. 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 tell me what code is generated in your case and which part is causing errors.

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();

On 04/19/2011 09:47 AM, Stefano Puri wrote:
Dear Ansgar,

thank you for the precious information.

So in my .uml profile I have stereotypes with attributes typed with MARTE NFP data types.

I have tried to use your patch and I have seen that your code is invoked during the creation of the .ecore and .genmodel representation of my profile.

However in the Java code which is then generated from from my genmodel I still have references to MARTE NFP data types (instead of String), and so compilation errors.

Am I missing something else?

Best regards,
Stefano.

Il 08/04/2011 11.16, RADERMACHER Ansgar 206501 ha scritto:

Dear Stefano,

no, it would be a bad idea to replace the types in your profile with
String, since you would loose 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;
}

Best regards

Ansgar



LEGAL DISCLAIMER:
The contents of this email and any transmitted files are confidential and intended solely for the use of the individual or entity to whom they are addressed. We hereby exclude any warranty and any liability as to the quality or accuracy of the contents of this email and any attached transmitted files. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. If you have received this email in error please contact the sender and delete the material from any computer.


Back to the top