protected String assignWorkItem(WorkItem workItem) {
String actorId = null;
// if this human task node is part of a swimlane, check whether an actor
// has already been assigned to this swimlane
String swimlaneName = getHumanTaskNode().getSwimlane();
SwimlaneContextInstance swimlaneContextInstance = getSwimlaneContextInstance(swimlaneName);
if (swimlaneContextInstance != null) {
actorId = swimlaneContextInstance.getActorId(swimlaneName);
}
// if no actor can be assigned based on the swimlane, check whether an
// actor is specified for this human task
if (actorId == null) {
actorId = (String) workItem.getParameter("ActorId");
if (actorId != null && swimlaneContextInstance != null) {
swimlaneContextInstance.setActorId(swimlaneName, actorId);
}
}
return actorId;
}