}
if (!(taskInstanceValue instanceof TaskInstance)) {
context.setError("Error starting task", "Attempted to start something other than a task instance");
return;
}
final TaskInstance taskInstance = (TaskInstance) taskInstanceValue;
if (actorIdExpression != null) {
final Object actorIdValue = actorIdExpression.getValue(elContext);
if (actorIdValue == null) {
context.setError("Error starting task", "Actor ID expression resolved to null");
return;
}
final String actorId = actorIdValue.toString();
if (overwriteSwimlaneExpression != null) {
final Object overwriteSwimlaneValue = overwriteSwimlaneExpression.getValue(elContext);
if (overwriteSwimlaneValue == null) {
context.setError("Error starting task", "Overwrite swimlane expression resolved to null");
return;
}
final Boolean overwriteSwimlane;
if (overwriteSwimlaneValue instanceof Boolean) {
overwriteSwimlane = (Boolean) overwriteSwimlaneValue;
} else {
overwriteSwimlane = Boolean.valueOf(overwriteSwimlaneValue.toString());
}
taskInstance.start(actorId, overwriteSwimlane.booleanValue());
} else {
taskInstance.start(actorId);
}
} else {
taskInstance.start();
}
context.addSuccessMessage("Task started");
context.getJbpmContext().getSession().flush();
context.selectOutcome("success");
} catch (Exception ex) {