ederign.me
Published on

An Execution Workflow to Leverage Local Computational Resources for Intensive Processing on Business Automation Web-Based Smart Editors (aka DMN Runner)

Authors

As the previous blog post described, the DMN Runner transformed the DMN Authoring experience, bringing an instantaneous feedback loop seamless authoring experience.

DMN runner

I'm proud of this innovation because I've created such a feature via a "no-cost" services running capability for our Business Automation web tooling, enabling a client-side-only web environment to leverage local computational resources seamlessly.

The invention of the DMN Runner, combined with the KIE Sandbox authoring experience, changed the landscape of the DMN industry. Keith Swenson, VP of R&D Fujitsu America and former leader of the DMN "Technical Compatibility Kit" shared these kind words in his blog:

"

What is particularly impressive is the DMN test capability. To get it to run, you need to download and start the KIE Sandbox Extended Services, which ran without a hitch. The web UI automatically noticed that the engine was installed. Then, it would automatically generate forms for inputting the data. Most impressive was that it can handle structured data records and arrays, even arrays of structured records. … KIE Sandbox is the "best all-around tool for a DMN practitioner

Also, my former Director of Product Management, shared the following feedback:

"

This should change the way we demo our products. No need to go through the setup and installation process. Show on the fly how simple and easy it is to model a decision and a workflow.

In this blog post, we will dive deep into the innovation behind the DMN Runner.

Note:

This blog post details an invention that created an Execution Workflow to Leverage Local Computational Resources for Intensive Processing on Business Automation Web-Based Smart Editors. I worked on this innovation with my colleague Alex Porcelli and it's published as a patent in US11914556B2 .

Problem description

On Red Hat Business Automation group, one of our main strategies for the next generation of Tooling is to provide a complete and easy-accessible environment for free for the community, aiming to increase the marketing share of our product and, later on, transform such users into paying customers.

We also aim to make the Customer Acquisition Cost in this environment near zero, meaning that ideally, all the web tooling should execute on the client-side.

As a successful example of implementing this strategy, we can point to "dmn.new" and "bpmn.new" Business Modeler initiatives, with a client-side only Business Authoring environment, popular in the community with no associated costs for Red Hat.

However, in the Business Automation space, some essential features of a complete tooling experience are challenging to be converted to a client-side (javascript-based) implementation. As an example, we can point:

  • DMN and BPMN Runtime Engines, historically Java-based;
  • Language-server capabilities to introspect Java types that require a backend maven build;
  • Smart editors authoring feedback loop that would require validation and execution of the Model (via backend runtime engine).

The traditional option in such use cases would be to connect our client-side online modeler to a backend service running on the cloud. Indeed, this is a viable and traditional option. However, this would directly impact our goal to have a 'near zero' Customer Acquisition Cost due to the service hosting costs.

Also, for some specific use cases on Business Automation, providing such services for thousands of users would require robust backend infrastructure, making the costs prohibitive for free availability to the community.

As an example of such use cases, let's expand more on the challenges related to the instantaneous feedback loop execution for BPMN and DMN models.

An essential piece of a seamless authoring experience of assets is an instantaneous feedback loop. A feedback loop on asset authoring happens when some portion of or all asset input is captured, analyzed, and used to provide insight to improve a future users' authoring experience. Providing such feedback instantaneously is crucial to a fluid authoring experience.

As an example of such feedback, we can highlight Gmail Smart Compose, a feature powered by artificial intelligence, able to help users to draft emails suggesting 'next words,' and also Grammarly Chrome Extension, able to analyze the text of a web page and provide feedback about spelling.

There are two important aspects related to this problem:

  1. The computational cost of the input analysis and insight generation;
  2. The latency of the feedback;

Regarding the computational cost of the input analysis and insight generation, from a computational perspective, executing such analysis in some cases is trivial, for example, querying an already trained neural network for textual word auto-completion on every user iteration.

However, on Business Automation assets, especially in BPMN and DMN models, building such feedback is computationally expensive. Such analysis would require interpretation or compilation of the whole model. In a cloud environment, doing such analysis multiple times per second for thousands of users would make this operation expensive.

The latency of the feedback is another problem for Business Automation assets. In this perspective, the Business Automation use case differs significantly from the 'text suggestion' example from Gmail Smart Compose, where a system can submit just the current word or a small context of the current edit.

In Business Automation use cases, BPMN and DMN models have a considerable size; some even have more than 1MB of XML text. Their structure is also complex, making it challenging to provide insight from a fraction of its content.

For a continuous feedback loop on business automation assets, we need to submit the whole model for the server evaluation on each modification (user iteration) of the asset, making the network latency impact prohibitive to provide timely feedback.

That is the rationale why Business Automation Web Tools don't provide such feedback instantaneously, and they do such operations via user action, i.e., when users save or validate the asset. However, such a need for manual iteration breaks user authoring flow due to the lack of an automatic instantaneous feedback loop.

So the problem we seek to solve with this invention is: How to provide a complete web tooling experience for the Business Automation community that would potentially include 'backend' services in a low latency environment for thousands of users while keeping the Customer Acquisition Cost near zero?

To tackle this issue, we created an innovative workflow that aims to provide a "no-cost" services running capability for a Business Automation web tooling that enables a client-side only web environment (https://dmn.new and https://bpmn.new) leverage local computational resources in a seamless way.

Architecture

To create an execution workflow, able to leverage local resources for intensive computation on Business Automation web-based smart editors, we introduced the concept of Business Automation daemon.

The Business Automation daemon is a desktop application running in the background on the user's machine. After installation, this daemon is listening in the background to a specific port, waiting to execute workloads from our client-side-only web application (https://dmn.new).

This daemon can execute a set of services; an example of such services could be DMN validation and execution and generating a form based on a DMN model.

As soon as the web application decides to execute a resource-intense computation, instead of a remote call to another machine running in a cloud, a service proxy routes the call to the daemon running on localhost. The asynchronous communication between service proxy and Business Automation daemon could be done via HTTP or via web socket.

This execution workflow allows this operation to be executed with low latency and leverage users' local resources.

DMN Runner

Example of use cases

DMN validation

  • Using dmn.new website, the user inserts a new Decision node in a DMN Model.
  • To provide user feedback on this operation the DMN editor decides to validate the model and calls the service proxy (both running on the browser);
  • The service proxy detects that the operation is a resource-intensive computation and the user has the Business Automation daemon, running on its machine.
  • The service proxy delegate this operation to the local daemon;
  • Business Automation daemon execute this operation using the user's machine resources and return the result for the service proxy;
  • The service proxy returns the result of the computation for the DMN Editor;
  • DMN editor provides feedback to the user;

Here is a video of the DMN Runner and this invention in action: KIE LIVE