<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=287945&amp;fmt=gif">

Form Computations Using Workflow Processes Automation

Posted by FlowWright on Mar 25, 2019 3:51:00 PM

FlowWright Forms are very common within the workflow processes.  Forms are meant to be routed to display information or capture information from a user.  But, did you know Forms also can have decision logic, validation or business logic built into the form itself? We explain why that is important below.

If you are developer and can write code, there are many ways to implement computations within FlowWright forms using your skills. The easiest path would be to use the javascript events on UI controls, put the code against the "click" event of a button to perform a computation or a validation. That is easy enough for our developer users.

What happens if you are not a developer? In that case FlowWright has a unique solution where you can use a process to make that computation.  FlowWright's powerful engine is able to execute in real-time mode, without any database dependency, completely in memory.  Using this feature, it's possible to pass values from the form to the process, execute the process and get the result from the process and show within the form. Amazing, right?

Let's take a simple example of computing the sum of 2 numbers; it's a very simple coding exercise for any seasoned developer, but for a business analyst who's not a developer, they might need some development help, and we are happy to supply a work around so organizations don't lose time due to bandwidth concerns. 

Here's how a business analyst able to solve this using FlowWright without any coding:  first, build a form with 3 fields as shown below.  Let's call the fields txtNum1, txtNum2 and txtSum in this order.

form with fields to compute sum using workflow

Next, all the magic is in the UI control called "Execute Workflow", with a simple drag of the control from the toolbox, place it next to the 3rd field as show above. 

Second, double click on the control to setup the properties for UI control and let's change the "Execute Button Text" to a value of "Calculate Sum".  The next step is to design the process that will compute the sum.  We then create a new workflow definition called "AddTwoNumbersForm"  (follow the steps below to build the process).

  • Define the numeric variables called - num1, num2 and sum
  • Drag an "eval expression" step to the designer canvas and connect the step to the "start" step
  • Configure the "eval expression" step as shown below:

  • Save the workflow definition

The designed workflow definition should look as follows:

Finally, let's switch back to the form and configure the rest of the required information for the "Execute workflow" UI control.  Configure the properties as shown below in the graphic:

First, select the workflow definition "AddTwoNumbersForm" from the list.  Next, map the input and output variables.  Map variable "num1" to "txtNum1" field, and map variable "num2" to "txtNum2" field.  Lastly, let's map the 3rd text field "txtSum" to the variable called "sum" and now, you are done! 

To test out the form, simply click the "preview" button on the toolbar to render the run-time version of the form.  Enter numeric values into the first 2 text fields and click the button to compute.  Here's what you should see....

It's that really that easy......Have questions? Let's Talk! 

Start Software Trial

Topics: dynamic forms, workflow processes