I have done this before by using a scripting operation, but I think I remember someone creating a Custom component to accomplish this. Here is a link to his blog:
By the way there is lots of good info on that blog.
works out, but I've now trouble to get the TaskID.
how can I get the TaskID without using the FormFields?
The TaskID is exposed as a system variable in the XPath editor (I think it is id).
Actually, it's the process instance id that gets exposed via xPath and not the task id. The task id is a bit tricky to get since you're already compelted with that task.
I've built the sililar fucntionality where it gets the process instance id instead of the task id as an input parameter.
I'll find the code back and post it here.
unfortunately the id is the process(instanceID).
I used the TaskCompletedEvent to get the TaskID.