Visualize current state of values
This example shows how to display live value states in a dashboard using a Value subscription widget, useful for real-time debugging during integration.
Create a boolean variable with
owner.variablesto serve as a test value.Add a Value subscription widget to a dashboard via the edit mode.
Bind the widget to one or more values and subscribe to their live state updates.
Toggle the variable directly from the widget to verify write and display behaviour.
git checkout origin/osp-web-configuration .
git checkout origin/osp-variables-configuration .
git checkout origin/example-dashboard-value-subscription .
Steps
1. Create a new empty dashboard
root/dashboards/values/dashboard.web
{
"moduleId": "modules.web.web-1",
"title": "Tutorial dashboard",
"description": "Tutorial dashboard",
"tags": ["Tutorial"]
}
root/dashboards/values/dashboard.view
{
"configuration": [
],
"layout": {
"lg": []
}
}
2. Create a boolean variable to be used in the value subscription
root/variables/example/value.ospp
{
"name": "Boolean variable",
"description": "Example - Variable displayed and controlled using the subscription widget",
"type": "BOOLEAN"
}
root/variables/example/owner.variables
{
"moduleId": "modules.variables.variables-1"
}
3. Push the configuration to the osp-configuration-dispatcher
git add .
git commit -m "Add new dashboard"
git pull
git push
4. Login to the dashboard and select the previously created dashboard
8. Replace the previous content of the dashboard.view file by the content copied in the previous step, and push the modifications
git add .
git commit -m "Add subscription widget"
git pull
git push
9. Refresh the dashboard, and subscribe to some values
Add this example in your configuration
You can directly use the following command to add this example into your configuration :
git checkout origin/example-dashboard-value-subscription .