Todoist Task That Cannot Be Completed



Subject

Todoist is a great app. If you're not sure where to find your completed tasks watch this short video.Some things in Todoist can be a little hard to find,. If you are looking for a task management app for individual use while requiring other people to stick their nose in your tasks and help from time to time, then probably Wunderlist is the best fit for you. On the other hand, if all you need is a dedicated app for managing your individual tasks and time, then Todoist might be the right choice. Completed tasks were visible until you told them not to be, in the old Todoist. They even stayed in the place they were custom ordered. Worked perfectly. You could look at a task list and see what you had done last on a project. I know people who were using it to keep track of taking pills, that all stopped. Then they took it away.

In this article, I describe how to install and run Camunda BPM engine on Oracle Cloud. I created this post as I had some spare hours between two jobs in winter 2020, then sort of forgot about it and publish it now with a delay of a few months.

Todoist task duration

The goal was just to see if this works and not intended to be used for any Production use. And the answer is – yes, it works!

Background

Oracle started to offer their Oracle Cloud free Tier in Autumn 2019 and I decided to try it out. I configured two Compute instances, Autonomous Transaction Processing (ATP) database, but then I didn’t know what to do next. So, it was just sitting there and doing nothing.

Then one happy day I learned about Camunda BPM engine. It can be used as an Open Source product and thus free as well. All in all, a good opportunity to use one’s spare time.

The easiest way to get started with Camunda BPM is to use the Spring-Boot package, which can be run just on a laptop. But I’m not looking for easy ways and so I decided to deploy it on a Tomcat application server using Oracle ATP database as it’s backend.

Process Model

I took the simplest model from the Camunda Quick Start application. Here is the diagram:

Plattform/Tools

  • Oracle Cloud free Tier provisioned in September 2019
  • Oracle Autonomous Transaction Processing database included in Oracle Free Tier, version 18c
  • Camunda BPM v 7.12
  • node.js v10.19.0 on Oracle Linux
  • Perl v5.30.1 (strawberry) on Windows 10

Solution

Big picture

Here is a short description of what we are doing.

First of all, an external Task executor has to be started. It will register with the Camunda BPM engine for a particular topic. This is step 0 in the above diagram.

We start the process with an application, running on a local PC. This is step 1. This application starts the process via REST API exposed by Camunda engine. The engine starts a process instance, which in turn executes Create Invoice task and an external service starts execution, this happens in step 2.

This external service stores new invoice information in its own mysql database. Then the Store invoice task does effectively nothing and the process ends.

In the following paragraphs, individual building blocks are described in more detail.

Oracle Cloud and the components we need

The setup of basic components on Oracle Public Cloud is very straightforward and Oracle provides good documentation, which will walk you through the setup. So I’ll describe only the things, that took me more than a minute to figure out.

Compute Instances

I decided to set up a cluster and ended up with two ubuntu 18.04 instances. I also configure access via SSH using public IPs. Although it was possible to use only private IPs, having public ones make things easier to understand and debug.

Still there are few things to be aware of.

Console user on ubuntu hosts in Oracle Public Cloud is “ubuntu”. Password is not needed, private/public key authentication is used.

Access to ssh, http and https ports have to be enabled on both hosts via iptables as well as in the Default Security list for the respective VCN (Virtual Cloud Network).

Tomcat

Nothing special here, just tomcat 9.0 installation on both hosts. Just don’t forget to open port 8080 in the Default Security list and in both host’s iptables.

Load balancer

This is the least obvious part of the setup. There are two parts to it, Backend Set, which specifies the back-end servers. And the Listener, which specifies what happens at the front-end.

My two tomcat servers are configured in the Backend Set like this:

Port number and IP Address actually tell how load balancer will check if the backend servers are alive. Another part of it is Session Persistance configuration. Below is the picture. I believe this is only important if I connect via browser to the Cockpit application, my REST client and worker applications will disregard session persistence cookies anyway.

Another piece is the Listener. It will listen to the external connections on port 8080. Note that it has its own public IP address. Here is the picture:

ATP database and jdbc

This is real fun. Oracle ATP (Autonomous Transaction Processing) database is the most special part of this whole setup. There are examples and also some documentation as to how to configure Camunda BPM with Oracle database, still, these examples use Oracle database on-premise. Also, the configuration steps so far are not much different from the same on any other tomcat server(s).

The culprit is that to connect to Oracle ATP one has to use a so-called Wallet. It can be downloaded from the ATP configuration page and is in fact a zip file, which contains some artifacts needed to establish a connection and to authenticate. This file can also be used to connect to Oracle ATP with sqldeveloper. This file has to be then uploaded to both Compute instances and extracted to some directory. I put it under /home/ubuntu

Next important step is to download Oracle 19.3 JDBC driver and put the below files into tomcat lib directory, like this:

The last step is to configure JNDI resource reference in the tomcat server.xml file:

The trieckest part is of course in the line #21. It points to the Wallet files location. It’s imprtant to make sure that this location is accessible to the tomcat/java process.

Obviously tomcat has to be restarted after making the changes. Note though, that further changes will be needed in server.xml for Camunda, they will be discussed later.

This is a good resource to read more: https://www.oracle.com/database/technologies/java-connectivity-to-atp.html

Camunda BPM

There is nothing special about this, Camunda BPM will be installed on to both tomcat servers running on our two compute instances. I followed this documentation: https://docs.camunda.org/manual/7.12/installation/full/tomcat/manual/. This link points to the Release 7.12 documentation, this was the latest release available at the time of writing. And I used the Community Edition of Camunda BPM.

The database creation script is delivered as a part of the distribution, to apply it to the Oracle ATP database I used Oracle sqldeveloper-19.2.1.247.2212. Database Wallet zip file has to be downloaded to the local PC, where sqldeveloper is installed. “Cloud Wallet” has to be selected as a connection type when connecting to the ATP database.

Following the documentation, some jar file coming with the Camunda distribution have to be added to the tomcat lib directory and changes made in the server.xml file to configure necessary listeners. And of course, the data source, as described in the previous section.

In fact, Camunda BPM installation on Oracle Public Cloud differs from any other environment only with data source configuration to connect to the ATP database.

Two more applications have to be installed, Cockpit, Tasklist and Admin as one and REST-API as another one. I missed this in the beginning and it took me some time additional time to make things work.

Finally we will have two Camunda BPM instances on tomcat cluster with two nodes, using a shared ATP database.

External Task service

Back to the process diagram, our “Create Invoice” tasks is an External Task. It needs an external service, which does the actual job. I implemented this as an external node.js worker, running on a separate ubuntu host. I used the example in Camunda Quick Start documentation: https://docs.camunda.org/get-started/quick-start/service-task/#b-using-javascript-nodejs.

Camunda provides an external task client implementation as a library, available via npm:

My implementation is in a single JS file and it does the following. It creates two workers, each of them connected to the respective Camunda BPM instance in our tomcat cluster on Oracle Public Cloud. Note different IP addresses and also different workerId‘s:

Then these clients subscribe to the invoiceCreator topic on Camunda BPM engine. This topic is defined in the “Create Invoice” task in our BPM process model we created in the beginning and deployed to the Camunda BPM engine:

The actual work is performed by the handler function, which is specified as a call-back when subscribing to the topic. It can be anything, but for testing purposes, I implemented the following very simple functionality. It will just take the task id and write it to the mysql database with the workerId, timestamp, and an error message in case of any errors. Like this:

This can be a simulation of some simple external business application. Note that both workers will use the same mysql database to store the data.

Todoist Task That Cannot Be Completed For A

Client application

This is the last piece of the whole setup. We need a client application, which will trigger the execution of the business process. My first attempt was a perl script, which used a REST call to Camunda BPM engine to start the execution. This was too simple and later I created an apache JMeter test plan to do the same, but using JMeter I can start several execution threads at the same time.

Here is my Test Plan:

The most important part of it is obviously the HTTP Request. Here we specify the target IP and Port Number and also the HTTP Request properties. We will use POST method and in the path we have the ID of the process definition Order_Process:1:5b28a61c-afea-11ea-a71f-0200170287af. This is taken from the Cockpit application:

By the way, the target IP is the external IP of the Load Balancer.

Two more important components, HTTP Header Manager, which specifies Content-Type: application/json:

And the HTTP Authorization Manager, which is needed to specify user name and password to connect to Camunda BPM:

With all components of our Test Plan in place, we can go to the Thread Group and configure the number of Threads and the Loop Count:

After that we can run our Test Plan and observe the results in the View Results Tree:

So we started two requests, both successful with the HTTP Response code 200.

voilà!

Discussion

What we achieved so far? Actually we successfully started two processes on Camunda BPM engine. Let’s take a look at the Cockpit application:

Nice picture, but it seems like there are 3 instances of the Create Invoice task, that are waiting for something. We started 2 just now and another one I created earlier with my first test. They are sitting and waiting because I haven’t started my external task workers on my external host yet. Let’s do it:

What does the above listing show? We started very well, our two workers subscribed to the topic, but then things started to fail. However, a careful reading of the above output shows that all tasks have been actually processed. The errors reported by the second worker (Client_2) only show that it didn’t get any work to do because the first worker (Client_1) was already working on the respective task. We can expect that if we start more threads with a higher loop count, the second worker will process some tasks as well. There is a very good explanation here: https://blog.camunda.com/post/2015/09/scaling-camunda-bpm-in-cluster-job/. It compares the situation with a jar of candies, where jobs are trying to acquire as many sweeties as possible, but some of them, like Clinet_2 in our case, is always trying to pick the piece, already taken by the other(s).

Parallel job execution in a cluster environment is an interesting topic on itself, but it won’t be covered here. If we take a look at the Cockpit, we will see that all tasks are processed and this is the result we need:

Caveats

In the test described above, I used just one single thread to trigger task execution. Apache JMeter gives a natural opportunity to increase the number of threads and thus to see how the system behaves under load.

It turned out that increasing the load leads to random errors with the message “Process engine persistence exception”. These errors appear on the client side (JMeter), but also in the external client/worker application. My impression is that after Oracle upgraded their Cloud ATP database to 19c, there are more of theses errors.

I currently don’t have time to investigate the reason for these errors. Probably I’ll do it in my next article.

References

Comments

comments

Recently, I’ve noticed a lot of people, in the forums I follow, commenting on how overwhelmed they feel and how many tasks they have on their to-do list every day. I’ve seen numbers ranging from twenty to sixty tasks per day and I know, from my own experience, that these numbers are not sustainable and what will happen is people will end up rescheduling many of these tasks because they won’t get done.

The problem with a long list of to-dos is the very sight of such a list leads to that feeling of overwhelm. Looking at a list of thirty to-dos first thing in the morning is just going to put you off wanting to even start attacking such a list. Instead what you need is a list of around ten items that will leave you feeling inspired to get started.

Why ten?

We live in a world of distraction. No matter who you are or what you do, you are going to get distracted. Email brings new tasks, bosses and colleagues ask us to do little pieces of work for them and clients and customers demand attention. These are unavoidable. When you start the day with a list of thirty tasks something is going to break, and usually that something is your task management. When you assign yourself a maximum of ten tasks a day on your to-do list two things happen. The first is you have time to deal with the distractions that will come in and second you will be forced to prioritise what you want to get done that day which helps you to focus on the things that are meaningful to you.

The Ten Task Maximum

The ten task maximum does not include your regular daily routines. If you have a morning routine of exercise, planning and learning for example, then the morning routine would not be included in your ten tasks. A morning routine is just something you do every morning and if you do it regularly — ie every morning — you should not need any reminder on your to-do list to do it.

I have a morning routine that involves 45 minutes of studying and 15 minutes of meditation. These two tasks are not on my to-do list, but the one hour is scheduled on my calendar as my self-development hour. It is a non-negotiable part of my day. I have been following this routine for nearly a year now and I really do not need to be reminded to do it in my to-do list. All I need to see is at 5 AM tomorrow morning I will do my studying followed by fifteen minutes of meditation.

I also have around eight routines admin tasks that need doing at the end of every day. Little things like writing up student feedback, updating attendance records and tracking new students in my learning centre. These routine tasks are on my to-do list, but I filter them out and they only show up at the end of the day when I need to see them. For the majority of the day, I do not need to see these tasks because they cannot be done until the end of the day and they act as little reminders to make sure I have done them. I do not include them on my list of ten tasks.

Todoist Filter Completed Tasks

What I want to do is see ten tasks (or less if possible) when I begin the day and those ten tasks are meaningful and advance my work or projects in a positive way. I have a daily calendar event on my calendar for doing admin tasks (8:00 pm to 8:50 pm) and so I know they will get done.

Time Blocking

Because it is inevitable we will be distracted by something each day, be that a request from a customer or a demand from a boss, blocking an hour or two off each workday to get on with the ten tasks you have assigned yourself is crucial. All of us should be able to find an hour in the morning and an hour in the afternoon for undisturbed focus work. There really isn’t anything so urgent it cannot wait an hour or so. Of course, if you work in the emergency room of a hospital or are a firefighter, then you are not going to be able to do this, but any information worker who cannot block off an hour or so each day has bigger problems than just a long list of to-dos.

In twenty-five years of working in the legal and education professions, I have never once come across a situation where I was not able to block one hour off to get some focused work done. I have some language students who sometimes tell me they are too busy to do their English class, yet they are always able to find ninety minutes for their lunch (officially they have one hour, but they go for lunch at 11:30 am and they don’t return to their desks until close to 1 pm.) When we need to, we can find the time. It’s just a question of priorities.

Priorities

Delete

And that nicely leads me to the biggest benefit of only allowing ten tasks on your to-do list each day. It forces you to prioritise. We all have a lot of things we would like to do each day, but we only have twenty-four hours to do them. We cannot do everything at once. When you are limited to just ten meaningful tasks each day you are forced to think about which of the tasks you have to do will have the biggest positive impact on your day and your active projects. When you choose tasks that will move your projects forward each day you are making a bigger impact on your projects than if you were randomly picking away at a long list of tasks. You become more focused on the outcomes and less focused on the trivialities. Ultimately, projects need to be completed and focusing on the tasks that will get you to completion rather than the little insignificant tasks will get you to the outcome you want faster.

Completed

Having a long list of daily to-dos does not make you a hero. All it does is cause you to feel overwhelmed and that leads to procrastination. Reducing your to-do list to the ten most important tasks each day allows you to begin the day focused and energised and ready to move your projects towards the outcomes you desire faster. You will procrastinate less and you will still have time each day to deal with the unforeseen interruptions and distractions that are an inevitable part of living in the twenty-first century.

Todoist See Completed Tasks

Thank you for reading my stories! 😊 If you enjoyed this article, hit that like button below 👍 It would mean a lot to me and it helps other people see the story.

My purpose is to help 1 million people by 2020 to live the lives they desire. To help people find happiness and become better organised and more productive so they can do more of the important things in life.

Todoist View Completed Tasks

If you would like to learn more about the work I do, and how I can help you to become better organised and more productive, you can visit my website or you can say hello on Twitter, YouTube or Facebook and subscribe to my weekly newsletter right here.