The philosophy of the Custom block is that of two perspectives: In one, the block is created and made functional by someone with knowledge of script languages such as R or Python. In the other, the block is used as part of a workflow like any other block from the block menu.
|Design Tab with some options specified||And the resulting Options tab|
Part of using a block in a workflow is to configure its functionality dependent on the data coming from upstream. This is usually achieved through block options where for example fields are specified that correspond to quantities that should be predicted.
An example of how it works is attached to this article. Alternatively, have a look at the community block section in omniscope and check out the community blocks on github
For Custom Blocks these options can be specified in the "Design" tab. There, various types of options can be added to the block which then appear in the "Options" tab. When a workflow designer configures these options with values, these values are made available to the script via the Omniscope api (see Omniscope API Documentation).
Each option has some commonalities, some of them are found in the three-dots menu next to "Title":
- Type: Option types such as a Field, or a Text input
- Name: The name must be unique and is used to obtain the option value from within the script
- Title: This is the title the the workflow designer will see in the "Options" tab
- Description: Text that is displayed together with the option to explain what the option is for, or how it should be used
- Group title: Options with the same group title will be put into the same options group. The group title is used as the paragraph title
- Option width: How much horizontal space the option should be allowed to use.
- Mandatory: Not all options can be made mandatory. If an option is made mandatory, it cannot be left empty.
Reference of option types
A text option allows the input of arbitrary text.
A text option that masks the text with dots.
An option to select a predefined choice. The choices themselves must be added in the three-dots menu next to "Title". To add a choice press on the big plus. Then enter a "Value" and a "Title". The "Value" is what will be given to the script when that choice is selected, and "Title" is what will be displayed as a choice in the "Options" tab. There, choices can be shown in a number of ways:
- Auto: Omniscope tries to automatically select the best way to show the choices based on the amount of space made available to the option
- List: The choices are shown all at once vertically. Each choice is a radio-button.
- Compact: The choices are arranged horizontally next to each other in a way where they use the least amount of space.
- Multi-Column: Depending on the option width the options are laid out horizontally in multiple vertical columns.
If the checkbox "Dropdown" is checked, the option is converted into a dropdown.
An option to enter integer number such as 0, 1, 2... It is possible and optional to specify either a minimum number, a maximum number, or both to define the range of number permissible. The minimum and maximum numbers are inclusive, meaning they themselves are allowed as input values.
An option to enter decimal numbers such as 0.5, 1.2, 2.8... It is possible and optional to specify either a minimum number, a maximum number, or both to define the range of number permissible. The minimum and maximum numbers are inclusive, meaning they themselves are allowed as input values.
Specifies a checkbox, or a toggle. It can have two states: checked or unchecked. When accessed from within the script, it is a boolean type, which means that it is either "True" or "False" respectively. Boolean options cannot be made mandatory. In their default form they are unchecked, and therefore "False".
An option to enter a single field from one of the inputs. It is possible to specify the input from which the field should be selected. In that context "1" specifies the first input index, "2" the second etc.
An option to enter a list of fields from one of the inputs. Just like for a single field, it is possible to specify the input from which the field should be selected. In that context "1" specifies the first input index, "2" the second etc. If the option is made mandatory, then at least one field has to be chosen.
An option to enter or choose a path to a file on the hard-drive the IOX is located. This means the hard-drive connected to the computer Omniscope is running.