});
}
protected Work updateValue(Work value) {
Work work = new WorkImpl();
work.setName("Human Task");
work.setParameter("TaskName", nameText.getText());
work.setParameter("ActorId", actorText.getText());
work.setParameter("GroupId", groupText.getText());
work.setParameter("Comment", commentText.getText());
work.setParameter("Priority", priorityText.getText());
work.setParameter("Skippable", skippableButton.getSelection() + "");
String content = contentText.getText();
work.setParameter("Content", content.trim().length() == 0 ? null : content);
work.setParameter("Locale", localeText.getText());
// process reassignment
if (!reassignments.isEmpty()) {
StringBuffer notStartedReassignments = new StringBuffer();
StringBuffer notCompletedReassignments = new StringBuffer();
for (Reassignment reassign : reassignments) {
if ("not-started".equalsIgnoreCase(reassign.getTypeAsString())) {
if (notStartedReassignments.length() > 0) {
notStartedReassignments.append(COMPONENT_SEPARATOR);
}
notStartedReassignments.append(reassign.toDataInput());
} else if ("not-completed".equalsIgnoreCase(reassign.getTypeAsString())) {
if (notCompletedReassignments.length() > 0) {
notCompletedReassignments.append(COMPONENT_SEPARATOR);
}
notCompletedReassignments.append(reassign.toDataInput());
}
}
if (notStartedReassignments.length() > 0) {
work.setParameter("NotStartedReassign", notStartedReassignments.toString());
}
if (notCompletedReassignments.length() > 0) {
work.setParameter("NotCompletedReassign", notCompletedReassignments.toString());
}
}
// process notifications
if (!notifications.isEmpty()) {
StringBuffer notStartedNotifications = new StringBuffer();
StringBuffer notCompletedNotifications = new StringBuffer();
for (Notification notification : notifications) {
if ("not-started".equalsIgnoreCase(notification.getType())) {
if (notStartedNotifications.length() > 0) {
notStartedNotifications.append(COMPONENT_SEPARATOR);
}
notStartedNotifications.append(notification.toDataInput());
} else if ("not-completed".equalsIgnoreCase(notification.getType())) {
if (notCompletedNotifications.length() > 0) {
notCompletedNotifications.append(COMPONENT_SEPARATOR);
}
notCompletedNotifications.append(notification.toDataInput());
}
}
if (notStartedNotifications.length() > 0) {
work.setParameter("NotStartedNotify", notStartedNotifications.toString());
}
if (notCompletedNotifications.length() > 0) {
work.setParameter("NotCompletedNotify", notCompletedNotifications.toString());
}
}
work.setParameterDefinitions(((Work) value).getParameterDefinitions());
return work;
}