Bug 559506

Summary: Debug KDMtoUML for non-trivial models
Product: [Modeling] MoDisco Reporter: Ed Willink <ed>
Component: MainAssignee: Project Inbox <modisco.web-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 Keywords: helpwanted
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=559115
https://bugs.eclipse.org/bugs/show_bug.cgi?id=559507
https://git.eclipse.org/r/156895
https://bugs.eclipse.org/bugs/show_bug.cgi?id=559016
https://git.eclipse.org/r/157158
https://git.eclipse.org/r/157157
https://git.eclipse.org/r/157164
https://git.eclipse.org/r/157185
https://git.eclipse.org/c/modisco/org.eclipse.modisco.git/commit/?id=26b58bd549df6ff165f67fcaab89431add8dc8c1
https://git.eclipse.org/c/modisco/org.eclipse.modisco.git/commit/?id=28a33ff7a0a9ef5c9a9eb8843b5fa2605ec01538
https://git.eclipse.org/c/modisco/org.eclipse.modisco.git/commit/?id=5ef0c1c0da09ae0f9978f61809895ff436b2af4a
https://git.eclipse.org/c/modisco/org.eclipse.modisco.git/commit/?id=afd47db61ba853a034dc7c41959172a4aebb1567
https://git.eclipse.org/c/modisco/org.eclipse.modisco.git/commit/?id=9d9c85765010c4d7db78d6021759ba660e0cd494
Whiteboard:

Description Ed Willink CLA 2020-01-24 07:00:05 EST
Bug 559016#c21 reports a 

org.eclipse.m2m.atl.engine.vm.VMException: Cannot set feature uml!Model.packagedElement to value 

whose diagnosus was confused by the lack of UML2 currency in the MoDisco project (Bug 559115).

Debugging the actual failure. An ArrayStoreException occurs in the assignment of a Sequence of 15423 elements to Model.packagedElement. The failure occurs at the 629th assignment. Earlier assignments are of {Package,Interface,Class}Impl. The failure is for a PropertyImpl. Looks like a straightforward bug in

bundleresource://656.fwk2131772703/org/eclipse/modisco/kdm/uml2converter/internal/resources/transformations/KDMtoUML.asm

Don't assign non-PackageableElement to package.packagedElement.

Trying to figure out if UML has changed. I give up. UML 2.5 is PDF browsable. 2.2-Infra/Super are impenetrable. The UML2 migration guides are not that helpfule but the 2.2-to2.4 notes that Property ceases to be a TemplateableElement derivation. LOading the UML2 2.2.0 UML.ecore siggests that Property inheritance is not significantly chnaged.

Examining KDM2UML.atl we have:

rule ExtensionFamilyToProfile {
	from src :kdm!ExtensionFamily
	to tgt :uml!Profile (
		name <- src.name
		,packagedElement <- src.annotation
		,packagedElement <- src.attribute
		,packagedElement <- src.stereotype
	)
}

which seems to have no ability to restrict packagedElement assignments to genuine PacakeableElements.

Clearly the TX is just plain broken. Never ever worked. Never tested on a realistic model with adequate coverage.
Comment 1 Ed Willink CLA 2020-01-24 07:20:12 EST
As well as KDM2UML being broken its KDM is vintage; Bug 559507.
Comment 2 Ed Willink CLA 2020-01-30 12:18:09 EST
Commenting out packedElement assignments the failure changes from a unsupported assignment to an empty stack, probably due to isCollection/isMap not being supported on a Void / empty collection.

Specifically

rule CodeModelToModel extends KDMModelToModel {
	from src :kdm!CodeModel
	to tgt :uml!Model (
		packagedElement <- src.codeElement		--12
	)
}

seems to be able to assign a Property.

The complexity of this defeats mindless tweaking, a re-design of the output containment tree is need to accommodate the UML 2.5 change.

Probably needs to be done in conjunction with a KDM update. Bug 559507.

---

Until someone steps forward for the redesign, may be we just eliminate the 

Discovery->Discovers->Discover UML from KDM Model...

menu entry that clearly does not work.
Comment 3 Eclipse Genie CLA 2020-01-30 12:47:04 EST
New Gerrit change created: https://git.eclipse.org/r/156895
Comment 4 Eclipse Genie CLA 2020-02-04 11:19:07 EST
New Gerrit change created: https://git.eclipse.org/r/157158
Comment 5 Eclipse Genie CLA 2020-02-04 11:19:09 EST
New Gerrit change created: https://git.eclipse.org/r/157157
Comment 6 Ed Willink CLA 2020-02-04 11:23:55 EST
Fabien Giquel commented on the Gerrit:

ok for this uml2converter.ui/plugin.xml.
But in order to complete disactivation : the extensions from org.eclipse.modisco.usecase.simpletransformationschain.ui/plugin.xml should be commented too : it proposes menus for shorcut transfo "java(->kdm)->uml" in using the KTMtoUML.atl step.

-----

Trimming the extensions from org.eclipse.modisco.kdm.uml2converter.ui probably reduced the UI plugin to zero functionality, and casts doubt on the non-UI functionality it facilitated.

The org.eclipse.modisco.usecase.simpletransformationschain.ui extensions all seem to exploit the {Java/Project>->KDM->UML capability. So yes, they need to be hidden too. But that makes org.eclipse.modisco.usecase.simpletransformationschain.ui zero functionality and again casts doubt on the non-UI functionality.

All org.eclipse.modisco.kdm.uml2converter, org.eclipse.modisco.usecase.simpletransformationschain functionaity marked as deprecated (pending a KDMtoUML fix / amputation).
Comment 7 Eclipse Genie CLA 2020-02-04 12:40:24 EST
New Gerrit change created: https://git.eclipse.org/r/157164
Comment 8 Eclipse Genie CLA 2020-02-05 03:36:14 EST
New Gerrit change created: https://git.eclipse.org/r/157185
Comment 14 Ed Willink CLA 2020-02-05 05:10:17 EST
Deprecation/suppression of three plugin.xml's of transitive KDMtoUML invocations pushed to master for 1.5.1M2 today.

(In reply to Ed Willink from comment #2)
> The complexity of this defeats mindless tweaking, a re-design of the output
> containment tree is need to accommodate the UML 2.5 change.

This bug remains open awaiting help/enthusiasm for the KDMtoUML.atl re-design.