use of org.kie.internal.task.api.InternalTaskService in project jbpm by kiegroup.
the class DefaultChecklistManager method updateTaskDescription.
public void updateTaskDescription(long taskId, String description) {
RuntimeEngine runtime = getRuntime();
List<I18NText> descriptions = new ArrayList<I18NText>();
I18NText text = TaskModelProvider.getFactory().newI18NText();
((InternalI18NText) text).setLanguage("en-UK");
((InternalI18NText) text).setText(description);
descriptions.add(text);
((InternalTaskService) runtime.getTaskService()).setDescriptions(taskId, descriptions);
manager.disposeRuntimeEngine(runtime);
}
use of org.kie.internal.task.api.InternalTaskService in project jbpm by kiegroup.
the class DefaultChecklistManager method updateTaskName.
public void updateTaskName(long taskId, String name) {
RuntimeEngine runtime = getRuntime();
List<I18NText> names = new ArrayList<I18NText>();
I18NText text = TaskModelProvider.getFactory().newI18NText();
((InternalI18NText) text).setLanguage("en-UK");
((InternalI18NText) text).setText(name);
names.add(text);
((InternalTaskService) runtime.getTaskService()).setTaskNames(taskId, names);
manager.disposeRuntimeEngine(runtime);
}
use of org.kie.internal.task.api.InternalTaskService in project jbpm by kiegroup.
the class UserTaskServiceImpl method addComment.
@Override
public Long addComment(String deploymentId, Long taskId, String text, String addedBy, Date addedOn) {
UserTaskInstanceDesc task = dataService.getTaskById(taskId);
validateTask(deploymentId, taskId, task);
RuntimeManager manager = getRuntimeManager(task);
if (manager == null) {
logger.warn("Cannot find runtime manager for task {}", taskId);
return null;
}
RuntimeEngine engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get(task.getProcessInstanceId()));
try {
TaskService taskService = engine.getTaskService();
// perform actual operation
InternalComment comment = (InternalComment) TaskModelProvider.getFactory().newComment();
comment.setText(text);
comment.setAddedAt(addedOn);
comment.setAddedBy(TaskModelProvider.getFactory().newUser(addedBy));
return ((InternalTaskService) taskService).addComment(taskId, comment);
} finally {
disposeRuntimeEngine(manager, engine);
}
}
use of org.kie.internal.task.api.InternalTaskService in project jbpm by kiegroup.
the class UserTaskServiceImpl method setSkipable.
@Override
public void setSkipable(String deploymentId, Long taskId, boolean skipable) {
UserTaskInstanceDesc task = dataService.getTaskById(taskId);
validateTask(deploymentId, taskId, task);
RuntimeManager manager = getRuntimeManager(task);
if (manager == null) {
logger.warn("Cannot find runtime manager for task {}", taskId);
return;
}
RuntimeEngine engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get(task.getProcessInstanceId()));
try {
TaskService taskService = engine.getTaskService();
// perform actual operation
((InternalTaskService) taskService).setSkipable(taskId, skipable);
} finally {
disposeRuntimeEngine(manager, engine);
}
}
use of org.kie.internal.task.api.InternalTaskService in project jbpm by kiegroup.
the class UserTaskServiceImpl method setName.
@Override
public void setName(String deploymentId, Long taskId, String name) {
UserTaskInstanceDesc task = dataService.getTaskById(taskId);
validateTask(deploymentId, taskId, task);
RuntimeManager manager = getRuntimeManager(task);
if (manager == null) {
logger.warn("Cannot find runtime manager for task {}", taskId);
return;
}
RuntimeEngine engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get(task.getProcessInstanceId()));
try {
InternalI18NText text = (InternalI18NText) TaskModelProvider.getFactory().newI18NText();
text.setLanguage("en-UK");
text.setText(name);
List<I18NText> names = new ArrayList<I18NText>();
names.add(text);
TaskService taskService = engine.getTaskService();
// perform actual operation
((InternalTaskService) taskService).setTaskNames(taskId, names);
} finally {
disposeRuntimeEngine(manager, engine);
}
}
Aggregations