with jbpm4, you can use custom-task or extend TaskActivity class
We don't want to create custom tasks, we want to extend the task object's data model.
So it is not the execution we want to change, but the actual task persisted data model.
Uhhhmmm... if you want to extend the datamodel you have to have a corresponding class. In jBPM4 that is the TaskActivity class, so by extending that and changing the corresponding config files you achieve what you want I think, so rams.rapo is right
But in jbpm3 we could register a custom task factory, so the tasks were created using the extended class with the extra properties initialized in the constructor (using the execution context).
I can't seem to find anything in the manuals (user en dev) for doing this?
that same can be done in jbpm4 with changing the file (jbpm.jpdl.activities.xml) that references the task activity (no factory needed). That is what rams.rapo meant. You might need to change ./pvm/src/main/resources/jbpm.task.hbm.xml as well but that might depend on what you want.
What is even greater, you can change more of the behaviour of the task in jbpm.jpdl.activities.xml
But keep in mind that this part is not fully stabilized yet
When I look closer into the source code I can see what you are trying to suggest (extend TaskActivity) and create my own kind of task and use this one in the execute method of TaskActivity (correct me if I'm wrong).
But the actual creation of the TaskImpl object is happening in the DBSessionImpl class. Isn't it dangerous not using this anymore (it is used in two other locations as well: NewTaskCmd and createSubTask() in TaskImpl )?
Also, this would mean that I have to duplicate all the code from TaskActivity - execute method (and hope it doesn't change too much).
Ah... ok I personally missed that. Will look into that in a few days since this would mean extensibility is less easy.