FIFO and LIFO in task priority


Is there an easy way to prioritize the tasks using FIFO or LIFO?

I know I can sort the tasks by “created” field, but I don’t want to use it because my client needs to know my sort criteria. So, I want to hide this information in a way that all queries should sort by and only by the “priority” field, that is what seems to make sense semantically speaking.

The problem is: how?

I have already though about some ideas but none of them works or seems to be much more complicated them what I would like.

  • I tried to use “timestamp” (a.k.a dateTime().now()) as priority but it returns a long and “priority” is an integer. I could divide it by some arbitrary number “to fit” but it seems so obscure to me.
  • I tried to use a shorter version of timestamp like “yyyyMMddHHmmss” but even that does not fit in an integer. To fit in an integer I could use “yyMMddHHmm”. It is not ideal but it seems to be the best option for a while that would work until 2099 =) even though I do not like it either.

When things are getting complicated I think that it is time to pause and see what is wrong. Because of that I decided to looking for your help. I have alredy tried to search about “priority”, “FIFO” and “LIFO” in this forum and in Camunda documentation, but I could not find any information about that.

Can you help me?