I have a special situation where in some cases, when a UserTask is created, I want to 'automatically' complete it – but I still need to do some work, such as log that it was automatically created and approved. When I call getTaskService().completeTask(id) from inside the TaskListener, I get an exception about the Task not being found – it appears the TaskListener on the 'create' event is called prior to the Task actually being saved?
Is there any way to do this? I'm working with a DelegateTask inside the TaskListener.notify() method.
Thanks,
Sheila.