How I took a meme way too seriously and accidentally created Handwashing Zombies with Low-Code…

Sezen de Bruijn
5 min readOct 12, 2020

I have very little to say for myself, other than it was Friday and I was kinda done for the week, and sometimes the mind just needs to follow that little bit of whimsy down the rabbit hole.

The little bit of whimsy was in this case a small conversation in the WhatsApp group of the EMEA SA’s:

I wondered that too…. So here was my first attempt:

I shared it with my colleagues and they had some concerns… Mainly the fact that in my model hands only got washed when you got tested. Besides, I had realized myself that running a server action would mean a time-out after 10 minutes, which hopefully is way too short a period for a process that should go on as long as someone is alive.

So, given the concerns with hand-washing, my personal concern about timeouts and the fact it still was Friday I moved it to Business Process Technology. Handwashing was now on its own time-based scheduling and the process could run indefinitely until Alive state was not true anymore.

And as soon as I shared that I spotted the problem… Do you see it as well? No? Well let’s zoom in a little bit…

This is an infinite loop. Once someone starts washing their hands, they keep on washing them. Forever. Regardless of a change in the isAlive property…

So…

Of course, behind every bug hides another. Helpfully my colleagues managed to identify a few more:

  • Face masks should only be worn when Social Distance is impossible
  • Hand-Washing still was a problem, because that also needs to happen whenever you’ve been outside
  • The monitoring for symptoms should be an ongoing activity
  • The isAlive property never gets set

So, I did some refactoring.

Like a lot. Now three parallel processes get kicked off. One checks if there are symptoms that require testing. The second check whether a person is going outside and runs social distancing, mask wearing and handwashing protocols when they do. The third makes you wash your hands on regular intervals, we could call this one the personal hygiene protocol. And finally we now have a bit of logic that actually sets the isAlive property. This logic gets triggered whenever the Health of the person is updated, checks whether the person is Alive and sets the property.

There… all is well..

Or is it??

We still have a zombie problem here… To be specific, we have two… The person gets continuously checked for symptoms, regardless of whether they are still alive. This is unfortunate as it means the process will keep on running forever, but does not lead to any unwanted behavior, as someone is unlikely to have any symptoms when they are not alive. So nothing actually happens…
The other one is more tricky. Remember when we solved the Zombie hand washing problem?

Yeah, we did not.

We check if someone is alive before we start the timer, but someone’s isAlive property can be — is in fact most likely to be- changed while the timer is running. Which means that I still have zombies washing their hands, but now it will only happen once. That is a slight improvement, I guess, but undesirable nonetheless.

Both of these problems could of course be fixed by moving some code around, but by now I was fed up with the if-statement method and started thinking that there should be a smarter way to do this.

There is. You can simply change any end-state to ‘terminate’ which will kill the entire process. So I did one more refactoring. The action that updates the Alive property is now an action that evaluates whether someone is alive, and when that turns out to be untrue, terminates the entire process. No matter what was going on before the Health update, it will now immediately be stopped.

I also removed all those if-statements, which made the code much simpler.

See? That is better! Much cleaner, and much less likely to create Zombies. Which is, as Arjan said in the WhatsApp group, always an important consideration.

In total, I spent a few hours having a blast, trying to model out the correct Covid protocol in Low-Code. (The only time that the pandemic has given me any joy so far.) It helped that with the visual modelling approach I could quickly get feedback from the EMEA SA team, where there turned out to be some people just as crazy as me. This meant that I got instant feedback and because it is Low-Code I could adapt the versions just as quickly.

After this amazing achievement I’m sure you are wondering what is next for me on this journey… Well… It was suggested that a State Machine might have been a more effective way to deal with all that hand-washing…

So perhaps just…. One more take?

--

--

Sezen de Bruijn

Low-Code Solution Architect ★ helping you build IT Fast, Right and for the Future ★ Let’s just have some fun :-)