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 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
>>
>>

-- 
Ansgar Radermacher                CEA/DRT/DILS/LISE
http://www-list.cea.fr/index.htm
phone: +33 16908 3812
mailto: ansgar.radermacher@xxxxxx



Back to the top