strategies.add(subTaskStrategy);
}
task.setSubTaskStrategies(strategies);
}
PeopleAssignments assignments = new PeopleAssignments();
List<OrganizationalEntity> potentialOwners = new ArrayList<OrganizationalEntity>();
String actorId = (String) workItem.getParameter("ActorId");
if (actorId != null) {
String[] actorIds = actorId.split(",");
for (String id: actorIds) {
User user = new User();
user.setId(id.trim());
potentialOwners.add(user);
}
//Set the first user as creator ID??? hmmm might be wrong
if (potentialOwners.size() > 0){
taskData.setCreatedBy((User)potentialOwners.get(0));
}
}
String groupId = (String) workItem.getParameter("GroupId");
if (groupId != null) {
String[] groupIds = groupId.split(",");
for (String id: groupIds) {
potentialOwners.add(new Group(id));
}
}
assignments.setPotentialOwners(potentialOwners);
List<OrganizationalEntity> businessAdministrators = new ArrayList<OrganizationalEntity>();
businessAdministrators.add(new User("Administrator"));
assignments.setBusinessAdministrators(businessAdministrators);
task.setPeopleAssignments(assignments);
task.setTaskData(taskData);
ContentData content = null;