Thanks for the answers.
I think TaskLifeCycleEventListener interface is exactly what i need.
I've succesfully managed to set deadlines on tasks via implementation of TaskLifeCycleEventListener.
Now i have another question - I noticed that, task deadlines are removed after particular operations - eg. end deadlines are being removed after task is complete.
This is done via CancelDeadlineCommand with parameters (taskId (taskId), true (removeStart) , true (removeEnd)))
I need to always have this deadline, for future reports.
Is there a way to make these deadlines always stored in database?