cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

start an external exe via ACL with return value

hbestler
12-Amethyst

start an external exe via ACL with return value

Hi together,

 

we would like send some elements as string to an external .exe Tool, and want to get the result as a return value back in acl. So we need a interaction between acl and the external exe.
Do you have an idea how we can do this via ACL? 
We know the "sh" command, which starts the exe, but we cannot get a return value from this.


Best regards

1 ACCEPTED SOLUTION

Accepted Solutions

I see three other options: system(), javascript() and java_static().

 

Here are some untested example ideas for each:

system("my.exe arg1 arg2")
javascript('runCommand("my.exe", "arg1", "arg2")')
java_static("MyClass", "MyMethod", "args")

 

Java works because it is built in to Arbortext. Javascript works because Arbortext uses Rhino, which is itself spawned from Java.

 

The Java method should use Runtime.getRuntime().exec("my.exe arg1 arg2") which returns a Process object from which you can gather the output and return values.

 

View solution in original post

3 REPLIES 3

I see three other options: system(), javascript() and java_static().

 

Here are some untested example ideas for each:

system("my.exe arg1 arg2")
javascript('runCommand("my.exe", "arg1", "arg2")')
java_static("MyClass", "MyMethod", "args")

 

Java works because it is built in to Arbortext. Javascript works because Arbortext uses Rhino, which is itself spawned from Java.

 

The Java method should use Runtime.getRuntime().exec("my.exe arg1 arg2") which returns a Process object from which you can gather the output and return values.

 

Hi GarethOakes,

 

thanks for your help. After many tests  with java (unfortunately not our preferred programming language) we were successfull with using java_static.
We could get a return value back from java to acl. Now we must implement our operations with C# and call the exe via Java and path is through ACL 🙂

 

Thank you. 
Greetings from germany

Yes, there is no direct binding to the CLR available from Arbortext, so any heavy lifting must be done via Java. The only Microsoft bindings are for JScript and VBScript which allow access to Windows COM objects. If you don't wish to use Java then you can use Javascript (Rhino interpreter) which runs inside the JRE.

FWIW, our standard approach these days is to use a minimal amount of ACL and code all business logic inside Java classes.

Top Tags