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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

start an external exe via ACL with return value

hbestler
13-Aquamarine

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

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.

 

hbestler
13-Aquamarine
(To:GarethOakes)

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.

Announcements

Top Tags