Этот код из потока здесь может помочь вам получить taskID.
JournalArticle journalArticle = JournalArticleLocalServiceUtil.getArticle(id);
getPermissionChecker().init(u.getUser(), true);
WorkflowInstanceLink wil= WorkflowInstanceLinkLocalServiceUtil.getWorkflowInstanceLink(companyId, journalArticle.getGroupId(), JournalArticle.class.getName(), journalArticle.getId());
WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, wil.getWorkflowInstanceId());
Map<String, Serializable> workflowContext = workflowInstance.getWorkflowContext();
List<Integer> logTypes_assign = new ArrayList<Integer>();
logTypes_assign.add(WorkflowLog.TASK_ASSIGN);
List<WorkflowLog> workflowLogs_assign = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(companyId, wil.getWorkflowInstanceId(), logTypes_assign, QueryUtil.ALL_POS, QueryUtil.ALL_POS, WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true));
//WorkflowPermissionUtil.hasPermission(permissionChecker, groupId, className, classPK, actionId);
if(workflowLogs_assign.size() > 0){
long taskId = workflowLogs_assign.get(workflowLogs_assign.size()-1).getWorkflowTaskId();
WorkflowTask task = WorkflowTaskManagerUtil.getWorkflowTask(companyId, taskId);
_log.info("task : "+task.getName());
WorkflowTask nextTask = WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, userId, task.getWorkflowTaskId(), userId, "auto assign", task.getDueDate(), workflowContext);
WorkflowTaskManagerUtil.completeWorkflowTask(companyId, userId, nextTask.getWorkflowTaskId(), "next task transition name", "next task name", workflowContext);
}
Спасибо.