Skip to main content
Skip table of contents

Service Interface: The Shell

A Unique Interface for all Services

To communicate with a service, you need to have an API. We chose to use a shell because:

  • A shell can be made REST aware and then provides REST handlers automatically.

  • You can easily attach a Terminal dashboard component and interact and test it.

  • You can automatically create Form and CRUD dashboard components from a shell and have a user-friendly UI.

  • Flows can act with services by a Shell Executor component in an asynchronous and highly scalable way.

Creating a Shell

Create a shell using a flow. Connect all the required components, and activate your flow. 3 parts make up a shell:

The Shell

The Shell component registers the shell with a list of the possible commands. Please give it a name, description, and list of commands within the properties.

Commands

For each command name defined in the Shell component, you'll need a corresponding Register Shell Command component to register the command. The Register Shell Command has the following properties:

  • Command Name - Must be the same name as the one defined in the Shell component.

  • Description - This Will be shown when typing help in your shell's terminal.

  • Reference Label/Value Key (Optional) - Only used if a parameter in Form or Shell CRUD dashboard component references this command.

Command Parameters (Optional)

You can also define the parameters your command might need. Each parameter must be registered using the Shell Command Parameter component. Note that parameter values are always strings by default, including booleans. If you expect the actual type in your flow, check Convert to Type and the values will arrive as the specified type.

Command Handler & Output

Every command in the Shell component will receive its own connector. Use this connector to handle the command.

The incoming message from the connector will have the parameters set as properties.

To reply to a command using the Shell Reply component. You will need to select the command response type for it to be formatted properly.

In the above example, we reference the name property (a command parameter) using {name} and return a stubbed user.

Registration

To start your shell registration, you would typically use a Flow Start component which will execute as the flow is activated. Alternatively, you may choose to register a shell depending on your data flow dynamically.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.