Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
ADOxx and External Applications
external coupling xml adoscript add-on implementation adoxx
Answer
6/5/19 3:36 PM
Hello,

I am implementing a tool on the ADOxx platform that takes advantage of its External Coupling functionality. In a few words, the steps of the implementation are:
  • Export the designed models into XML
  • A Java program parses and translates the models into another format
  • The Java program executes the translated file and produces some results that are saved into a results file
  • The results file is then used to display the results back into the models in ADOxx 

Right now the XML exports of the models, the translated file and the results file are given with full local paths and the whole implementation in Java is used by calling the .jar file from an AdoScript script. But this kind of implementation cannot work since we want the tool to be used by anyone. So I have the following question:
  • Can I add the .jar file into the library (so I can call it with db://...)? I have tried doing just that but the .jar couldn't run (it couldn't read the input file)
 
Thank you in advance.

RE: ADOxx and External Applications
Answer
6/5/19 3:40 PM as a reply to Nena Basina.
Hi Nena - long time no see emoticon

in order to overcome this issue, please put the JAR file into the installation directory of ADOxx in a separate folder. Using the GET_PATH AdoScript command, you can retrieve the installation directory and construct the absolute path. When distributing the tool, we will package the JAR into the installer and it will be part of your tool after installation.

Best regards,
Wilfrid

RE: ADOxx and External Applications
Answer
6/6/19 10:08 AM as a reply to Wilfrid Utz.
Thank you Wilfrid, it worked! emoticon

RE: ADOxx and External Applications
Answer
6/20/19 12:25 PM as a reply to Wilfrid Utz.
Using the GET_PATH AdoScript command, you can retrieve the installation directory and construct the absolute path. 

There is a problem with this implementation. When I use the GET_PATH command, the resulting path contains this string: 
1"C:\Program Files (x86)\BOC\ADOxx15_EN_SA\"
which is part of a variable called sExportPath, saved for further use.
Notice the spaces in the Program Files folder name.

In the case where I have to run the .jar, this command works if I add the quotes before and after the path variable.
1SYSTEM ("cmd /c java -jar \"" + sJARpath + "\" " + sJARargs)

But in other cases, it doesn't seem to work, with or without the quotation, and I'm guessing that the problem might be because of the spaces. A couple of examples that don't work:

1CC "AdoScript" FWRITE file: (sADOXMLExportFile) text: (sModifiedXml) binary:0
In this case the xml export file is never created, ecode is 1.

1CC "Application" GET_PATH "ECAVI\\clingo.exe"
2   #--> returns: "C:\Program Files (x86)\BOC\ADOxx15_EN_SA\ECAVI\clingo.exe"
3SET sClingoPath: (path)
4SYSTEM ("cmd /c " + sClingoPath +  ....)
In this case, the clingo.exe cannot run. 

I have tried different paths that don't contain spaces and they work perfectly.

Any thoughts?