public void UpdateWorkItem(WorkItem changedWorkItem) { var currentWorkItem = GetWorkItemOrThrow(changedWorkItem.Id); ThrowIfConflictingTimestamp(currentWorkItem, changedWorkItem); currentWorkItem = currentWorkItem.UpdatePropertiesAndOrdinalFrom(changedWorkItem).UpdateTimestamp(TimeSource.GetTime()); var leafStep = WorkflowRepository.GetLeafStep(changedWorkItem.Path); if (changedWorkItem.Path == currentWorkItem.Path || currentWorkItem.Path == leafStep.Path) { WorkflowRepository.UpdateWorkItem(currentWorkItem); } else { var mover = new WorkItemMover(WorkflowRepository, TimeSource); mover.MoveWorkItem(currentWorkItem, leafStep); } }
public void UpdateWorkItem(WorkItem changedWorkItem) { var currentWorkItem = GetWorkItemOrThrow(changedWorkItem.Id); ThrowIfConflictingTimestamp(currentWorkItem, changedWorkItem); currentWorkItem = currentWorkItem.UpdatePropertiesAndOrdinalFrom(changedWorkItem).UpdateTimestamp(TimeSource.GetTime()); var leafStep = WorkflowRepository.GetLeafStep(changedWorkItem.Path); if (changedWorkItem.Path == currentWorkItem.Path || currentWorkItem.Path == leafStep.Path) { WorkflowRepository.UpdateWorkItem(currentWorkItem); } else { var mover = new WorkItemMover(WorkflowRepository,TimeSource); mover.MoveWorkItem(currentWorkItem, leafStep); } }