Blog Posts BPMN DMN

New web app for SonataFlow deployments

Blog: Drools & jBPM Blog

The Serverless Logic Web Tools has the deploy on OpenShift functionality to deploy your Serverless Workflows. After you deploy a Serverless Workflow it’s possible to execute them through normal POST requests.
Since the KIE Tools 0.32.0, you can use the SonataFlow Deployment web app, to easily run your workflows directly from your deployment.

It provides a simple and user-friendly interface for viewing and starting workflows, generating custom forms and triggering cloud events.

Requirements

View and start a workflow in the deployment

The home page displays the list of all workflows inside the deployment. From the list you can also start a workflow by clicking the play button and a JSON editor will be shown to input your workflow data. After you start a workflow, the app will show the server’s response to see the output of the workflow and troubleshoot any errors.
The video below shows the full process of deploying a workflow on OpenShift from Serverless Logic Web Tools.
As a first step, we use the Greeting workflow from the Samples and then deploy it on OpenShift.
The video shows a new application has been created in the OpenShift cluster.
In the last part of the video, we access the deployment to see the home page of SonataFlow Deployment.

Show a custom form generated from a JSON schema

In the Serverless Workflow specification there is the possibility to use a defined JSON schema to validate the input data before starting the workflow.
If the dataInputSchema property is defined in your workflow, the web app will generate a custom form which you can use to provide the required input data and validate it before triggering the workflow.
The second video in this article shows a custom Quarkus app deployment in an OpenShift cluster.
In the first part of the video we are running the service workflow and this time, we will see an automatically generated form to input our data.

Read more: Input and Output schema definition for SonataFlow 

Triggering a Cloud Event

The SonataFlow Deployment Web App allows you to trigger cloud events to which your workflow will listen.
To trigger an event you can simply click on the Trigger Cloud Event button, and then a form will be shown with the possibility of setting the endpoint, the method, the event type, the source, the instance id, the event data, and also set as many custom headers you want.
The second video also presents the event-triggering process.

Installing the SonataFlow Deployment web app as a webjar

For manual installation in your Quarkus app, SonataFlow Deployment web app can be easily integrated as a webjar from webjars.org. Following the steps below:

  1. Visit webjars.org and search for the latest available version of sonataflow-deployment-webapp
  2. Edit the pom.xml file and add the following plugin configuration:

Add the sonataflow-deployment-webapp version from webjars.org to the properties section of your pom.xml, replacing the value with the one from the previous step.

0.32.0
  1. Add the webjar as a dependency in the dependencies section:


    

        org.webjars.npm

        sonataflow-deployment-webapp

        ${sonataFlowDeploymentWebapp.version}

    

  
  1. Add a plugin to unpack and copy the Webjar in the plugins section

    
      
          org.apache.maven.plugins
          maven-dependency-plugin
          
              
                  unpack-sonataflow-deployment-webapp
                  process-resources
                  
                      unpack
                  
                  
                      
                          
                              org.webjars.npm
                              sonataflow-deployment-webapp
                              ${sonataFlowDeploymentWebapp.version}
                              ${project.build.directory}/sonataflow-deployment-webapp
                          
                      
                      false
                      true
                  
              
          
      
      
          maven-resources-plugin
          
              
                  copy-sonataflow-deployment-webapp-resources
                  process-resources
                  
                      copy-resources
                  
                  
                      ${project.basedir}/src/main/resources/META-INF/resources
                      true
                      
                          
                              ${project.build.directory}/sonataflow-deployment-webapp/META-INF/resources/webjars/sonataflow-deployment-webapp/${sonataFlowDeploymentWebapp.version}/dist

                                **/*
                          
                      
            
          
        
      
    
  

This configuration will add the necessary dependencies, unpack the webjar, and copy the required resources.

  1. Start your app:
$mvn clean quarkus:dev

Once these steps are completed, you’ll have integrated SonataFlow Deployment web app into your project, and see the app as the home page of your Quarkus app.

Manual installation of the SonataFlow Deployment web app as a webjar is a good option if you want to have more control over the deployment of the web app or you want to try your workflows locally.
You will also be able to deploy your app to OpenShift following the usual configuration.

An example of a SonataFlow Deployment to use locally it’s available in this repository:
https://github.com/fantonangeli/sonataflow-deployment-webapp-consumer

Read more: Creating a Quarkus Workflow Project

Customizations of the web app

The web app supports a few customizations through the json located in src/main/resources/META-INF/resources/sonataflow-deployment-webapp-data.json, where you can specify the following fields:

OpenAPI Specification download

The application gives you also the possibility to let you download the openapi.json file and let you use it for generating client libraries or in your SwaggerUI, for instance.

Responsive Design

The web app has a responsive design to support a variety of devices, including desktops, laptops, tablets, and smartphones.

The post New web app for SonataFlow deployments appeared first on KIE Community.

Leave a Comment

Get the BPI Web Feed

Using the HTML code below, you can display this Business Process Incubator page content with the current filter and sorting inside your web site for FREE.

Copy/Paste this code in your website html code:

<iframe src="https://www.businessprocessincubator.com/content/new-web-app-for-sonataflow-deployments/?feed=html" frameborder="0" scrolling="auto" width="100%" height="700">

Customizing your BPI Web Feed

You can click on the Get the BPI Web Feed link on any of our page to create the best possible feed for your site. Here are a few tips to customize your BPI Web Feed.

Customizing the Content Filter
On any page, you can add filter criteria using the MORE FILTERS interface:

Customizing the Content Filter

Customizing the Content Sorting
Clicking on the sorting options will also change the way your BPI Web Feed will be ordered on your site:

Get the BPI Web Feed

Some integration examples

BPMN.org

XPDL.org

×