archimatetool/archi-scripting-plugin

diagram-model-note imageSource returns always -1 even with a custom image

romualdrichard opened this issue · 6 comments

JArchi 1.5
I use Export Folder New Model script and I found that all my notes with images are not exported.
Digging the script, it seems that objetc diagram-model-note always returns -1 with diagram-model-note.imageSource

Expected Behaviour

return IMAGE_SOURCE.CUSTOM

Can you please point me at the script you are using?

Edit: I will investigate...

imageSource only applies to ArchiMate elements. Notes and Groups do not have this attribute. So for a Note, ignore this attribute and get the Image Path from getImage().path

I've updated the wiki to make this clear.

Thanks for the link. It seems that the script does not handle the images for Notes properly. I didn't have time to fully debug the script but I got it to work by removing line 510 and the closing bracket on line 523:

if (sourceObject.imageSource === IMAGE_SOURCE.CUSTOM) {

I changd it to if ((sourceObject.imageSource === IMAGE_SOURCE.CUSTOM ) || (sourceObject.getImage().path)) and that do the trick

OK, so let's close this.