[-]
 [+]
  
 
[-]
  
  
  
  
  
  
  
  
  
  
  
 
 
Updated on 9/27/2019
Service Designer User's Guide
Properties
Direct link to topic in this publication:

Properties in UI Services

When you create a flow in the UI services designer page, Neutrinos creates a flow level object named bh to access input, local, and system properties of the flow. The input and local properties are user-defined for an app, whereas the system properties are generated by the Neutrinos Platform.

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.system property contains all the variables and services that are pre-defined by the  Neutrinos Platform.

Create an input or local Property

You create an input or local property in the Start node of a flow.

  1. Create a service or open an existing service
  2. Drag and drop a Start node
  3. 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. 
    • Click + Add.
  4. To create a local Parameter, in the Local Parameters field:
    • Enter a local key
    • Enter a value to be associated with the key. The value can be of type JSON, String, and number. 
    • Click +Add.

Set an input or local Property as an Output variable 

If you want to access an input or local property variable outside the flow, perform the following tasks:
  • Add an  input or local  property to the Start node of the flow
  • Assign it to be an output variable by toggling the output property of the variable to True.  
  • Add more nodes and connect them to create a logical flow.

Access input and local Properties from the App Page

To use  input and local  properties in an application page, you have to import the relevant service (the service in which you have declared these properties) to that page. For example, in this screenshot, a service named calculator is created:

To access the  input and local  properties of the calculator service in the Index page of the app:

  • Import the service to the page:
  • Inject the calculator service in the constructor of the page:

JavaScript
constructor(private bdms: NDataModelService, private calc: calculator)
{
// your code here
}

  • Now you can call any flow that you have created in UI services by using the calc property of the page. For example, to access the subtraction flow, use calc.subtraction(). Every flow when called will return the bh object on success.
  • You can then use the bh object to access the UI services properties. For example:

JavaScript
this.result = this.calc.calculator(Number(this.first), Number(this.second), $event).then(bh => {
console.log(bh);
this.result = bh.local.result;
});