kie-tooling
Published in

kie-tooling

Dashbuilder Runtime Embedded Mode

Dashbuilder Runtime (DB) allows you to run your dashboards in a cloud-ready web application. Since jBPM 7.40 users can access their dashboards by logging directly into DB or they can bring dashboards to their application by using the improved embedded mode.

With embedded mode, Dashbuilder Runtime can be part of users’ own applications. The REST API also allows users to upload dashboards directly into Dashbuilder and navigate through the existing dashboards.

In this article, we discuss Dashbuilder embedded mode and the REST API that can be used to retrieve dashboards information.

Embedding dashboards

Every dashboard in DB page can be accessed in embedded mode using the URL format:

${DB_URL}?standalone&perspective=${PG_NAME}

Where:

  • DB_URL: The URL where Dashbuilder Runtime is running;
  • PG_NAME: The dashboard page name

in Multi-mode you just need to additionally provide the import name:

${DB_URL}?standalone&perspective=${PG_NAME}&import=${IMPORT}

Here’s a sample URL:

http://localhost:8280/?import=population&perspective=Countries%20Population&standalone

A dashboard running in embedded mode

REST API

The integration with the third party application is improved by DB REST API:

  • GET /api: Provides server information: Runtime Mode and list of available models. Sample
  • POST /api/dashboard/: Received a POST ZIP with dashboards and register it for use (upload). You must send a form param called “selectedFile” with the file contents. It returns the dashboard id.

curl -u ‘admin:admin’ -F ‘selectedFile=@/home/wsiqueir/Downloads/new_dashboard.zip’ http://localhost:8280/rest/api/dashboard

Sample request to upload a dashboard

  • GET /api/dashboard/{id}: Retrieves information about the dashboard {id}
Sample response for a dashboard details

Javascript Client Library

It is possible to wrap the REST calls using a Javascript library published in npm: dashbuilder-js/api. With this, you can use dashboards directly in your application. See examples in dashbuilder-js repository.

Using dashboards from a Javascript application

Conclusion

Dashbuilder Runtime can be seamlessly integrated with existing applications. In jBPM 7.43 we also added support to integrate your own components inside DB and in the next article, we will discuss how this can be done.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
William Antônio Siqueira

William Antônio Siqueira

A software engineer passionate about open source, open data, data visualization and Java development.