Flow Operations

Import Flow

Description: Imports one or more flows from a specified source, placing them in the environment identified with the ID {envId}.

POST /resource/import/flow/{envId}

Parameters

Parameters in bold are mandatory.

Location

Name

Description

Type

querystring

origin

The source where the flow to import is located. Possible values are __local__, __filesystem__, __repo__.

str

path

envId

The ID of the environment where the flows will be imported. See Get Resource ID for further details on how to retrieve IDs.

str

body

params

A dictionary describing the parameters of the import. Possible entries are:

  • “path” the path to the .rfl file used in the import (considered only in ‘__filesystem__’ or ‘__local__’ origins)

  • “components” used to select which components of the flow are considered. A dictionary with the following entries:
    • topology: if true, the topology will be imported.

    • data: if true, the data will be imported.

    • doc: if true, the documentation will be imported.

    • graphics: if true, graphics will be imported.

    • events: if true, events will be imported.

    • modules: if true, modules will be imported.

    • var: if true, variables will be imported.

  • “source” a dictionary formed by the internal information of the source used (considered only in ‘__filesystem__’ or ‘__repo__’ case). The form of this dictionary differs according to the origin value. In the case of a ‘__filesystem__’ origin we have:
    while in the case of a ‘__repo__’ origin:
    • type: it must be the string "git" for a custom connection or the path to a Repository resource stored in the Rulex Platform working area.

    • <other components>: in case of custom connection, parameters expressed as explained in repository configuration section.

    • params: a further dictionary to express the branch and eventually tag from which import the desired flow
      • branchname: the hash of the versioned flow (obtained through the info operation) to be imported.

      • commitname: the name of the tag to be considered in the import operation. If null, it will import the latest version of the flow.

dict

querystring

incurr

If true, the flow will be imported in the current flow.

bool

querystring

label

The new name of the imported flow.

str

querystring

inmemory

If true, the flow will be imported in in-memory mode (no interaction with the database)

bool

body

permissionList

The permissions assigned to the new flow. The parameters to specify are:

  • “name”: the name of the user or the group. If the type entry is set to other, this has to be null.

  • “type”: the type of entity to which the permissions are assigned. It can be:
    • “user”

    • “group”

    • “other”

  • “view”: the view permissions of the specified entity. They can be one of these values: “allow”, “deny”, “unspecified” (default value)

  • “modify”: the modify permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

  • “create”: the create permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

  • “execute”: the execute permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

  • “delete”: the delete permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

  • “setpermissions”: the setpermissions permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

  • “share”: the share permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

dict or list

querystring

withprogress

If true, progress information will be calculated.

bool

querystring

convertmodule

The selected module conversion policy.

str

Response

The response schema for this specific request follows standard exposed in api response section. An example response is:

{
  "status": "completed",
  "code": 0,
  "data": {
      "label": "apiAdult",
      "timestamp": "2024-03-02 03:51:18",
      "lock": null,
      "info": {
          "created_on": "2021-12-01, 19:44:24,369",
          "last_modified": "2024-03-02 03:51:18",
          "last_modified_user": null
      },
      "exec_params": null,
      "id": "7c586303-0866-43be-8289-75ce624df356",
      "isversioned": false,
      "isversioneddirty": false,
      "status": null,
      "modules": [],
      "hasissens": {
          "code": [
              "Var_2"
          ]
      }
  },
  "desc": "",
  "status_code": 200,
  "progress": "100%"
}

Export Flow

Description: Exports one or more flows, identified with the IDs {flowIds}, to a generic filesystem, which can be your local filesystem or a remote one.

POST /resource/export/flow

Parameters

Parameters in bold are mandatory.

Location

Name

Description

Type

body

flowIds

The ID(s) of the flow(s) to be exported.

list

body

params

The export parameters of the flows. It contains the key value pairs:
  • source formed as in the Import flow case by a key uri which could be a path to a saved filesystem resource, local for a download export or one of the uri types in case of a custom connection.

  • <other components>: in case of custom connection, parameters expressed as explained in filesystem configuration section.

dict

body

flowLabels

The labels of the flows to be exported. Used only for progress purposes.

list

body

diz_export

The parameters regarding the export mode. Their value can be True (default value) or False. The export mode parameters available are:

  • “topology”: if true, the topology will be exported.
  • “data”: if true, the data will be exported.
  • “doc”: if true, the documentation will be exported.
  • “graphics”: if true, graphics will be exported.
  • “events”: if true, events will be exported.
  • “modules”: if true, modules will be exported.
  • var“: if true, variables will be exported.
  • dict

    querystring

    source_refs

    If true, reference to saved sources will be exported.

    bool

    querystring

    addsuffix

    If true, the date and timestamp will be added to the end of the basename as a suffix.

    bool

    querystring

    addprefix

    If true, the date and timestamp will be added to the start of the basename as a prefix.

    bool

    querystring

    addtag

    If true, the tag name will be added to the end of the basename as a suffix.

    bool

    querystring

    taskList

    The list of the tasks to be exported.
    Lists must be transformed into a string,
    by joining the separate elements with commas “,”, and wrapping any spaces with quotes.
    For example: [“a”, “b”, “c”] –> “a,b,c”;
    [“first element”, “second element”, “third_element”] –> “‘first element’,’second element’,third_element”

    str, or
    list for multiple names.

    querystring

    newnames

    The new names to be assigned to the exported flows.
    Lists must be transformed into a string,
    by joining the separate elements with commas “,”, and wrapping any spaces with quotes.
    For example: [“a”, “b”, “c”] –> “a,b,c”;
    [“first element”, “second element”, “third_element”] –> “‘first element’,’second element’,third_element”

    str, or
    list for multiple names. This will be reflected on the name of the final .rfl created each.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

      {
        "status": "completed",
        "code": 0,
        "data": {
            "file_url": [
                "87a9662b-652a-4d32-a4c3-a9f88324a7b5"
            ]
        },
        "desc": "",
        "status_code": 200,
        "progress": "100%"
    }
    

    Create Flow

    Description: Creates a flow in the environment. The environment is identified by the {envId}.

    POST /resource/create/flow/{envId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    envId

    The ID of the environment where the flow will be created.
    See Get Resource ID for further details on how to retrieve IDs.

    str

    querystring

    label

    The name of the flow to be created.

    str

    body

    permissionList

    The permissions assigned to the new flow. The parameters to specify are:

    • “name”: the name of the user or the group. If type entry is set to other, this has to be null.

    • “type”: the type of entity to which the permissions are assigned. It can be:
      • “user”

      • “group”

      • “other”

    • “view”: the view permissions of the specified entity. They can be one of these values: “allow”, “deny”, “unspecified” (default value)

    • “modify”: the modify permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    • “create”: the create permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    • “execute”: the execute permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    • “delete”: the delete permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    • “setpermissions”: the setpermissions permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    • “share”: the share permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    list

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {
          "id": "de7d15aa-946d-4906-8250-2fb6ab75e2b9",
          "label": "API_Flow"
      },
      "desc": "",
      "status_code": 200,
      "topic": "resource/Create/Flow/c4ff0035-4a1b-4270-9821-66cc8b8cbf9e"
    }
    

    Delete Flow

    Description: Deletes the flow(s), identified with the ID(s) flowIds.

    POST /resource/delete/flow

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    querystring

    flowIds

    The id(s) of the flow(s) to delete. See Get Resource ID for further details on how to retrieve IDs.
    Lists must be transformed into a string,
    by joining the separate elements with commas “,”, and wrapping any spaces with quotes.
    For example: [“a”, “b”, “c”] –> “a,b,c”;
    [“first element”, “second element”, “third_element”] –> “‘first element’,’second element’,third_element”

    str, or
    list for multiple flows

    body

    flowLabels

    The name(s) of the flow(s) to delete.
    Lists must be transformed into a string,
    by joining the separate elements with commas “,”, and wrapping any spaces with quotes.
    For example: [“a”, “b”, “c”] –> “a,b,c”;
    [“first element”, “second element”, “third_element”] –> “‘first element’,’second element’,third_element”

    str, or
    list for multiple names.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "progress": "100%"
    }
    

    Rename Flow

    Description: Renames the flow identified with the ID {rflId}.

    POST /resource/rename/flow/{rflId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    rflId

    The ID of the flow to be renamed. See Get Resource ID for further details on how to retrieve IDs.

    str

    querystring

    newlabel

    The new name for the resource.

    str

    body

    isSelected

    If true, the renamed flow will be the one in use.

    bool

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "topic": "resource/Rename/Database/82620cac-4bdf-4f1d-af9a-cf38a83c684a"
    }
    

    List Flow

    Description: Lists the flows in the parent environment identified with the ID {envId}.

    GET /resource/list/flow/{envId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    envId

    The ID of the environment from which you want to retrieve the list of flows. See Get Resource ID for further details on how to retrieve IDs.

    str

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {
          "resources": {
              "82620cac-4bdf-4f1d-af9a-cf38a83c684a": {
                  "type": "flow",
                  "name": "API_Flow",
                  "isversioned": false,
                  "islocked": false,
                  "isversioneddirty": false
              },
              "7c586303-0866-43be-8289-75ce624df356": {
                  "type": "flow",
                  "name": "apiAdult",
                  "isversioned": false,
                  "islocked": false,
                  "isversioneddirty": false
              }
          },
          "n_resources": 2,
          "folder": {
              "id": "d4c60ad0-1a2b-4d29-875f-c56108e1ecd7",
              "name": "Env_cm"
          },
          "path": {
              "id": [
                  "c8ca121e-91ef-4ad3-8df2-735d5cd08049",
                  "60587735-cc2d-4325-ac4e-38c544f966e3"
              ],
              "name": [
                  "/",
                  "rulex"
              ]
          },
          "create": true
      },
      "desc": "",
      "status_code": 200,
      "topic": "resource/List/Flow/d4c60ad0-1a2b-4d29-875f-c56108e1ecd7"
    }
    

    Copy Flow

    Description: Copies a flow from the environment pointed by {envId} to a potentially different environment indicated by {{destenv_Id}}.

    POST /resource/copy/flow/{envId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    envId

    The ID of the source environment where the environment will be taken. See Get Resource ID for further details on how to retrieve IDs.

    str

    querystring

    id

    The list of ids of the flow to be copied.

    list

    querystring

    label

    The list of names of the flow affected by the modification occurred.

    list

    querystring

    cut

    If yes, the original resource will be erased at the end of the transition.

    str

    body

    permissionList

    The permissions assigned to the new flow. The parameters to specify are:

    • “name”: the name of the user or the group. If type entry is set to other, this has to be null.

    • “type”: the type of entity to which the permissions are assigned. It can be:
      • “user”

      • “group”

      • “other”

    • “view”: the view permissions of the specified entity. They can be one of these values: “allow”, “deny”, “unspecified” (default value)

    • “modify”: the modify permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    • “create”: the create permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    • “execute”: the execute permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    • “delete”: the delete permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    • “setpermissions”: the setpermissions permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    • “share”: the share permissions of the specified entity. They can be: “allow”, “deny”, “unspecified” (default value)

    dict

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "progress": "100%"
    }
    

    Create Task

    Description: Creates a task inside a flow referenced by its flowID.

    POST /session/create/task/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow to be modified. See Get Resource ID for further details on how to retrieve IDs.

    str

    querystring

    name

    The name of the added task.

    str

    querystring

    category

    The category of the task. See this section for further details.

    str

    body

    position

    The coordinates (x,y,z) of the newly created task. It is a dictionary with keys ‘x’, ‘y’, ‘z’ and float values.

    dict

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
        "status": "completed",
        "code": 0,
        "data": "cd42059a-fa27-4115-9613-6ce0d244804f",
        "desc": "",
        "status_code": 200,
        "topic": "session/Create/Task/2baa9aaa-30a1-4e27-a542-e751652a264f"
    }
    

    Delete Code

    Description: Deletes some rows in an existing history of a manager task in a flow identified with the ID {flowId}.

    POST /session/delet/code/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow which contains the task to be updated. See Get Resource ID for further details on how to retrieve IDs.

    str

    querystring

    task

    The name of the task to be updated.

    str.

    body

    indexes

    The indexes of the history rows to be deleted.

    list.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": [],
      "desc": "",
      "status_code": 200,
      "topic": "session/Delete/Code/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    }
    

    Reset Code

    Description: Resets the status of a whole history of a manager task in a flow identified with the ID {flowId}.

    POST /session/reset/code/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow which contains the task to be updated. See Get Resource ID for further details on how to retrieve IDs.

    str

    querystring

    task

    The name of the task to be updated.

    str.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": [],
      "desc": "",
      "status_code": 200,
      "topic": "session/Delete/Code/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    }
    

    Get Code

    Description: Gets the history of a manager task in a flow identified with the ID {flowId}.

    GET /session/get/code/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow which contains the history to be retrieved. See Get Resource ID for further details on how to retrieve IDs.

    str

    querystring

    task

    The name of the task to be updated.

    str.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": [
          {
              "id": 1,
              "operation": "ADD ATTRIBUTES",
              "code": "//DATASET OPERATION\n//ADD ATTRIBUTES\nt.dataset.addAttribute([\"Var_1\"], [\"nominal\"], [\"input\"], True, False)",
              "scope": null,
              "environment": "dataset",
              "status": 2,
              "desc": "Add attribute/s <i>Var_1</i>"
          },
          {
              "id": 2,
              "operation": "FORMULA",
              "code": "//DATASET OPERATION\n//FORMULA\n$\"Var_1\" = \"mamma\"\n//DATASET OPERATION\n//EDIT ATTRIBUTES\nt.dataset.changeAttribute(\"Var_1\", \"formula\", \"\\\"mamma\\\"\")",
              "scope": null,
              "environment": "dataset",
              "status": 2,
              "desc": "Assign to attribute <i>Var_1</i> result of formula <i>&quot;mamma&quot;</i>"
          },
          {
              "id": 3,
              "operation": "FORMULA",
              "code": "//DATASET OPERATION\n//FORMULA\n$\"average_cost\" = enum()\n//DATASET OPERATION\n//EDIT ATTRIBUTES\nt.dataset.changeAttribute(\"average_cost\", \"formula\", \"enum()\")",
              "scope": null,
              "environment": "dataset",
              "status": 2,
              "desc": "Assign to attribute <i>average_cost</i> result of formula <i>enum()</i>"
          }
      ],
      "desc": "",
      "status_code": 200,
      "topic": "session/Get/Code/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    }
    

    List Option

    Description: Lists all the modified options in a task belonging to a flow identified with the ID {flowId}.

    GET /session/list/option/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow which contains the task to be updated. See Get Resource ID for further details on how to retrieve IDs.

    str

    querystring

    task

    The name of the task to be updated.

    str.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
    }
    

    List Task

    Description: Gets the list of tasks present in a flow identified with the ID {flowId}.

    GET /session/list/task/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow. See Get Resource ID for further details on how to retrieve IDs.

    str

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {
          "dataman": "datamanager",
          "adult_new": "sourcetextfile",
          "adultdata": "datamanager",
          "child": "datamanager"
      },
      "desc": "",
      "status_code": 200,
      "topic": "session/List/Task/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    

    }


    Set Code

    Description: Updates an existing history of a manager task in a flow identified with the ID {flowId}.

    POST /session/set/code/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow which contains the task to be updated. See Get Resource ID for further details on how to retrieve IDs.

    str

    querystring

    task

    The name of the task to be updated.

    str.

    body

    option

    The name of the task options to be updated. You can use the task context help

    list.

    body

    code

    The actual code of the options to be updates in the task.

    list.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "topic": "session/Set/Option/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
     }
    

    Set Option

    Description: Sets an option within a task, identified with the {task}, within a flow identified with the ID {flowID}.

    POST /session/Set/Option/{{rflId}}?task={{task}}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    querystring

    task

    The name of the task whose options will be set.

    str

    body

    option

    The name of the option which will be affected by the change.

    list

    body

    code

    The value which will be inserted in the corresponding option.

    list

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "topic": "session/Set/Option/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
     }
    

    Set Variable

    Description: Creates a new flow variable or updates an existing flow variable in the flow identified with the ID {flowId}.

    POST /session/set/variable/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow to modify. See Get Resource ID for more details on how to retrieve IDs.

    str

    body

    varname

    The name of the variable.

    str, or
    list for multiple variables.

    body

    vartype

    The type of the variable. It can be ‘code’ or ‘vault’.

    str, or
    list for multiple variables.

    body

    value

    The value of the variable. If updating an existing variable it could be omitted to maintain the previous value.

    str, or
    list for multiple variables.

    body

    issensitive

    A boolean to state if the variable is sensitive or not. If updating an existing variable it could be omitted to maintain the previous value.

    str, or
    list for multiple variables.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "topic": "session/Set/Variable/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    }
    

    Delete Variable

    Description:Deletes a flow variable in the flow identified with the ID {flowId}.

    POST /session/delete/variable/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow to modify. See Get Resource ID for further details on how to retrieve IDs.

    str

    body

    varname

    The name of the variable.

    str, or
    list for multiple variables.

    body

    vartype

    The type of the variable. It can be ‘code’ or ‘vault’.

    str, or
    list for multiple variables.

    querystring

    force

    Performs the operation forced, regardless its usage in the flow.

    bool.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "topic": "session/Delete/Variable/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    }
    

    Rename Variable

    Description: Renames a flow variable in the flow identified with the ID {flowId}.

    POST /session/rename/variable/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow to modify. See Get Resource ID for more details on how to retrieve IDs.

    str

    body

    vartype

    The type of the variable. It can be ‘code’ or ‘vault’.

    str, or
    list for multiple variables.

    body

    oldname

    The original name of the variable.

    str, or
    list for multiple variables.

    body

    newname

    The new name of the variable.

    str, or
    list for multiple variables.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "topic": "session/Rename/Variable/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    }
    

    List Variable

    Description: Lists the flow variables in the flow identified with the ID {flowId}.

    POST /session/list/variables/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow to modify. See Get Resource ID for more details on how to retrieve IDs.

    str

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {
          "code": {
              "testenvvar3": {
                  "value": "\"pippo\"",
                  "issensitive": 0,
                  "local": 0
              }
          }
      },
      "desc": "",
      "status_code": 200,
      "topic": "session/List/Variables/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    }
    

    Insert Code

    Description: Inserts some new rows at a target position of an existing history of a manager task in a flow identified with the ID {flowId}.

    POST /session/insert/code/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow which contains the task to be updated. See Get Resource ID for more details on how to retrieve IDs.

    str

    querystring

    task

    The name of the task to be updated.

    str.

    body

    code

    The actual code of the rows to be added to the task history.

    list.

    querystring

    target

    The target index position for the insertion. If it is not provided, the top or the bottom of the whole list according to the before flag is considered.

    str.

    querystring

    before

    A flag to control if the new rows should be inserted before or after the target position.

    str.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": [
          {
              "id": 1,
              "operation": "ADD ATTRIBUTES",
              "code": "//DATASET OPERATION\n//ADD ATTRIBUTES\nt.dataset.addAttribute([\"Var_1\"], [\"nominal\"], [\"input\"], True, False)",
              "scope": null,
              "environment": "dataset",
              "status": 2,
              "desc": "Add attribute/s <i>Var_1</i>"
          },
          {
              "id": 2,
              "operation": "FORMULA",
              "code": "//DATASET OPERATION\n//FORMULA\n$\"Var_1\" = \"mamma\"\n//DATASET OPERATION\n//EDIT ATTRIBUTES\nt.dataset.changeAttribute(\"Var_1\", \"formula\", \"\\\"mamma\\\"\")",
              "scope": null,
              "environment": "dataset",
              "status": 2,
              "desc": "Assign to attribute <i>Var_1</i> result of formula <i>&quot;mamma&quot;</i>"
          },
          {
              "id": 3,
              "operation": "FORMULA",
              "code": "//DATASET OPERATION\n//FORMULA\n$\"average_cost\" = enum()\n//DATASET OPERATION\n//EDIT ATTRIBUTES\nt.dataset.changeAttribute(\"average_cost\", \"formula\", \"enum()\")",
              "scope": null,
              "environment": "dataset",
              "status": 2,
              "desc": "Assign to attribute <i>average_cost</i> result of formula <i>enum()</i>"
          }
      ],
      "desc": "",
      "status_code": 200,
      "topic": "session/Insert/Code/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    }
    

    Delete Task

    Description: Deletes a task inside a flow referenced by its flowID.

    POST /session/delete/task/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow to be modified. See Get Resource ID for more details on how to retrieve IDs.

    str

    querystring

    task

    The name of the task to be deleted.

    str

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "topic": "session/Delete/Task/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
      }
    

    Rename Task

    Description: Renames a task inside a flow referenced by its flowID.

    POST /session/rename/task/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow to be modified. See Get Resource ID for more details on how to retrieve IDs.

    str

    querystring

    oldname

    The original name of the task.

    str

    querystring

    newname

    The new name of the task.

    str

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "topic": "session/Rename/Task/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    }
    

    Create Task Linked

    Description: Creates a task inside a flow referenced by its flowID automatically connected to a provided list of parent tasks.

    POST /session/create/tasklinked/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow to be modified. See Get Resource ID for more details on how to retrieve IDs.

    str

    querystring

    name

    The name of the added task.

    str

    querystring

    category

    The category of the task. See this section for more details.

    str

    body

    position

    The coordinates (x,y,z) of the newly created task. It is a dictionary with keys ‘x’, ‘y’, ‘z’ and float values.

    dict

    body

    parents

    The list of task which are going to be connected to the newly created task.

    list

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
        "status": "completed",
        "code": 0,
        "data": {
            "topology": {
                "parents": {
                    "child": [
                        "adultdata"
                    ]
                },
                "children": {
                    "child": []
                }
            },
            "tasks": {
                "child": {
                    "category": "datamanager",
                    "id": "d7404fda-8b58-4e71-995b-5f9329231d93",
                    "status": 2,
                    "progress": 0,
                    "priority": 0,
                    "loc": "100 100",
                    "zOrder": "1"
                }
            },
            "graphics": null,
            "events": {}
        },
        "desc": "",
        "status_code": 200,
        "topic": "session/Create/TaskLinked/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    }
    

    List Task

    Description: Gets the list of tasks present in a flow identified with the ID {flowId}.

    GET /session/list/task/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow. See Get Resource ID for more details on how to retrieve IDs.

    str

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {
          "dataman": "datamanager",
          "adult_new": "sourcetextfile",
          "adultdata": "datamanager",
          "child": "datamanager"
      },
      "desc": "",
      "status_code": 200,
      "topic": "session/List/Task/4c0e6962-8e35-4060-bbc1-aa1ee5b42846"
    

    }



    Delete Multi Objects

    Description: Deletes a set of objects (tasks, links or widgets) from a flow stage referenced by its flowID.

    POST /session/delete/multiobjects/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow to be modified. See Get Resource ID for more details on how to retrieve IDs.

    str

    body

    link

    A dictionary containing the keys parent and child pointing to a list value formed by the sequence of task name which are parent and child respectively of the links to be erased.

    dict

    body

    task

    A dictionary with a unique key task pointing to a list value formed by the sequence of task names to be erased.

    dict

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "progress": "100%"
    }
    

    Reset Flow

    Description: Resets all the tasks belonging to a flow identified with the ID {flowId}.

    GET /session/reset/flow/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow containing the task to be updated. See Get Resource ID for more details on how to retrieve IDs.

    str

    querystring

    mode

    The reset mode which could be:
    • soft: only the status will be restored to ready, even if data structures of a previous computation are not erased.

    • hard: status is restored to ready, and all the internal structures are erased.

    str.

    body

    taskList

    The list of tasks to be reset

    list.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed",
      "code": 0,
      "data": {},
      "desc": "",
      "status_code": 200,
      "topic": "session/Reset/Flow/543a4e15-cedb-47b3-8c75-ea884e1a5ae8"
    }
    

    Execute Event

    Description: Executes an event stored in a specific flow.

    POST /session/execute/event

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    querystring

    flowPath (click here to know more about it)

    The path of the flow which contains the event to be executed.

    str

    querystring

    eventName

    The name of the event to be executed.

    str.

    querystring

    failurePolicy

    The failure policy for the execution of the event. Can be stopmacro, to stop the execution at the first encountered error, or continue, to show all errors at the end of the execution.

    str.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
    }
    

    Stop Execute Event

    Description: Stops the execution of a running event contained in a flow identified with the ID {flowId}.

    POST /session/stop/executeevent/{flowId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    flowId

    The ID of the flow which contains the running event. See Get Resource ID for more details on how to retrieve IDs.

    str

    querystring

    eventName

    The name of the event to be executed.

    str.

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
    }
    

    Compute Flow

    Description: Computes a flow, which is identified with the {rflId}.

    POST /compute/compute/flow/{rflId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    querystring

    mode

    The computation mode, which can be:
    • “flow”, to compute the whole flow;

    • “upto”, to compute upstream of the selected tasks;

    • “onwards”, to compute downstream the selected tasks;

    • “selected” to compute only the selected tasks.

    str

    querystring

    onetime

    Performs a one-time computation starting from a .rfl file or a flow version on a repository. It can be true or false (default).

    The imported file is automatically disambiguated from the other flows on the working area to permit infinite parallel computations of the same flow.

    The flow at the end can be deleted according to an ad-hoc compute params entry.

    bool

    path

    rflId

    The ID of the flow. See Get Resource ID for more details on how to retrieve IDs.

    str

    body

    taskList

    The list of the tasks to be computed.

    str, or list for multiple tasks.

    body

    compute_params

    The computation parameters for the chosen flow, which can be:
    • “inmemory”: in which case:
      • 0 for a standard full computation (default)

      • 1 for a complete in memory computation

      • 2 for an in memory source saving computation

    • “procvar”: it contains a key/value dict with the list of flow variables to be overwritten for the current run. The values passed are not persistent.

    • “nparallel”: the maximum number of task which can be computed at the same time.

    • “failpolicy”: the policy to use if the computation fails; it can be “stopprocess”, “stopneighbours”, “continue”.

    • “prioritypolicy”: the policy to use to calculate the priorities; it can be “parentfirst” or “priorityfirst”.

    • “failpolicymacro”: the policy to use if the macro fails; it can be “continue”, “stopmacro”.

    • “floatprec”: the digit precision for real number operations.

    • “cache_vault_var”: if true, the vault variables’ values are cached.

    • “suppress_alert”: if true, alerts are not used in computation.

    • “deleteFlow”: in which case:
      • 0 is the default flow is not cancelled at the end of the computation

      • 1 flow is cancelled only in case of successful run

      • 2 flow is cancelled in any case

    • “inputdata”: a dictionary containing as key the name of the tasks we want to data fill, and as value the actual dataset for the task expressed in json format. The computation of the selected task is going to be skipped, and the data imported from the provided json is going to be considered as the output dataset of the task.

    • “outputdata”: a list of task names. The dataset of the tasks inserted in this list is going to be exported as json and attached to the final response.

    dict

    body

    import_params

    The import information used in case of one-time computation (ignored in all other cases). Dictionary composed by:

    • “flowPath”: the internal path on the working area of Rulex Platform where to import the flow. Suffix is automatically added to prevent name conflicts between parallel computations. The path is intended as environment path and base flow name. Click here to know more about the flow path.

    • “params”: A dictionary describing the parameters of the import. Possible entries are:

      • path” the path to the .rfl file used in the import (considered only in ‘__filesystem__’ or ‘__local__’ origins)

      • components” used to select which components of the flow are considered. A dictionary with the following entries:

        • topology: if true, the topology will be imported.

        • data: if true, the data will be imported.

        • doc: if true, the documentation will be imported.

        • graphics: if true, graphics will be imported.

        • events: if true, events will be imported.

        • modules: if true, modules will be imported.

        • var: if true, variables will be imported.

      • source” a dictionary formed by the internal information of the source used (considered only in ‘__filesystem__’ case):

        • uri: the path of the Filesystem resource stored in the Rulex Platform working area.

    dict

    Note

    The syntax for the procvar parameter is the GOLD syntax, with specific rules whether the variable is ordinal or a string:

    • For all the variables: the @ symbol is not required before them, the variable is written in .json format.

    • For ordinal variables: numbers must be included into ". e.g. {"var1":"2"}

    • For nominal variables: the string must be included into “, and it must be further included in ". e.g. {"var2":"\"string\""}

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

      {
      "status": "warning",
      "code": -10500,
      "data": {
          "res": 1,
          "errstr": "The following tasks have finished the computation with warnings:\ntextfile1 : The file <path> can not be located., most recent computation data have been used.",
          "outputdata": "{\"uut\":{\"age\":[39,50,38,53,28,37,...],...}}",
          "uncomputable": null,
          "computechild": []
      },
      "desc": "Warning in operation compute.Computation: The following tasks have finished the computation with warnings:\ntextfile1 :  The file <path> can not be located., most recent computation data have been used.",
      "status_code": 230,
      "progress": "100%",
      "tasks": [
          {
              "name": "app1",
              "status": "computed",
              "progress": "100%"
          },
          {
              "name": "llm1",
              "status": "computed",
              "progress": "100%"
          },
          {
              "name": "split1",
              "status": "computed",
              "progress": "100%"
          },
          {
              "name": "textfile1",
              "status": "warning",
              "progress": "100%"
          },
          {
              "name": "uut",
              "status": "computed",
              "progress": "100%"
          }
      ]
    }
    

    Stop Computation

    Description: Ends the computation of the flow identified with the ID {rflId}.

    POST /compute/stop/computation/{rflId}

    Parameters

    Parameters in bold are mandatory.

    Location

    Name

    Description

    Type

    path

    rflId

    The ID of the flow which is computing. See Get Resource ID for more details on how to retrieve IDs.

    str

    Response

    The response schema for this specific request follows standard exposed in api response section. An example response is:

    {
      "status": "completed"
      "code": 0
      "data": {}
      "desc": ""
      "status_code": 200
      "topic": "compute/Stop/Computation/543a4e15-cedb-47b3-8c75-ea884e1a5ae8"
    }