A solution to repeating events

It’s been a few years since I started using farmOS. I always wanted some task managment for my pig business : What needs to be done when.

I have this spreadsheet telling me everything. All important dates a couple of years ahead.
Great for planning, but for week to week overview, not so good. The solution for me has been a calendar app,

In my pig barn there are 3 group of sows. It takes 22 weeks form one sows farrowing until next farrowing. And there are 7 weeks between each groups farrowings.
(That’s actually 7+7+8 weeks, because of biology and the 22 weeks.)

And during each 22 weeks period there are tasks to be done, at correct time.

farmOS don’t support this very well.

I came up with a decent module for this, and I think I managed to generalize it enough so it can be used by any usecase (I can think of..)

I call it farm_rotation. It creates a menu item in the left farmos-menu, and has 2 views, and one settings page. It might seem complex to set up at first, but its actually very simple.

In the setings page I define what I call each batch, series, group or whatever. And how many of them.
Then the weeks between each series.
And eventually the tasks. We can se in the image that at day 116 after the series start, there is a farrowing. The 0 at the end tells the module that this is usually not needed as a log.
Vaccine on the other hand, would be a nice pending activity log, and is marked with a 1 at the end.

In the “Plan” page, we can see all the dates generated

And then there’s the Scedule view:

Here the events ending with 1 is already preselected, and you can create pending activity logs with the button.

2 Likes

Awesome! Thanks for sharing this @pat!

Repeating events has been on my mind again recently - every year around this time I wish there was a better way to do it than just cloning logs, which is my current workaround :sweat_smile:.

I like your strategy! It seems very useful for contexts where the set of events are always the same and count off in days from a start date. Reminds me a bit of the Template module @paul121 started working on.

Curious what others think of this approach.

Question: would this work for very simple repeating tasks, like something you need to do each month?

Also, I’ll cross-link a few older threads for context:

Yes. This is useful indeed to keep track of important dates way ahead of time.
Easy to setup.

Well, if it has to be done very 2. of each month, or always on a monday : no.
Every 30. day, no problem.

For the pig management scenario the days from first event is essential.
But for bulk-creating logs each month, it’s maybe not critical if due date misses by a day or two. Not ideal of course.

I’m sure it’s possible to enhance the logic

5|Do something useful|1
This will add the event “Do something useful” 5 days after the start date, and check the box for log creation

monthly:2:wed|Check tractor|1

This could possibly add the event “Check tractor” every 2nd wednesday each month. And check the box. No logic for this yet tho.. But should be possible.

1 Like

This is great. I’m still eager to explore something along the lines of a “recurring task plan type” like I described here - perhaps as a (the first) core plan type: Client Challenge

Seeing how you approach this is very helpful, and maybe we can come up with something that provides different types of logic depending on what’s needed, with the same end result (automatically creating logs ahead of time).

Combine that with email notifications to tell me what I need to do today, and it will save me a lot of thinking (and forgetting)! :rocket: :smile:

Cool.

Exactly

1 Like

Propably wise to have some kind of checking to avoid duplicate logs.

1 Like

Very valuable. Defining these related strategies effectively and when they should be used correctly is really important also.

  1. Copying a task - super useful sometimes
  2. A plan - defining a connected set of tasks, sometimes repeated (irrigation or weeding is an example), with defined times between them (this, then wait 20 days, then that, etc.)
  3. A repeated task - more of a traditional calendar-type style. Repeat this X times till Y date, etc. This is what you’re talking about here.

I’d love to see not only these design patterns clearly defined, but also the ‘when one versus the other’.

Not that helpful to your problem, but it’s also something I’ve dealt with so throwing in my two cents :slight_smile:

2 Likes

Yes, there are different strategies indeed.
I like the 2nd one. Didn’t think too much of plans in this case.. :thinking:

At least it’s easy to complicate it :grinning_face:

2 Likes