[umbrello] [Bug 425156] Template typenames in attribute and operation parameter types don't work

Ralf Habacker bugzilla_noreply at kde.org
Thu Aug 13 13:54:25 BST 2020


https://bugs.kde.org/show_bug.cgi?id=425156

--- Comment #22 from Ralf Habacker <ralf.habacker at freenet.de> ---
(In reply to Robert Hairgrove from comment #8)
> (In reply to Ralf Habacker from comment #4)
> > (In reply to Robert Hairgrove from comment #3)
> > > Is there any reason why the type must be a UMLClassifier?
> > 
> > Types may be classes and therefore need to be a UMLClassifier
> 
> The problem is, we can select a template from the "type" list for the types
> of lots of different things. Everything else in the list is either a
> datatype or a class name. Indeed, the type of a template parameter is
> "class", unless some integral expression or type with external linkage is
> specified.
> 
> So template parameters SHOULD be considered classifiers, but they aren't --
> at least not in Umbrello.

This probably comes from the fact, that classifiers do not have types, instead
they have super classes. 

> What I am looking at now is how to properly load and save these in the XMI
> file. I've looked at XMI files produced by other applications, for example
> Modelio, and I have the XMI reference as a PDF file. But every other UML
> tool uses a different format.

Looking at the xmi 1.4 dtd at
https://www.omg.org/spec/UML/20010967/01-02-16.dtd there is 

<!ELEMENT UML:ModelElement.templateParameter (UML:TemplateParameter)*>

<!ELEMENT UML:TemplateParameter (%UML:TemplateParameterFeatures;)*>
<!ENTITY % UML:TemplateParameterFeatures 'XMI.extension |
   UML:TemplateParameter.template |
   UML:TemplateParameter.parameter |
   UML:TemplateParameter.defaultElement'>

<!ELEMENT UML:TemplateParameter.defaultElement (UML:ModelElement)*>

<!-- ========= UML:TemplateParameter ========= -->
<!ELEMENT UML:TemplateParameter.template (UML:ModelElement)*>

<!ELEMENT UML:TemplateParameter.parameter (UML:ModelElement|
   UML:GeneralizableElement|UML:Classifier|UML:Class|UML:AssociationClass|
   UML:DataType|UML:Primitive|UML:Enumeration|UML:ProgrammingLanguageDataType|
   UML:Interface|UML:Component|UML:Node|UML:Artifact|UML:Signal|UML:Exception|
   UML:UseCase|UML:Actor|UML:ClassifierRole|UML:ClassifierInState|
   UML:Subsystem|UML:Association|UML:AssociationRole|UML:Stereotype|
   UML:Collaboration|UML:Package|UML:Model|UML:Namespace|UML:Feature|
   UML:StructuralFeature|UML:Attribute|UML:BehavioralFeature|UML:Operation|
   UML:Method|UML:Reception|UML:AssociationEnd|UML:AssociationEndRole|
   UML:Constraint|UML:Relationship|UML:Generalization|UML:Dependency|
   UML:Abstraction|UML:Usage|UML:Binding|UML:Permission|UML:Flow|UML:Extend|
   UML:Include|UML:Parameter|UML:Comment|UML:EnumerationLiteral|
   UML:TagDefinition|UML:TaggedValue|UML:Instance|UML:Object|UML:LinkObject|
   UML:DataValue|UML:ComponentInstance|UML:NodeInstance|UML:SubsystemInstance|
   UML:UseCaseInstance|UML:Action|UML:CreateAction|UML:DestroyAction|
   UML:UninterpretedAction|UML:CallAction|UML:SendAction|UML:ActionSequence|
   UML:ReturnAction|UML:TerminateAction|UML:AttributeLink|UML:Link|
   UML:Argument|UML:LinkEnd|UML:Stimulus|UML:ExtensionPoint|UML:StateMachine|
   UML:ActivityGraph|UML:Event|UML:TimeEvent|UML:CallEvent|UML:SignalEvent|
   UML:ChangeEvent|UML:StateVertex|UML:State|UML:CompositeState|
   UML:SubmachineState|UML:SubactivityState|UML:SimpleState|UML:ActionState|
   UML:CallState|UML:ObjectFlowState|UML:FinalState|UML:Pseudostate|
   UML:SynchState|UML:StubState|UML:Transition|UML:Guard|UML:Message|
   UML:Interaction|UML:InteractionInstanceSet|UML:CollaborationInstanceSet|
   UML:Partition)*>

and this is implemented into umbrello

 UMLTemplate::saveToXMI1(QDomDocument& qDoc, QDomElement& qElement)
{
    QDomElement attributeElement =
UMLObject::save1(QLatin1String("UML:TemplateParameter"), qDoc);
    if (m_pSecondary)
        attributeElement.setAttribute(QLatin1String("type"),
Uml::ID::toString(m_pSecondary->id()));
    qElement.appendChild(attributeElement);
}

There is room for additional work.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the umbrello-devel mailing list