I think I've identified a broader issue than that listed above. I don't think the current code is built to support reassignment of SwimlaneInstance pooledActors (though reassigning the actor seems to work fine).
In support of that statement--if a TaskInstance does not have any pooledActors itself, it will try to return it's SwimlaneInstance's pooledActors; however, if assignments to the SwimlaneInstance's pooledActors are made after the TaskInstance has been created, the TaskInstance will (as mentioned) return the pooledActors assigned to the SwimlaneInstance while taskMgmtSession.findPooledTaskInstances(theSamePooledActor) returns nothing (from the jbpm_taskactorpool table).
Another related issue is that calling swimlaneInstance.setPooledActors(pooledActors) doesn't replace the pooledActors already in the database, it adds to them.
Unless someone steps up to make the argument that we shouldn't be reassigning a SwimlaneInstance's PooledActors anyway, I'll create a JIRA issue on this and label it as a bug (since the method calls are already there, and actor reassignment is functional).
Personally, this functionallity is fairly important to my own applications.
1) swimlaneInstance.setPooledActors should set the backpointer. in all of the jbpm code, 1-n bidirectional relations are maintained at the 'many' side.
2) for the assignment i will try to work out some test cases. it would be great if you could help in creating those test cases. if you sign the contributors agreement, you can get cvs access. send me an email if you want to know more: tom dot baeyens at jboss dot com.
this email adres is normally visible as your username..... :-))))