Search code examples
blueprism

With Time Range


Suppose I have Some Employee Scheduled working hour(9:30 AM- 5.30PM) and He punches in at 9.25AM or 9:45 so I'm trying to find out if there is logic or Code or any kind of help to solve this problem. I want Bot to Identify +30 or -30min for Punch In or Punch-out time. Is there any VBO for Time Manipulations or give time ranges in collection or Data Item?


Solution

  • Why not just use a Decision stage with basic arithmetic to check the lower and upper bounds of your distance from the expected?

    Load the expected punch-in time and the actual punch-in time to Time-typed Data Items, then set a third data TimeSpan-typed data item to the deviation you're willing to accept between the scheduled and actual times.

    Since Blue Prism's internal expression evaluation engine doesn't support absolute value, you'll have to check that both permutations of the difference fall within the bound of the Acceptable Deviation. Thus, your Decision would look something like the following:

    [Scheduled Start Time] - [Punch-in Time] < [Acceptable Deviation] AND [Punch-in Time] - [Scheduled Start Time] < [Acceptable Deviation]
    

    Blue Prism sample process layout