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

Question

Question

Is it possible to limit a business process to be ran only once a day

asked on February 6, 2023

Hi all,

I would like to know if it is possible to allow a business process to run only once per day. I'm in the process of creating a monthly form that contains daily quality checks. The daily submissions would be saved into a SQL database and then I will use lookup rules to pull back the previous day's data.

If the form has been completed for the day, the business process should not proceed and terminate. 

Has anyone done something similar that could provide insight?

Thanks!

0 0

Answer

SELECTED ANSWER
replied on February 7, 2023

You're right, they do call forms "Business Process" and also certain type of workflows "Business Process" and that throws me every single time.  You used the right terminology, I just didn't pay enough attention to which type of "Business Process" you were referring to, so that was totally my bad.

 

Based on the way you have described it, if I were making this process, I wouldn't do it as a process that the staff start themselves.  I would make it a scheduled process that assigns the task to the full team of users.  If you are on version 11 Update 2 or Update 3, you can also assign it by group instead of user or team.  Then any one of the users included in the assignment can claim the task and complete it.  Include the Timer Catch Event to interrupt the task and finish it if it isn't completed by a staff member before end of day.  This way, it's only starting once, because you have the schedule starting it, not the staff.  It's only being completed once, because someone has to claim it and complete it, and it can't be claimed and completed more than once.  And if no one completes it, the system still finalizes it, so that you have the record that it wasn't done that day. 

If you really do want users to start it, then you'll need to have a lookup to identify if it has already been processed for the day, and use that in conjunction with Field Rules or similar limitation to ensure it cannot be started again (hide the submit button for example).  You could make a simple View on your LFForm database to report the max start timestamp of this particular process - then the lookup returns that value and you have some formulas or Javascript to indicate that the the form cannot be processed if that date is too recent.  But this has a flaw if done as a Message Start Event that if two people are in the submission form at once, the lookup won't catch each other, and then they can both submit.  So instead, you'd need to do a Start Event instead of a Message Start Event, then run a workflow to check the history, and report back to forms on a user task.  This should work, but it does feel more complicated than the schedule option in my opinion.

0 0

Replies

replied on February 6, 2023

There's a couple ways I can think of that you could do this.

  1. With a database update.  When your workflow runs, populate a field in your database with a timestamp (the last time the report was run).  At the start of your workflow, this timestamp value is checked on the database, and if it is the same day, then the rest of your workflow doesn't run (probably by wrapping everything in a Conditional Sequence activity).  If you specifically need it to show as terminated (based on how you worded your question), you can do that too.  Instead of a Conditional Sequence, use a Conditional Decision, and on the path that is decided by the fact that the workflow already ran today, you can include an End Workflow activity and set it to show as Terminated.
  2. As part of your workflow (probably the end of it), include a Delay activity that waits until the end of the day (might need a Date Token Calculator activity or something else to determine the specifics of how long to delay).  With this delay in place, your workflow is technically still running all day.  Then on the Workflow admin console, set this workflow to single instance mode.  That way, it will not let it run more than one instance of the workflow, and since the delay is causing it to continue running until EOD, it can't be started again during the day.
1 0
replied on February 7, 2023

Hi Matthew,

Thank you for the response! These sound like great workarounds but I was looking to see if it was something Laserfiche would provide as an option from the start as there could be duplicate forms and submissions all the time. I guess something similar to how we can set workflow to single instance mode. 

2. This sounds good but this form also has to be reviewed by a member for it to be considered complete and saved to the repository(and temp database). Inside Forms, the service task would have to be set wait for the workflow to finish before proceeding to have the workflow running in single mode. I can see this becoming an issue for the daily review. I guess I would have to create another workflow just for the single instance mode towards the end of the business process's Form's workflow. Right?

 

0 0
replied on February 7, 2023 Show version history

Unfortunately, I do not believe Laserfiche has any built in way to limit a process to a single run.

I guess I didn’t realize you were talking about a Forms process.  When you said “Business Process” I assumed you meant the “Business Process” functionality of Workflow (workflows that can be started manually from the repository).  But I guess you are actually talking about a Forms process.  Total misunderstanding on my part - didn’t quite read everything fully I guess.

If it a Forms process that needs to run just once a day, can you start it on a schedule and have it assign a user task out.  Doing that, and not granting access to users to start the process, should ensure it is only running in the schedule needed and not started manually.  I have several processes that work this way - the users don’t even see it under Start Process, they just receive the task when it is time to complete it.

If that doesn’t meet your needs, can you provide a little more information about how the process is intended to work and how you would like it to work if a user attempts to restart the process the second time during the day?  With a better understanding, I might be able to provide better suggestions.

0 0
replied on February 7, 2023

I see, so it's not possible.

I was looking at process designer docs and they referred to it as a business process, my apologizes on that too. 

I did think about that after posting the question but I don't think it would work if I assigned it to one user. I guess I could do Assign to Team(department) instead?

For example, one of our processes is to print out a cleaning sheet each month for 5 areas that need to be cleaned. Anyone in the department can fill out the day's daily check, but only certain members of the department can sign off on it. If the daily check was not completed an occurrence is written, mostly the next day when it is caught. After the whole month is complete, it's reviewed by the manager of the department and filed accordingly. 

Initially I was thinking of allowing the process to be started manually by staff and I would use a Timer Catch Event to end as well as save to the repository if it was not complete/reviewed before midnight. I didn't take into consideration we'd have too many duplicate instances if staff kept starting the same process again and again(it would definitely happen). That's when I decided to ask if it was possible to limit it.


I hope I've explained myself a bit better and I appreciate your help!!

0 0
SELECTED ANSWER
replied on February 7, 2023

You're right, they do call forms "Business Process" and also certain type of workflows "Business Process" and that throws me every single time.  You used the right terminology, I just didn't pay enough attention to which type of "Business Process" you were referring to, so that was totally my bad.

 

Based on the way you have described it, if I were making this process, I wouldn't do it as a process that the staff start themselves.  I would make it a scheduled process that assigns the task to the full team of users.  If you are on version 11 Update 2 or Update 3, you can also assign it by group instead of user or team.  Then any one of the users included in the assignment can claim the task and complete it.  Include the Timer Catch Event to interrupt the task and finish it if it isn't completed by a staff member before end of day.  This way, it's only starting once, because you have the schedule starting it, not the staff.  It's only being completed once, because someone has to claim it and complete it, and it can't be claimed and completed more than once.  And if no one completes it, the system still finalizes it, so that you have the record that it wasn't done that day. 

If you really do want users to start it, then you'll need to have a lookup to identify if it has already been processed for the day, and use that in conjunction with Field Rules or similar limitation to ensure it cannot be started again (hide the submit button for example).  You could make a simple View on your LFForm database to report the max start timestamp of this particular process - then the lookup returns that value and you have some formulas or Javascript to indicate that the the form cannot be processed if that date is too recent.  But this has a flaw if done as a Message Start Event that if two people are in the submission form at once, the lookup won't catch each other, and then they can both submit.  So instead, you'd need to do a Start Event instead of a Message Start Event, then run a workflow to check the history, and report back to forms on a user task.  This should work, but it does feel more complicated than the schedule option in my opinion.

0 0
replied on February 8, 2023

Hi,

Thank you! I will try your solution! Thank you for walking through this with me!

1 0
replied on February 7, 2023

Expanding on Matthew's idea, in the forms process an initial form could run a workflow to check to see if there had already been a submission for that day before presenting the user the main form and the process terminated if one had already been submitted..

0 0
replied on February 7, 2023 Show version history

I assume I would set the form to start by the Start Event and then use a Workflow Service Task to do this?

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

Sign in to reply to this post.