public void testRevisionUpdatedOnSave() { Task task = taskService.newTask(); taskService.saveTask(task); assertEquals(1, ((TaskEntity) task).getRevision()); task.setDescription("first modification"); taskService.saveTask(task); assertEquals(2, ((TaskEntity) task).getRevision()); task.setDescription("second modification"); taskService.saveTask(task); assertEquals(3, ((TaskEntity) task).getRevision()); taskService.deleteTask(task.getId(), true); }
public Void execute(CommandContext commandContext) { ensureNotNull("task", task); String operation; if (task.getRevision() == 0) { try { checkCreateTask(task, commandContext); task.insert(null); commandContext.getHistoricTaskInstanceManager().createHistoricTask(task); operation = UserOperationLogEntry.OPERATION_TYPE_CREATE; task.executeMetrics(Metrics.ACTIVTY_INSTANCE_START); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } } else { checkTaskAssign(task, commandContext); task.update(); operation = UserOperationLogEntry.OPERATION_TYPE_UPDATE; } task.fireAuthorizationProvider(); task.fireEvents(); task.createHistoricTaskDetails(operation); return null; }
public Void execute(CommandContext commandContext) { ensureNotNull("task", task); String operation; if (task.getRevision() == 0) { try { checkCreateTask(task, commandContext); task.insert(null); commandContext.getHistoricTaskInstanceManager().createHistoricTask(task); operation = UserOperationLogEntry.OPERATION_TYPE_CREATE; task.executeMetrics(Metrics.ACTIVTY_INSTANCE_START); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } } else { checkTaskAssign(task, commandContext); task.update(); operation = UserOperationLogEntry.OPERATION_TYPE_UPDATE; } task.fireAuthorizationProvider(); task.fireEvents(); task.createHistoricTaskDetails(operation); return null; }
public void testRevisionUpdatedOnSave() { Task task = taskService.newTask(); taskService.saveTask(task); assertEquals(1, ((TaskEntity) task).getRevision()); task.setDescription("first modification"); taskService.saveTask(task); assertEquals(2, ((TaskEntity) task).getRevision()); task.setDescription("second modification"); taskService.saveTask(task); assertEquals(3, ((TaskEntity) task).getRevision()); taskService.deleteTask(task.getId(), true); }
public Void execute(CommandContext commandContext) { ensureNotNull("task", task); String operation; if (task.getRevision() == 0) { try { checkCreateTask(task, commandContext); task.insert(null); commandContext.getHistoricTaskInstanceManager().createHistoricTask(task); operation = UserOperationLogEntry.OPERATION_TYPE_CREATE; task.executeMetrics(Metrics.ACTIVTY_INSTANCE_START); } catch (NullValueException e) { throw new NotValidException(e.getMessage(), e); } } else { checkTaskAssign(task, commandContext); task.update(); operation = UserOperationLogEntry.OPERATION_TYPE_UPDATE; } task.fireAuthorizationProvider(); task.fireEvents(); task.createHistoricTaskDetails(operation); return null; }