| Summary: | [report]Define a model transformation structure for statistics data input | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Alvaro Sanchez-Leon <alvaro.sanchez-leon> | ||||
| Component: | Mylyn | Assignee: | Project Inbox <r4e-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | lmcbout, sebastien.dubois | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 0.9 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 348895 | ||||||
| Attachments: |
|
||||||
|
Description
Alvaro Sanchez-Leon
An transformation plug-in has been created to separate this functionality from the core, the transformation plug-in defines an extension to the core model with serialisation containers from group to reviews and reviews to users, the transformation api provides a way to manage the extended model i.e. create, open, close of the groups, and addition of an existing core model review as a copy of the extended model which included a serialisation step before the return. Handling the copy of one review at a time will allow the user application to split the task in a job, and this job can be associated to a progress monitor where the execution could be interrupter before proceeding with another review. A normal test case for this has been created and the format has been validated, this output can be used by the BIRT parser and validate the format produced. NEXT: Clean up, create additional test cases and join them to the core test cases to be executed by the nightly builds. The current approach to transform the model relies on moving of elements to new resource files, however this may not work to refresh all elements, specially references which could ramain pointing to the old file resource, the results may vary as the move take place on slightly different order from model to model. There is a need to try two additional alternatives to make it reliable 1) cloning element trees and refreshing the references on the new clones, the refreshing of references may need to happen once all needed elements exists 2) if cloning element trees does not provide reliable results, the last alternative is to create single clone elements to copy all elements and references one by one in a similar sequence to the creation of the original model Created attachment 202353 [details]
mylyn/context/zip
large context back
Created a group with three different types of reviews i.e. Basic, Formal, Informal.
and observe
1) The references not transformed or not moved to the new file structure.
* reviewedContent
* FixedInVersion
2) The original review structure gets corrupted
This was initially though to be caused by configuration of the genmodel i.e. Container proxy resolution set to false. but it does not make a difference.
EMF seems to try to keep data consistency and saves the modification in the original resourceset even though the save is performed on the destination resourceSet.
* Alternative a) Try cloning the structure
* Alternative b) Copy the group files and REview being transformed to a tmp directory, then transform and discard tmp directory.
Issue 2) has to be addressed as first priority as the affected references in 1) don't seem to be used.
Cloning the structures is the way to go i.e. using EcoreUtils.Copier the complete structures get copied and a relationship with the original elements is kept so after all affected elements are copied, the Copier allows to update the references on the copies. Since the Group and Review elements are extensions of the R4ECore model, the different attributes and references had to be copied one by one. The user structure and substructures could be copied directly in one shot. The above works in a simpler way if all the new model elements reside in one Resource. the above gives us the advantage to: 1) Work on a separate ResourceSet (i.e. no indirect impact to the original model) 2) The code is relatively simple and easier to maintain 3) Having the model in one Resource simplify resolution of references needed by BIRT xml data source parsing. Pending issue: During unit test, it was observed that the consolidated model does not load the user time log instances, the time log instances are a key, value map of Date, Integer. this map entries point to a proxy i.e. proxy resolution = true by default. multiple EcoreUtils were attempted to resolve the proxy or to find a diagnostic for the problem, but not errors were reported and the proxy was not resolved. A work around is to set the proxy resolution to false for this reference as the time log is indeed within the same resource in the original model and the transformed model. However this propagates changes in the model transformation so many items are no embedded as substructures rather than plain references to the actual substructures. For the time being, we can keep the initial format as the model consumed by BIRT is not actually read by EMF but an XML parsing adapter. The long term transformation strategy need to be discussed as we need to minimize impacts from the EMF serialisation rules. Fixed - The current format is good enough for the use of BIRT - XML as data source. The long term strategy will involve using the BIRT - EMF interface as mentioned in previous comment |