Is there any restriction local version of the model ?

Started by z720, March 31, 2021, 10:01:49 AM

Previous topic - Next topic

z720

I was trying to automate publication using the command line on a local repository but I couldn't get the model  loaded.

Is there any restriction using the .archimate file located in the .git folder?

I'm trying to do :

$ARCHIPATH/Archi -application com.archimatetool.commandline.app -consoleLog -nosplash --loadModel .git/temp.archimate --html.createReport "html"
## or --script.runScript "$SCRIPT_LIB/test.ajs"


and I get the following error:

org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, size=0
        at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:346)
        at com.archimatetool.editor.model.impl.EditorModelManager.loadModel(EditorModelManager.java:290)
        at com.archimatetool.commandline.providers.LoadModelFromFileProvider.run(LoadModelFromFileProvider.java:58)
        at com.archimatetool.commandline.CentralScrutinizer.runProviderOptions(CentralScrutinizer.java:164)
        at com.archimatetool.commandline.CentralScrutinizer.start(CentralScrutinizer.java:82)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1461)


test script only shows loaded model to the console and there is nothing loaded...

Loaded model []
Script Error: javax.script.ScriptException: com.archimatetool.script.ArchiScriptException: Could not get the currently selected model. Select a model before running this script.


Context: Archi 4.8.1 with macOS Catalina

Phil Beauvoir

#1
The "temp.archimate" file is a working copy of the model that Archi uses when running so you should be able to perform standard operations on it using the Command Line.
Are you sure that your path to the file is correct? Can you actually open that "temp.archimate" file in Archi itself?

If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

z720

I double checked the path: the model open in the UI from the same location using open .git/temp.archimate from the command line.

Phil Beauvoir

#3
I've experimented a bit with this and found that using an absolute file path is needed on Mac. Did you try that?

The path to the model file provided on the command line is relative to the Archi application, not the current directory from where you are running the command, so you'll need to specify an absolute file path.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

z720

Right it seems that MacOS version requires an absolute path otherwise the /Applications/Archi/Content/MacOS folder is considered for relative path...

By the way, I think that the model content might also be in cause, I had a few weird issue with a model that disappeared after a few cleanup (Fix validation issue) but I couldn't spot which one...

So Fixed for the moment

I'll post on that topic again if I encounter such an issue.