Good day,
Is it possible to import an .arx script file into ARIS using the scripting language?
Hi Freddy,
yes you can import .arx files into ARIS. For this check out the following article "Reports and macros in ARIS".
Regards
Eva
Hi Freddy,
Keep both the javscript reports in same group. For eg. Report 1 and Report 2
Consider we have to import code from Report 2 in Report 1.
1) Keep Report 2 in same folder group as of Report 1, or keep Report 2 in common files.
2) Go to Properties of Report 1. Select "General" tab. There you will find "Imported Files" button. You can select files to be imported into Report 1. Report 2 will also be listed there.
If you want to execute Report 2 in some point of time in Report 1 execution, check Report component for Report.execute method.
Thanks,
Amol Patil
Hi Amol,
This will still not allow me to import .arx files programmatically.
I have a ZIP file that contains around 50 arx file, in my ARIS Script I already have the code that extracts the ZIP file, now I want to know if their is away to import the arx files with code in a ARIS Script?
Hi Freddy,
I misunderstood you problem. Now I guess you need to unzip the zip file containing .arx, and import them in some folder in ARIS, through script. Please try the following if it helps.
1. Create a blank Folder in ARIS script module. e.g. "Import".
2. You have a code to unzip arx file. This is gr8. You need to further unzip .arx file also. There will be minimum 3 files for each .arx file (.info, .script, .loc)
3. Use some java code to copy all the unzipped arx (.info, .script, .loc) files to the folder "Import" located at "{ARIS Install}\server\templates\scriptservice\Report\Import".
4. Might require aris server restart.
Thanks,
Amol Patil
What you are trying to is something like the C/C++ "#include" statement, correct?
Hypothetical syntax:
include("myfunctions.arx"); // use included library functions here myfunA(..); myfunB(..);
Maybe we could emulate #include's behaviour using a combination of java file reader + javascript eval(..).
Hi All,
I finally found a way to do the importing of an .arx file using javascript.
Here is my code:
var oScript = new com.idsscheer.aris.server.bl.logic.scriptadmin.AScriptAdmin(""); var oVASN = new com.idsscheer.aris.cltech.common.core.ariscommon.VASNInfo(0,0); oScript.deleteCategory(1,1,"", new Array("Fred Test"),false,oVASN); oScript.createCategory(1,"", new Array("Fred Test"),oVASN); var oFile = Dialogs.getFilePath("", "*.arx!!ARIS Script Files|*.arx||", "", "Select ARX File to Import", 1); if(oFile!=null){ oFile = oFile[0]; var bytes = oFile.getData(); Dialogs.MsgBox(oScript.importScript(1,1, "", "Fred Test", 1, bytes, true, oVASN)); }
This script deletes the "Fred Test" category and then creates it again. It then show me a open dialog where I can select the .arx file I want to import.
The script imports the .arx file into the "Fred Test" category.
There is only one problem, for some reason it creates a weird artifact in the "Fred Test" category called "__COMPONENT_1".
Do you maybe know why it is doing that, and how I can fix it?
Hi Fred,
That's an interesting hack you have over there, using internal classes for script handling :-)
I believe the artifact "__COMPONENT_1" is part of the ARX file (which is a ZIP file itself):
(If someone requests, I can post more information on this subject - ARX file formats)
Maybe some arguments to oScript.ImportScript are incorrect? I haven't checked the parameter semantics, but I guess one of them controls what artifact we pull from the ARX file (component, source code, locale info, script info,...)
Just a wild guess.
I've tried running your code on 7.0.2 (old version, I know), without luck. I have access to other versions as well, so what's the ARIS version you are using? 7.2?
Cheers!
Hi Freddy,
Thank you for the interesting script. Why would you want to import external ARX files into ARIS, I would just like to understand the background a little better.
Could you also please provide your last version where you got it working just to finalise the thread?
Thank you in advance.
Rgs,
Francois du Toit