Divooka Reference

Processes

7 nodes

On this page 7

Command Line

Function

The command line a program and its arguments make, quoted as the system reads it - for showing in a log what Run Command or Start Process runs.

Signature
CommandLine(program: Text, arguments: Any Array) -> Text
string CommandLine(string program, object[] arguments)

Parameters

nametypedefaultdescription
programText—The program: a name on the PATH, or a path to it.
argumentsAny Array—The arguments, each value one argument; empty for none.

Returns

Command LineText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Processes
Package
Standard Library

Is Running

Function

Whether a program begun with Start Process is still running.

Signature
IsRunning(process: Running Process) -> Truth
bool IsRunning(RunningProcess process)

Parameters

nametypedefaultdescription
processRunning Process—The program, from Start Process.

Returns

RunningTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Processes
Package
Standard Library

Run Command

Function

Runs a program with arguments, waits for it to end, and answers the code it ended with and what it printed.

Signature
RunCommand -> Command Result
    program: Text
    arguments: Any Array
    workingFolder: Text
    timeoutSeconds: Number
CommandResult RunCommand(
    string program,
    object[] arguments,
    string workingFolder = "",
    double timeoutSeconds = 0)

Parameters

nametypedefaultdescription
programText—The program: a name on the PATH, or a path to it.
argumentsAny Array—The arguments, each value one argument; empty for none.
workingFolderText—The folder the program runs in; empty for the folder the run is in.
timeoutSecondsNumber0How long the program may take, in seconds, before it is stopped and the node fails; 0 for no limit.

Returns

ResultCommand Result
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Processes
Package
Standard Library

Run Shell Command

Function

Runs one command line through the system's shell - cmd on Windows, sh elsewhere - waits for it to end, and answers the code it ended with and what it printed.

Signature
RunShellCommand -> Command Result
    commandLine: Text
    workingFolder: Text
    timeoutSeconds: Number
CommandResult RunShellCommand(
    string commandLine,
    string workingFolder = "",
    double timeoutSeconds = 0)

Parameters

nametypedefaultdescription
commandLineText—The command line, as typed at the shell's prompt.
workingFolderText—The folder the shell runs in; empty for the folder the run is in.
timeoutSecondsNumber0How long it may take, in seconds, before it is stopped and the node fails; 0 for no limit.

Returns

ResultCommand Result
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Processes
Package
Standard Library

Start Process

Function

Starts a program with arguments and goes on at once, answering the running program for Wait For Process, Is Running and Stop Process.

Signature
StartProcess -> Running Process
    program: Text
    arguments: Any Array
    workingFolder: Text
RunningProcess StartProcess(
    string program,
    object[] arguments,
    string workingFolder = "")

Parameters

nametypedefaultdescription
programText—The program: a name on the PATH, or a path to it.
argumentsAny Array—The arguments, each value one argument; empty for none.
workingFolderText—The folder the program runs in; empty for the folder the run is in.

Returns

ProcessRunning Process
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Processes
Package
Standard Library

Stop Process

Function

Stops a program begun with Start Process, and every program it started; a program that has ended already is left as it is.

Signature
StopProcess(process: Running Process)
void StopProcess(RunningProcess process)

Parameters

nametypedefaultdescription
processRunning Process—The program, from Start Process.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Processes
Package
Standard Library

Wait For Process

Function

Waits for a program begun with Start Process to end, and answers the code it ended with and what it printed.

Signature
WaitForProcess -> Command Result
    process: Running Process
    timeoutSeconds: Number
CommandResult WaitForProcess(
    RunningProcess process,
    double timeoutSeconds = 0)

Parameters

nametypedefaultdescription
processRunning Process—The program, from Start Process.
timeoutSecondsNumber0How long to wait, in seconds, before the node fails; 0 for no limit.

Returns

ResultCommand Result

Remarks

A program that has ended already answers at once. When the time limit passes the program is left running and the node fails, which a Try can take; Stop Process ends it. The run's Stop ends the wait, not the program.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Processes
Package
Standard Library