In<code> UserTaskActivityBehavior.java</code> assigneeValue is initialized to null because of which it works fine. Similarly why is null value not allowed for groupId ? why is exception thrown if value is null?
<blockcode>
if (taskDefinition.getAssigneeExpression() != null) {
Object assigneeExpressionValue = taskDefinition.getAssigneeExpression().getValue(execution);
String assigneeValue = null;
if (assigneeExpressionValue != null) {
assigneeValue = assigneeExpressionValue.toString();
}
task.setAssignee(assigneeValue, true, false);
}
</blockcode>
<blockcode>
if (!taskDefinition.getCandidateGroupIdExpressions().isEmpty()) {
for (Expression groupIdExpr : taskDefinition.getCandidateGroupIdExpressions()) {
Object value = groupIdExpr.getValue(execution);
if (value instanceof String) {
List<String> candidates = extractCandidates((String) value);
task.addCandidateGroups(candidates);
} else if (value instanceof Collection) {
task.addCandidateGroups((Collection) value);
} else {
//why is exception thrown here? can't the "value" be null?
throw new ActivitiIllegalArgumentException("Expression did not resolve to a string or collection of strings"); // line num:179
}
}
} </blockcode>