Compute

Description: Computes a Rulex process.

URL/compute

Method: POST

Header: You must provide the authentication token in the header, using the following syntax:

{ 
	Authorization : "Bearer" + " " + token 
}


Parameters

The Compute method uses the following parameters:

Name

Data Type

Mandatory

Default Value

Description

process

string

(tick)

The name of the process you want to compute.

options.inmemory

boolean

(error)

true

If you want to compute the process "inmemory".

options.mode

string

(error)

"all"

The computation mode of the process.

options.tasks

array

(error)


The list of tasks to compute.

This option only applies when options.mode is different than "all"

options.storeSources

boolean

(error)

false

If you want to compute the process "inmemory" but saving the results of source (input) tasks.

This option only applies to inmemory computation

options.processVariables

object

(error)

null

The dictionary containing the process variables to write to the current process

This option only applies to non-inmemory computation.

Previously stored values will be overwritten by a variable with the same name.

options.inputs

object

(error)


The input data to feed inside the specific tasks.

Each task used for input of new data has to belong to the input category.

options.inputs.task label.format

string

(error)

"cols"

The format of the data to feed as input.

options.inputs.task label.data (cols format)

object

(error)


An object representing the columns to feed as input.

There must be an array for each column.

options.inputs.task label.data (rows format)

array

(error)


An array representing the rows to feed as input.

There must be an object for each row.

options.outputs

object

(error)

The task to select to show in output.

options.outputs.task label

array

(error)

[ "*" ]

The list of attributes to show as output commands.


Syntax example

Data Params
{ 
	process : process name, 
	options : { 
		inmemory : [true] | false,
		mode : ["all"] | null | "onwards"| "downon",
		tasks : task list | null,
		storeSources : [false] | true,
		processVariables : [null] | {
			ProcessVariable1 : "A",
			ProcessVariable2 : 1
		}
		inputs : {
			task label : {
				format : ["cols"] | "rows",
				data (cols) : {
					Var_1 : ["A", "B", null, "Z"],
					Var_2 : [1, 2, 4, null],
					Var_3 : [0.1, 3.14, 4, 1.1]
				}
				data (rows) : [
					{
						Var_1 : "A",
						Var_2 : 1,
						Var_3 : 0.1
					},
					{
						Var_1 : "B",
						Var_2 : 2,
						Var_3 : 3.14
					},
					{
						Var_1 : null,
						Var_2 : 4,
						Var_3 : 4
					},
					{
						Var_1 : "Z",
						Var_3 : 1.1,
					}
				]
			},
		},
		outputs : {
			task label : ["*"] | attributes list
		}
	}
}


Response Codes

Code

Result

Response

Success

200

Success

{ 
	data : required computation data
}

Warnings

307

Temporary redirect

{ 
	resultUrl : url 
}

Client Errors

400

Bad request

404

Not found