use of org.kie.internal.task.api.model.InternalTask in project jbpm by kiegroup.
the class LifeCycleBaseTest method testLongDescription.
@Test
public void testLongDescription() {
// BZ-1107473
String str = "(with (new Task()) { priority = 55, taskData = (with( new TaskData()) { } ), ";
str += "peopleAssignments = (with ( new PeopleAssignments() ) { potentialOwners = [new User('Bobba Fet'), new User('Darth Vader') ],businessAdministrators = [ new User('Administrator') ], }),";
str += "name = 'This is my task name' })";
Task task = TaskFactory.evalTask(new StringReader(str));
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 1000; i++) {
sb.append("a");
}
String comment = sb.toString();
// NOTE: AbstractHTWorkItemHandler stores "Comment" parameter as 'Description'
List<I18NText> descriptions = new ArrayList<I18NText>();
I18NText descText = TaskModelProvider.getFactory().newI18NText();
((InternalI18NText) descText).setLanguage("en-UK");
((InternalI18NText) descText).setText(comment);
descriptions.add(descText);
((InternalTask) task).setDescriptions(descriptions);
// Fails if shortText is longer than 255
taskService.addTask(task, new HashMap<String, Object>());
long taskId = task.getId();
Task resultTask = taskService.getTaskById(taskId);
List<I18NText> resultDescriptions = resultTask.getDescriptions();
InternalI18NText resultDescription = (InternalI18NText) resultDescriptions.get(0);
// This is text
assertEquals(1000, resultDescription.getText().length());
// 6.1.x no longer uses shortText in API and Taskorm.xml so no assert.
}
use of org.kie.internal.task.api.model.InternalTask in project jbpm by kiegroup.
the class TaskInstanceServiceImpl method setPriority.
public void setPriority(long taskId, int priority) {
Task task = persistenceContext.findTask(taskId);
taskEventSupport.fireBeforeTaskUpdated(task, context);
((InternalTask) task).setPriority(priority);
taskEventSupport.fireAfterTaskUpdated(task, context);
}
use of org.kie.internal.task.api.model.InternalTask in project jbpm by kiegroup.
the class TaskInstanceServiceImpl method setName.
@Override
public void setName(long taskId, String name) {
Task task = persistenceContext.findTask(taskId);
((InternalTask) task).setName(name);
}
use of org.kie.internal.task.api.model.InternalTask in project jbpm by kiegroup.
the class TaskInstanceServiceImpl method setSubTaskStrategy.
public void setSubTaskStrategy(long taskId, SubTasksStrategy strategy) {
Task task = persistenceContext.findTask(taskId);
((InternalTask) task).setSubTaskStrategy(strategy);
}
use of org.kie.internal.task.api.model.InternalTask in project jbpm by kiegroup.
the class TaskInstanceServiceImpl method setDescription.
@Override
public void setDescription(long taskId, String description) {
Task task = persistenceContext.findTask(taskId);
((InternalTask) task).setDescription(description);
}
Aggregations