Archi Forum

Discussion Boards => coArchi => Topic started by: z720 on March 31, 2021, 09:01:49 AM

Title: Is there any restriction local version of the model ?
Post by: z720 on March 31, 2021, 09:01:49 AM
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
Title: Re: Is there any restriction local version of the model ?
Post by: Phil Beauvoir on March 31, 2021, 09:53:22 AM
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?

Title: Re: Is there any restriction local version of the model ?
Post by: z720 on March 31, 2021, 12:42:11 PM
I double checked the path: the model open in the UI from the same location using open .git/temp.archimate from the command line.
Title: Re: Is there any restriction local version of the model ?
Post by: Phil Beauvoir on March 31, 2021, 13:08:15 PM
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.
Title: Re: Is there any restriction local version of the model ?
Post by: z720 on April 01, 2021, 05:17:37 AM
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.