08-05-2011 06:48 PM
TaskService taskService = pe.getTaskService();
// Create and save task
Task task = taskService.newTask();
task.setName("testTask");
taskService.saveTask(task);
This seems to work, I can query the task and handle it with the API. It is also correctly inserted into the database. But - as was to be expected - the task instance lacks a process_inst_id and execution_id.
18:11:31,343 ERROR [freemarker.runtime]
Expression jsonUtils.encodeJSONString(x) is undefined on line 1, column 15 in org/activiti/rest/api/task/task.lib.ftl.
The problematic instruction:
———-
==> ${task.executionId} escaped ${jsonUtils.encodeJSONString(task.executionId)} [on line 19, column 18 in org/activiti/rest/api/task/task.lib.ftl]
in user-directive printTask [on line 7, column 5 in org/activiti/rest/api/task/task.lib.ftl]
in user-directive taskLib.printTaskList [on line 4, column 11 in org/activiti/rest/api/task/tasks.get.json.ftl]
After some googling, I found that this is probably due to some value being null. Sure enough, the template contains
"assignee": <#if task.assignee??>"${task.assignee}"<#else>null</#if>,
"executionId": ${task.executionId},
"processInstanceId": <#if task.processInstanceId??>"${task.processInstanceId}"<#else>null</#if>,
Since the executionId is null, this fails. Making it similar to the other checks fixed the problem.08-06-2011 09:21 AM
08-08-2011 04:54 AM
08-10-2011 08:48 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.