You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Calculate Observed Holidays in Workflow

posted on December 2, 2020

I work at a Financial Institution where we observe federal holidays and are sometimes closed for an in-service day. As we know with holidays, the date can differ from year to year or the date of observance can change if it falls on a weekend. A number of our Laserfiche Forms start workflows and a number of our workflows send reports, email notifications or contain HTTP Form Post activities that we would not want to run on an observed holiday.

I am not a skilled programmer (and maybe you aren't either) and so I decided to create a workflow without custom activities that would calculate our observed holiday dates for the current year and would not require yearly maintenance. I designed this workflow to be invoked by another workflow whenever holiday dates needed to be checked and then pass the dates back to the parent workflow in a multi-value token.

I'm sure this could be done many different ways, this is just the solution I came up with. I'm happy to hear any suggestions or improvements you may have.

I included an image file for visual learners, and then a txt file containing a summary of what was done within each activity. I also added an Output parameter token called "Observance Days" that the final activity modifies if another workflow started this one.

I hope that this proves to be useful to someone. :)

 

 

Calculate Current Holiday Closures.png
2 0
replied on December 3, 2020 Show version history

There's actually a much much easier way to do this.

In the Workflow Administration Console, you can configure your observed holidays with quite a bit of precision; there are some gaps but you can get around those with customized holidays.

For example, with the observe on Friday if Saturday or Monday if Sunday situation, I just checked the calendar ahead for a few years and created custom rules to cover anything that didn't work with the built-in options (although I did put in a feature request to address those scenarios so the more people who ask for it the more likely it is we get it lol).

You can customize existing holidays, or you can add your own custom ones depending on your needs.

Then, on the Workflow side, just use the Token Calculator (not Date Token Calculator) and the WORKDAY function, which will automatically exclude the weekends/holidays you configured.

For example, I frequently use a formula like this to find the "business day closest to today" 

WORKDAY(WORKDAY(%(Date),-1),1)

So if the input date was a normal Friday, it would subtract 1 to get Thursday, then add one to end up back on Friday. If that Friday was the Friday after Thanksgiving, it would subtract 1 to get Wednesday (since Thursday would be a holiday too), then add one ending up with the following Monday.

1 0
replied on December 3, 2020

Ahhh, I did not know about the Workday function within the token calculator. Thank you, that is very helpful! I'll play around with that.

I have configured holidays within the Workflow Admin Console and it does work for most of them. However I found the exception options to be limiting. For example, if Independence Day fell on Saturday, we would observe it on Friday but if it fell on a Sunday we would observe it on Monday. So using the "Moved to the next business day" or "Moved to the previous business day" options wouldn't work in cases like that. Or am I missing something?

0 0
replied on December 3, 2020 Show version history

Yea, I ran into the same situation because the "previous" or "next" business day really isn't enough considering it depends on if it is a Saturday or Sunday for many of our holidays.

What I was saying before is that I just looked a few years ahead in the calendar and added custom holidays to account for those scenarios, and fortunately there weren't that many that were affected.

For example,

I've requested a change to support different previous/next behavior based on whether it falls on a Saturday or Sunday, but requests like that sometimes need more people asking for it before they gain traction.

Feature Request: Granular Weekend Rules for Workflow Holidays - Laserfiche Answers

2 0
replied on December 3, 2020

Oh now I understand what you did to get around it. Very nice! I agree, that looks like the cleanest option for someone who knows what they're doing and would last for several years.

I'm actually leaving my workplace to go on indefinite maternity leave, so I was looking for a near zero maintenance solution since they haven't found a replacement for me.

I'll vote on your Feature Request post. ^_^

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.