This article is outdated, you can access the most current version here: https://doc.onedata.de/apps/apps-docs/odml-documentation/AppBuilder/elements/ExecuteButtonElement.html#id
Article Content
Execute Button Element
type = "executeButton"
With this Element you can execute a Workflow, Production Line or Function.
Properties
Property | Type | Description | Example Value |
id | string | The unique id assigned to the Element. | "id": "execButton1" |
type | string | Type of the Element | "type": "executeButton" |
config | object | Configuration of the Element. | "config": { // ID of the endpoint "endpoint": "TestEndpoint", // Button Icon (default // is a play button) "icon": "", // Label of the button "label": "Execute Test Workflow" } |
config. messages | object | Configuration of the displayed execution messages. The default messages will be used if no message is defined. | "messages": { "started": { // Headline text "headline": "Started", // Message text "message": "" }, "error": { "headline": "Error", "message": "" }, "failed": { "headline": "Failed", "message": "" }, "aborted": { "headline": "Aborted", "message": "" }, "success": { "headline": "Success", "message": "" } } |
config. messages. success. messagePath | string | A JSONPath expression defining where to find the text of the message in the object returned by the function. If this is omitted or the respective field does not exist in the function response, the text from 'message' will be shown. | This relates to Function feature. Further information below. |
config. messages. hideAfter Seconds | number | By default the message will not be hidden and has to be closed by the user. Setting this value to 4 on the other hand, auto-hides the message after 4 seconds. This can also be configured globally, see Global>Messages. | "messages": { "hideAfterSeconds": 4 } |
config. messages. disabled | boolean | Disables the message all together, hiding it from the user. Defaults to false. This can also be configured globally, see Global>Messages. | "messages": { "disabled": false } |
config. showSpecific Error Messages | boolean | Enable specific ONE DATA Error or Warning messages. | "showSpecificErrorMessages": true |
config. disabled | boolean | Property to disable the Execute Button | "disabled": false |
config. diableExecute Button. untilFinished | number | Property to disable Execute Button until the Workflow / Production Line is finished. | "disableExecuteButton": { "untilFinished": true }, |
config. diableExecute Button. forTime | number | Property to disable the Execution Button for 5 seconds after click. Something like 1.2 is also possible | "disableExecuteButton": { "forTime": 4 }, |
Example
Executing Functions with customizable messages
When triggering Endpoints of type "function"
additional possibilities for customizing user-facing messages are available. This section explains additional possibilities for customizing the toast messages in both success and error cases.
The examples in this section assume that the the following Python-function was already created in the Processing Library or Use Cases module of ONE DATA. It accepts a dictionary with a name
field as parameter, validates that the name is not empty and returns an object containing a greeting.
def handle(req): # Get the function payload user = req['args'] # Validate that a name is provided if 'name' not in user or not user['name']: raise Exception('No name was provided') # Generate and return the message return { 'greeting': { 'text': 'Welcome to Apps, %s!' % user['name'] } }
Given this Function a Function endpoint can be defined and used for the execute button. In this configuration it is possible to customize the toast message shown to the user using a value from the functions return value. The property messages.success.messagePath
allows to specify a JSONPath expression pointing to any string value in the functions return value that should be used as text for the toast. The following example shows how the greeting generated by the above function can be shown to the user when the function was successfully executed.
ResetFilterButton Element
type = "resetFilter"
With this Element you can add a one click button to reset all Filters
Properties
Property | Type | Description | Example Value |
id | string | The unique id assigned to the Element. This is defined by the user and used to refer to the Element in layouts. | "myElementId" |
type | string | Type of your Element | "resetFilter" |
config.label | string | The label (button text) that should be displayed. | "Reset all filters" |
config.icon | string | The icon which will be displayed in front of the label. | "arrowleft" or "refresh" |
Example
ToggleButton Element
type = "toggleButton"
With this Element you can switch between two states.
Properties
Property | Type | Description | Example Value |
id | string | The unique id assigned to the Element. This is defined by the user and used to refer to the Element in Layouts. | "myElementId" |
type | string | Type of your Element | "toggleButton" |
config.variable | string | Name of the variable you want to change. | "foo" |
config.left | object | Properties for the left state of the toggle button. | "left": { "label": "Table", "value": { "sub1": "table", "sub2": "table" } } |
config.right | object | Properties for the right state of the toggle button. | "right": { "label": "Highchart", "value": { "sub1": "highcharts", "sub2": "highcharts" } } |
.config.checked | boolean | Property to set the default state of the toggle button to the right state. | "checked": true |
config.disabled | boolean | Property to disable the toggle button. | "disabled": false |
Example
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article