Start From DBIO

With this node you can start a flow and create a workable to collect and later return data to the database_proxy module in the CLOUDFLOW API.

Some words about CRUD

CRUD refers to the major functions that are implemented in relational database applications. It is short for:
  • Create: a function that creates a new document in the database.
  • Read (Get): a function that reads (gets) a document by id in the database by id.
  • Update: a function that updates a document, where the document data contains enough information to find the document. No document will be updated if the document is not found.
  • Delete: a function that removes a document by id.

CRUD functions in the CLOUDFLOW API

The CLOUDFLOW API contains the database_proxy module. This module contains functions to access data that is generated by workflows starting with the Start From DBIO node and that acts like a database. The module is used to implement CRUD functionality, compatible with our other CRUD functions, but that is fully customizable by using a workflow. See API for more information on the CLOUDFLOW API. See the database_proxy module in the API reference on http://<server>:<port>/?api.

If you call one of this functions, a workflow is triggered.

Example

You use the API call api_async.database_proxy.list(). In that case, the creation of a workable is triggered in the Start From DBIO node. In this workable you can collect the required JSON data that you need to return in the Set DBIO Reply node. The result of the above API call you will be the returned JSON.

With this method, you can implement CRUD functionality that can be used in your JavaScript files or in Pagebuilder and work with the data as if they come directly from a database.

The node

It has the following configuration options:
  • Name: here you can specify the input name to use in the API calls to select this starting point.
  • Allow Access to Scopes: here you can specify which scopes are allowed to use this input. Options:
    • If you leave this field blank, users with the same scope as the Whitepaper are allowed to use this input.
    • If you enter *, all users are allowed to use this input.
    • If you enter a comma separated list of scopes, users that are in one of the specified scopes are allowed to use this input.
  • Allow Access to Users with Attributes: here you can define which attributes users need to be allowed to use this input. Options:
    • If you leave the parameter field black, all workflows will be accessible for all users in KIOSK.
    • If you define a comma separated list of attributes, all users who have one or more of the specified attributes are allowed to use this workflow in KIOSK.
    Note: Only if these users also have the correct scope as configured in Allow Access to Scopes, they will be able to access the workflows in KIOSK.
  • Enable for guest users: if you select this checkbox, guest users can use this node to create workables.
  • Workable name: here you can specify the name to assign to the created workable. Leave this parameter empty if you do not have a specific name to assign. Select the pencil to open Expression Builder.
  • Link To Jacket (by name): here you can specify a jacket name that will be searched.
    • If found, the new workable will be linked to the jacket.
    • If not found, a new jacket will be created, and the specified name will be assigned to it.
    Leave this parameter empty if you do not want to link to an existing jacket. Select the pencil to open Expression Builder.
  • Priority: in this drop-down list you can specify the priority to assign to the created workable.
  • Scope From User: if you select this checkbox, the scope for the workable is taken from the user that is creating the workables. If you do not select it, the scope from the selected Whitepaper will be used.
Each output of the node corresponds to one of the CRUD functions:
  • Get: if you select this output, a document in the database is read by id.
  • Create: if you select this output, a new document will be created in the database.
  • Update: if you select this output, a document in the database is updated in case the document data contains enough information to find the document. If the document is not found, it will not be updated.
  • Delete: if you select this output, a document in the database is deleted by id.
Next to the CRUD functions, three extra outputs are available to execute extra functions:
  • List: if you select this output, all documents that are specified by the supplied query are collected.
  • Count: if you select this output, all documents that are specified by the supplied query are counted.
  • Get Columns: if you select this output, the columns in the documents are returned. The return value of this function must be an object containing one key columns and a value with an array structure. Each element of the array must be an object. Each object must have a parameter name with an nonempty string containing the name of the column and a parameter data_type containing the JSON type representation of the internal value of the column. Supported values are number, string, boolean.
    "columns" : [{
    
    "name": <name of the column, JSON path to the value>,
    "data_type": <"number" | "string" | "boolean" | (not yet supported but allowed "date", "date_iso")>
    
    }]
    Note: It is recommend that the name and the data_type correspond to the returned JSON structure, because some features will directly handle the returned JSON and do not pass via the Start from DBIO node.