Resource creation ignores an attribute while saving to output file! [message #1256724] |
Tue, 25 February 2014 18:36 |
Parsa Pourali Messages: 210 Registered: February 2014 |
Senior Member |
|
|
Hi,
I'm new to the forum, I hope here is the right place to bring this topic !
I am working with ecore models, I set the attributes value for one of the models, everything is fine, but one attribute will not appear in the output file:
as it can be seen in the code below, I set 4 of the attributes hard coded before saving the output file, 3 of them work grete, but the one which is the first one does not appear in the output ! the funny thing is that if I change its type to string it works !
the thing is that it was working fine, unless I have added other attributes in its sibling models (that have nothing to do with this one) !
here is the code:
ResourceSet resourceSet = new ResourceSetImpl();
URI fileURI = URI.createFileURI(file);
Resource res = resourceSet.createResource(fileURI);
uiRoot.getMagicUiAdminDomainSgTemplates().get(0).setMagicUiSgTempRedundancyModel(SaAmfRedundancyModelT.SA_AMF_2N_REDUNDANCY_MODEL); // This one has problem
uiRoot.getMagicUiAdminDomainSgTemplates().get(0).setMagicUiSgTempNumberofActiveSus(10);
uiRoot.getMagicUiAdminDomainSgTemplates().get(0).setMagicUiSgTempNumberofSpareSus(1);
uiRoot.getMagicUiAdminDomainSgTemplates().get(0).setMagicUiSgTempNumberofStdbSus(5);
res.getContents().add(uiRoot);
try {
res.save(Collections.EMPTY_MAP);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Error occured in saving the user input \n(Utility.Loader.saveUserInput error)","Saving Error", JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
}
Thanks,
Parsa
|
|
|
Powered by
FUDForum. Page generated in 0.03609 seconds