file XMI export of ValueSpecification of other types than LiteralSpecification

7 years 4 months ago - 7 years 4 months ago #605 by michaelp
Hi,

Currently, from what I observed, when you export a Package in XMI, all value specifications (for classes and instances) are interpreted as Literals from the attribute type. UML 2.4.1 defines other types : OpaqueExpression, Expression...

This makes it impossible to write an expression that defines the rule to set the value of an element (eg in english). I'm trying to use this in Object diagrams and am stuck when exporting with XMI.

How to reproduce :

NO TYPE
-> Create a class with an attribute of type "None", set a value => XMI export will be unable to complete in the strangest way (no "complete" popup, no error message, Export and Cancel buttons are still clickable)

EXPRESSION FOR INTEGER
-> Create a class with an attribute of type "Integer" and type in a rule (eg "Increment") => XMI export will crash with an obscure message that can be traced in the log as a ValueOf Exception.

I don't know however if it's doable in the current state ("value" being only a field, with nowhere to store information about it being literal or expression).

Thanks,

Michaël
Praxeme Institute

Please Log in or Create an account to join the conversation.

7 years 4 months ago - 7 years 4 months ago #611 by ebr
Hi Michaelp,

Many thanks for this feedback.

You are right when you said that actually there is no place for specifying the type of a ValueSpecification as Expression or OpaqueExpression (even with Modelio 2.1.1).

Actually when the type of an attribute is "Integer", XMI export considers that its value would be a LiteralInteger. I guess we can improve this behavior in some cases (for example in the No Type case) but allowing the specification of a LiteralString in the case of attribute typed Boolean would need a lot changes in Modelio.

Best Regards,

EBR

Please Log in or Create an account to join the conversation.

7 years 4 months ago #623 by michaelp
Thanks for your quick answer.

I understand the changes it would require to completely integrate UML2 "ValueSpecification"

However could we imagine to just change the XMI exporter behaviour so that in case of valueOf Exception, the value gets exported as LiteralString ?

This would not be the cleanest way to do things, however it would allow to specify and export expressions instead of crashing.

Michaël
Praxeme Institute

Please Log in or Create an account to join the conversation.

7 years 4 months ago #624 by ebr
This kind of behaviour could be possible.

Please Log in or Create an account to join the conversation.

7 years 4 months ago #625 by michaelp
I'm still a little lost between the forum and the forge : should I now create a feature request on the forge ? Would that be in Modelio project ? Is the XMI component open-sourced too ?

Michaël
Praxeme Institute

Please Log in or Create an account to join the conversation.

7 years 4 months ago #626 by ebr
Hi,

As the XMI component is a part of the Modelio Project, please create a feature request on the Modelio Project.
It could be useful to create two requests:
  • one for the support of OpaqueExpression, Expression, etc.
  • a second one for the new XMI Behavior


Best Regards,

EBR

Please Log in or Create an account to join the conversation.

Moderators: cdeebr
Time to create page: 0.039 seconds
^ Back to Top