Inheritance: WorkflowRepositoryInteraction
コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }