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

Question

Question

Best way to determine if date token occurs during a certain period during the week?

asked on October 7, 2020 Show version history

Hello,

I have a customer with a workflow that sends an email to dispatchers when a form is submitted with a shortcut to the document in Laserfiche. The dispatchers then use a field value to assign a driver to the order.
 

They contacted me today asking about sending an additional email to a couple other people if the order form is submitted between 5 PM Friday and 7:30 AM Monday. I've messed around with adding a conditional decision/sequence to my existing workflow to determine if this extra email should be sent and I'm not sure if that's the best way to do it versus maybe an additional workflow that runs on a schedule or can somehow determine if it should run based on starting conditions. 

Has anyone done something similar? I feel like I'm missing a simple way to do this but I can't seem to figure it out.

8.5.1
8.5.1
0 0

Answer

SELECTED ANSWER
replied on October 7, 2020

I think something like extracting the time and day of the week from the date, then the range when emails shouldn't be sent, breaks down as :

  • It's either Tuesday, Wednesday or Thursday
  • OR (it's Friday AND it's before 5:30PM)
  • OR (it's Monday AND it's after 7:30AM)

(WARNING: very lightly tested!)

 

1 0

Replies

replied on October 7, 2020

Does this workflow start when the document is created? You could look at the creation date on the starting entry. (You could also look at the current time, but that may be off if the server is under load. So you could have a document created at 7:28 AM on Monday, but Workflow doesn't get to it until 7:31 AM)

You could also have Forms write the business process instance and submission IDs to the document, then use Workflow to look up the submission time. That would be more accurate since there could also be delays between the time the submission is made and when Forms saves it to the repository.

1 0
replied on October 7, 2020 Show version history

Hi Miruna,

How would I go about determining if the creation date/submission date is within my time window? That's my main problem - coming up with a way for my workflow to determine if my date token (whichever one I use) falls within the Friday 5 PM to Monday 7:30 AM.

8.5.1
0 0
SELECTED ANSWER
replied on October 7, 2020

I think something like extracting the time and day of the week from the date, then the range when emails shouldn't be sent, breaks down as :

  • It's either Tuesday, Wednesday or Thursday
  • OR (it's Friday AND it's before 5:30PM)
  • OR (it's Monday AND it's after 7:30AM)

(WARNING: very lightly tested!)

 

1 0
replied on October 7, 2020

Makes sense. I ended up creating this prior to seeing your reply.

After talking with the customer, anything created on Monday before 7:30 AM isn't anything special and the one email to dispatch should suffice. How does workflow evaluate a time token? Is "%(Time) > 5:00:00 PM" something that even makes sense to workflow?

Thanks for the help!

0 0
replied on October 8, 2020

If you make sure your tokens are tagged as time, not string, they will evaluate as time.

1 0
replied on October 8, 2020

Perfect. That'll be what makes this work. Thanks for the help!

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

Sign in to reply to this post.