How to handle task that is repeated through a month with camunda - bpmn

I'm new to Camunda and didn't find any tutorial or reference explaining how to achieve the following:
This is a workflow to monthly hour registry. So an employee should compile a "form" task to insert how many hours he has worked every day in the month and save it on a sheet for example. At the end of the month the account take the sheet with the hours and make a kind of report for each employee.
Is it possible to handle this kind of recursion (do a task once a day into the month) with camunda and any idea how to make it with a bpmn graph?

Related

Group data by weeks since the start of event in sql

I’m a data analyst in the insurance industry and we currently have a program in SAS EG that tracks catastrophe development week by week since the start of the event for all of the catastrophic events that are reported.
(I.E week 1 is catastrophe start date + 7 days, week 2 would be end of week 1 + 7 days and so on) then all transaction amounts (dollars) for the specific catastrophes would be grouped into the respective weeks based on the date each transaction was made.
Problem that we’re faced with is we are moving away from SAS EG to GCP big query and the current process of calculating those weeks is a manually read in list which isn’t very efficient and not easily translated to BigQuery.
Curious if anybody has an idea that would allow me to calculate each week number in periods of 7 days since the start of an event in SQL or has an idea specific for BigQuery? There would be different start dates for each event.
It is complex, I know and I’m willing to give more explanation as needed. Open to any ideas for this as I haven’t been able to find anything.

Second to last Week of a Month

I have jobs that need to be scheduled on the second to last Monday of a month. Is this possible with current functionality?
From what I've seen, it doesn't seem to be possible with standard cron expressions.
Currently I have the job running every week and a check inside the job to see if it is the correct week, but I'd rather not use this set up as it still registers the job as running and being successful.
Thanks!
I was able to answer my question. I made a small addition to the cron expressions file in the apscheduler module and added a class that allowed for [-1, -2, etc]. Then was able to use that as an index for a calendar from the calendar module to grab the week I wanted. So now it allows for expressions like '-2 thu'.
If someone wants more help with how I implemented this, let me know.

I want to schedule data feed on every 24th of month weekday and if 24th comes on weekend then it reschedule to Monday. How i do that?

I want to schedule data feed on every 24th of month weekday and if 24th comes on weekend then it reschedule to Monday. How do I do this?
This question should not me downgraded. This is a legitimate question.
Option 1: you can trigger data feeds via Archer API. I think that this functionality has been added in Archer v6. Not sure about v5.
In this case you will need to run the code on 24th day of each month that will either trigger the datafeed execution, or will reschedule the execution in case of the weekend.This is a relatively simple solution that require some coding.
Option 2: you can create another data feed that will execute daily and it will update schedule for the targeted data feed. In this case you will read the date and schedule of the data feed to execute from the Archer Instance database directly and will be making changes to the data feed configuration in Archer Instance database as required via SQL statement embedded into the 2nd datafeed.
This is not simple, but doable if you know SQL and understand Archer table structure.
I have managed to trigger LDAP synch multiple times a day this way.
Good luck!

Hangfire - How does it handle last couple of days of the month?

I have a UI where users select on which day of each month they want to receive an email. What happens if they select the 31st? How does Hangfire handle the days which have only 30 day or february?
Thank you!
In case anyone comes back to this - this limitation was lifted in Hangfire 1.7 when they migrated to Chronos for recurring CRON expression support.
According to this issue, Hangfire lacks the capability to schedule any job for the last day of the month.
Hangfire use NCrontab, that's not support for # or L
Your best bet (at the moment) is to:
Schedule multiple jobs manually (using calendar to figure out last day of the month or other methods to figure out days in a month)
Not use Hangfire (use something that is more capable in terms of cron type scheduling)
FluentScheduler does have support for LastDayOfTheMonth
Schedule(() => Console.WriteLine("This task will run at last day of every month."))
.ToRunEvery(1)
.Months()
.OnTheLastDay();

Design of Databases for storing the details of the recurrent occurrence of an event

I need to implement a feature similar to the one provided by Microsoft Outlook to make your meeting appointment recurrent. I am trying to figure out the optimized Database design that I will be requiring for implementing this feature.
The requirement is something like that each run or task entered by the user will also be applicable for scheduling like a recurrent event - weekly, monthly or yearly. Could you please suggest me the Database model - table structure (with constraints) for storing these details in the DB which can be afterwards accessed by the program to do the appropriate task. Screenshots for some of the possible scheduler details can be found at the following link.
We have a mysql DB running at the backend for storing these details. As soon as the user submits a request, a request id with the details of the request is stored in the table and then a action corresponding to it is taken by the program. More clarification would be like that the users intent is to run a sql script,getting the values and then performing statistical analysis to it. But as the oracle reference DB is dynamically updated by many users, he wants to run it in a recurrent manner and get the analysis done. Note that the mysql db and the ref DB are different.
Please let me know if you require any other details.!
I would suggest storing the details of the first occurence in one table (scheduled tasks) and then the recurance (recurring tasks) details in another.
I might also then be tempted to update the scheduled task table with the next occurance as each task is completed.
As for the Table layout, a rough sketch would be as follows:
[ScehduledTasks]
TaskId (Primary Key)
Description and Details etc...
Start Datetime
End Datetime
[RecurringTasks]
TaskId (Foreign Key)
Frequency : Daily, Weekly, Monthly or Yearly.
DayNo : What Day to run on (1-7 for weekly, 1-31 for monthly, 1-365 for yearly)
Interval : Every x weeks, months etc.
WeekOfMonth : first, second, third... etc If populated then DayNo specifies the day of the week.
MonthOfYear : 1-12.
EndDatetime : The last date to perform
Occurences : The number of times to perform. If this and the previous value are null then perform for ever.
Obvious certain fields would be blank depending on how the task was set up, but I think the above covers all you would need to emulate the tasks in Outlook.