Share:
When you create a flow in the client services designer page, Neutrinos creates a flow level object named bh to access input, local, error, and system properties of the flow. The input and local properties are user-defined for an app, the system properties are generated by the Neutrinos Platform, and the error property is created when an exception occurs.

Properties

  • The bh.input property contains variables that are provided as input to the service. These are properties that you supply to a flow when the flow is called. They are not available outside the flow unless they are defined as Output variables. 
  • The bh.local property contains variables that are private to the flow. They are also not available outside the flow unless they are defined as Output variables.
  • The bh.error property contains the error object after an exception occurs. These exceptions are caught by the Catch node.
  • The bh.system property contains all the variables and services that are pre-defined by the  Neutrinos Platform. See System-defined Properties to learn about these properties.
Warning

 You should not override the bh object. For example, you should not assign the following values to the bh object:

  • bh = null
  • bh = undefined
  • bh = empty object

Create an input or local Property

You can create any number of input or local properties in the Start and Script nodes of a flow. 

Create input or local Properties in the Start Node

To create input or local properties in the Start node, create a service or open an existing service, and perform the following steps:

  1. Drag and drop a Start node.
  2. To create an input property, in the Input Parameters field specify the input parameters for the flow.
    • Enter an input key
    • Enter a value to be associated with the key. The value can be of type JSON, String, and number. 
    • If you want to access the input property variable outside the flow, assign it to be an output variable by toggling the Output property of the variable to True 
    • Click the Add icon to add the input variable.
  3. To create a local Parameter, in the Local Parameters field:
    1. Enter a local key
    2. Enter a value to be associated with the key. The value can be of type JSON, String, and number. 
    3. If you want to access the local property variable outside the flow, assign it to be an output variable by toggling the Output property of the variable to True 
    4. Click the Add icon to add the input variable.
Information    If you want to set an input or local property as an output variable (so that the variable can be accessed outside the flow), then you have to create the property only in the Start node and toggle the Output to True.

Create input or local Properties in the Script node

To create input or local properties in the Script node, create a service or open an existing service, and perform the following steps:

  1. Drag and drop a Script node.
  2. To create an input or local properties, In the Code Editor, add the code to create one or more properties. If the property already exists, it's value will be updated, else a new property will be created. For example:
    JavaScript
    bh.input.modelrApiURL='http://localhost:24483/';
    bh.local.city='Goa';
You cannot set input or local properties as output variables from the Script node. You have to use the Start node to do this operation.