This class is used to create operating system processes.

1 Running a process

In Javascript, we can use ProcessBuilder to call external commands easily. In the following example we see how an external ls command (using bash), and display the output.

    var pb = new Ax.lang.ProcessBuilder(); 
    var status ='/tmp').command('/bin/bash', '-c', 'ls -l'); 
    if (status == 0)
    return status;
drwx------  3 jet  wheel  96 Dec 20 11:54
drwx------  3 jet  wheel  96 Dec 20 11:54

2 Non blocking process

The process.getInputStream is “blocking” so it will block main thread until process completed. In the case we want to run with a timeout to avoid a long running process hangs the script application you can use a timout value.

To set a timeout use setTimeout(int second) in process builder object.