Open SteveHespelt opened 2 months ago
This has to do with the json serialization process of mdk to mms - elements that are ValueSpecifications are inlined in the place where they are referenced (usually defaultValue of properties or value of slots) - this is accounted for in the mms elastic mapping, but sometimes we've seen an orphan valuespec being housed in a package with nothing pointing to it (and also it's invisible in the cameo client by default). From the logs you can find the id of the offending element where it says "Preview of field's value", ex. _18_5_3_8db028d_1526068215613_864996_10382, remove those elements and the model push should work.
there is an option to Log JSON in the Options -> Environment -> MDK, if it's set to true it'll log every request and reply to mms server and the error would show up in the response
this is a simple jython macro that'll remove any offending value specs in the model (assuming these are orphans and actual model values are not in packages) that you can run to 'clean' the model first
from com.nomagic.magicdraw.core import Application
from com.nomagic.magicdraw.openapi.uml import SessionManager
from com.nomagic.uml2.ext.magicdraw.classes.mdkernel import ValueSpecification
from com.nomagic.uml2.ext.magicdraw.classes.mdkernel import Package
deleteCount = 0
bads = []
def replaceElementsRecursively(element):
global deleteCount
global bads
for ownedElement in element.getOwnedElement():
if isinstance(ownedElement, Package):
replaceElementsRecursively(ownedElement)
if isinstance(ownedElement, ValueSpecification):
Application.getInstance().getGUILog().log(ownedElement.getID())
bads.append(ownedElement)
deleteCount += 1
project = Application.getInstance().getProject()
if (SessionManager.getInstance().isSessionCreated(project)):
SessionManager.getInstance().cancelSession(project)
SessionManager.getInstance().createSession(project, 'Fixing bad instance ')
replaceElementsRecursively(project.getModel())
for e in bads:
e.dispose()
SessionManager.getInstance().closeSession(project)
Application.getInstance().getGUILog().log('[INFO] deleted ' + str(deleteCount) + ' element(s).')
Describe the bug Not sure if this clear or concise but here goes. I'll pose the question first, then observations that led to the question.
Using MDK 5.1.3, will using TeamworkCloud projects that have previously been the source for MMS 3.4.2 /MDK4 importing, have issues such as viewpoint exposed content from used models not being pushed to MMS-4, therefore not rendering in VE 4? I'm posting this issue here because the below error messages appear while using MDK to push the models into a new MMS-4.0.20 setup. VE is where the issue manifests.
The msosa.log contains:
FYI: The MSoSA GUILog windows doesn't not show any messages regarding the above 500 exception.
The MMS-4.0.20 log contains the following:
And the Elasticsearch container's log contains:
I'm guessing that the root cause of the issue is related to the Elasticsearch exception:
MapperParsingException: failed to parse field [packagedElementIds]
in the above log output. And that perhaps the JSON content isn't exactly what the parser is able to handle, due to earlier usage with MMS-3.4.2 ?I know about the MMS-3 to MMS-4 migration draft but I'm not migrating the MMS-3 data in this scenerio, just using the same TWC project. But as it's a project used as the source for MMS-3.4.2, perhaps the only way to use it is to use the migration sequence? Thanks, -steve
To Reproduce Steps to reproduce the behavior:
Expected behavior The ProjectA-Document model that uses the ProjectA model results in the content from ProjectA being rendered by VE
Screenshots Observations above from msosa, MMS, Elasticsearch logs.
Environment:
Additional context Add any other context about the problem here.