How to calculate a duration between two time variable & display the result in the same form?

1
0
-1

Hi all,

I am currently creating daily movement in office workflow using Bonita BPM Community version. The idea is to track how many hours were spent by an employee during their outside job.

My plan for the first form is to create 3 widget to calculate total expected time;

  1. Time to leave the office
  2. Expected time to be back
  3. Total expected time

METHOD 1

For the 1st & 2nd widget I am using the 'Select' widget where the I have created a list of time e.g "9:00, 9:30, 10:00, 10:30...". So when user select, there will be a string value. The string value will need to be converted before being calculated right?

The issue is, is it possible calculate the time difference between 1st & 2nd widget and at the same time displayed the total time is in 3rd widget as user inserted/selected the value in the first two widget? I have tried multiple groovy calculation method (which i referred from various sources on google) but none of them succeed.

METHOD 2

For the 1st & 2nd widget I am using the 'Date' widget which I have set the output to display only hour & minute. I have seen an example where they calculate the total time between the two different dates but this method involve some script in 'contingencies' tab in 'widget properties' where this feature only available in Bonita BPM Subscription not in the Community version that i'm using.

To be honest I'm not a person with programming background. I hope u guys can give me some idea and solution upon this matter. Thank you

No answers yet.
Notifications