@Override protected void exportAdditionalNodeElements(Node node, Element nodeElement) { Task task = (Task) node; exportAssignmentsElement(task.getAssignments(), nodeElement, "assignments"); exportTimersElement(task, nodeElement, "task-timers", "task-timer"); }
public KaleoTask addKaleoTask( long kaleoDefinitionId, long kaleoNodeId, Task task, ServiceContext serviceContext) throws PortalException, SystemException { // Kaleo task User user = userPersistence.findByPrimaryKey(serviceContext.getGuestOrUserId()); Date now = new Date(); long kaleoTaskId = counterLocalService.increment(); KaleoTask kaleoTask = kaleoTaskPersistence.create(kaleoTaskId); kaleoTask.setCompanyId(user.getCompanyId()); kaleoTask.setUserId(user.getUserId()); kaleoTask.setUserName(user.getFullName()); kaleoTask.setCreateDate(now); kaleoTask.setModifiedDate(now); kaleoTask.setKaleoDefinitionId(kaleoDefinitionId); kaleoTask.setKaleoNodeId(kaleoNodeId); kaleoTask.setName(task.getName()); kaleoTaskPersistence.update(kaleoTask, false); // Kaleo assignments Set<Assignment> assignments = task.getAssignments(); for (Assignment assignment : assignments) { kaleoTaskAssignmentLocalService.addKaleoTaskAssignment( KaleoTask.class.getName(), kaleoTaskId, kaleoDefinitionId, assignment, serviceContext); } // Kaleo task forms Set<Form> forms = task.getForms(); for (Form form : forms) { kaleoTaskFormLocalService.addKaleoTaskForm( kaleoDefinitionId, kaleoTaskId, form, serviceContext); } return kaleoTask; }