Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2013-10-17 23:02:31 +0000
committerRoberto E. Escobar2013-11-25 23:45:29 +0000
commitd07bba90619cee2f19d25bbfeb83935144832555 (patch)
tree7da5782f4df423bb67cf27d74dc1b230dcbb805d /plugins
parentc4f67af4a1438b08fff0e55c0e63597300e265ca (diff)
downloadorg.eclipse.osee-d07bba90619cee2f19d25bbfeb83935144832555.tar.gz
org.eclipse.osee-d07bba90619cee2f19d25bbfeb83935144832555.tar.xz
org.eclipse.osee-d07bba90619cee2f19d25bbfeb83935144832555.zip
feature[ats_S5JDQ]: Move TransitionManager to ats.core
- Replace client-only SkynetTransaction with AtsChangeSet - Convert necessary Artifact references objects with ATS interfaces - Move TransitionManager to ats.core Change-Id: I629cd44a06e1435679c542ebdee3664017692092
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF7
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsWorkItem.java6
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/review/IAtsReviewService.java40
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/review/IAtsReviewServiceProvider.java21
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java25
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAtsWorkDefinition.java14
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java2
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java24
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchServiceProvider.java21
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java21
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransaction.java25
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionHelper.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ITransitionHelper.java)26
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionListener.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ITransitionListener.java)10
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionAdapter.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionAdapter.java)10
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionOption.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionOption.java)2
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResult.java (renamed from plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionResult.java)2
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionResults.java)56
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ValidResult.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ValidResult.java)2
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ValidType.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ValidType.java)2
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java45
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java69
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java66
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/CreateGoalTestDemoArtifacts.java78
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/access/AtsBranchAccessManagerTest.java5
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/CancelledDateColumnTest.java31
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/CompletedDateColumnTest.java31
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/DeadlineColumnTest.java11
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/EstimatedHoursColumnTest.java27
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/NumberOfTasksAndInWorkTasksColumnsTest.java19
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/PeerToPeerReviewColumnsTest.java24
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java35
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java61
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtilTest.java29
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/action/AutoAddActionToGoalTest.java59
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/config/store/VersionArtifactStoreTest.java12
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotificationManagerTest.java80
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotifyUsersTest.java46
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java34
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewManagerTest.java27
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerReviewDefinitionManagerTest.java23
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java23
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/TaskManagerTest.java20
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/createTasks/CreateTasksOperationTest.java13
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/CopyActionDetailsTest.java10
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/AtsCoreClient_Transition_Suite.java2
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/MockTransitionHelper.java24
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/StateManagerTest.java16
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionListenersTest.java109
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java185
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsDecisionReviewPrepareStateItemTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItemTest.java18
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItemTest.java24
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/AtsDeleteManagerTest.java47
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/SMAPromptChangeStatusTest.java75
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java14
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/OSGI-INF/ats.client.service.xml2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java18
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsWorkDefinitionAdmin.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifactRollup.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionManager.java26
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/INewActionListener.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchManagerCore.java41
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java33
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IAtsArtifactStore.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IAtsArtifactWriter.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java53
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AbstractAtsArtifactWriter.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/ActionableItemArtifactWriter.java20
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsArtifactStore.java8
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/TeamDefinitionArtifactWriter.java19
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/VersionArtifactWriter.java14
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImpl.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsWorkItemServiceImpl.java48
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewDefinitionManager.java26
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewManager.java36
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerReviewDefinitionManager.java21
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerToPeerReviewManager.java58
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/ReviewManager.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/ValidateReviewManager.java21
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/XDecisionOptions.java10
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/UserRoleManager.java11
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AbstractTaskableArtifact.java16
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskArtifact.java20
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskManager.java26
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/AbstractTaskOp.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/CreateTasksOperation.java20
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/ExecuteTaskOpList.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/ITaskOperation.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpCreate.java11
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpDoNothing.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpModify.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java21
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowManager.java45
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java90
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/SubscribeManager.java26
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java27
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java34
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelperAdapter.java22
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionListeners.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionManager.java564
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionToOperation.java26
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java15
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/transition/TransitionResultTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.ats.core/OSGI-INF/ats.core.xml2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/AtsCore.java24
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelper.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelper.java)54
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapter.java66
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java558
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionStatusData.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionStatusData.java)22
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/model/WorkDefinition.java5
-rw-r--r--plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/MockWorkDefinition.java5
-rw-r--r--plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/WorkflowPortingBlam.java22
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ConvertActionableItemsAction.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewGoal.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java12
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalManager.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigOperation.java47
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java14
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java66
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeHoursSpent.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeStatus.java19
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WETransitionComposite.java69
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java19
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java23
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java25
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsStateItem.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java19
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java21
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsRemoteEventTestItem.java19
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationTransitionListener.java15
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateActionFromTaskBlam.java12
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java12
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ModifyActionableItemsBlam.java12
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewItem.java13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewJob.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java20
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/CreateActionUsingAllActionableItems.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java18
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java22
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ImportActionsViaSpreadsheetBlam.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TransitionStatusDialog.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java23
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java18
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/ReleaseVersionItem.java18
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/AtsWorkDefinitionSheetProviders.java44
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java23
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportWorkDefinitionsItem.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/provider/AtsWorkDefinitionImporter.java17
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/TransitionToMenu.java148
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java3
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/users/UserDataWriter.java4
164 files changed, 2800 insertions, 2091 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF
index eb1308b23a..d2cbbddda8 100644
--- a/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF
@@ -21,10 +21,13 @@ Export-Package: org.eclipse.osee.ats.api,
org.eclipse.osee.ats.api.workdef,
org.eclipse.osee.ats.api.workflow,
org.eclipse.osee.ats.api.workflow.log,
- org.eclipse.osee.ats.api.workflow.state
+ org.eclipse.osee.ats.api.workflow.state,
+ org.eclipse.osee.ats.api.workflow.transition
Require-Bundle: org.eclipse.core.runtime
Import-Package: org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.util,
- org.eclipse.osee.framework.jdk.core.type
+ org.eclipse.osee.framework.jdk.core.type,
+ org.eclipse.osee.framework.jdk.core.util,
+ org.eclipse.osee.framework.logging
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsWorkItem.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsWorkItem.java
index db4ecc797a..f7a07dd8b4 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsWorkItem.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsWorkItem.java
@@ -43,4 +43,10 @@ public interface IAtsWorkItem extends IAtsObject, HasWorkData, HasAssignees, Has
IAtsLogItem getStateStartedData(IStateToken state) throws OseeCoreException;
+ boolean isTask();
+
+ boolean isTeamWorkflow();
+
+ String getTypeName();
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/review/IAtsReviewService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/review/IAtsReviewService.java
new file mode 100644
index 0000000000..e78e8de70e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/review/IAtsReviewService.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.review;
+
+import java.util.Collection;
+import java.util.Date;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IAtsReviewService {
+
+ boolean isValidationReviewRequired(IAtsWorkItem workItem) throws OseeCoreException;
+
+ /**
+ * Create a new decision review configured and transitioned to handle action validation
+ *
+ * @param force will force the creation of the review without checking that a review should be created
+ */
+ IAtsDecisionReview createValidateReview(IAtsTeamWorkflow teamWf, boolean force, Date transitionDate, IAtsUser transitionUser, IAtsChangeSet changes) throws OseeCoreException;
+
+ Collection<IAtsAbstractReview> getReviewsFromCurrentState(IAtsTeamWorkflow teamWf) throws OseeCoreException;
+
+ ReviewBlockType getReviewBlockType(IAtsAbstractReview reviewArt) throws OseeCoreException;
+
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/review/IAtsReviewServiceProvider.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/review/IAtsReviewServiceProvider.java
new file mode 100644
index 0000000000..bb5a83be39
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/review/IAtsReviewServiceProvider.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.review;
+
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IAtsReviewServiceProvider {
+
+ public IAtsReviewService getReviewService() throws OseeCoreException;
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
new file mode 100644
index 0000000000..4761b6646f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.util;
+
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IAtsChangeSet {
+
+ void add(Object obj) throws OseeCoreException;
+
+ void execute() throws OseeCoreException;
+
+ void clear();
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAtsWorkDefinition.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAtsWorkDefinition.java
index 1697a92049..4d3b73f4ad 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAtsWorkDefinition.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAtsWorkDefinition.java
@@ -23,20 +23,22 @@ public interface IAtsWorkDefinition extends Identifiable<String>, HasDescription
* Identification
*/
@Override
- public abstract String getName();
+ String getName();
- public abstract String getId();
+ String getId();
@Override
- public abstract String getDescription();
+ String getDescription();
/**
* States
*/
- public abstract List<IAtsStateDefinition> getStates();
+ List<IAtsStateDefinition> getStates();
- public abstract IAtsStateDefinition getStateByName(String name);
+ IAtsStateDefinition getStateByName(String name);
- public abstract IAtsStateDefinition getStartState();
+ IAtsStateDefinition getStateDefinitionByName(String name);
+
+ IAtsStateDefinition getStartState();
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
index b3f34e3da1..bbb8d77ba5 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
@@ -45,4 +45,6 @@ public interface IAttributeResolver {
<T> Collection<IAttribute<T>> getAttributes(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException;
+ void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType cancelledreason) throws OseeCoreException;
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
new file mode 100644
index 0000000000..f3b8eee2d4
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.workflow;
+
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IAtsBranchService {
+
+ boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException;
+
+ boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException;
+
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchServiceProvider.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchServiceProvider.java
new file mode 100644
index 0000000000..07f3ab0724
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchServiceProvider.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.workflow;
+
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IAtsBranchServiceProvider {
+
+ IAtsBranchService getBranchService() throws OseeCoreException;
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java
index c91195582b..18466e1291 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java
@@ -11,13 +11,20 @@
package org.eclipse.osee.ats.api.workflow;
import java.util.Collection;
+import java.util.List;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workdef.WidgetResult;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
/**
* @author Donald G. Dunne
@@ -54,4 +61,18 @@ public interface IAtsWorkItemService {
boolean isAccessControlWrite(IAtsWorkItem workItem);
+ String getCurrentStateName(IAtsWorkItem workItem);
+
+ void clearImplementersCache(IAtsWorkItem workItem);
+
+ Collection<WidgetResult> validateWidgetTransition(IAtsWorkItem workItem, IAtsStateDefinition toStateDef) throws OseeStateException;
+
+ Collection<IAtsTask> getTaskArtifacts(IAtsWorkItem workItem) throws OseeCoreException;
+
+ void transitioned(IAtsWorkItem workItem, IAtsStateDefinition fromState, IAtsStateDefinition toState, List<? extends IAtsUser> updatedAssigees, IAtsChangeSet changes) throws OseeCoreException;
+
+ void setInTransition(IAtsWorkItem workItem, boolean inTransition);
+
+ Collection<ITransitionListener> getTransitionListeners();
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransaction.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransaction.java
new file mode 100644
index 0000000000..e0316ec82b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransaction.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.workflow.transition;
+
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G Dunne
+ */
+public interface ITransaction {
+
+ void persist(IAtsWorkItem workItem) throws OseeCoreException;
+
+ void setInTransition(IAtsWorkItem workItem, boolean set);
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ITransitionHelper.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionHelper.java
index 796cdda1d4..e3da042fd9 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ITransitionHelper.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionHelper.java
@@ -8,15 +8,17 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.transition;
+package org.eclipse.osee.ats.api.workflow.transition;
import java.util.Collection;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
-import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
/**
* @author Donald G. Dunne
*/
@@ -28,7 +30,7 @@ public interface ITransitionHelper {
public boolean isOverrideTransitionValidityCheck();
- public Collection<? extends AbstractWorkflowArtifact> getAwas();
+ public Collection<? extends IAtsWorkItem> getWorkItems();
/**
* @return Result.isTrue with text if reason provided
@@ -44,18 +46,26 @@ public interface ITransitionHelper {
*/
public Result handleExtraHoursSpent();
- public Collection<? extends IAtsUser> getToAssignees(AbstractWorkflowArtifact awa) throws OseeCoreException;
+ public Collection<? extends IAtsUser> getToAssignees(IAtsWorkItem workItem) throws OseeCoreException;
public String getToStateName();
boolean isOverrideAssigneeCheck();
- boolean isWorkingBranchInWork(TeamWorkFlowArtifact teamArt) throws OseeCoreException;
+ boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException;
- boolean isBranchInCommit(TeamWorkFlowArtifact teamArt) throws OseeCoreException;
+ boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException;
public boolean isSystemUser() throws OseeCoreException;
- public boolean isSystemUserAssingee(AbstractWorkflowArtifact awa) throws OseeCoreException;
+ public boolean isSystemUserAssingee(IAtsWorkItem workItem) throws OseeCoreException;
+
+ public void setInTransition(IAtsWorkItem workItem, boolean inTransition) throws OseeCoreException;
+
+ public IAtsChangeSet getChangeSet();
+
+ public boolean isExecuteChanges();
+
+ public Collection<ITransitionListener> getTransitionListeners();
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ITransitionListener.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionListener.java
index e1042e0825..881c8991e2 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ITransitionListener.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionListener.java
@@ -8,22 +8,22 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.transition;
+package org.eclipse.osee.ats.api.workflow.transition;
import java.util.Collection;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IStateToken;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
*/
public interface ITransitionListener {
- public void transitioning(TransitionResults results, AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) throws OseeCoreException;
+ public void transitioning(TransitionResults results, IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) throws OseeCoreException;
- public void transitioned(AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) throws OseeCoreException;
+ public void transitioned(IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionAdapter.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionAdapter.java
index b6cbcbf70b..f1bbeead11 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionAdapter.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionAdapter.java
@@ -8,14 +8,14 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.transition;
+package org.eclipse.osee.ats.api.workflow.transition;
import java.util.Collection;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IStateToken;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -24,13 +24,13 @@ public class TransitionAdapter implements ITransitionListener {
@SuppressWarnings("unused")
@Override
- public void transitioning(TransitionResults results, AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) throws OseeCoreException {
+ public void transitioning(TransitionResults results, IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) throws OseeCoreException {
// provided for subclass implementation
}
@SuppressWarnings("unused")
@Override
- public void transitioned(AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
+ public void transitioned(IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
// provided for subclass implementation
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionOption.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionOption.java
index 40f4fc4ee9..449021bd1b 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionOption.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionOption.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.transition;
+package org.eclipse.osee.ats.api.workflow.transition;
public enum TransitionOption {
None,
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionResult.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResult.java
index 37526c2411..a429ad03ce 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionResult.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResult.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.workflow.transition;
+package org.eclipse.osee.ats.api.workflow.transition;
import org.eclipse.osee.ats.api.workdef.ITransitionResult;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionResults.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
index 63d3082bd3..1ac44dce69 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionResults.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
@@ -8,17 +8,15 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.transition;
+package org.eclipse.osee.ats.api.workflow.transition;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.workdef.ITransitionResult;
-import org.eclipse.osee.ats.core.client.internal.Activator;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.workflow.transition.TransitionResult;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -32,21 +30,21 @@ public class TransitionResults {
private final List<ITransitionResult> results = new ArrayList<ITransitionResult>();
- private final Map<AbstractWorkflowArtifact, List<ITransitionResult>> awaToResults =
- new HashMap<AbstractWorkflowArtifact, List<ITransitionResult>>();
+ private final Map<IAtsWorkItem, List<ITransitionResult>> workItemToResults =
+ new HashMap<IAtsWorkItem, List<ITransitionResult>>();
- public void addResult(AbstractWorkflowArtifact awa, ITransitionResult result) {
- List<ITransitionResult> results = awaToResults.get(awa);
+ public void addResult(IAtsWorkItem workItem, ITransitionResult result) {
+ List<ITransitionResult> results = workItemToResults.get(workItem);
if (results == null) {
results = new ArrayList<ITransitionResult>();
- awaToResults.put(awa, results);
+ workItemToResults.put(workItem, results);
}
results.add(result);
}
public void clear() {
results.clear();
- awaToResults.clear();
+ workItemToResults.clear();
}
public void addResult(ITransitionResult result) {
@@ -54,7 +52,7 @@ public class TransitionResults {
}
public boolean isEmpty() {
- return results.isEmpty() && awaToResults.isEmpty();
+ return results.isEmpty() && workItemToResults.isEmpty();
}
public boolean isCancelled() {
@@ -73,38 +71,38 @@ public class TransitionResults {
return results.contains(transitionResult);
}
- public boolean isEmpty(AbstractWorkflowArtifact awa) {
- List<ITransitionResult> awaResults = awaToResults.get(awa);
- if (awaResults == null || awaResults.isEmpty()) {
+ public boolean isEmpty(IAtsWorkItem workItem) {
+ List<ITransitionResult> workItemResults = workItemToResults.get(workItem);
+ if (workItemResults == null || workItemResults.isEmpty()) {
return true;
}
return false;
}
- public boolean contains(AbstractWorkflowArtifact awa, TransitionResult transitionResult) {
- List<ITransitionResult> awaResults = awaToResults.get(awa);
- if (awaResults == null) {
+ public boolean contains(IAtsWorkItem workItem, TransitionResult transitionResult) {
+ List<ITransitionResult> workItemResults = workItemToResults.get(workItem);
+ if (workItemResults == null) {
return false;
}
- return awaResults.contains(transitionResult);
+ return workItemResults.contains(transitionResult);
}
public String getResultString() {
- if (results.isEmpty() && awaToResults.isEmpty()) {
+ if (results.isEmpty() && workItemToResults.isEmpty()) {
return "<Empty>";
}
StringBuffer sb = new StringBuffer();
sb.append("Reason(s):\n");
appendResultsString(sb, results);
- for (AbstractWorkflowArtifact awa : awaToResults.keySet()) {
+ for (IAtsWorkItem workItem : workItemToResults.keySet()) {
sb.append("\n");
- sb.append(awa.getArtifactTypeName());
+ sb.append(workItem.getTypeName());
sb.append(" [");
- sb.append(awa.getAtsId());
+ sb.append(workItem.getAtsId());
sb.append("] Titled [");
- sb.append(awa.getName());
+ sb.append(workItem.getName());
sb.append("]\n\n");
- appendResultsString(sb, awaToResults.get(awa));
+ appendResultsString(sb, workItemToResults.get(workItem));
}
return sb.toString();
@@ -117,16 +115,16 @@ public class TransitionResults {
for (ITransitionResult result : results) {
Exception ex = result.getException();
if (ex != null) {
- OseeLog.log(Activator.class, Level.SEVERE, result.getDetails(), ex);
+ OseeLog.log(TransitionResults.class, Level.SEVERE, result.getDetails(), ex);
}
}
- for (AbstractWorkflowArtifact awa : awaToResults.keySet()) {
- List<ITransitionResult> results = awaToResults.get(awa);
+ for (IAtsWorkItem workItem : workItemToResults.keySet()) {
+ List<ITransitionResult> results = workItemToResults.get(workItem);
for (ITransitionResult result : results) {
Exception ex = result.getException();
if (ex != null) {
- String message = awa.toStringWithId() + " - " + result.getDetails();
- OseeLog.log(Activator.class, Level.SEVERE, message, ex);
+ String message = workItem.toStringWithId() + " - " + result.getDetails();
+ OseeLog.log(TransitionResults.class, Level.SEVERE, message, ex);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ValidResult.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ValidResult.java
index 8f0db392b2..4c977d2f97 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ValidResult.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ValidResult.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.transition;
+package org.eclipse.osee.ats.api.workflow.transition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ValidType.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ValidType.java
index 3a0811de4d..815958596c 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/ValidType.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ValidType.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.transition;
+package org.eclipse.osee.ats.api.workflow.transition;
public enum ValidType {
Valid,
diff --git a/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF
index 94a080b742..95c5ab0189 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF
@@ -24,10 +24,12 @@ Import-Package: org.eclipse.core.filesystem,
org.eclipse.osee.ats.api.rule,
org.eclipse.osee.ats.api.team,
org.eclipse.osee.ats.api.user,
+ org.eclipse.osee.ats.api.util,
org.eclipse.osee.ats.api.version,
org.eclipse.osee.ats.api.workdef,
org.eclipse.osee.ats.api.workflow,
org.eclipse.osee.ats.api.workflow.state,
+ org.eclipse.osee.ats.api.workflow.transition,
org.eclipse.osee.ats.core,
org.eclipse.osee.ats.core.client,
org.eclipse.osee.ats.core.client.action,
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java
index 4b3b42717f..8f17491e8d 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java
@@ -20,8 +20,10 @@ import java.util.logging.Level;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.client.demo.config.DemoDbActionData;
import org.eclipse.osee.ats.client.demo.config.DemoDbActionData.CreateReview;
import org.eclipse.osee.ats.client.demo.config.DemoDbGroups;
@@ -38,10 +40,10 @@ import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.ats.util.AtsUtil;
@@ -229,21 +231,19 @@ public class PopulateDemoActions extends XNavigateItemAction {
}
private void createNonReqChangeDemoActions() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Populate Demo DB - Create Actions");
+ AtsChangeSet changes = new AtsChangeSet("Populate Demo DB - Create Actions");
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "createNonReqChangeDemoActions - SAW_Bld_3");
}
Set<ActionArtifact> actions =
- createActions(DemoDbActionData.getNonReqSawActionData(), DemoArtifactToken.SAW_Bld_3, null, transaction);
- appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_3.getName(), transaction);
+ createActions(DemoDbActionData.getNonReqSawActionData(), DemoArtifactToken.SAW_Bld_3, null, changes);
+ appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_3.getName(), changes);
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "createNonReqChangeDemoActions - SAW_Bld_2");
}
- actions =
- createActions(DemoDbActionData.getNonReqSawActionData(), DemoArtifactToken.SAW_Bld_2, null, transaction);
- appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_2.getName(), transaction);
+ actions = createActions(DemoDbActionData.getNonReqSawActionData(), DemoArtifactToken.SAW_Bld_2, null, changes);
+ appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_2.getName(), changes);
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "createNonReqChangeDemoActions - SAW_Bld_1");
@@ -251,34 +251,34 @@ public class PopulateDemoActions extends XNavigateItemAction {
actions =
createActions(DemoDbActionData.getNonReqSawActionData(), DemoArtifactToken.SAW_Bld_1, TeamState.Completed,
- transaction);
- appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_1.toString(), transaction);
+ changes);
+ appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_1.toString(), changes);
- transaction.execute();
+ changes.execute();
}
private void createGenericDemoActions() throws Exception {
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "createNonReqChangeDemoActions - getGenericActionData");
}
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Populate Demo DB - Create Generic Actions");
- createActions(DemoDbActionData.getGenericActionData(), null, null, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet("Populate Demo DB - Create Generic Actions");
+ createActions(DemoDbActionData.getGenericActionData(), null, null, changes);
+ changes.execute();
}
- private void appendBuildNameToTitles(Set<ActionArtifact> actions, String buildName, SkynetTransaction transaction) throws OseeCoreException {
+ private void appendBuildNameToTitles(Set<ActionArtifact> actions, String buildName, IAtsChangeSet changes) throws OseeCoreException {
for (ActionArtifact action : actions) {
for (TeamWorkFlowArtifact team : action.getTeams()) {
team.setName(team.getName() + " for " + buildName);
- team.persist(transaction);
+ changes.add(team);
}
- ActionArtifactRollup rollup = new ActionArtifactRollup(action, transaction);
+ ActionArtifactRollup rollup = new ActionArtifactRollup(action);
rollup.resetAttributesOffChildren();
+ changes.add(action);
}
}
- private Set<ActionArtifact> createActions(List<DemoDbActionData> actionDatas, IArtifactToken versionToken, TeamState toStateOverride, SkynetTransaction transaction) throws Exception {
+ private Set<ActionArtifact> createActions(List<DemoDbActionData> actionDatas, IArtifactToken versionToken, TeamState toStateOverride, IAtsChangeSet changes) throws Exception {
Set<ActionArtifact> actionArts = new HashSet<ActionArtifact>();
int currNum = 1;
for (DemoDbActionData aData : actionDatas) {
@@ -293,7 +293,7 @@ public class PopulateDemoActions extends XNavigateItemAction {
ActionArtifact actionArt =
ActionManager.createAction(null, prefixTitle + " " + aData.postFixTitle,
TITLE_PREFIX[x] + " " + aData.postFixTitle, CHANGE_TYPE[x], aData.priority, false, null,
- aData.getActionableItems(), createdDate, createdBy, null, transaction);
+ aData.getActionableItems(), createdDate, createdBy, null, changes);
actionArts.add(actionArt);
for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
TeamWorkFlowManager dtwm =
@@ -318,7 +318,7 @@ public class PopulateDemoActions extends XNavigateItemAction {
// Transition to desired state
Result result =
dtwm.transitionTo((toStateOverride != null ? toStateOverride : aData.toState),
- teamWf.getAssignees().iterator().next(), false, transaction);
+ teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to state [%s]: [%s]", teamWf.toStringWithId(),
aData.toState.getName(), result.getText());
@@ -327,12 +327,9 @@ public class PopulateDemoActions extends XNavigateItemAction {
// Reset assignees that may have been overwritten during transition
teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
}
-
- teamWf.persist(transaction);
if (versionToken != null) {
IAtsVersion version = AtsVersionService.get().getById(versionToken);
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
- teamWf.persist(transaction);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java
index 66d93d6d36..c958f95931 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java
@@ -16,8 +16,10 @@ import java.util.logging.Level;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.client.demo.config.DemoDbAIs;
import org.eclipse.osee.ats.client.demo.config.DemoDbUtil;
import org.eclipse.osee.ats.client.demo.config.DemoDbUtil.SoftwareRequirementStrs;
@@ -30,12 +32,11 @@ import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.ats.util.AtsBranchManager;
-import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -50,8 +51,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
/**
* @author Donald G. Dunne
@@ -68,22 +67,21 @@ public class PopulateSawBuild2Actions {
Conditions.checkNotNull(version, "SAW_Bld_2");
// Create SAW_Bld_2 Actions
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Populate Demo DB - PopulateSawBuild2Actions");
+ AtsChangeSet changes = new AtsChangeSet("Populate Demo DB - PopulateSawBuild2Actions");
// SawBuild2Action1
- ActionArtifact committedAction = sawBuild2Action1_createCommittedAction(transaction);
+ ActionArtifact committedAction = sawBuild2Action1_createCommittedAction(changes);
// SawBuild2Action2
- ActionArtifact unCommittedAction = sawBuild2Action2_createUnCommittedAction(transaction);
+ ActionArtifact unCommittedAction = sawBuild2Action2_createUnCommittedAction(changes);
// SawBuild2Action3
- sawBuild2Action3_createNoBranchAction(transaction);
+ sawBuild2Action3_createNoBranchAction(changes);
// SawBuild2Action4
- ActionArtifact conflictedAction = sawBuild2Action4_createUnCommittedConflictedAction(transaction);
+ ActionArtifact conflictedAction = sawBuild2Action4_createUnCommittedConflictedAction(changes);
- transaction.execute();
+ changes.execute();
// Sleep to wait for the persist of the actions
DemoDbUtil.sleep(3000);
@@ -99,7 +97,7 @@ public class PopulateSawBuild2Actions {
}
- private static ActionArtifact sawBuild2Action4_createUnCommittedConflictedAction(SkynetTransaction transaction) throws OseeCoreException {
+ private static ActionArtifact sawBuild2Action4_createUnCommittedConflictedAction(IAtsChangeSet changes) throws OseeCoreException {
String title = "SAW (uncommitted-conflicted) More Requirement Changes for Diagram View";
Collection<IAtsActionableItem> aias =
DemoDbUtil.getActionableItems(new String[] {DemoDbAIs.SAW_Requirements.getAIName()});
@@ -109,7 +107,7 @@ public class PopulateSawBuild2Actions {
ActionArtifact actionArt =
ActionManager.createAction(null, title, "Problem with the Diagram View", ChangeType.Problem, priority, false,
- null, aias, createdDate, createdBy, null, transaction);
+ null, aias, createdDate, createdBy, null, changes);
for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
TeamWorkFlowManager dtwm =
@@ -117,7 +115,7 @@ public class PopulateSawBuild2Actions {
TransitionOption.OverrideTransitionValidityCheck);
// Transition to desired state
- Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, transaction);
+ Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to state [%s]: [%s]", teamWf.toStringWithId(),
toState.getName(), result.getText());
@@ -128,15 +126,13 @@ public class PopulateSawBuild2Actions {
teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
}
- teamWf.persist(transaction);
-
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
- teamWf.persist(transaction);
+ changes.add(teamWf);
}
return actionArt;
}
- private static ActionArtifact sawBuild2Action3_createNoBranchAction(SkynetTransaction transaction) throws OseeCoreException {
+ private static ActionArtifact sawBuild2Action3_createNoBranchAction(IAtsChangeSet changes) throws OseeCoreException {
String title = "SAW (no-branch) Even More Requirement Changes for Diagram View";
Collection<IAtsActionableItem> aias =
DemoDbUtil.getActionableItems(new String[] {
@@ -150,7 +146,7 @@ public class PopulateSawBuild2Actions {
ActionArtifact actionArt =
ActionManager.createAction(null, title, "Problem with the Diagram View", ChangeType.Problem, priority, false,
- null, aias, createdDate, createdBy, null, transaction);
+ null, aias, createdDate, createdBy, null, changes);
for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
boolean isSwDesign = teamWf.getTeamDefinition().getName().contains("SW Design");
@@ -160,7 +156,7 @@ public class PopulateSawBuild2Actions {
if (isSwDesign) {
// transition to analyze
Result result =
- dtwm.transitionTo(TeamState.Analyze, teamWf.getAssignees().iterator().next(), false, transaction);
+ dtwm.transitionTo(TeamState.Analyze, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to Analyze state: [%s]", teamWf.toStringWithId(),
toState.getName(), result.getText());
@@ -175,8 +171,7 @@ public class PopulateSawBuild2Actions {
}
// transition to authorize
- result =
- dtwm.transitionTo(TeamState.Authorize, teamWf.getAssignees().iterator().next(), false, transaction);
+ result = dtwm.transitionTo(TeamState.Authorize, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to Authorize state: [%s]",
teamWf.toStringWithId(), toState.getName(), result.getText());
@@ -192,7 +187,7 @@ public class PopulateSawBuild2Actions {
}
}
// Transition to final state
- Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, transaction);
+ Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to state [%s]: [%s]", teamWf.toStringWithId(),
toState.getName(), result.getText());
@@ -203,15 +198,13 @@ public class PopulateSawBuild2Actions {
teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
}
- teamWf.persist(transaction);
-
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
- teamWf.persist(transaction);
+ changes.add(teamWf);
}
return actionArt;
}
- private static ActionArtifact sawBuild2Action2_createUnCommittedAction(SkynetTransaction transaction) throws OseeCoreException {
+ private static ActionArtifact sawBuild2Action2_createUnCommittedAction(IAtsChangeSet changes) throws OseeCoreException {
String title = "SAW (uncommitted) More Reqt Changes for Diagram View";
Collection<IAtsActionableItem> aias =
DemoDbUtil.getActionableItems(new String[] {
@@ -225,7 +218,7 @@ public class PopulateSawBuild2Actions {
ActionArtifact actionArt =
ActionManager.createAction(null, title, "Problem with the Diagram View", ChangeType.Problem, priority, false,
- null, aias, createdDate, createdBy, null, transaction);
+ null, aias, createdDate, createdBy, null, changes);
for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
boolean isSwDesign = teamWf.getTeamDefinition().getName().contains("SW Design");
@@ -236,7 +229,7 @@ public class PopulateSawBuild2Actions {
if (isSwDesign) {
// transition to analyze
Result result =
- dtwm.transitionTo(TeamState.Analyze, teamWf.getAssignees().iterator().next(), false, transaction);
+ dtwm.transitionTo(TeamState.Analyze, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to Analyze state [%s] error [%s]",
teamWf.toStringWithId(), toState.getName(), result.getText());
@@ -251,8 +244,7 @@ public class PopulateSawBuild2Actions {
}
// transition to authorize
- result =
- dtwm.transitionTo(TeamState.Authorize, teamWf.getAssignees().iterator().next(), false, transaction);
+ result = dtwm.transitionTo(TeamState.Authorize, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to Authorize state: [%s]",
teamWf.toStringWithId(), toState.getName(), result.getText());
@@ -269,7 +261,7 @@ public class PopulateSawBuild2Actions {
}
// Transition to final state
- Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, transaction);
+ Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to state [%s]: [%s]", teamWf.toStringWithId(),
toState.getName(), result.getText());
@@ -280,15 +272,13 @@ public class PopulateSawBuild2Actions {
teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
}
- teamWf.persist(transaction);
-
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
- teamWf.persist(transaction);
+ changes.add(teamWf);
}
return actionArt;
}
- private static ActionArtifact sawBuild2Action1_createCommittedAction(SkynetTransaction transaction) throws OseeCoreException {
+ private static ActionArtifact sawBuild2Action1_createCommittedAction(IAtsChangeSet changes) throws OseeCoreException {
String title = "SAW (committed) Reqt Changes for Diagram View";
Collection<IAtsActionableItem> aias =
DemoDbUtil.getActionableItems(new String[] {
@@ -301,7 +291,7 @@ public class PopulateSawBuild2Actions {
ActionArtifact actionArt =
ActionManager.createAction(null, title, "Problem with the Diagram View", ChangeType.Problem, priority, false,
- null, aias, createdDate, createdBy, null, transaction);
+ null, aias, createdDate, createdBy, null, changes);
for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
if (teamWf.getTeamDefinition().getName().contains("Req") && !teamWf.getWorkDefinition().getName().equals(
@@ -327,7 +317,7 @@ public class PopulateSawBuild2Actions {
TransitionOption.OverrideTransitionValidityCheck);
// Transition to desired state
- Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, transaction);
+ Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to state [%s]: [%s]", teamWf.toStringWithId(),
toState.getName(), result.getText());
@@ -338,9 +328,8 @@ public class PopulateSawBuild2Actions {
teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
}
- teamWf.persist(transaction);
+ changes.add(teamWf);
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
- teamWf.persist(transaction);
}
return actionArt;
}
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java
index 86d0d45463..c1466c2d69 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java
@@ -16,6 +16,7 @@ import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.client.demo.DemoArtifactTypes;
import org.eclipse.osee.ats.client.demo.DemoUsers;
import org.eclipse.osee.ats.client.demo.internal.Activator;
@@ -34,14 +35,13 @@ import org.eclipse.osee.ats.core.client.review.defect.ReviewDefectItem.Severity;
import org.eclipse.osee.ats.core.client.review.role.Role;
import org.eclipse.osee.ats.core.client.review.role.UserRole;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.artifact.search.QueryOptions;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
/**
* @author Donald G. Dunne
@@ -49,11 +49,10 @@ import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
public class DemoDbReviews {
public static void createReviews(boolean DEBUG) throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Populate Demo DB - Create Reviews");
- createPeerToPeerReviews(DEBUG, transaction);
- createDecisionReviews(DEBUG, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet("Populate Demo DB - Create Reviews");
+ createPeerToPeerReviews(DEBUG, changes);
+ createDecisionReviews(DEBUG, changes);
+ changes.execute();
}
/**
@@ -63,7 +62,7 @@ public class DemoDbReviews {
* 3) Decision in Complete state w Joe Smith assignee and completed<br>
* <br>
*/
- public static void createDecisionReviews(boolean DEBUG, SkynetTransaction transaction) throws Exception {
+ public static void createDecisionReviews(boolean DEBUG, IAtsChangeSet changes) throws Exception {
Date createdDate = new Date();
IAtsUser createdBy = AtsClientService.get().getUserAdmin().getCurrentUser();
@@ -76,21 +75,21 @@ public class DemoDbReviews {
// Create a Decision review and transition to ReWork
DecisionReviewArtifact reviewArt =
- ValidateReviewManager.createValidateReview(firstTestArt, true, createdDate, createdBy, transaction);
+ ValidateReviewManager.createValidateReview(firstTestArt, true, createdDate, createdBy, changes);
Result result =
- DecisionReviewManager.transitionTo(reviewArt, DecisionReviewState.Followup, createdBy, false, transaction);
+ DecisionReviewManager.transitionTo(reviewArt, DecisionReviewState.Followup, createdBy, false, changes);
if (result.isFalse()) {
throw new IllegalStateException("Failed transitioning review to Followup: " + result.getText());
}
- reviewArt.persist(transaction);
+ changes.add(reviewArt);
// Create a Decision review and transition to Completed
- reviewArt = ValidateReviewManager.createValidateReview(secondTestArt, true, createdDate, createdBy, transaction);
- DecisionReviewManager.transitionTo(reviewArt, DecisionReviewState.Completed, createdBy, false, transaction);
+ reviewArt = ValidateReviewManager.createValidateReview(secondTestArt, true, createdDate, createdBy, changes);
+ DecisionReviewManager.transitionTo(reviewArt, DecisionReviewState.Completed, createdBy, false, changes);
if (result.isFalse()) {
throw new IllegalStateException("Failed transitioning review to Completed: " + result.getText());
}
- reviewArt.persist(transaction);
+ changes.add(reviewArt);
}
@@ -118,7 +117,7 @@ public class DemoDbReviews {
* 3) PeerToPeer in Prepare state w Joe Smith assignee and completed<br>
* <br>
*/
- public static void createPeerToPeerReviews(boolean DEBUG, SkynetTransaction transaction) throws Exception {
+ public static void createPeerToPeerReviews(boolean DEBUG, IAtsChangeSet changes) throws Exception {
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "Create Peer To Peer reviews");
@@ -129,41 +128,38 @@ public class DemoDbReviews {
// Create a PeerToPeer review and leave in Prepare state
PeerToPeerReviewArtifact reviewArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(firstCodeArt, "Peer Review first set of code changes",
- firstCodeArt.getStateMgr().getCurrentStateName(), transaction);
- reviewArt.persist(transaction);
+ firstCodeArt.getStateMgr().getCurrentStateName(), changes);
// Create a PeerToPeer review and transition to Review state
reviewArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(firstCodeArt, "Peer Review algorithm used in code",
- firstCodeArt.getStateMgr().getCurrentStateName(), transaction);
+ firstCodeArt.getStateMgr().getCurrentStateName(), changes);
List<UserRole> roles = new ArrayList<UserRole>();
- roles.add(new UserRole(Role.Author,
- AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Joe_Smith)));
- roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(
- DemoUsers.Kay_Jones)));
- roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(
- DemoUsers.Alex_Kay), 2.0, true));
+ roles.add(new UserRole(Role.Author, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Joe_Smith)));
+ roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Kay_Jones)));
+ roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay),
+ 2.0, true));
Result result =
PeerToPeerReviewManager.transitionTo(reviewArt, PeerToPeerReviewState.Review, roles, null,
- AtsClientService.get().getUserAdmin().getCurrentUser(), false, transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), false, changes);
if (result.isFalse()) {
throw new IllegalStateException("Failed transitioning review to Review: " + result.getText());
}
- reviewArt.persist(transaction);
+ changes.add(reviewArt);
// Create a PeerToPeer review and transition to Completed
reviewArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(secondCodeArt, "Review new logic",
secondCodeArt.getStateMgr().getCurrentStateName(), new Date(),
AtsClientService.get().getUserAdmin().getUserFromOseeUser(DemoDbUtil.getDemoUser(DemoUsers.Kay_Jones)),
- transaction);
+ changes);
roles = new ArrayList<UserRole>();
- roles.add(new UserRole(Role.Author,
- AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Kay_Jones), 2.3, true));
- roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(
- DemoUsers.Joe_Smith), 4.5, true));
- roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(
- DemoUsers.Alex_Kay), 2.0, true));
+ roles.add(new UserRole(Role.Author, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Kay_Jones),
+ 2.3, true));
+ roles.add(new UserRole(Role.Reviewer,
+ AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Joe_Smith), 4.5, true));
+ roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay),
+ 2.0, true));
List<ReviewDefectItem> defects = new ArrayList<ReviewDefectItem>();
defects.add(new ReviewDefectItem(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay),
@@ -186,9 +182,9 @@ public class DemoDbReviews {
}
result =
PeerToPeerReviewManager.transitionTo(reviewArt, PeerToPeerReviewState.Completed, roles, defects,
- AtsClientService.get().getUserAdmin().getCurrentUser(), false, transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), false, changes);
if (result.isTrue()) {
- reviewArt.persist(transaction);
+ changes.add(reviewArt);
}
if (result.isFalse()) {
throw new IllegalStateException("Failed transitioning review to Completed: " + result.getText());
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/CreateGoalTestDemoArtifacts.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/CreateGoalTestDemoArtifacts.java
index 9e8cee2468..4f035387f2 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/CreateGoalTestDemoArtifacts.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/CreateGoalTestDemoArtifacts.java
@@ -15,6 +15,7 @@ import java.util.Date;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.artifact.GoalManager;
import org.eclipse.osee.ats.client.demo.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
@@ -24,6 +25,7 @@ import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewManager;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.util.AtsUtil;
@@ -31,8 +33,6 @@ import org.eclipse.osee.ats.world.WorldEditor;
import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
@@ -60,104 +60,88 @@ public class CreateGoalTestDemoArtifacts extends XNavigateItemAction {
return;
}
createdDate = new Date();
+ AtsChangeSet changes = new AtsChangeSet(getName());
createdBy = AtsClientService.get().getUserAdmin().getCurrentUser();
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), getName());
- GoalArtifact sawCodeGoal = GoalManager.createGoal("SAW Code");
- GoalArtifact sawTestGoal = GoalManager.createGoal("SAW Test");
- GoalArtifact toolsTeamGoal = GoalManager.createGoal("Tools Team");
- GoalArtifact facilitiesGoal = GoalManager.createGoal("Facilities Team");
- GoalArtifact cisReqGoal = GoalManager.createGoal("CIS Requirements");
-
- TeamWorkFlowArtifact teamArt = createAction1(transaction, sawCodeGoal);
-
- createAction2(transaction, sawCodeGoal, cisReqGoal);
-
- createAction3(transaction, sawTestGoal, cisReqGoal);
-
- teamArt = createAction456(transaction, sawCodeGoal, facilitiesGoal, teamArt);
-
- createAction7(transaction, facilitiesGoal);
+ GoalArtifact sawCodeGoal = GoalManager.createGoal("SAW Code", changes);
+ GoalArtifact sawTestGoal = GoalManager.createGoal("SAW Test", changes);
+ GoalArtifact toolsTeamGoal = GoalManager.createGoal("Tools Team", changes);
+ GoalArtifact facilitiesGoal = GoalManager.createGoal("Facilities Team", changes);
+ GoalArtifact cisReqGoal = GoalManager.createGoal("CIS Requirements", changes);
+
+ TeamWorkFlowArtifact teamArt = createAction1(changes, sawCodeGoal);
+ createAction2(changes, sawCodeGoal, cisReqGoal);
+ createAction3(changes, sawTestGoal, cisReqGoal);
+ teamArt = createAction456(changes, sawCodeGoal, facilitiesGoal, teamArt);
+ createAction7(changes, facilitiesGoal);
for (String name : Arrays.asList("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P",
"Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "AA", "BB", "CC", "DD", "EE", "FF", "GG", "HH", "II", "JJ",
"KK", "LL", "MM", "NN", "OO", "PP", "QQ", "RR")) {
TaskArtifact taskArt = teamArt.createNewTask("Task " + name, createdDate, createdBy);
toolsTeamGoal.addMember(taskArt);
- taskArt.persist(transaction);
+ changes.add(taskArt);
}
- toolsTeamGoal.persist(transaction);
-
- transaction.execute();
+ changes.add(toolsTeamGoal);
+ changes.execute();
WorldEditor.open(new WorldEditorSimpleProvider("Goals", Arrays.asList(sawCodeGoal, sawTestGoal, toolsTeamGoal,
facilitiesGoal, cisReqGoal)));
}
- private void createAction7(SkynetTransaction transaction, GoalArtifact facilitiesGoal) throws OseeCoreException {
+ private void createAction7(IAtsChangeSet changes, GoalArtifact facilitiesGoal) throws OseeCoreException {
Artifact action =
ActionManager.createAction(null, "Add the Improvement", "Description", ChangeType.Improvement, "4", false,
- null, ActionableItems.getActionableItems(Arrays.asList("Network")), createdDate, createdBy, null,
- transaction);
- action.persist(transaction);
+ null, ActionableItems.getActionableItems(Arrays.asList("Network")), createdDate, createdBy, null, changes);
facilitiesGoal.addMember(action);
- facilitiesGoal.persist(transaction);
+ changes.add(facilitiesGoal);
}
- private TeamWorkFlowArtifact createAction456(SkynetTransaction transaction, GoalArtifact sawCodeGoal, GoalArtifact facilitiesGoal, TeamWorkFlowArtifact teamArt) throws OseeCoreException {
+ private TeamWorkFlowArtifact createAction456(IAtsChangeSet changes, GoalArtifact sawCodeGoal, GoalArtifact facilitiesGoal, TeamWorkFlowArtifact teamArt) throws OseeCoreException {
for (String msaTool : Arrays.asList("Backups", "Computers", "Network")) {
Artifact action =
ActionManager.createAction(null, "Fix " + msaTool + " button", "Description", ChangeType.Problem, "4",
false, null, ActionableItems.getActionableItems(Arrays.asList(msaTool)), createdDate, createdBy, null,
- transaction);
- action.persist(transaction);
+ changes);
facilitiesGoal.addMember(ActionManager.getFirstTeam(action));
teamArt = ActionManager.getFirstTeam(action);
TaskArtifact taskArt = teamArt.createNewTask("Task 1", createdDate, createdBy);
sawCodeGoal.addMember(taskArt);
- taskArt.persist(transaction);
+ changes.add(taskArt);
taskArt = teamArt.createNewTask("Task 2", createdDate, createdBy);
facilitiesGoal.addMember(taskArt);
- taskArt.persist(transaction);
+ changes.add(taskArt);
}
return teamArt;
}
- private void createAction3(SkynetTransaction transaction, GoalArtifact sawCodeGoal, GoalArtifact cisReqGoal) throws OseeCoreException {
+ private void createAction3(IAtsChangeSet changes, GoalArtifact sawCodeGoal, GoalArtifact cisReqGoal) throws OseeCoreException {
Artifact action =
ActionManager.createAction(null, "Remove Workflow button", "Description", ChangeType.Problem, "4", false,
null, ActionableItems.getActionableItems(Arrays.asList("SAW Code", "CIS Requirements")), createdDate,
- createdBy, null, transaction);
- action.persist(transaction);
+ createdBy, null, changes);
sawCodeGoal.addMember(ActionManager.getFirstTeam(action));
cisReqGoal.addMember(ActionManager.getFirstTeam(action));
- ActionManager.getFirstTeam(action).persist(transaction);
}
- private void createAction2(SkynetTransaction transaction, GoalArtifact sawCodeGoal, GoalArtifact cisReqGoal) throws OseeCoreException {
+ private void createAction2(IAtsChangeSet changes, GoalArtifact sawCodeGoal, GoalArtifact cisReqGoal) throws OseeCoreException {
ActionArtifact action =
ActionManager.createAction(null, "Add CDB Check Signals", "Description", ChangeType.Problem, "4", false, null,
ActionableItems.getActionableItems(Arrays.asList("SAW Code", "CIS Requirements")), createdDate, createdBy,
- null, transaction);
- action.persist(transaction);
+ null, changes);
sawCodeGoal.addMember(ActionManager.getFirstTeam(action));
cisReqGoal.addMember(ActionManager.getFirstTeam(action));
- for (TeamWorkFlowArtifact teamArt2 : action.getTeams()) {
- teamArt2.persist(transaction);
- }
}
- private TeamWorkFlowArtifact createAction1(SkynetTransaction transaction, GoalArtifact sawCodeGoal) throws OseeCoreException {
+ private TeamWorkFlowArtifact createAction1(IAtsChangeSet changes, GoalArtifact sawCodeGoal) throws OseeCoreException {
Artifact action =
ActionManager.createAction(null, "Fix this model", "Description", ChangeType.Problem, "2", false, null,
- ActionableItems.getActionableItems(Arrays.asList("SAW Code")), createdDate, createdBy, null, transaction);
- action.persist(transaction);
+ ActionableItems.getActionableItems(Arrays.asList("SAW Code")), createdDate, createdBy, null, changes);
sawCodeGoal.addMember(ActionManager.getFirstTeam(action));
TeamWorkFlowArtifact teamArt = ActionManager.getFirstTeam(action);
PeerToPeerReviewArtifact peerReviewArt =
- PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt, "New Review", "Implement", transaction);
+ PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt, "New Review", "Implement", changes);
sawCodeGoal.addMember(peerReviewArt);
- teamArt.persist(transaction);
return teamArt;
}
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/access/AtsBranchAccessManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/access/AtsBranchAccessManagerTest.java
index 89042b3170..32db765db4 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/access/AtsBranchAccessManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/access/AtsBranchAccessManagerTest.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.ats.client.integration.tests.ats.access;
import static java.lang.Thread.sleep;
import java.util.Arrays;
-import org.junit.Assert;
import org.eclipse.osee.ats.access.AtsBranchAccessManager;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.client.demo.DemoActionableItems;
@@ -34,6 +33,7 @@ import org.eclipse.osee.framework.skynet.core.event.OseeEventService;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.osgi.framework.Bundle;
@@ -117,9 +117,6 @@ public class AtsBranchAccessManagerTest {
* {@link org.eclipse.osee.ats.access.AtsBranchAccessManager#getContextId(org.eclipse.osee.framework.skynet.core.artifact.Artifact)}
* {@link org.eclipse.osee.ats.access.AtsBranchAccessManager#getEventFilters()}.
* {@link org.eclipse.osee.ats.access.AtsBranchAccessManager#handleArtifactEvent(org.eclipse.osee.framework.skynet.core.event.model.ArtifactEvent, org.eclipse.osee.framework.skynet.core.event.model.Sender)}
- *
- * @throws OseeCoreException
- * @throws InterruptedException
*/
@Test
public void testGetContextIdBranch() throws Exception {
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/CancelledDateColumnTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/CancelledDateColumnTest.java
index f63a1a2370..168cee2943 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/CancelledDateColumnTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/CancelledDateColumnTest.java
@@ -13,21 +13,19 @@ package org.eclipse.osee.ats.client.integration.tests.ats.column;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.client.integration.tests.util.DemoTestUtil;
import org.eclipse.osee.ats.column.CancelledDateColumn;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
-import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.jdk.core.util.DateUtil;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.support.test.util.TestUtil;
import org.junit.AfterClass;
import org.junit.Assert;
@@ -49,12 +47,12 @@ public class CancelledDateColumnTest {
public void testGetDateAndStrAndColumnText() throws Exception {
SevereLoggingMonitor loggingMonitor = TestUtil.severeLoggingStart();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), CancelledDateColumnTest.class.getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(CancelledDateColumnTest.class.getSimpleName());
TeamWorkFlowArtifact teamArt =
- DemoTestUtil.createSimpleAction(CancelledDateColumnTest.class.getSimpleName(), transaction);
- transaction.execute();
+ DemoTestUtil.createSimpleAction(CancelledDateColumnTest.class.getSimpleName(), changes);
+ changes.execute();
+ changes.clear();
Assert.assertEquals("",
CancelledDateColumn.getInstance().getColumnText(teamArt, CancelledDateColumn.getInstance(), 0));
Date date = CancelledDateColumn.getDate(teamArt);
@@ -63,12 +61,13 @@ public class CancelledDateColumnTest {
TransitionHelper helper =
new TransitionHelper("Transition to Cancelled", Arrays.asList(teamArt), TeamState.Cancelled.getName(), null,
- "reason", TransitionOption.OverrideTransitionValidityCheck, TransitionOption.OverrideAssigneeCheck);
+ "reason", changes, TransitionOption.OverrideTransitionValidityCheck, TransitionOption.OverrideAssigneeCheck);
TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
Assert.assertTrue(results.toString(), results.isEmpty());
- transitionMgr.getTransaction().execute();
+ changes.execute();
+ changes.clear();
date = CancelledDateColumn.getDate(teamArt);
Assert.assertNotNull(date);
Assert.assertEquals(DateUtil.getMMDDYYHHMM(date), CancelledDateColumn.getDateStr(teamArt));
@@ -77,12 +76,12 @@ public class CancelledDateColumnTest {
helper =
new TransitionHelper("Transition to Endorse", Arrays.asList(teamArt), TeamState.Endorse.getName(),
- Collections.singleton(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.OverrideTransitionValidityCheck,
- TransitionOption.OverrideAssigneeCheck);
+ Collections.singleton(AtsClientService.get().getUserAdmin().getCurrentUser()), null, changes,
+ TransitionOption.OverrideTransitionValidityCheck, TransitionOption.OverrideAssigneeCheck);
transitionMgr = new TransitionManager(helper);
results = transitionMgr.handleAll();
Assert.assertTrue(results.toString(), results.isEmpty());
- transitionMgr.getTransaction().execute();
+ changes.execute();
Assert.assertEquals("Cancelled date should be blank again", "",
CancelledDateColumn.getInstance().getColumnText(teamArt, CancelledDateColumn.getInstance(), 0));
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/CompletedDateColumnTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/CompletedDateColumnTest.java
index f65b6b0615..2ec96f8f8d 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/CompletedDateColumnTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/CompletedDateColumnTest.java
@@ -12,21 +12,19 @@ package org.eclipse.osee.ats.client.integration.tests.ats.column;
import java.util.Arrays;
import java.util.Date;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.client.integration.tests.util.DemoTestUtil;
import org.eclipse.osee.ats.column.CompletedDateColumn;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
-import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.jdk.core.util.DateUtil;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.support.test.util.TestUtil;
import org.junit.AfterClass;
import org.junit.Assert;
@@ -48,12 +46,12 @@ public class CompletedDateColumnTest {
public void testGetDateAndStrAndColumnText() throws Exception {
SevereLoggingMonitor loggingMonitor = TestUtil.severeLoggingStart();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), CompletedDateColumnTest.class.getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(CancelledDateColumnTest.class.getSimpleName());
TeamWorkFlowArtifact teamArt =
- DemoTestUtil.createSimpleAction(CompletedDateColumnTest.class.getSimpleName(), transaction);
- transaction.execute();
+ DemoTestUtil.createSimpleAction(CompletedDateColumnTest.class.getSimpleName(), changes);
+ changes.execute();
+ changes.clear();
Assert.assertEquals("",
CompletedDateColumn.getInstance().getColumnText(teamArt, CompletedDateColumn.getInstance(), 0));
Date date = CompletedDateColumn.getDate(teamArt);
@@ -62,12 +60,13 @@ public class CompletedDateColumnTest {
TransitionHelper helper =
new TransitionHelper("Transition to Completed", Arrays.asList(teamArt), TeamState.Completed.getName(), null,
- null, TransitionOption.OverrideTransitionValidityCheck, TransitionOption.OverrideAssigneeCheck);
+ null, changes, TransitionOption.OverrideTransitionValidityCheck, TransitionOption.OverrideAssigneeCheck);
TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
Assert.assertTrue(results.toString(), results.isEmpty());
- transitionMgr.getTransaction().execute();
+ changes.execute();
+ changes.clear();
date = CompletedDateColumn.getDate(teamArt);
Assert.assertNotNull(date);
Assert.assertEquals(DateUtil.getMMDDYYHHMM(date), CompletedDateColumn.getDateStr(teamArt));
@@ -76,12 +75,12 @@ public class CompletedDateColumnTest {
helper =
new TransitionHelper("Transition to Endorse", Arrays.asList(teamArt), TeamState.Endorse.getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.OverrideTransitionValidityCheck,
- TransitionOption.OverrideAssigneeCheck);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, changes,
+ TransitionOption.OverrideTransitionValidityCheck, TransitionOption.OverrideAssigneeCheck);
transitionMgr = new TransitionManager(helper);
results = transitionMgr.handleAll();
Assert.assertTrue(results.toString(), results.isEmpty());
- transitionMgr.getTransaction().execute();
+ changes.execute();
Assert.assertEquals("Cancelled date should be blank again", "",
CompletedDateColumn.getInstance().getColumnText(teamArt, CompletedDateColumn.getInstance(), 0));
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/DeadlineColumnTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/DeadlineColumnTest.java
index 554139e581..d6d30d97ef 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/DeadlineColumnTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/DeadlineColumnTest.java
@@ -17,11 +17,9 @@ import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil
import org.eclipse.osee.ats.client.integration.tests.util.DemoTestUtil;
import org.eclipse.osee.ats.column.DeadlineColumn;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.framework.jdk.core.util.DateUtil;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.support.test.util.TestUtil;
import org.junit.AfterClass;
import org.junit.Assert;
@@ -43,11 +41,10 @@ public class DeadlineColumnTest {
public void testGetColumnText() throws Exception {
SevereLoggingMonitor loggingMonitor = TestUtil.severeLoggingStart();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), CancelledDateColumnTest.class.getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(CancelledDateColumnTest.class.getSimpleName());
TeamWorkFlowArtifact teamArt =
- DemoTestUtil.createSimpleAction(CancelledDateColumnTest.class.getSimpleName(), transaction);
- transaction.execute();
+ DemoTestUtil.createSimpleAction(CancelledDateColumnTest.class.getSimpleName(), changes);
+ changes.execute();
Assert.assertNull(DeadlineColumn.getDate(teamArt));
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/EstimatedHoursColumnTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/EstimatedHoursColumnTest.java
index 75b06b306a..7c8e317aec 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/EstimatedHoursColumnTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/EstimatedHoursColumnTest.java
@@ -19,12 +19,10 @@ import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewManager;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.EstimatedHoursUtil;
-import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.support.test.util.TestUtil;
import org.junit.AfterClass;
import org.junit.Assert;
@@ -46,25 +44,26 @@ public class EstimatedHoursColumnTest {
public void testGetDateAndStrAndColumnText() throws Exception {
SevereLoggingMonitor loggingMonitor = TestUtil.severeLoggingStart();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), EstimatedHoursColumnTest.class.getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(EstimatedHoursColumnTest.class.getSimpleName());
TeamWorkFlowArtifact teamArt1 =
- DemoTestUtil.createSimpleAction(EstimatedHoursColumnTest.class.getSimpleName(), transaction);
+ DemoTestUtil.createSimpleAction(EstimatedHoursColumnTest.class.getSimpleName(), changes);
Artifact actionArt = teamArt1.getParentActionArtifact();
TeamWorkFlowArtifact teamArt2 =
- DemoTestUtil.addTeamWorkflow(actionArt, EstimatedHoursColumnTest.class.getSimpleName(), transaction);
+ DemoTestUtil.addTeamWorkflow(actionArt, EstimatedHoursColumnTest.class.getSimpleName(), changes);
TaskArtifact taskArt1 =
- teamArt1.createNewTask(EstimatedHoursColumnTest.class.getSimpleName(), new Date(), AtsClientService.get().getUserAdmin().getCurrentUser());
- taskArt1.persist(transaction);
+ teamArt1.createNewTask(EstimatedHoursColumnTest.class.getSimpleName(), new Date(),
+ AtsClientService.get().getUserAdmin().getCurrentUser());
+ changes.add(taskArt1);
TaskArtifact taskArt2 =
- teamArt1.createNewTask(EstimatedHoursColumnTest.class.getSimpleName(), new Date(), AtsClientService.get().getUserAdmin().getCurrentUser());
- taskArt2.persist(transaction);
+ teamArt1.createNewTask(EstimatedHoursColumnTest.class.getSimpleName(), new Date(),
+ AtsClientService.get().getUserAdmin().getCurrentUser());
+ changes.add(taskArt2);
PeerToPeerReviewArtifact peerArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt1, getClass().getSimpleName(),
- teamArt1.getStateMgr().getCurrentStateName(), transaction);
- peerArt.persist(transaction);
- transaction.execute();
+ teamArt1.getStateMgr().getCurrentStateName(), changes);
+ changes.add(peerArt);
+ changes.execute();
Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(actionArt), 0);
Assert.assertEquals(0.0, EstimatedHoursUtil.getEstimatedHours(teamArt1), 0);
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/NumberOfTasksAndInWorkTasksColumnsTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/NumberOfTasksAndInWorkTasksColumnsTest.java
index 55ad70f6c4..6ad77287b8 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/NumberOfTasksAndInWorkTasksColumnsTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/NumberOfTasksAndInWorkTasksColumnsTest.java
@@ -20,12 +20,10 @@ import org.eclipse.osee.ats.column.NumberOfTasksRemainingColumn;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.task.TaskManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.support.test.util.TestUtil;
import org.junit.Assert;
@@ -48,21 +46,18 @@ public class NumberOfTasksAndInWorkTasksColumnsTest {
TaskArtifact taskArt = codeArt.getTaskArtifacts().iterator().next();
Collection<IAtsUser> taskAssignees = new HashSet<IAtsUser>();
taskAssignees.addAll(codeArt.getStateMgr().getAssignees());
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), getClass().getSimpleName());
- Result result = TaskManager.transitionToCompleted(taskArt, 0.0, 2, transaction);
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ Result result = TaskManager.transitionToCompleted(taskArt, 0.0, 2, changes);
Assert.assertEquals(true, result.isTrue());
- taskArt.persist(transaction);
- transaction.execute();
+ changes.execute();
Assert.assertEquals("6", NumberOfTasksColumn.getInstance().getColumnText(codeArt, null, 0));
Assert.assertEquals("5", NumberOfTasksRemainingColumn.getInstance().getColumnText(codeArt, null, 0));
- transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), getClass().getSimpleName());
- result = TaskManager.transitionToInWork(taskArt, taskAssignees.iterator().next(), 0, -2, transaction);
+ changes.clear();
+ result = TaskManager.transitionToInWork(taskArt, taskAssignees.iterator().next(), 0, -2, changes);
Assert.assertEquals(true, result.isTrue());
- taskArt.persist(transaction);
- transaction.execute();
+ changes.execute();
Assert.assertEquals("6", NumberOfTasksColumn.getInstance().getColumnText(codeArt, null, 0));
Assert.assertEquals("6", NumberOfTasksRemainingColumn.getInstance().getColumnText(codeArt, null, 0));
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/PeerToPeerReviewColumnsTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/PeerToPeerReviewColumnsTest.java
index cbb0cbaa52..6a7b88db24 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/PeerToPeerReviewColumnsTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/column/PeerToPeerReviewColumnsTest.java
@@ -34,10 +34,8 @@ import org.eclipse.osee.ats.core.client.review.role.Role;
import org.eclipse.osee.ats.core.client.review.role.UserRole;
import org.eclipse.osee.ats.core.client.review.role.UserRoleManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.support.test.util.TestUtil;
import org.junit.AfterClass;
import org.junit.Assert;
@@ -58,16 +56,15 @@ public class PeerToPeerReviewColumnsTest {
@org.junit.Test
public void testGetColumnText() throws Exception {
SevereLoggingMonitor loggingMonitor = TestUtil.severeLoggingStart();
+ AtsChangeSet changes = new AtsChangeSet(PeerToPeerReviewColumnsTest.class.getSimpleName());
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), PeerToPeerReviewColumnsTest.class.getSimpleName());
TeamWorkFlowArtifact teamArt =
- DemoTestUtil.createSimpleAction(PeerToPeerReviewColumnsTest.class.getSimpleName(), transaction);
+ DemoTestUtil.createSimpleAction(PeerToPeerReviewColumnsTest.class.getSimpleName(), changes);
PeerToPeerReviewArtifact peerArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt, getClass().getSimpleName(),
- teamArt.getStateMgr().getCurrentStateName(), transaction);
- peerArt.persist(transaction);
- transaction.execute();
+ teamArt.getStateMgr().getCurrentStateName(), changes);
+ changes.add(peerArt);
+ changes.execute();
Assert.assertEquals("0", ReviewNumIssuesColumn.getInstance().getColumnText(peerArt, null, 0));
Assert.assertEquals("0", ReviewNumMajorDefectsColumn.getInstance().getColumnText(peerArt, null, 0));
@@ -76,8 +73,7 @@ public class PeerToPeerReviewColumnsTest {
Assert.assertEquals("", ReviewModeratorColumn.getInstance().getColumnText(peerArt, null, 0));
Assert.assertEquals("", ReviewReviewerColumn.getInstance().getColumnText(peerArt, null, 0));
- transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), PeerToPeerReviewColumnsTest.class.getSimpleName());
+ changes.clear();
ReviewDefectItem item =
new ReviewDefectItem(AtsClientService.get().getUserAdmin().getCurrentUser(), Severity.Issue, Disposition.None,
InjectionActivity.Code, "description", "resolution", "location", new Date());
@@ -126,9 +122,9 @@ public class PeerToPeerReviewColumnsTest {
roleMgr.addOrUpdateUserRole(role, peerArt);
role = new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Kay_Jones));
roleMgr.addOrUpdateUserRole(role, peerArt);
- roleMgr.saveToArtifact(transaction);
- peerArt.persist(transaction);
- transaction.execute();
+ roleMgr.saveToArtifact(changes);
+ changes.add(peerArt);
+ changes.execute();
Assert.assertEquals("4", ReviewNumIssuesColumn.getInstance().getColumnText(peerArt, null, 0));
Assert.assertEquals("1", ReviewNumMajorDefectsColumn.getInstance().getColumnText(peerArt, null, 0));
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java
index 9860a732ee..e888e1abee 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java
@@ -29,6 +29,7 @@ import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.core.config.AtsVersionService;
@@ -146,10 +147,9 @@ public class AtsBranchConfigurationTest {
versionToTarget.setAllowCommitBranch(true);
versionToTarget.setAllowCreateBranch(true);
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
- AtsClientService.get().storeConfigObject(versionToTarget, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ AtsClientService.get().storeConfigObject(versionToTarget, changes);
+ changes.execute();
TestUtil.sleep(2000);
@@ -163,15 +163,14 @@ public class AtsBranchConfigurationTest {
ActionableItems.getActionableItems(appendToName(BRANCH_VIA_VERSIONS, "A1"));
assertFalse(selectedActionableItems.isEmpty());
- transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Branch Configuration Test");
+ changes.clear();
Artifact actionArt =
ActionManager.createAction(null, BRANCH_VIA_VERSIONS.getName() + " Req Changes", "description",
ChangeType.Problem, "1", false, null, selectedActionableItems, new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), null, transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
TeamWorkFlowArtifact teamWf = ActionManager.getTeams(actionArt).iterator().next();
AtsVersionService.get().setTargetedVersionAndStore(teamWf, versionToTarget);
- teamWf.persist(transaction);
- transaction.execute();
+ changes.execute();
TeamWorkFlowManager dtwm = new TeamWorkFlowManager(teamWf);
@@ -180,7 +179,7 @@ public class AtsBranchConfigurationTest {
OseeLog.log(AtsBranchConfigurationTest.class, Level.INFO, "Transitioning to Implement state");
}
- dtwm.transitionTo(TeamState.Implement, AtsClientService.get().getUserAdmin().getCurrentUser(), false, transaction);
+ dtwm.transitionTo(TeamState.Implement, AtsClientService.get().getUserAdmin().getCurrentUser(), false, changes);
teamWf.persist("Branch Configuration Test");
SMAEditor.editArtifact(teamWf);
@@ -261,10 +260,9 @@ public class AtsBranchConfigurationTest {
// setup team def to allow create/commit of branch
teamDef.setAllowCommitBranch(true);
teamDef.setAllowCreateBranch(true);
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
- AtsClientService.get().storeConfigObject(teamDef, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ AtsClientService.get().storeConfigObject(teamDef, changes);
+ changes.execute();
TestUtil.sleep(2000);
@@ -276,13 +274,14 @@ public class AtsBranchConfigurationTest {
ActionableItems.getActionableItems(appendToName(BRANCH_VIA_TEAM_DEFINITION, "A1"));
assertFalse(selectedActionableItems.isEmpty());
- transaction =
+ SkynetTransaction transaction =
TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Test branch via team definition: create action");
String actionTitle = BRANCH_VIA_TEAM_DEFINITION.getName() + " Req Changes";
+ changes.clear();
Artifact actionArt =
ActionManager.createAction(null, actionTitle, "description", ChangeType.Problem, "1", false, null,
- selectedActionableItems, new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), null,
- transaction);
+ selectedActionableItems, new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
+ changes.addTo(transaction);
transaction.execute();
final TeamWorkFlowArtifact teamWf = ActionManager.getTeams(actionArt).iterator().next();
@@ -292,8 +291,8 @@ public class AtsBranchConfigurationTest {
if (DEBUG) {
OseeLog.log(AtsBranchConfigurationTest.class, Level.INFO, "Transitioning to Implement state");
}
- dtwm.transitionTo(TeamState.Implement, AtsClientService.get().getUserAdmin().getCurrentUser(), false, transaction);
- teamWf.persist("Test branch via team definition: Transition to desired state");
+ dtwm.transitionTo(TeamState.Implement, AtsClientService.get().getUserAdmin().getCurrentUser(), false, changes);
+ teamWf.persist("Test branch via team definition: create action");
// create branch
createBranch(namespace, teamWf);
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
index 789afd3594..00fbd6c822 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.IAtsDecisionReviewOption;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
@@ -29,6 +30,8 @@ import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.StateType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.client.demo.DemoSawBuilds;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
@@ -45,15 +48,14 @@ import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewManager;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.workdef.SimpleDecisionReviewOption;
import org.eclipse.osee.ats.core.workflow.state.StateTypeAdapter;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.editor.SMAEditor;
import org.eclipse.osee.ats.mocks.MockStateDefinition;
import org.eclipse.osee.ats.mocks.MockWidgetDefinition;
@@ -248,8 +250,7 @@ public class AtsTestUtil {
private static void reset(String postFixName) throws OseeCoreException {
AtsBulkLoad.reloadConfig(true);
AtsTestUtil.postFixName = postFixName;
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), AtsTestUtil.class.getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(AtsTestUtil.class.getSimpleName());
workDef = new MockWorkDefinition(WORK_DEF_NAME);
analyze = new MockStateDefinition("Analyze");
@@ -344,13 +345,11 @@ public class AtsTestUtil {
actionArt =
ActionManager.createAction(null, getTitle("Team WF", postFixName), "description", ChangeType.Improvement, "1",
false, null, Arrays.asList(testAi), new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(),
- null, transaction);
+ null, changes);
teamArt = actionArt.getFirstTeam();
- teamArt.persist(transaction);
- actionArt.persist(transaction);
- transaction.execute();
+ changes.execute();
}
public static TaskArtifact getOrCreateTaskOffTeamWf1() throws OseeCoreException {
@@ -517,20 +516,20 @@ public class AtsTestUtil {
TestUtil.sleep(4000);
}
- public static Result transitionTo(AtsTestUtilState atsTestUtilState, IAtsUser user, SkynetTransaction transaction, TransitionOption... transitionOptions) {
+ public static Result transitionTo(AtsTestUtilState atsTestUtilState, IAtsUser user, IAtsChangeSet changes, TransitionOption... transitionOptions) throws OseeCoreException {
if (atsTestUtilState == AtsTestUtilState.Analyze && teamArt.isInState(AtsTestUtilState.Analyze)) {
return Result.TrueResult;
}
if (atsTestUtilState == AtsTestUtilState.Cancelled) {
- Result result = transitionToState(teamArt, AtsTestUtilState.Cancelled, user, transaction, transitionOptions);
+ Result result = transitionToState(teamArt, AtsTestUtilState.Cancelled, user, changes, transitionOptions);
if (result.isFalse()) {
return result;
}
return Result.TrueResult;
}
- Result result = transitionToState(teamArt, AtsTestUtilState.Implement, user, transaction, transitionOptions);
+ Result result = transitionToState(teamArt, AtsTestUtilState.Implement, user, changes, transitionOptions);
if (result.isFalse()) {
return result;
}
@@ -540,7 +539,7 @@ public class AtsTestUtil {
}
if (atsTestUtilState == AtsTestUtilState.Completed) {
- result = transitionToState(teamArt, AtsTestUtilState.Completed, user, transaction, transitionOptions);
+ result = transitionToState(teamArt, AtsTestUtilState.Completed, user, changes, transitionOptions);
if (result.isFalse()) {
return result;
}
@@ -550,11 +549,11 @@ public class AtsTestUtil {
}
- private static Result transitionToState(TeamWorkFlowArtifact teamArt, IStateToken toState, IAtsUser user, SkynetTransaction transaction, TransitionOption... transitionOptions) {
+ private static Result transitionToState(TeamWorkFlowArtifact teamArt, IStateToken toState, IAtsUser user, IAtsChangeSet changes, TransitionOption... transitionOptions) throws OseeCoreException {
TransitionHelper helper =
new TransitionHelper("Transition to " + toState.getName(), Arrays.asList(teamArt), toState.getName(),
- Arrays.asList(user), null, transitionOptions);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ Arrays.asList(user), null, changes, transitionOptions);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
if (results.isEmpty()) {
return Result.TrueResult;
@@ -581,15 +580,14 @@ public class AtsTestUtil {
}
}
- public static PeerToPeerReviewArtifact getOrCreatePeerReview(ReviewBlockType reviewBlockType, AtsTestUtilState relatedToState, SkynetTransaction transaction) throws OseeCoreException {
+ public static PeerToPeerReviewArtifact getOrCreatePeerReview(ReviewBlockType reviewBlockType, AtsTestUtilState relatedToState, IAtsChangeSet changes) throws OseeCoreException {
ensureLoaded();
try {
if (peerRevArt == null) {
peerRevArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(
AtsClientService.get().getWorkDefinitionAdmin().getDefaultPeerToPeerWorkflowDefinitionMatch().getWorkDefinition(),
- teamArt, AtsTestUtil.class.getSimpleName() + " Test Peer Review", relatedToState.getName(),
- transaction);
+ teamArt, AtsTestUtil.class.getSimpleName() + " Test Peer Review", relatedToState.getName(), changes);
}
} catch (OseeCoreException ex) {
throw new OseeWrappedException(ex);
@@ -600,15 +598,13 @@ public class AtsTestUtil {
public static TeamWorkFlowArtifact getTeamWf2() throws OseeCoreException {
ensureLoaded();
if (teamArt2 == null) {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), AtsTestUtil.class.getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(AtsTestUtil.class.getSimpleName());
actionArt2 =
ActionManager.createAction(null, getTitle("Team WF2", postFixName), "description", ChangeType.Improvement,
"1", false, null, Arrays.asList(testAi2), new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), null, transaction);
-
+ AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
teamArt2 = actionArt2.getFirstTeam();
- transaction.execute();
+ changes.execute();
}
return teamArt2;
}
@@ -621,15 +617,13 @@ public class AtsTestUtil {
public static TeamWorkFlowArtifact getTeamWf3() throws OseeCoreException {
ensureLoaded();
if (teamArt3 == null) {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), AtsTestUtil.class.getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(AtsTestUtil.class.getSimpleName());
actionArt3 =
ActionManager.createAction(null, getTitle("Team WF3", postFixName), "description", ChangeType.Improvement,
"1", false, null, Arrays.asList(testAi3), new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), null, transaction);
-
+ AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
teamArt3 = actionArt3.getFirstTeam();
- transaction.execute();
+ changes.execute();
}
return teamArt3;
}
@@ -642,16 +636,15 @@ public class AtsTestUtil {
public static TeamWorkFlowArtifact getTeamWf4() throws OseeCoreException {
ensureLoaded();
if (teamArt4 == null) {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), AtsTestUtil.class.getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(AtsTestUtil.class.getSimpleName());
actionArt4 =
ActionManager.createAction(null, getTitle("Team WF4", postFixName), "description", ChangeType.Improvement,
"1", false, null, Arrays.asList(testAi4), new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), null, transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
teamArt4 = actionArt4.getFirstTeam();
AtsVersionService.get().setTargetedVersion(teamArt4, verArt4);
- transaction.execute();
+ changes.execute();
}
return teamArt4;
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtilTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtilTest.java
index 50d3c48737..bd0b1dbefe 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtilTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtilTest.java
@@ -11,18 +11,16 @@
package org.eclipse.osee.ats.client.integration.tests.ats.core.client;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.Assert;
/**
@@ -129,7 +127,8 @@ public class AtsTestUtilTest extends AtsTestUtil {
AtsTestUtil.cleanupAndReset("AtsTestUtilTest.testGetPeerReview");
AtsTestUtil.validateArtifactCache();
- Assert.assertNotNull(AtsTestUtil.getOrCreatePeerReview(ReviewBlockType.Commit, AtsTestUtilState.Analyze, null));
+ Assert.assertNotNull(AtsTestUtil.getOrCreatePeerReview(ReviewBlockType.Commit, AtsTestUtilState.Analyze,
+ new AtsChangeSet("testGetPeerReview")));
AtsTestUtil.cleanup();
@@ -144,23 +143,23 @@ public class AtsTestUtilTest extends AtsTestUtil {
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
Assert.assertEquals(teamArt.getCurrentStateName(), TeamState.Analyze.getName());
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), "test");
+ AtsChangeSet changes = new AtsChangeSet("test");
Result result =
- AtsTestUtil.transitionTo(AtsTestUtilState.Implement, AtsClientService.get().getUserAdmin().getCurrentUser(), transaction,
- TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
+ AtsTestUtil.transitionTo(AtsTestUtilState.Implement, AtsClientService.get().getUserAdmin().getCurrentUser(),
+ changes, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
Assert.assertEquals(Result.TrueResult, result);
Assert.assertEquals(teamArt.getCurrentStateName(), TeamState.Implement.getName());
result =
- AtsTestUtil.transitionTo(AtsTestUtilState.Completed, AtsClientService.get().getUserAdmin().getCurrentUser(), transaction,
- TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
+ AtsTestUtil.transitionTo(AtsTestUtilState.Completed, AtsClientService.get().getUserAdmin().getCurrentUser(),
+ changes, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
Assert.assertEquals(Result.TrueResult, result);
Assert.assertEquals(teamArt.getCurrentStateName(), TeamState.Completed.getName());
teamArt.reloadAttributesAndRelations();
- transaction.execute();
+ changes.execute();
AtsTestUtil.cleanup();
}
@@ -173,17 +172,17 @@ public class AtsTestUtilTest extends AtsTestUtil {
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
Assert.assertEquals(teamArt.getCurrentStateName(), TeamState.Analyze.getName());
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), "test");
+ AtsChangeSet changes = new AtsChangeSet("test");
Result result =
- AtsTestUtil.transitionTo(AtsTestUtilState.Cancelled, AtsClientService.get().getUserAdmin().getCurrentUser(), transaction,
- TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
+ AtsTestUtil.transitionTo(AtsTestUtilState.Cancelled, AtsClientService.get().getUserAdmin().getCurrentUser(),
+ changes, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
Assert.assertEquals(Result.TrueResult, result);
Assert.assertEquals(teamArt.getCurrentStateName(), TeamState.Cancelled.getName());
teamArt.reloadAttributesAndRelations();
- transaction.execute();
+ changes.execute();
AtsTestUtil.cleanup();
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/action/AutoAddActionToGoalTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/action/AutoAddActionToGoalTest.java
index c3ca882194..3a1f826971 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/action/AutoAddActionToGoalTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/action/AutoAddActionToGoalTest.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.ats.client.integration.tests.ats.core.client.action;
import java.util.List;
-import org.junit.Assert;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
@@ -22,6 +21,7 @@ import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.artifact.GoalArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -32,6 +32,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.QueryOptions;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.BeforeClass;
/**
@@ -60,7 +61,9 @@ public class AutoAddActionToGoalTest {
public void testNoActionAddedToGoal() throws OseeCoreException {
AtsTestUtil.cleanupAndReset("AutoAddActionToGoalTest - AutoAddActionToGoalTest - NoAdd");
- GoalArtifact goalArt = GoalManager.createGoal("AutoAddActionToGoalTest - NoActionAddedGoal");
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ GoalArtifact goalArt = GoalManager.createGoal("AutoAddActionToGoalTest - NoActionAddedGoal", changes);
+ changes.execute();
List<Artifact> memArt = goalArt.getRelatedArtifacts(AtsRelationTypes.Goal_Member);
Assert.assertEquals("Goal should have no memebers", 0, memArt.size());
ArtifactCache.deCache(goalArt);
@@ -73,16 +76,17 @@ public class AutoAddActionToGoalTest {
AtsTestUtil.cleanupAndReset("AutoAddActionToGoalTest - AddActionWithAI");
IAtsWorkDefinition workDef = AtsTestUtil.getWorkDef();
- GoalArtifact goalArt = GoalManager.createGoal("AutoAddActionToGoalTest - AddActionToGoalFromAI");
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ GoalArtifact goalArt = GoalManager.createGoal("AutoAddActionToGoalTest - AddActionToGoalFromAI", changes);
+ changes.execute();
IAtsActionableItem actionItem2 = AtsTestUtil.getTestAi2();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
- AtsClientService.get().storeConfigObject(actionItem2, transaction);
+ changes.clear();
+ AtsClientService.get().storeConfigObject(actionItem2, changes);
IAtsTeamDefinition teamDef = AtsTestUtil.getTestTeamDef();
teamDef.getVersions().clear();
- AtsClientService.get().storeConfigObject(teamDef, transaction);
- transaction.execute();
+ AtsClientService.get().storeConfigObject(teamDef, changes);
+ changes.execute();
Artifact testAI2 = AtsClientService.get().getArtifact(AtsTestUtil.getTestAi2());
@@ -108,14 +112,12 @@ public class AutoAddActionToGoalTest {
public void testAutoAddActionToGoal_TeamWF() throws OseeCoreException {
AtsTestUtil.cleanupAndReset("AutoAddActionToGoalTest - AddActionWithTeamDef");
- GoalArtifact goalArt = GoalManager.createGoal("AutoAddActionToGoalTest - AddActionToGoalFromTeamDef");
-
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ GoalArtifact goalArt = GoalManager.createGoal("AutoAddActionToGoalTest - AddActionToGoalFromTeamDef", changes);
IAtsTeamDefinition teamDef = AtsTestUtil.getTestTeamDef();
teamDef.getVersions().clear();
- AtsClientService.get().storeConfigObject(teamDef, transaction);
- transaction.execute();
+ AtsClientService.get().storeConfigObject(teamDef, changes);
+ changes.execute();
Artifact teamDefArtifact = AtsClientService.get().getArtifact(AtsTestUtil.getTestTeamDef());
@@ -138,16 +140,15 @@ public class AutoAddActionToGoalTest {
AtsTestUtil.cleanupAndReset("AutoAddActionToGoalTest - AddActionWithAIandTeamDef");
IAtsWorkDefinition workDef = AtsTestUtil.getWorkDef();
- GoalArtifact goalArt = GoalManager.createGoal("AutoAddActionToGoalTest - AddActionToGoalFromAIorTeamDef");
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ GoalArtifact goalArt =
+ GoalManager.createGoal("AutoAddActionToGoalTest - AddActionToGoalFromAIorTeamDef", changes);
IAtsActionableItem actionItem = AtsTestUtil.getTestAi2();
-
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
- AtsClientService.get().storeConfigObject(actionItem, transaction);
+ AtsClientService.get().storeConfigObject(actionItem, changes);
IAtsTeamDefinition teamDef = AtsTestUtil.getTestTeamDef();
teamDef.getVersions().clear();
- AtsClientService.get().storeConfigObject(teamDef, transaction);
- transaction.execute();
+ AtsClientService.get().storeConfigObject(teamDef, changes);
+ changes.execute();
Artifact testAI2 = AtsClientService.get().getArtifact(AtsTestUtil.getTestAi2());
Artifact teamDefArtifact = AtsClientService.get().getArtifact(AtsTestUtil.getTestTeamDef());
@@ -176,19 +177,19 @@ public class AutoAddActionToGoalTest {
AtsTestUtil.cleanupAndReset("DecisionReviewManagerTest - UnAssigned");
IAtsWorkDefinition workDef = AtsTestUtil.getWorkDef();
- GoalArtifact goalArt = GoalManager.createGoal("AutoAddActionToGoalTest - AddTwoActions");
- GoalArtifact goalArt2 = GoalManager.createGoal("AutoAddActionToGoalTest - SecondGoal");
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ GoalArtifact goalArt = GoalManager.createGoal("AutoAddActionToGoalTest - AddTwoActions", changes);
+ GoalArtifact goalArt2 = GoalManager.createGoal("AutoAddActionToGoalTest - SecondGoal", changes);
IAtsActionableItem actionItem2 = AtsTestUtil.getTestAi2();
IAtsActionableItem actionItem3 = AtsTestUtil.getTestAi3();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
- AtsClientService.get().storeConfigObject(actionItem2, transaction);
- AtsClientService.get().storeConfigObject(actionItem3, transaction);
+ TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
+ AtsClientService.get().storeConfigObject(actionItem2, changes);
+ AtsClientService.get().storeConfigObject(actionItem3, changes);
IAtsTeamDefinition teamDef = AtsTestUtil.getTestTeamDef();
teamDef.getVersions().clear();
- AtsClientService.get().storeConfigObject(teamDef, transaction);
- transaction.execute();
+ AtsClientService.get().storeConfigObject(teamDef, changes);
+ changes.execute();
Artifact testAI2 = AtsClientService.get().getArtifact(AtsTestUtil.getTestAi2());
Artifact testAI3 = AtsClientService.get().getArtifact(AtsTestUtil.getTestAi3());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/config/store/VersionArtifactStoreTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/config/store/VersionArtifactStoreTest.java
index 7ff19ba68b..f39e5ecf30 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/config/store/VersionArtifactStoreTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/config/store/VersionArtifactStoreTest.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.config.IAtsConfig;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -31,6 +32,9 @@ import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
+/**
+ * @author Donald G. Dunne
+ */
public class VersionArtifactStoreTest {
@BeforeClass
@@ -122,11 +126,9 @@ public class VersionArtifactStoreTest {
version.setDescription("description");
version.setFullName("full name");
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranchToken(),
- VersionArtifactStoreTest.class.getSimpleName() + " - testSaveToArtifact");
- AtsClientService.get().storeConfigObject(version, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet(VersionArtifactStoreTest.class.getSimpleName() + " - testSaveToArtifact");
+ AtsClientService.get().storeConfigObject(version, changes);
+ changes.execute();
Artifact saveArt = AtsClientService.get().getConfigArtifact(version);
Assert.assertEquals("VersionArtifactStoreTest - version 3", version.getName());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotificationManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotificationManagerTest.java
index c74b175725..0e12b1cad4 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotificationManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotificationManagerTest.java
@@ -16,6 +16,7 @@ import java.util.Date;
import java.util.List;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.client.demo.DemoUsers;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
@@ -31,9 +32,9 @@ import org.eclipse.osee.ats.core.client.review.role.Role;
import org.eclipse.osee.ats.core.client.review.role.UserRole;
import org.eclipse.osee.ats.core.client.review.role.UserRoleManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.util.Result;
@@ -300,14 +301,13 @@ public class AtsNotificationManagerTest {
// verify no notification events yet
Assert.assertEquals(0, mgr.getNotificationEvents().size());
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
Result result =
AtsTestUtil.transitionTo(AtsTestUtilState.Completed, AtsClientService.get().getUserAdmin().getCurrentUser(),
- transaction, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
+ changes, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
Assert.assertEquals(Result.TrueResult, result);
Assert.assertEquals(teamArt.getCurrentStateName(), TeamState.Completed.getName());
- transaction.execute();
+ changes.execute();
// verify notification to originator
Assert.assertEquals(1, mgr.getNotificationEvents().size());
@@ -343,14 +343,13 @@ public class AtsNotificationManagerTest {
// verify no notification events yet
Assert.assertEquals(0, mgr.getNotificationEvents().size());
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
Result result =
AtsTestUtil.transitionTo(AtsTestUtilState.Cancelled, AtsClientService.get().getUserAdmin().getCurrentUser(),
- transaction, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
+ changes, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
Assert.assertEquals(Result.TrueResult, result);
Assert.assertEquals(teamArt.getCurrentStateName(), TeamState.Cancelled.getName());
- transaction.execute();
+ changes.execute();
// verify notification to originator
Assert.assertEquals(1, mgr.getNotificationEvents().size());
@@ -383,19 +382,17 @@ public class AtsNotificationManagerTest {
mgr.clear();
// create another action
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
ActionArtifact actionArt =
ActionManager.createAction(null, getClass().getSimpleName() + " - testSubscribedTeam", "description",
ChangeType.Improvement, "1", false, null, Arrays.asList(AtsTestUtil.getTestAi()), new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), null, transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
// verify notification to subscriber
Assert.assertEquals(1, mgr.getNotificationEvents().size());
Assert.assertTrue(mgr.getNotificationEvents().iterator().next().getDescription().startsWith(
"You have subscribed for email notification for Team "));
-
- transaction.execute();
+ changes.execute();
SkynetTransaction transaction2 =
TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
@@ -436,32 +433,30 @@ public class AtsNotificationManagerTest {
mgr.clear();
// create another action
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
ActionArtifact actionArt =
ActionManager.createAction(null, getClass().getSimpleName() + " - testSubscribedAI", "description",
ChangeType.Improvement, "1", false, null, Arrays.asList(AtsTestUtil.getTestAi()), new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), null, transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
// verify notification to subscriber
Assert.assertEquals(1, mgr.getNotificationEvents().size());
Assert.assertTrue(mgr.getNotificationEvents().iterator().next().getDescription().startsWith(
"You have subscribed for email notification for Actionable Item "));
+ changes.execute();
- transaction.execute();
-
- SkynetTransaction transaction2 =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ SkynetTransaction transaction =
+ TransactionManager.createTransaction(AtsUtilCore.getAtsBranchToken(), getClass().getSimpleName());
- actionArt.getTeams().iterator().next().deleteAndPersist(transaction2);
- actionArt.deleteAndPersist(transaction2);
+ actionArt.getTeams().iterator().next().deleteAndPersist(transaction);
+ actionArt.deleteAndPersist(transaction);
User user = UserManager.getUser(DemoUsers.Alex_Kay);
user.setSoleAttributeValue(CoreAttributeTypes.Email, "");
user.deleteRelations(AtsRelationTypes.SubscribedUser_Artifact);
- user.persist(transaction2);
+ user.persist(transaction);
- transaction2.execute();
+ transaction.execute();
AtsTestUtil.cleanup();
}
@@ -491,13 +486,12 @@ public class AtsNotificationManagerTest {
mgr.clear();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
Result result =
AtsTestUtil.transitionTo(AtsTestUtilState.Implement, AtsClientService.get().getUserAdmin().getCurrentUser(),
- transaction, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
+ changes, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
Assert.assertEquals(Result.TrueResult, result);
- transaction.execute();
+ changes.execute();
// verify notification to workflow subscriber
Assert.assertEquals(1, mgr.getNotificationEvents().size());
@@ -531,10 +525,10 @@ public class AtsNotificationManagerTest {
kay.setSoleAttributeValue(CoreAttributeTypes.Email, "kay.jones@boeing.com");
kay.persist(getClass().getSimpleName() + "- set kay email address");
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+
PeerToPeerReviewArtifact peerArt =
- AtsTestUtil.getOrCreatePeerReview(ReviewBlockType.None, AtsTestUtilState.Analyze, transaction);
+ AtsTestUtil.getOrCreatePeerReview(ReviewBlockType.None, AtsTestUtilState.Analyze, changes);
List<UserRole> roles = new ArrayList<UserRole>();
UserRole author = new UserRole(Role.Author, AtsClientService.get().getUserAdmin().getUserFromOseeUser(alex));
roles.add(author);
@@ -548,38 +542,32 @@ public class AtsNotificationManagerTest {
Result result =
PeerToPeerReviewManager.transitionTo(peerArt, PeerToPeerReviewState.Review, roles, null,
- AtsClientService.get().getUserAdmin().getCurrentUser(), false, transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), false, changes);
Assert.assertEquals(Result.TrueResult, result);
- peerArt.persist(transaction);
- transaction.execute();
+ changes.execute();
mgr.clear();
peerArt.getCurrentStateName();
// complete reviewer1 role
- transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(),
- getClass().getSimpleName() + " - update reviewer 1");
+ changes.reset(getClass().getSimpleName() + " - update reviewer 1");
UserRoleManager roleMgr = new UserRoleManager(peerArt);
reviewer1.setHoursSpent(1.0);
reviewer1.setCompleted(true);
roleMgr.addOrUpdateUserRole(reviewer1, peerArt);
- roleMgr.saveToArtifact(transaction);
- transaction.execute();
+ roleMgr.saveToArtifact(changes);
+ changes.execute();
// no notifications sent
Assert.assertEquals(0, mgr.getNotificationEvents().size());
// complete reviewer2 role
- transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(),
- getClass().getSimpleName() + " - update reviewer 2");
+ changes.reset(getClass().getSimpleName() + " - update reviewer 2");
reviewer2.setHoursSpent(1.0);
reviewer2.setCompleted(true);
roleMgr.addOrUpdateUserRole(reviewer2, peerArt);
- roleMgr.saveToArtifact(transaction);
- peerArt.persist(transaction);
- transaction.execute();
+ roleMgr.saveToArtifact(changes);
+ changes.execute();
// notification sent to author/moderator
Assert.assertEquals(1, mgr.getNotificationEvents().size());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotifyUsersTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotifyUsersTest.java
index 10b162babf..a180d227df 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotifyUsersTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotifyUsersTest.java
@@ -16,6 +16,8 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import org.eclipse.osee.ats.api.notify.AtsNotifyType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.client.demo.DemoActionableItems;
import org.eclipse.osee.ats.client.demo.DemoUsers;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
@@ -25,15 +27,14 @@ import org.eclipse.osee.ats.core.client.notify.AtsNotificationManager;
import org.eclipse.osee.ats.core.client.notify.AtsNotificationManager.ConfigurationProvider;
import org.eclipse.osee.ats.core.client.notify.AtsNotifyUsers;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.util.SubscribeManager;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.User;
@@ -78,13 +79,13 @@ public class AtsNotifyUsersTest {
}
private static void cleanUpAction() throws OseeCoreException {
- SkynetTransaction transaction =
+ SkynetTransaction changes =
TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), AtsNotifyUsersTest.class.getSimpleName());
for (Artifact art : ArtifactQuery.getArtifactListFromAttribute(CoreAttributeTypes.Name,
AtsNotifyUsersTest.class.getSimpleName(), AtsUtilCore.getAtsBranch(), QueryOptions.CONTAINS_MATCH_OPTIONS)) {
- art.deleteAndPersist(transaction);
+ art.deleteAndPersist(changes);
}
- transaction.execute();
+ changes.execute();
}
@org.junit.Test
@@ -105,8 +106,7 @@ public class AtsNotifyUsersTest {
AtsNotificationManager.setConfigurationProvider(configProvider);
AtsNotificationManager.setInTest(false);
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
teamArt.setName(AtsNotifyUsersTest.class.getSimpleName() + "-testNotify");
teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(kay_ValidEmail));
@@ -114,8 +114,8 @@ public class AtsNotifyUsersTest {
assignees.addAll(Arrays.asList(inactiveSteve, alex_NoValidEmail, jason_ValidEmail, kay_ValidEmail,
joeSmith_CurrentUser));
teamArt.getStateMgr().setAssignees(AtsClientService.get().getUserAdmin().getAtsUsers(assignees));
- teamArt.persist(transaction);
- transaction.execute();
+ changes.add(teamArt);
+ changes.execute();
notifyManager.clear();
AtsNotificationManager.notify(teamArt, AtsNotifyType.Originator);
@@ -168,11 +168,10 @@ public class AtsNotifyUsersTest {
notifyManager.clear();
SubscribeManager.toggleSubscribe(teamArt);
- transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), "AtsNotifyUsersTests.toggle.subscribed");
- SubscribeManager.addSubscribed(teamArt,
- AtsClientService.get().getUserAdmin().getUserFromOseeUser(inactiveSteve), transaction);
- transaction.execute();
+ changes.clear();
+ SubscribeManager.addSubscribed(teamArt, AtsClientService.get().getUserAdmin().getUserFromOseeUser(inactiveSteve),
+ changes);
+ changes.execute();
AtsNotificationManager.notify(teamArt, AtsNotifyType.Subscribed);
Assert.assertEquals(1, notifyManager.getNotificationEvents().size());
event = notifyManager.getNotificationEvents().get(0);
@@ -212,11 +211,11 @@ public class AtsNotifyUsersTest {
AtsClientService.get().getUserAdmin().getCurrentUser());
TransitionHelper helper =
new TransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt), TeamState.Cancelled.getName(), null,
- "this is the reason", TransitionOption.OverrideTransitionValidityCheck);
- transaction = TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ "this is the reason", changes, TransitionOption.OverrideTransitionValidityCheck);
+ changes.clear();
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
- transaction.execute();
+ changes.execute();
Assert.assertTrue("Transition should have no errors", results.isEmpty());
Assert.assertEquals(1, notifyManager.getNotificationEvents().size());
@@ -240,13 +239,12 @@ public class AtsNotifyUsersTest {
AtsNotificationManager.setConfigurationProvider(configProvider);
AtsNotificationManager.setInTest(false);
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
ActionManager.createAction(null, getClass().getSimpleName() + "-OnNewAction", "Description",
ChangeType.Improvement, "2", false, null,
ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_SW_Design.getName())), new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), null, transaction);
- transaction.execute();
+ AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
+ changes.execute();
Assert.assertEquals(1, notifyManager.getNotificationEvents().size());
OseeNotificationEvent event = notifyManager.getNotificationEvents().get(0);
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java
index 0b6880a130..9db4afc291 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java
@@ -11,11 +11,12 @@
package org.eclipse.osee.ats.client.integration.tests.ats.core.client.review;
import java.util.Arrays;
-import org.junit.Assert;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.StateEventType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.workflow.transition.MockTransitionHelper;
@@ -25,16 +26,13 @@ import org.eclipse.osee.ats.core.client.review.DecisionReviewManager;
import org.eclipse.osee.ats.core.client.review.DecisionReviewState;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.mocks.MockDecisionReviewDefinition;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.BeforeClass;
/**
@@ -72,14 +70,13 @@ public class DecisionReviewDefinitionManagerTest extends DecisionReviewDefinitio
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
Assert.assertEquals("No reviews should be present", 0, ReviewManager.getReviews(teamArt).size());
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt), implement.getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
- TransitionManager transMgr = new TransitionManager(helper, transaction);
- TransitionResults results = transMgr.handleAll();
- transaction.execute();
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, changes, TransitionOption.None);
+ TransitionManager transitionMgr = new TransitionManager(helper);
+ TransitionResults results = transitionMgr.handleAll();
+ changes.execute();
Assert.assertTrue(results.toString(), results.isEmpty());
@@ -118,14 +115,13 @@ public class DecisionReviewDefinitionManagerTest extends DecisionReviewDefinitio
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
Assert.assertEquals("No reviews should be present", 0, ReviewManager.getReviews(teamArt).size());
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt), implement.getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
- TransitionManager transMgr = new TransitionManager(helper, transaction);
- TransitionResults results = transMgr.handleAll();
- transaction.execute();
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, changes, TransitionOption.None);
+ TransitionManager transitionMgr = new TransitionManager(helper);
+ TransitionResults results = transitionMgr.handleAll();
+ changes.execute();
Assert.assertTrue(results.toString(), results.isEmpty());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewManagerTest.java
index 3567f7fd8b..9e78863c62 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewManagerTest.java
@@ -14,7 +14,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
-import org.junit.Assert;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.workdef.IAtsDecisionReviewOption;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
@@ -25,15 +24,14 @@ import org.eclipse.osee.ats.core.client.review.DecisionReviewArtifact;
import org.eclipse.osee.ats.core.client.review.DecisionReviewManager;
import org.eclipse.osee.ats.core.client.review.DecisionReviewState;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.ats.mocks.MockDecisionReviewOption;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.BeforeClass;
/**
@@ -66,14 +64,14 @@ public class DecisionReviewManagerTest extends DecisionReviewManager {
Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser().getUserId())));
// create and transition decision review
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
String reviewTitle = "Test Review - " + teamWf.getName();
DecisionReviewArtifact decRev =
DecisionReviewManager.createNewDecisionReviewAndTransitionToDecision(teamWf, reviewTitle, "my description",
AtsTestUtil.getAnalyzeStateDef().getName(), ReviewBlockType.Transition, options,
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
- transaction.execute();
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), new Date(),
+ AtsClientService.get().getUserAdmin().getCurrentUser(), changes);
+ changes.execute();
Assert.assertNotNull(decRev);
Assert.assertFalse(
@@ -95,15 +93,14 @@ public class DecisionReviewManagerTest extends DecisionReviewManager {
Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser().getUserId())));
// create and transition decision review
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
String reviewTitle = "Test Review - " + teamWf.getName();
DecisionReviewArtifact decRev =
DecisionReviewManager.createNewDecisionReviewAndTransitionToDecision(teamWf, reviewTitle, "my description",
AtsTestUtil.getAnalyzeStateDef().getName(), ReviewBlockType.Transition, options,
Arrays.asList(AtsClientService.get().getUserAdmin().getUserFromToken(SystemUser.UnAssigned)), new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
- transaction.execute();
+ AtsClientService.get().getUserAdmin().getCurrentUser(), changes);
+ changes.execute();
Assert.assertNotNull(decRev);
Assert.assertEquals(reviewTitle, decRev.getName());
@@ -124,7 +121,8 @@ public class DecisionReviewManagerTest extends DecisionReviewManager {
DecisionReviewArtifact decRev =
DecisionReviewManager.createNewDecisionReview(teamWf, ReviewBlockType.Commit, reviewTitle,
TeamState.Implement.getName(), "description", DecisionReviewManager.getDefaultDecisionReviewOptions(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay)), new Date(), AtsClientService.get().getUserAdmin().getCurrentUser());
+ Arrays.asList(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay)), new Date(),
+ AtsClientService.get().getUserAdmin().getCurrentUser());
Assert.assertNotNull(decRev);
Assert.assertEquals(reviewTitle, decRev.getName());
@@ -143,7 +141,8 @@ public class DecisionReviewManagerTest extends DecisionReviewManager {
DecisionReviewArtifact decRev =
DecisionReviewManager.createNewDecisionReview(teamWf, ReviewBlockType.Commit, reviewTitle,
TeamState.Implement.getName(), "description", DecisionReviewManager.getDefaultDecisionReviewOptions(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getUserFromToken(SystemUser.UnAssigned)), new Date(), AtsClientService.get().getUserAdmin().getCurrentUser());
+ Arrays.asList(AtsClientService.get().getUserAdmin().getUserFromToken(SystemUser.UnAssigned)), new Date(),
+ AtsClientService.get().getUserAdmin().getCurrentUser());
Assert.assertNotNull(decRev);
Assert.assertEquals(reviewTitle, decRev.getName());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerReviewDefinitionManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerReviewDefinitionManagerTest.java
index 34f6a1f6ab..128c6249a6 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerReviewDefinitionManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerReviewDefinitionManagerTest.java
@@ -11,11 +11,12 @@
package org.eclipse.osee.ats.client.integration.tests.ats.core.client.review;
import java.util.Arrays;
-import org.junit.Assert;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.StateEventType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.workflow.transition.MockTransitionHelper;
@@ -24,16 +25,13 @@ import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewState;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.mocks.MockPeerReviewDefinition;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.AfterClass;
+import org.junit.Assert;
import org.junit.BeforeClass;
/**
@@ -69,14 +67,13 @@ public class PeerReviewDefinitionManagerTest extends PeerReviewDefinitionManager
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
Assert.assertEquals("No reviews should be present", 0, ReviewManager.getReviews(teamArt).size());
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt), implement.getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
- TransitionManager transMgr = new TransitionManager(helper, transaction);
- TransitionResults results = transMgr.handleAll();
- transaction.execute();
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, changes, TransitionOption.None);
+ TransitionManager transitionMgr = new TransitionManager(helper);
+ TransitionResults results = transitionMgr.handleAll();
+ changes.execute();
Assert.assertTrue(results.toString(), results.isEmpty());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java
index 9e74e8023e..9b5bed931c 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/PeerToPeerReviewManagerTest.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewManager;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewState;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -62,15 +63,14 @@ public class PeerToPeerReviewManagerTest extends PeerToPeerReviewManager {
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
// create and transition peer review
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
String reviewTitle = "Test Review - " + teamArt.getName();
PeerToPeerReviewArtifact peerArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt, reviewTitle,
AtsTestUtil.getAnalyzeStateDef().getName(), new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
- transaction.execute();
+ AtsClientService.get().getUserAdmin().getCurrentUser(), changes);
+ changes.execute();
Assert.assertNotNull(peerArt);
Assert.assertFalse(
@@ -90,14 +90,13 @@ public class PeerToPeerReviewManagerTest extends PeerToPeerReviewManager {
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
// create and transition peer review
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
String reviewTitle = "Test Review - " + teamArt.getName();
PeerToPeerReviewArtifact peerArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt, reviewTitle,
- AtsTestUtil.getAnalyzeStateDef().getName(), transaction);
- transaction.execute();
+ AtsTestUtil.getAnalyzeStateDef().getName(), changes);
+ changes.execute();
Assert.assertNotNull(peerArt);
Assert.assertFalse(
@@ -116,14 +115,13 @@ public class PeerToPeerReviewManagerTest extends PeerToPeerReviewManager {
IAtsActionableItem testAi = AtsTestUtil.getTestAi();
// create and transition peer review
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
String reviewTitle = "Test Review - " + testAi;
PeerToPeerReviewArtifact peerArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(testAi, reviewTitle, null, new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
- transaction.execute();
+ AtsClientService.get().getUserAdmin().getCurrentUser(), changes);
+ changes.execute();
Assert.assertNotNull(peerArt);
Assert.assertFalse(
@@ -133,5 +131,4 @@ public class PeerToPeerReviewManagerTest extends PeerToPeerReviewManager {
Assert.assertEquals("Joe Smith", peerArt.getStateMgr().getAssigneesStr());
Assert.assertEquals(peerArt.getSoleAttributeValue(AtsAttributeTypes.ActionableItem), testAi.getGuid());
}
-
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/TaskManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/TaskManagerTest.java
index 8d18df335f..b8e85f52d1 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/TaskManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/TaskManagerTest.java
@@ -20,13 +20,11 @@ import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.task.TaskManager;
import org.eclipse.osee.ats.core.client.task.TaskStates;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.util.HoursSpentUtil;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -143,12 +141,10 @@ public class TaskManagerTest extends TaskManager {
AtsTestUtil.validateArtifactCache();
// transition to Completed
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(),
- getClass().getSimpleName() + " testTransitionToCompletedThenInWork() 1");
- Result result = TaskManager.transitionToCompleted(taskArt, 0.0, 3, transaction);
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName() + " testTransitionToCompletedThenInWork() 1");
+ Result result = TaskManager.transitionToCompleted(taskArt, 0.0, 3, changes);
Assert.assertEquals(Result.TrueResult, result);
- transaction.execute();
+ changes.execute();
Assert.assertEquals(TaskStates.Completed.getName(), taskArt.getCurrentStateName());
Assert.assertEquals(3.0, HoursSpentUtil.getHoursSpentTotal(taskArt), 0.0);
@@ -158,14 +154,12 @@ public class TaskManagerTest extends TaskManager {
AtsTestUtil.validateArtifactCache();
// transition back to InWork
- transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(),
- getClass().getSimpleName() + " testTransitionToCompletedThenInWork() 2");
+ changes = new AtsChangeSet(getClass().getSimpleName() + " testTransitionToCompletedThenInWork() 2");
result =
TaskManager.transitionToInWork(taskArt, AtsClientService.get().getUserAdmin().getCurrentUser(), 45, .5,
- transaction);
+ changes);
Assert.assertEquals(Result.TrueResult, result);
- transaction.execute();
+ changes.execute();
Assert.assertEquals(TaskStates.InWork.getName(), taskArt.getCurrentStateName());
Assert.assertEquals(3.5, HoursSpentUtil.getHoursSpentTotal(taskArt), 0.0);
Assert.assertEquals("Joe Smith", taskArt.getStateMgr().getAssigneesStr());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/createTasks/CreateTasksOperationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/createTasks/CreateTasksOperationTest.java
index ec61488bb6..235d058cb9 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/createTasks/CreateTasksOperationTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/createTasks/CreateTasksOperationTest.java
@@ -32,6 +32,7 @@ import org.eclipse.osee.ats.core.client.task.createtasks.TaskEnum;
import org.eclipse.osee.ats.core.client.task.createtasks.TaskMetadata;
import org.eclipse.osee.ats.core.client.task.createtasks.TaskOpModify;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
@@ -119,9 +120,7 @@ public class CreateTasksOperationTest {
private void runCreateTasksOperation(IAtsVersion destinationVersion, IAtsActionableItem actionableItemArt, ChangeData changeData) throws OseeCoreException {
OperationLogger stringLogger = NullOperationLogger.getSingleton();
MockTaskTitleProvider taskTitleProvider = new MockTaskTitleProvider();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(),
- artifactNamePrefix + " - testCreateTasksOperation");
+ AtsChangeSet changes = new AtsChangeSet(artifactNamePrefix + " - testCreateTasksOperation");
XResultData resultData = new XResultData();
resultData.clear();
@@ -129,11 +128,11 @@ public class CreateTasksOperationTest {
// Kind of more complicated testing environment than I would prefer, but that's how it goes.
CreateTasksOperation createTasksOp =
new CreateTasksOperation(destinationVersion, actionableItemArt, changeData, reqTeamWf, false, resultData,
- transaction, stringLogger, taskTitleProvider);
+ changes, stringLogger, taskTitleProvider);
Operations.executeWorkAndCheckStatus(createTasksOp);
-
- transaction.execute();
-
+ if (!changes.isEmpty()) {
+ changes.execute();
+ }
}
@org.junit.Test
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/CopyActionDetailsTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/CopyActionDetailsTest.java
index 97eed3ad50..5c5b494ce3 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/CopyActionDetailsTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/util/CopyActionDetailsTest.java
@@ -16,6 +16,7 @@ import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil.AtsTestUtilState;
import org.eclipse.osee.ats.core.client.review.DecisionReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.CopyActionDetails;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.AfterClass;
@@ -58,18 +59,17 @@ public class CopyActionDetailsTest {
DecisionReviewArtifact review =
AtsTestUtil.getOrCreateDecisionReview(ReviewBlockType.Commit, AtsTestUtilState.Analyze);
String str = new CopyActionDetails(review).getDetailsString();
- assertEquals("\"Decision Review\" - " + review.getAtsId() + " - \"AtsTestUtil Test Decision Review\"",
- str);
+ assertEquals("\"Decision Review\" - " + review.getAtsId() + " - \"AtsTestUtil Test Decision Review\"", str);
review.persist(getClass().getSimpleName());
}
@Test
public void test04GetDetailsStringForPeerReview() throws OseeCoreException {
PeerToPeerReviewArtifact review =
- AtsTestUtil.getOrCreatePeerReview(ReviewBlockType.None, AtsTestUtilState.Analyze, null);
+ AtsTestUtil.getOrCreatePeerReview(ReviewBlockType.None, AtsTestUtilState.Analyze, new AtsChangeSet(
+ "test04GetDetailsStringForPeerReview"));
String str = new CopyActionDetails(review).getDetailsString();
- assertEquals("\"PeerToPeer Review\" - " + review.getAtsId() + " - \"AtsTestUtil Test Peer Review\"",
- str);
+ assertEquals("\"PeerToPeer Review\" - " + review.getAtsId() + " - \"AtsTestUtil Test Peer Review\"", str);
review.persist(getClass().getSimpleName());
}
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/AtsCoreClient_Transition_Suite.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/AtsCoreClient_Transition_Suite.java
index e91374e9bb..3f40277a5e 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/AtsCoreClient_Transition_Suite.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/AtsCoreClient_Transition_Suite.java
@@ -20,7 +20,7 @@ import org.junit.runners.Suite;
* @author Donald G. Dunne
*/
@RunWith(Suite.class)
-@Suite.SuiteClasses({TransitionManagerTest.class, StateManagerTest.class})
+@Suite.SuiteClasses({TransitionManagerTest.class, StateManagerTest.class, TransitionListenersTest.class})
public class AtsCoreClient_Transition_Suite {
@BeforeClass
public static void setUp() throws Exception {
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/MockTransitionHelper.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/MockTransitionHelper.java
index 7f4b6ec467..18643aa6ef 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/MockTransitionHelper.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/MockTransitionHelper.java
@@ -11,11 +11,13 @@
package org.eclipse.osee.ats.client.integration.tests.ats.core.client.workflow.transition;
import java.util.Collection;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
-import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -31,24 +33,24 @@ public class MockTransitionHelper extends TransitionHelper {
public Boolean systemUserAssigned = null;
public Boolean overrideTransitionValidityCheck = null;
- public MockTransitionHelper(String name, Collection<? extends AbstractWorkflowArtifact> awas, String toStateName, Collection<? extends IAtsUser> toAssignees, String cancellationReason, TransitionOption... transitionOption) {
- super(name, awas, toStateName, toAssignees, cancellationReason, transitionOption);
+ public MockTransitionHelper(String name, Collection<? extends AbstractWorkflowArtifact> awas, String toStateName, Collection<? extends IAtsUser> toAssignees, String cancellationReason, IAtsChangeSet changes, TransitionOption... transitionOption) {
+ super(name, awas, toStateName, toAssignees, cancellationReason, changes, transitionOption);
}
@Override
- public boolean isWorkingBranchInWork(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
+ public boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException {
if (workingBranchInWork != null) {
return workingBranchInWork;
}
- return super.isWorkingBranchInWork(teamArt);
+ return super.isWorkingBranchInWork(teamWf);
}
@Override
- public boolean isBranchInCommit(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
+ public boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException {
if (branchInCommit != null) {
return branchInCommit;
}
- return super.isBranchInCommit(teamArt);
+ return super.isBranchInCommit(teamWf);
}
public Boolean getWorkingBranchInWork() {
@@ -80,11 +82,11 @@ public class MockTransitionHelper extends TransitionHelper {
}
@Override
- public boolean isSystemUserAssingee(AbstractWorkflowArtifact awa) throws OseeCoreException {
+ public boolean isSystemUserAssingee(IAtsWorkItem workItem) throws OseeCoreException {
if (systemUserAssigned != null) {
return systemUserAssigned;
}
- return super.isSystemUserAssingee(awa);
+ return super.isSystemUserAssingee(workItem);
}
public void setSystemUserAssigned(Boolean systemUserAssigned) {
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/StateManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/StateManagerTest.java
index 1ea4109ca9..6b2dd33dc4 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/StateManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/StateManagerTest.java
@@ -12,13 +12,14 @@ package org.eclipse.osee.ats.client.integration.tests.ats.core.client.workflow.t
import java.util.Collections;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionHelper;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.ITransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.util.HoursSpentUtil;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.AfterClass;
import org.junit.Assert;
@@ -44,24 +45,25 @@ public class StateManagerTest {
IAtsStateManager stateMgr = teamWf.getStateMgr();
stateMgr.updateMetrics(AtsTestUtil.getAnalyzeStateDef(), 1.1, 1, false);
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
ITransitionHelper helper =
new MockTransitionHelper("dodad", Collections.singletonList(teamWf),
AtsTestUtil.getImplementStateDef().getName(),
- Collections.singleton(AtsClientService.get().getUserAdmin().getCurrentUser()), null);
+ Collections.singleton(AtsClientService.get().getUserAdmin().getCurrentUser()), null, changes);
TransitionManager manager = new TransitionManager(helper);
TransitionResults results = manager.handleAll();
- manager.getTransaction().execute();
+ changes.execute();
Assert.assertTrue(results.isEmpty());
stateMgr.updateMetrics(AtsTestUtil.getImplementStateDef(), 2.2, 1, false);
helper =
new MockTransitionHelper("dodad", Collections.singletonList(teamWf),
AtsTestUtil.getCompletedStateDef().getName(),
- Collections.singleton(AtsClientService.get().getUserAdmin().getCurrentUser()), null);
+ Collections.singleton(AtsClientService.get().getUserAdmin().getCurrentUser()), null, changes);
manager = new TransitionManager(helper);
results = manager.handleAll();
- manager.getTransaction().execute();
+ changes.execute();
Assert.assertTrue(results.toString(), results.isEmpty());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionListenersTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionListenersTest.java
new file mode 100644
index 0000000000..52206f30ba
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionListenersTest.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.client.integration.tests.ats.core.client.workflow.transition;
+
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionAdapter;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResult;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
+import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
+import org.eclipse.osee.ats.core.client.workflow.transition.TransitionListeners;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.junit.Assert;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TransitionListenersTest {
+
+ @org.junit.Test
+ public void testHandleTransitionValidation__ExtensionPointCheck() throws OseeCoreException {
+
+ AtsTestUtil.cleanupAndReset("TransitionManagerTest-7");
+ TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
+ MockTransitionHelper helper =
+ new MockTransitionHelper(
+ getClass().getSimpleName(),
+ Arrays.asList(teamArt),
+ AtsTestUtil.getImplementStateDef().getName(),
+ Arrays.asList(org.eclipse.osee.ats.client.integration.tests.AtsClientService.get().getUserAdmin().getCurrentUser()),
+ null, new AtsChangeSet(getClass().getSimpleName()), TransitionOption.None);
+ TransitionManager transMgr = new TransitionManager(helper);
+ TransitionResults results = new TransitionResults();
+
+ // validate that can transition
+ transMgr.handleTransitionValidation(results);
+ Assert.assertTrue(results.isEmpty());
+
+ // add transition listeners and verify can't transition
+ final String reason1 = "Don't want you to transition";
+ final String reason2 = "Don't transition yet";
+ final String exceptionStr = "This is the exception message";
+ ITransitionListener listener1 = new TransitionAdapter() {
+
+ @Override
+ public void transitioning(TransitionResults results, IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
+ results.addResult(new TransitionResult(reason1));
+ }
+
+ };
+ ITransitionListener listener2 = new TransitionAdapter() {
+
+ @Override
+ public void transitioning(TransitionResults results, IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
+ results.addResult(workItem, new TransitionResult(reason2));
+ }
+
+ };
+ ITransitionListener listener3 = new TransitionAdapter() {
+
+ @Override
+ public void transitioning(TransitionResults results, IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
+ // do nothing
+ }
+
+ };
+ ITransitionListener listener4 = new TransitionAdapter() {
+
+ @Override
+ public void transitioning(TransitionResults results, IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) throws OseeCoreException {
+ throw new OseeCoreException(exceptionStr);
+ }
+
+ };
+ try {
+ TransitionListeners.addListener(listener1);
+ TransitionListeners.addListener(listener2);
+ TransitionListeners.addListener(listener3);
+ TransitionListeners.addListener(listener4);
+
+ transMgr.handleTransitionValidation(results);
+ Assert.assertTrue(results.contains(reason1));
+ Assert.assertTrue(results.contains(reason2));
+ Assert.assertTrue(results.contains(exceptionStr));
+ } finally {
+ TransitionListeners.removeListener(listener1);
+ TransitionListeners.removeListener(listener2);
+ TransitionListeners.removeListener(listener3);
+ TransitionListeners.removeListener(listener4);
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
index ac720e34e0..e9d0535b59 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.ats.client.integration.tests.ats.core.client.workflow.t
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Date;
import java.util.List;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
@@ -21,10 +20,12 @@ import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
-import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.RuleDefinitionOption;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResult;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.client.demo.DemoUsers;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
@@ -35,23 +36,16 @@ import org.eclipse.osee.ats.core.client.review.DecisionReviewState;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.task.TaskManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.ITransitionListener;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionAdapter;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
-import org.eclipse.osee.ats.core.workflow.transition.TransitionResult;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.mocks.MockStateDefinition;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -76,7 +70,8 @@ public class TransitionManagerTest {
AtsTestUtil.cleanupAndReset("TransitionManagerTest-A");
TransitionHelper helper =
new TransitionHelper(getClass().getSimpleName(), EMPTY_AWAS, AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
transMgr.handleTransitionValidation(results);
@@ -87,7 +82,8 @@ public class TransitionManagerTest {
public void testHandleTransitionValidation__ToStateNotNull() throws OseeCoreException {
TransitionHelper helper =
new TransitionHelper(getClass().getSimpleName(), Arrays.asList(AtsTestUtil.getTeamWf()), null,
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
transMgr.handleTransitionValidation(results);
@@ -98,7 +94,8 @@ public class TransitionManagerTest {
public void testHandleTransitionValidation__InvalidToState() throws OseeCoreException {
TransitionHelper helper =
new TransitionHelper(getClass().getSimpleName(), Arrays.asList(AtsTestUtil.getTeamWf()), "InvalidStateName",
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
transMgr.handleTransitionValidation(results);
@@ -115,7 +112,9 @@ public class TransitionManagerTest {
TransitionHelper helper =
new TransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
+ helper.setExecuteChanges(true);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
@@ -170,7 +169,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
@@ -208,7 +208,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
@@ -234,7 +235,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
IAtsStateDefinition fromStateDef = AtsTestUtil.getAnalyzeStateDef();
fromStateDef.getLayoutItems().clear();
TransitionManager transMgr = new TransitionManager(helper);
@@ -274,7 +276,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
IAtsStateDefinition fromStateDef = AtsTestUtil.getAnalyzeStateDef();
fromStateDef.getLayoutItems().clear();
TransitionManager transMgr = new TransitionManager(helper);
@@ -329,7 +332,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
@@ -362,17 +366,17 @@ public class TransitionManagerTest {
helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getCancelledStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
transMgr = new TransitionManager(helper);
results.clear();
transMgr.handleTransitionValidation(results);
Assert.assertTrue(results.contains(teamArt, TransitionResult.TASKS_NOT_COMPLETED));
// Cleanup task by completing and validate can transition
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
- TaskManager.transitionToCompleted(taskArt, 0.0, 0.1, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ TaskManager.transitionToCompleted(taskArt, 0.0, 0.1, changes);
+ changes.execute();
results.clear();
transMgr.handleTransitionValidation(results);
Assert.assertTrue(results.isEmpty());
@@ -390,7 +394,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
@@ -418,7 +423,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
@@ -447,7 +453,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
@@ -477,84 +484,15 @@ public class TransitionManagerTest {
Assert.assertTrue(results.contains(teamArt, TransitionResult.COMPLETE_BLOCKING_REVIEWS));
// validate that can transition cause review completed
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ Result result =
+ DecisionReviewManager.transitionTo(decArt, DecisionReviewState.Completed,
+ AtsClientService.get().getUserAdmin().getCurrentUser(), false, changes);
+ Assert.assertTrue(result.getText(), result.isTrue());
+ changes.execute();
results.clear();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), getClass().getSimpleName());
- DecisionReviewManager.transitionTo(decArt, DecisionReviewState.Completed,
- AtsClientService.get().getUserAdmin().getCurrentUser(), false, transaction);
- transaction.execute();
- transMgr.handleTransitionValidation(results);
- Assert.assertTrue(results.isEmpty());
- }
-
- @org.junit.Test
- public void testHandleTransitionValidation__ExtensionPointCheck() throws OseeCoreException {
-
- AtsTestUtil.cleanupAndReset("TransitionManagerTest-7");
- TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
- MockTransitionHelper helper =
- new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
- AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
- TransitionManager transMgr = new TransitionManager(helper);
- TransitionResults results = new TransitionResults();
-
- // validate that can transition
transMgr.handleTransitionValidation(results);
Assert.assertTrue(results.isEmpty());
-
- // add transition listeners and verify can't transition
- final String reason1 = "Don't want you to transition";
- final String reason2 = "Don't transition yet";
- final String exceptionStr = "This is the exception message";
- ITransitionListener listener1 = new TransitionAdapter() {
-
- @Override
- public void transitioning(TransitionResults results, AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
- results.addResult(new TransitionResult(reason1));
- }
-
- };
- ITransitionListener listener2 = new TransitionAdapter() {
-
- @Override
- public void transitioning(TransitionResults results, AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
- results.addResult(sma, new TransitionResult(reason2));
- }
-
- };
- ITransitionListener listener3 = new TransitionAdapter() {
-
- @Override
- public void transitioning(TransitionResults results, AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
- // do nothing
- }
-
- };
- ITransitionListener listener4 = new TransitionAdapter() {
-
- @Override
- public void transitioning(TransitionResults results, AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) throws OseeCoreException {
- throw new OseeCoreException(exceptionStr);
- }
-
- };
- try {
- TransitionManager.addListener(listener1);
- TransitionManager.addListener(listener2);
- TransitionManager.addListener(listener3);
- TransitionManager.addListener(listener4);
-
- transMgr.handleTransitionValidation(results);
- Assert.assertTrue(results.contains(reason1));
- Assert.assertTrue(results.contains(reason2));
- Assert.assertTrue(results.contains(exceptionStr));
- } finally {
- TransitionManager.removeListener(listener1);
- TransitionManager.removeListener(listener2);
- TransitionManager.removeListener(listener3);
- TransitionManager.removeListener(listener4);
- }
}
/**
@@ -572,7 +510,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt01, teamArt02),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
transMgr.handleTransitionValidation(results);
@@ -582,7 +521,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper01 =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt01, teamArt02),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr01 = new TransitionManager(helper01);
TransitionResults results01 = new TransitionResults();
transMgr01.handleTransitionValidation(results01);
@@ -592,7 +532,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper02 =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt01),
AtsTestUtil.getCompletedStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr02 = new TransitionManager(helper02);
TransitionResults results02 = new TransitionResults();
transMgr02.handleTransitionValidation(results02);
@@ -602,7 +543,8 @@ public class TransitionManagerTest {
MockTransitionHelper helper03 =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt01, teamArt02),
AtsTestUtil.getCompletedStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr03 = new TransitionManager(helper03);
TransitionResults results03 = new TransitionResults();
transMgr03.handleTransitionValidation(results03);
@@ -617,14 +559,14 @@ public class TransitionManagerTest {
Assert.assertTrue(assigneesBefore.size() > 0);
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
- AtsTestUtil.getImplementStateDef().getName(), teamArt.getAssignees(), null, TransitionOption.None);
+ AtsTestUtil.getImplementStateDef().getName(), teamArt.getAssignees(), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
TransitionResults results01 = new TransitionResults();
transMgr.handleTransitionValidation(results);
Assert.assertTrue(results.isEmpty());
results01 = transMgr.handleAll();
- transMgr.getTransaction().execute();
Assert.assertTrue(results01.isEmpty());
List<IAtsUser> assigneesAfter = teamArt.getAssignees();
Assert.assertTrue(assigneesAfter.containsAll(assigneesBefore));
@@ -639,14 +581,15 @@ public class TransitionManagerTest {
Assert.assertTrue(assigneesBefore.size() > 0);
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
- AtsTestUtil.getImplementStateDef().getName(), null, null, TransitionOption.None);
+ AtsTestUtil.getImplementStateDef().getName(), null, null, new AtsChangeSet(getClass().getSimpleName()),
+ TransitionOption.None);
+ helper.setExecuteChanges(true);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
TransitionResults results01 = new TransitionResults();
transMgr.handleTransitionValidation(results);
Assert.assertTrue(results.isEmpty());
results01 = transMgr.handleAll();
- transMgr.getTransaction().execute();
Assert.assertTrue(results01.isEmpty());
List<IAtsUser> assigneesAfter = teamArt.getAssignees();
Assert.assertTrue(assigneesAfter.containsAll(assigneesBefore));
@@ -659,11 +602,11 @@ public class TransitionManagerTest {
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
// Setup - Transition to Implement
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtilCore.getAtsBranchToken(), "create");
+ AtsChangeSet changes = new AtsChangeSet("create");
Result result =
AtsTestUtil.transitionTo(AtsTestUtilState.Implement, AtsClientService.get().getUserAdmin().getCurrentUser(),
- transaction, TransitionOption.OverrideAssigneeCheck);
- transaction.execute();
+ changes, TransitionOption.OverrideAssigneeCheck);
+ changes.execute();
Assert.assertTrue("Transition Error: " + result.getText(), result.isTrue());
Assert.assertEquals("Implement", teamArt.getCurrentStateName());
Assert.assertEquals(0, teamArt.getSoleAttributeValue(AtsAttributeTypes.PercentComplete, 0).intValue());
@@ -672,11 +615,11 @@ public class TransitionManagerTest {
MockTransitionHelper helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getCompletedStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
transMgr.handleTransition(results);
- transMgr.getTransaction().execute();
Assert.assertTrue("Transition Error: " + results.toString(), results.isEmpty());
Assert.assertEquals("Completed", teamArt.getCurrentStateName());
Assert.assertEquals(100, teamArt.getSoleAttributeValue(AtsAttributeTypes.PercentComplete, 100).intValue());
@@ -685,11 +628,11 @@ public class TransitionManagerTest {
helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
transMgr = new TransitionManager(helper);
results = new TransitionResults();
transMgr.handleTransition(results);
- transMgr.getTransaction().execute();
Assert.assertTrue("Transition Error: " + results.toString(), results.isEmpty());
Assert.assertEquals("Implement", teamArt.getCurrentStateName());
@@ -699,11 +642,11 @@ public class TransitionManagerTest {
helper =
new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getCancelledStateDef().getName(),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), null, new AtsChangeSet(
+ getClass().getSimpleName()), TransitionOption.None);
transMgr = new TransitionManager(helper);
results = new TransitionResults();
transMgr.handleTransition(results);
- transMgr.getTransaction().execute();
Assert.assertTrue("Transition Error: " + results.toString(), results.isEmpty());
Assert.assertEquals("Cancelled", teamArt.getCurrentStateName());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsDecisionReviewPrepareStateItemTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsDecisionReviewPrepareStateItemTest.java
index 3a4c6671e2..f4adee548f 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsDecisionReviewPrepareStateItemTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsDecisionReviewPrepareStateItemTest.java
@@ -15,12 +15,12 @@ import java.util.Arrays;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.core.client.review.DecisionReviewArtifact;
import org.eclipse.osee.ats.core.client.review.DecisionReviewManager;
import org.eclipse.osee.ats.core.client.review.DecisionReviewState;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.editor.stateItem.AtsDecisionReviewPrepareStateItem;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItemTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItemTest.java
index 74f2eb46a6..9fc97d4838 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItemTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItemTest.java
@@ -19,12 +19,11 @@ import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.client.integration.tests.util.DemoTestUtil;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.ats.editor.stateItem.AtsForceAssigneesToTeamLeadsStateItem;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
@@ -49,10 +48,9 @@ public class AtsForceAssigneesToTeamLeadsStateItemTest {
assertFalse("Test should not be run in production db", AtsUtil.isProductionDb());
if (teamArt == null) {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), getClass().getSimpleName());
- teamArt = DemoTestUtil.createSimpleAction(getClass().getSimpleName(), transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ teamArt = DemoTestUtil.createSimpleAction(getClass().getSimpleName(), changes);
+ changes.execute();
}
}
@@ -92,10 +90,10 @@ public class AtsForceAssigneesToTeamLeadsStateItemTest {
// make call to state item that should set options based on artifact's attribute value
AtsForceAssigneesToTeamLeadsStateItem stateItem = new AtsForceAssigneesToTeamLeadsStateItem();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), getClass().getSimpleName());
- stateItem.transitioned(teamArt, fromState, toState, Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ stateItem.transitioned(teamArt, fromState, toState,
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), changes);
+ changes.execute();
// assignee should be Joe Smith
Assert.assertEquals(1, teamArt.getStateMgr().getAssignees().size());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItemTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItemTest.java
index 86e59d7271..1a705ff8a7 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItemTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItemTest.java
@@ -22,11 +22,10 @@ import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewState;
import org.eclipse.osee.ats.core.client.review.role.Role;
import org.eclipse.osee.ats.core.client.review.role.UserRole;
import org.eclipse.osee.ats.core.client.review.role.UserRoleManager;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.editor.stateItem.AtsPeerToPeerReviewReviewStateItem;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
@@ -49,15 +48,14 @@ public class AtsPeerToPeerReviewReviewStateItemTest {
if (peerRevArt == null) {
// setup fake review artifact with decision options set
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
peerRevArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(
AtsClientService.get().getWorkDefinitionAdmin().getDefaultPeerToPeerWorkflowDefinitionMatch().getWorkDefinition(),
- null, getClass().getName(), "", transaction);
+ null, getClass().getName(), "", changes);
peerRevArt.setName(getClass().getSimpleName());
- peerRevArt.persist(transaction);
- transaction.execute();
+ changes.add(peerRevArt);
+ changes.execute();
}
}
@@ -81,10 +79,10 @@ public class AtsPeerToPeerReviewReviewStateItemTest {
UserRoleManager roleMgr = new UserRoleManager(peerRevArt);
roleMgr.addOrUpdateUserRole(userRole, peerRevArt);
userRole = new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserByName("Alex Kay"));
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "test transition");
+ AtsChangeSet changes = new AtsChangeSet("test transition");
roleMgr.addOrUpdateUserRole(userRole, peerRevArt);
- roleMgr.saveToArtifact(transaction);
- transaction.execute();
+ roleMgr.saveToArtifact(changes);
+ changes.execute();
// assignee should be user roles
Assert.assertEquals(2, peerRevArt.getStateMgr().getAssignees().size());
@@ -101,10 +99,10 @@ public class AtsPeerToPeerReviewReviewStateItemTest {
// make call to state item that should set options based on artifact's attribute value
AtsPeerToPeerReviewReviewStateItem stateItem = new AtsPeerToPeerReviewReviewStateItem();
- transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "test transition");
+ changes.reset("test transition");
stateItem.transitioned(peerRevArt, fromState, toState,
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), transaction);
- transaction.execute();
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), changes);
+ changes.execute();
// Joe and Alex should have been added to assignees
Assert.assertEquals(2, peerRevArt.getStateMgr().getAssignees().size());
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/AtsDeleteManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/AtsDeleteManagerTest.java
index 7dfb3b75ff..2ebe7ed718 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/AtsDeleteManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/util/AtsDeleteManagerTest.java
@@ -19,6 +19,7 @@ import java.util.List;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.client.demo.DemoActionableItems;
import org.eclipse.osee.ats.client.demo.DemoArtifactTypes;
@@ -29,6 +30,7 @@ import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.review.DecisionReviewArtifact;
import org.eclipse.osee.ats.core.client.review.DecisionReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
@@ -42,8 +44,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.artifact.search.QueryOptions;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -77,13 +77,12 @@ public class AtsDeleteManagerTest {
*/
@org.junit.Test
public void testTeamArtDeleteOneWorkflow() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Delete Manager Test");
+ AtsChangeSet changes = new AtsChangeSet("Delete Manager Test");
// Create Action
TeamWorkFlowArtifact teamArt =
createAction(TestNames.TeamArtDeleteOneWorkflow,
- ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName())), transaction);
- transaction.execute();
+ ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName())), changes);
+ changes.execute();
// Verify exists
verifyExists(TestNames.TeamArtDeleteOneWorkflow, 1, 1, 0, 2, 1);
@@ -102,13 +101,12 @@ public class AtsDeleteManagerTest {
*/
@org.junit.Test
public void testTeamArtDeleteWithTwoWorkflows() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Delete Manager Test");
+ AtsChangeSet changes = new AtsChangeSet("Delete Manager Test");
// Create Action
TeamWorkFlowArtifact teamArt =
createAction(TestNames.TeamArtDeleteWithTwoWorkflows, ActionableItems.getActionableItems(Arrays.asList(
- DemoActionableItems.SAW_Code.getName(), DemoActionableItems.SAW_Requirements.getName())), transaction);
- transaction.execute();
+ DemoActionableItems.SAW_Code.getName(), DemoActionableItems.SAW_Requirements.getName())), changes);
+ changes.execute();
// Verify exists
verifyExists(TestNames.TeamArtDeleteWithTwoWorkflows, 1, 1, 1, 2, 1);
@@ -122,13 +120,12 @@ public class AtsDeleteManagerTest {
@org.junit.Test
public void testTeamArtPurge() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Delete Manager Test");
+ AtsChangeSet changes = new AtsChangeSet("Delete Manager Test");
// Create Action
TeamWorkFlowArtifact teamArt =
createAction(TestNames.TeamArtPurge,
- ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName())), transaction);
- transaction.execute();
+ ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName())), changes);
+ changes.execute();
// Verify exists
verifyExists(TestNames.TeamArtPurge, 1, 1, 0, 2, 1);
@@ -142,13 +139,12 @@ public class AtsDeleteManagerTest {
@org.junit.Test
public void testActionDelete() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Delete Manager Test");
+ AtsChangeSet changes = new AtsChangeSet("Delete Manager Test");
// Create Action
TeamWorkFlowArtifact teamArt =
createAction(TestNames.ActionDelete,
- ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName())), transaction);
- transaction.execute();
+ ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName())), changes);
+ changes.execute();
// Verify exists
verifyExists(TestNames.ActionDelete, 1, 1, 0, 2, 1);
@@ -162,13 +158,12 @@ public class AtsDeleteManagerTest {
@org.junit.Test
public void testActionPurge() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Delete Manager Test");
+ AtsChangeSet changes = new AtsChangeSet("Delete Manager Test");
// Create Action
TeamWorkFlowArtifact teamArt =
createAction(TestNames.ActionPurge,
- ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName())), transaction);
- transaction.execute();
+ ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName())), changes);
+ changes.execute();
// Verify exists
verifyExists(TestNames.ActionPurge, 1, 1, 0, 2, 1);
@@ -201,12 +196,12 @@ public class AtsDeleteManagerTest {
Assert.assertEquals(message, expectedCount, actualCount);
}
- private TeamWorkFlowArtifact createAction(TestNames testName, Collection<IAtsActionableItem> actionableItems, SkynetTransaction transaction) throws OseeCoreException {
+ private TeamWorkFlowArtifact createAction(TestNames testName, Collection<IAtsActionableItem> actionableItems, IAtsChangeSet changes) throws OseeCoreException {
Date createdDate = new Date();
IAtsUser createdBy = AtsClientService.get().getUserAdmin().getCurrentUser();
Artifact actionArt =
ActionManager.createAction(null, testName.name(), "Description", ChangeType.Improvement, "2", false, null,
- actionableItems, createdDate, createdBy, null, transaction);
+ actionableItems, createdDate, createdBy, null, changes);
TeamWorkFlowArtifact teamArt = null;
for (TeamWorkFlowArtifact team : ActionManager.getTeams(actionArt)) {
@@ -216,13 +211,13 @@ public class AtsDeleteManagerTest {
}
teamArt.createTasks(Arrays.asList(testName.name() + " Task 1", testName.name() + " Task 2"),
- (List<IAtsUser>) null, createdDate, createdBy, transaction);
+ (List<IAtsUser>) null, createdDate, createdBy, changes);
DecisionReviewArtifact decRev =
DecisionReviewManager.createNewDecisionReview(teamArt, ReviewBlockType.None, testName.name(),
TeamState.Endorse.getName(), "Description", DecisionReviewManager.getDefaultDecisionReviewOptions(),
Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), createdDate, createdBy);
- decRev.persist(transaction);
+ changes.add(decRev);
return teamArt;
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/SMAPromptChangeStatusTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/SMAPromptChangeStatusTest.java
index 89c9a002a5..5a8f96f344 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/SMAPromptChangeStatusTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/SMAPromptChangeStatusTest.java
@@ -17,26 +17,25 @@ import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.Collection;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.client.integration.tests.util.DemoTestUtil;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.task.TaskStates;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.model.impl.WorkStateImpl;
import org.eclipse.osee.ats.core.util.HoursSpentUtil;
import org.eclipse.osee.ats.core.util.PercentCompleteTotalUtil;
import org.eclipse.osee.ats.core.workflow.state.AtsWorkStateFactory;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.editor.SMAPromptChangeStatus;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.util.Result;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
@@ -70,22 +69,19 @@ public class SMAPromptChangeStatusTest {
@Test
public void test01Initialize() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Prompt Change Status Test");
- teamArt = DemoTestUtil.createSimpleAction(getClass().getSimpleName(), transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet("Prompt Change Status Test");
+ teamArt = DemoTestUtil.createSimpleAction(getClass().getSimpleName(), changes);
+ changes.execute();
assertNotNull(teamArt);
}
@Test
public void test02ChangeTaskStatusNoResolution() throws Exception {
-
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Prompt Change Status Test");
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
Collection<TaskArtifact> tasks =
DemoTestUtil.createSimpleTasks(teamArt, getClass().getSimpleName() + "_NoRes", 4,
- teamArt.getCurrentStateName(), transaction);
- transaction.execute();
+ teamArt.getCurrentStateName(), changes);
+ changes.execute();
assertTrue(tasks.size() == 4);
@@ -115,23 +111,22 @@ public class SMAPromptChangeStatusTest {
@Test
public void test03ChangeStatusFailsIfTaskCancelled() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Prompt Change Status Test");
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
Collection<TaskArtifact> tasks =
- DemoTestUtil.createSimpleTasks(teamArt, getClass().getSimpleName() + "_Cancel", 2, null, transaction);
- transaction.execute();
+ DemoTestUtil.createSimpleTasks(teamArt, getClass().getSimpleName() + "_Cancel", 2, null, changes);
+ changes.execute();
assertTrue(tasks.size() == 2);
TaskArtifact cancelTask = tasks.iterator().next();
// test that if one task is cancelled, can't change status
- transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Prompt Change Status Test");
+ changes.clear();
TransitionHelper helper =
new TransitionHelper("Transition to Cancelled", Arrays.asList(cancelTask), TaskStates.Cancelled.getName(),
- null, null, TransitionOption.None);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ null, null, changes, TransitionOption.None);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
- transitionMgr.getTransaction().execute();
+ changes.execute();
assertEquals("Transition should have no errors", true, results.isEmpty());
Result result = SMAPromptChangeStatus.isValidToChangeStatus(tasks);
@@ -142,20 +137,18 @@ public class SMAPromptChangeStatusTest {
@Test
public void test04ChangeStatusFailsIfTaskWrongRelatedToState() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Prompt Change Status Test");
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
Collection<TaskArtifact> tasks =
DemoTestUtil.createSimpleTasks(teamArt, getClass().getSimpleName() + "_RelState", 2,
- teamArt.getCurrentStateName(), transaction);
- transaction.execute();
+ teamArt.getCurrentStateName(), changes);
+ changes.execute();
assertTrue(tasks.size() == 2);
TaskArtifact taskArt = tasks.iterator().next();
// test that if task not in related-to state of workflows's current status, can't change status
- transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Prompt Change Status Test");
taskArt.setSoleAttributeValue(AtsAttributeTypes.RelatedToState, TeamState.Analyze.getName());
- transaction.execute();
+ taskArt.persist(getClass().getSimpleName());
Result result = SMAPromptChangeStatus.isValidToChangeStatus(tasks);
assertTrue(result.isFalse());
assertTrue(result.getText().contains("Task work must be done in"));
@@ -163,11 +156,10 @@ public class SMAPromptChangeStatusTest {
@Test
public void test05ChangeStatusPassesIfTaskNotUsingRelatedToState() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Prompt Change Status Test");
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
Collection<TaskArtifact> tasks =
- DemoTestUtil.createSimpleTasks(teamArt, getClass().getSimpleName() + "_RelState", 2, "", transaction);
- transaction.execute();
+ DemoTestUtil.createSimpleTasks(teamArt, getClass().getSimpleName() + "_RelState", 2, "", changes);
+ changes.execute();
assertTrue(tasks.size() == 2);
@@ -177,24 +169,21 @@ public class SMAPromptChangeStatusTest {
private static void validateSMAs(Collection<? extends AbstractWorkflowArtifact> awas, String stateName, int totalPercent, double hoursSpent) throws Exception {
for (AbstractWorkflowArtifact awa : awas) {
- assertEquals("Current State wrong for " + awa.getAtsId(), awa.getStateMgr().getCurrentStateName(),
- stateName);
+ assertEquals("Current State wrong for " + awa.getAtsId(), awa.getStateMgr().getCurrentStateName(), stateName);
if (awa.isCompletedOrCancelled()) {
- assertEquals("ats.CurrentState wrong " + awa.getAtsId(),
- awa.getStateMgr().getCurrentStateName() + ";;;",
+ assertEquals("ats.CurrentState wrong " + awa.getAtsId(), awa.getStateMgr().getCurrentStateName() + ";;;",
awa.getSoleAttributeValue(AtsAttributeTypes.CurrentState));
}
- assertEquals("Percent wrong for " + awa.getAtsId(),
- PercentCompleteTotalUtil.getPercentCompleteTotal(awa), totalPercent);
- assertEquals("Hours Spent wrong for " + awa.getAtsId(), HoursSpentUtil.getHoursSpentTotal(awa),
- hoursSpent, 0.0);
+ assertEquals("Percent wrong for " + awa.getAtsId(), PercentCompleteTotalUtil.getPercentCompleteTotal(awa),
+ totalPercent);
+ assertEquals("Hours Spent wrong for " + awa.getAtsId(), HoursSpentUtil.getHoursSpentTotal(awa), hoursSpent,
+ 0.0);
for (String xml : awa.getAttributesToStringList(AtsAttributeTypes.State)) {
WorkStateImpl state = AtsWorkStateFactory.getFromXml(xml);
boolean isCompletedCancelledState = isCompletedCancelledState(awa, state.getName());
if (isCompletedCancelledState) {
- assertTrue("completed/cancelled ats.State [" + xml + "] wrong " + awa.getAtsId(),
- xml.endsWith(";;;"));
+ assertTrue("completed/cancelled ats.State [" + xml + "] wrong " + awa.getAtsId(), xml.endsWith(";;;"));
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java
index a23f0684ab..3d4628e941 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/util/DemoTestUtil.java
@@ -26,6 +26,7 @@ import java.util.logging.Level;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.client.demo.DemoActionableItems;
import org.eclipse.osee.ats.client.demo.DemoArtifactTypes;
import org.eclipse.osee.ats.client.demo.DemoSawBuilds;
@@ -51,7 +52,6 @@ import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.artifact.search.QueryOptions;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -97,11 +97,11 @@ public class DemoTestUtil {
/**
* Creates an action with the name title and demo code workflow
*/
- public static TeamWorkFlowArtifact createSimpleAction(String title, SkynetTransaction transaction) throws OseeCoreException {
+ public static TeamWorkFlowArtifact createSimpleAction(String title, IAtsChangeSet changes) throws OseeCoreException {
Artifact actionArt =
ActionManager.createAction(null, title, "Description", ChangeType.Improvement, "2", false, null,
ActionableItems.getActionableItems(Arrays.asList(DemoActionableItems.SAW_Code.getName())), new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), null, transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
TeamWorkFlowArtifact teamArt = null;
for (TeamWorkFlowArtifact team : ActionManager.getTeams(actionArt)) {
@@ -120,12 +120,12 @@ public class DemoTestUtil {
return getActionableItems(demoActionableItems).iterator().next();
}
- public static TeamWorkFlowArtifact addTeamWorkflow(Artifact actionArt, String title, SkynetTransaction transaction) throws OseeCoreException {
+ public static TeamWorkFlowArtifact addTeamWorkflow(Artifact actionArt, String title, IAtsChangeSet changes) throws OseeCoreException {
Set<IAtsActionableItem> actionableItems = getActionableItems(DemoActionableItems.SAW_Test);
Collection<IAtsTeamDefinition> teamDefs = TeamDefinitions.getImpactedTeamDefs(actionableItems);
ActionManager.createTeamWorkflow(actionArt, teamDefs.iterator().next(), actionableItems,
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), transaction, new Date(),
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), changes, new Date(),
AtsClientService.get().getUserAdmin().getCurrentUser(), null);
TeamWorkFlowArtifact teamArt = null;
@@ -140,13 +140,13 @@ public class DemoTestUtil {
/**
* Create tasks named title + <num>
*/
- public static Collection<TaskArtifact> createSimpleTasks(TeamWorkFlowArtifact teamArt, String title, int numTasks, String relatedToState, SkynetTransaction transaction) throws Exception {
+ public static Collection<TaskArtifact> createSimpleTasks(TeamWorkFlowArtifact teamArt, String title, int numTasks, String relatedToState, IAtsChangeSet changes) throws Exception {
List<String> names = new ArrayList<String>();
for (int x = 1; x < numTasks + 1; x++) {
names.add(title + " " + x);
}
return teamArt.createTasks(names, Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()),
- new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), relatedToState, transaction);
+ new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), relatedToState, changes);
}
public static TeamWorkFlowArtifact getToolsTeamWorkflow() throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF
index 1b03a2f382..91a7cd9d95 100644
--- a/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF
@@ -32,6 +32,7 @@ Import-Package: com.google.inject,
org.eclipse.osee.ats.api.workflow,
org.eclipse.osee.ats.api.workflow.log,
org.eclipse.osee.ats.api.workflow.state,
+ org.eclipse.osee.ats.api.workflow.transition,
org.eclipse.osee.ats.core,
org.eclipse.osee.ats.core.config,
org.eclipse.osee.ats.core.model,
diff --git a/plugins/org.eclipse.osee.ats.core.client/OSGI-INF/ats.client.service.xml b/plugins/org.eclipse.osee.ats.core.client/OSGI-INF/ats.client.service.xml
index cce87ee736..0dfa6f3202 100644
--- a/plugins/org.eclipse.osee.ats.core.client/OSGI-INF/ats.client.service.xml
+++ b/plugins/org.eclipse.osee.ats.core.client/OSGI-INF/ats.client.service.xml
@@ -9,6 +9,8 @@
<provide interface="org.eclipse.osee.ats.api.ev.IAtsEarnedValueServiceProvider"/>
<provide interface="org.eclipse.osee.ats.api.workflow.IAtsWorkItemServiceProvider"/>
<provide interface="org.eclipse.osee.ats.core.client.internal.IAtsWorkItemArtifactServiceProvider"/>
+ <provide interface="org.eclipse.osee.ats.api.workflow.IAtsBranchServiceProvider"/>
+ <provide interface="org.eclipse.osee.ats.api.review.IAtsReviewServiceProvider"/>
</service>
<reference bind="setAtsWorkDefinitionService" cardinality="1..1" interface="org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService" name="IAtsWorkDefinitionService" policy="static"/>
<reference bind="setAtsUserService" cardinality="1..1" interface="org.eclipse.osee.ats.api.user.IAtsUserService" name="IAtsUserService" policy="static"/>
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
index 26e8355caf..1835fd3f94 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
@@ -17,10 +17,16 @@ import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.ev.IAtsEarnedValueService;
import org.eclipse.osee.ats.api.ev.IAtsEarnedValueServiceProvider;
import org.eclipse.osee.ats.api.query.IAtsQueryService;
+import org.eclipse.osee.ats.api.review.IAtsReviewService;
+import org.eclipse.osee.ats.api.review.IAtsReviewServiceProvider;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersionServiceProvider;
+import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
+import org.eclipse.osee.ats.api.workflow.IAtsBranchServiceProvider;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemServiceProvider;
import org.eclipse.osee.ats.core.client.internal.IAtsWorkItemArtifactServiceProvider;
+import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.config.IActionableItemFactory;
import org.eclipse.osee.ats.core.config.IAtsConfigProvider;
import org.eclipse.osee.ats.core.config.ITeamDefinitionFactory;
@@ -28,14 +34,13 @@ import org.eclipse.osee.ats.core.config.IVersionFactory;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
*/
-public interface IAtsClient extends IAtsWorkItemArtifactServiceProvider, IAtsWorkItemServiceProvider, IAtsConfigProvider, ITeamDefinitionFactory, IActionableItemFactory, IVersionFactory, IAtsQueryService, IAtsVersionServiceProvider, IAtsEarnedValueServiceProvider {
+public interface IAtsClient extends IAtsReviewServiceProvider, IAtsBranchServiceProvider, IAtsWorkItemArtifactServiceProvider, IAtsWorkItemServiceProvider, IAtsConfigProvider, ITeamDefinitionFactory, IActionableItemFactory, IVersionFactory, IAtsQueryService, IAtsVersionServiceProvider, IAtsEarnedValueServiceProvider {
- <T extends IAtsConfigObject> Artifact storeConfigObject(T configObject, SkynetTransaction transaction) throws OseeCoreException;
+ <T extends IAtsConfigObject> Artifact storeConfigObject(T configObject, IAtsChangeSet changes) throws OseeCoreException;
<T extends IAtsConfigObject> T getConfigObject(Artifact artifact) throws OseeCoreException;
@@ -46,6 +51,8 @@ public interface IAtsClient extends IAtsWorkItemArtifactServiceProvider, IAtsWor
*/
Artifact getArtifact(IAtsObject atsObject) throws OseeCoreException;
+ AbstractWorkflowArtifact getWorkflowArtifact(IAtsObject atsObject) throws OseeCoreException;
+
List<Artifact> getConfigArtifacts(Collection<? extends IAtsObject> atsObjects) throws OseeCoreException;
<T extends IAtsConfigObject> Collection<T> getConfigObjects(Collection<? extends Artifact> artifacts, Class<T> clazz) throws OseeCoreException;
@@ -75,4 +82,9 @@ public interface IAtsClient extends IAtsWorkItemArtifactServiceProvider, IAtsWor
@Override
IAtsEarnedValueService getEarnedValueService() throws OseeStateException;
+ @Override
+ IAtsBranchService getBranchService() throws OseeCoreException;
+
+ @Override
+ IAtsReviewService getReviewService() throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsWorkDefinitionAdmin.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsWorkDefinitionAdmin.java
index f7b672d0d5..74a414250d 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsWorkDefinitionAdmin.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsWorkDefinitionAdmin.java
@@ -91,4 +91,6 @@ public interface IAtsWorkDefinitionAdmin {
WorkDefinitionMatch getWorkDefinitionForPeerToPeerReview(IAtsPeerToPeerReview review) throws OseeCoreException;
+ IAtsStateDefinition getStateDefinitionByName(IAtsWorkItem workItem, String stateName) throws OseeCoreException;
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifactRollup.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifactRollup.java
index ca0ae7c2cd..ef64f0a94c 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifactRollup.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifactRollup.java
@@ -23,7 +23,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -31,11 +30,9 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
public class ActionArtifactRollup {
private final ActionArtifact action;
- private final SkynetTransaction transaction;
- public ActionArtifactRollup(ActionArtifact action, SkynetTransaction transaction) throws OseeArgumentException {
+ public ActionArtifactRollup(ActionArtifact action) throws OseeArgumentException {
this.action = action;
- this.transaction = transaction;
if (!action.isOfType(AtsArtifactTypes.Action)) {
throw new OseeArgumentException("Artifact must be an Action instead of [%s]", action.getArtifactTypeName());
}
@@ -48,7 +45,6 @@ public class ActionArtifactRollup {
resetTitleOffChildren();
resetValidationOffChildren();
resetDescriptionOffChildren();
- action.persist(transaction);
}
public static void resetChangeTypeOffChildren(Artifact actionArt) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionManager.java
index 4687108291..acb79af59a 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionManager.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.CreateTeamOption;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.notify.AtsNotificationManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
@@ -40,14 +41,13 @@ import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
*/
public class ActionManager {
- public static ActionArtifact createAction(IProgressMonitor monitor, String title, String desc, ChangeType changeType, String priority, boolean validationRequired, Date needByDate, Collection<IAtsActionableItem> actionableItems, Date createdDate, IAtsUser createdBy, INewActionListener newActionListener, SkynetTransaction transaction) throws OseeCoreException {
+ public static ActionArtifact createAction(IProgressMonitor monitor, String title, String desc, ChangeType changeType, String priority, boolean validationRequired, Date needByDate, Collection<IAtsActionableItem> actionableItems, Date createdDate, IAtsUser createdBy, INewActionListener newActionListener, IAtsChangeSet changes) throws OseeCoreException {
Conditions.checkNotNullOrEmptyOrContainNull(actionableItems, "actionableItems");
// if "tt" is title, this is an action created for development. To
// make it easier, all fields are automatically filled in for ATS developer
@@ -76,7 +76,7 @@ public class ActionManager {
for (IAtsTeamDefinition teamDef : teamDefs) {
List<IAtsUser> leads = new LinkedList<IAtsUser>(teamDef.getLeads(actionableItems));
TeamWorkFlowArtifact teamWf =
- createTeamWorkflow(actionArt, teamDef, actionableItems, leads, transaction, createdDate, createdBy,
+ createTeamWorkflow(actionArt, teamDef, actionableItems, leads, changes, createdDate, createdBy,
newActionListener);
teamWf.getStateMgr().writeToStore();
}
@@ -86,11 +86,11 @@ public class ActionManager {
newActionListener.actionCreated(actionArt);
}
- actionArt.persist(transaction);
+ changes.add(actionArt);
return actionArt;
}
- public static TeamWorkFlowArtifact createTeamWorkflow(Artifact actionArt, IAtsTeamDefinition teamDef, Collection<IAtsActionableItem> actionableItems, List<? extends IAtsUser> assignees, SkynetTransaction transaction, Date createdDate, IAtsUser createdBy, INewActionListener newActionListener, CreateTeamOption... createTeamOption) throws OseeCoreException {
+ public static TeamWorkFlowArtifact createTeamWorkflow(Artifact actionArt, IAtsTeamDefinition teamDef, Collection<IAtsActionableItem> actionableItems, List<? extends IAtsUser> assignees, IAtsChangeSet changes, Date createdDate, IAtsUser createdBy, INewActionListener newActionListener, CreateTeamOption... createTeamOption) throws OseeCoreException {
ITeamWorkflowProvider teamExt = TeamWorkFlowManager.getTeamWorkflowProvider(teamDef, actionableItems);
IArtifactType teamWorkflowArtifactType =
TeamWorkFlowManager.getTeamWorkflowArtifactType(teamDef, actionableItems);
@@ -98,7 +98,7 @@ public class ActionManager {
// NOTE: The persist of the workflow will auto-email the assignees
TeamWorkFlowArtifact teamArt =
createTeamWorkflow(actionArt, teamDef, actionableItems, assignees, createdDate, createdBy, null,
- teamWorkflowArtifactType, newActionListener, transaction, createTeamOption);
+ teamWorkflowArtifactType, newActionListener, changes, createTeamOption);
// Notify extension that workflow was created
if (teamExt != null) {
teamExt.teamWorkflowCreated(teamArt);
@@ -106,7 +106,7 @@ public class ActionManager {
return teamArt;
}
- public static TeamWorkFlowArtifact createTeamWorkflow(Artifact actionArt, IAtsTeamDefinition teamDef, Collection<IAtsActionableItem> actionableItems, List<? extends IAtsUser> assignees, Date createdDate, IAtsUser createdBy, String guid, IArtifactType artifactType, INewActionListener newActionListener, SkynetTransaction transaction, CreateTeamOption... createTeamOption) throws OseeCoreException {
+ public static TeamWorkFlowArtifact createTeamWorkflow(Artifact actionArt, IAtsTeamDefinition teamDef, Collection<IAtsActionableItem> actionableItems, List<? extends IAtsUser> assignees, Date createdDate, IAtsUser createdBy, String guid, IArtifactType artifactType, INewActionListener newActionListener, IAtsChangeSet changes, CreateTeamOption... createTeamOption) throws OseeCoreException {
if (!Collections.getAggregate(createTeamOption).contains(CreateTeamOption.Duplicate_If_Exists)) {
// Make sure team doesn't already exist
@@ -153,16 +153,16 @@ public class ActionManager {
// Notify listener of team creation
if (newActionListener != null) {
- newActionListener.teamCreated((ActionArtifact) actionArt, teamArt, transaction);
+ newActionListener.teamCreated((ActionArtifact) actionArt, teamArt, changes);
}
// Relate Action to WorkFlow
actionArt.addRelation(AtsRelationTypes.ActionToWorkflow_WorkFlow, teamArt);
// Auto-add actions to configured goals
- addActionToConfiguredGoal(teamDef, teamArt, actionableItems, transaction);
+ addActionToConfiguredGoal(teamDef, teamArt, actionableItems, changes);
- teamArt.persist(transaction);
+ changes.add(teamArt);
AtsNotificationManager.notifySubscribedByTeamOrActionableItem(teamArt);
return teamArt;
@@ -171,14 +171,14 @@ public class ActionManager {
/**
* Auto-add actions to a goal configured with relations to the given ActionableItem or Team Definition
*/
- private static void addActionToConfiguredGoal(IAtsTeamDefinition teamDef, TeamWorkFlowArtifact teamArt, Collection<IAtsActionableItem> actionableItems, SkynetTransaction transaction) throws OseeCoreException {
+ private static void addActionToConfiguredGoal(IAtsTeamDefinition teamDef, TeamWorkFlowArtifact teamArt, Collection<IAtsActionableItem> actionableItems, IAtsChangeSet changes) throws OseeCoreException {
// Auto-add this team artifact to configured goals
Artifact teamDefArt = AtsClientService.get().getConfigArtifact(teamDef);
if (teamDefArt != null) {
for (Artifact goalArt : teamDefArt.getRelatedArtifacts(AtsRelationTypes.AutoAddActionToGoal_Goal)) {
if (!goalArt.getRelatedArtifacts(AtsRelationTypes.Goal_Member).contains(teamArt)) {
goalArt.addRelation(AtsRelationTypes.Goal_Member, teamArt);
- goalArt.persist(transaction);
+ changes.add(goalArt);
}
}
}
@@ -190,7 +190,7 @@ public class ActionManager {
for (Artifact goalArt : aiDefArt.getRelatedArtifacts(AtsRelationTypes.AutoAddActionToGoal_Goal)) {
if (!goalArt.getRelatedArtifacts(AtsRelationTypes.Goal_Member).contains(teamArt)) {
goalArt.addRelation(AtsRelationTypes.Goal_Member, teamArt);
- goalArt.persist(transaction);
+ changes.add(goalArt);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/INewActionListener.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/INewActionListener.java
index 1ac9e99b82..fbe3c1098c 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/INewActionListener.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/INewActionListener.java
@@ -10,10 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.client.action;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -28,7 +28,7 @@ public interface INewActionListener {
/**
* Called after team workflow and initialized and before persist of Action
*/
- public void teamCreated(ActionArtifact actionArt, TeamWorkFlowArtifact teamArt, SkynetTransaction transaction) throws OseeCoreException;
+ public void teamCreated(ActionArtifact actionArt, TeamWorkFlowArtifact teamArt, IAtsChangeSet changes) throws OseeCoreException;
/**
* @return workflow id to use instead of default configured id
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchManagerCore.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchManagerCore.java
index d9565df032..35af42b958 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchManagerCore.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchManagerCore.java
@@ -26,18 +26,21 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osee.ats.api.commit.ICommitConfigArtifact;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.IAtsDecisionReviewDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsPeerReviewDefinition;
import org.eclipse.osee.ats.api.workdef.StateEventType;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.client.internal.Activator;
+import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.review.DecisionReviewArtifact;
import org.eclipse.osee.ats.core.client.review.DecisionReviewDefinitionManager;
import org.eclipse.osee.ats.core.client.review.PeerReviewDefinitionManager;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
-import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.stateitem.AtsStateItemCoreManager;
import org.eclipse.osee.ats.core.client.workflow.stateitem.IAtsStateItemCore;
import org.eclipse.osee.ats.core.config.AtsVersionService;
@@ -62,7 +65,6 @@ import org.eclipse.osee.framework.plugin.core.util.IExceptionableRunnable;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.conflict.ConflictManagerExternal;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
/**
@@ -127,6 +129,12 @@ public class AtsBranchManagerCore {
/**
* @return whether there is a working branch that is not committed
*/
+ public static boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) AtsClientService.get().getArtifact(teamWf);
+ Branch branch = getWorkingBranch(teamArt);
+ return branch != null && !branch.getBranchState().isCommitted();
+ }
+
public static boolean isWorkingBranchInWork(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
Branch branch = getWorkingBranch(teamArt);
return branch != null && !branch.getBranchState().isCommitted();
@@ -667,11 +675,13 @@ public class AtsBranchManagerCore {
private static void performPostBranchCreationTasks(final TeamWorkFlowArtifact teamArt) throws OseeCoreException {
// Create reviews as necessary
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), "Create Reviews upon Transition");
- createNecessaryBranchEventReviews(StateEventType.CreateBranch, teamArt, new Date(), AtsCoreUsers.SYSTEM_USER,
- transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet("Create Reviews upon Transition");
+ boolean created =
+ createNecessaryBranchEventReviews(StateEventType.CreateBranch, teamArt, new Date(), AtsCoreUsers.SYSTEM_USER,
+ changes);
+ if (created) {
+ changes.execute();
+ }
// Notify extensions of branch creation
for (IAtsStateItemCore item : AtsStateItemCoreManager.getStateItems()) {
@@ -679,7 +689,11 @@ public class AtsBranchManagerCore {
}
}
- public static void createNecessaryBranchEventReviews(StateEventType stateEventType, TeamWorkFlowArtifact teamArt, Date createdDate, IAtsUser createdBy, SkynetTransaction transaction) throws OseeCoreException {
+ /**
+ * @return true if one or more reviews were created
+ */
+ public static boolean createNecessaryBranchEventReviews(StateEventType stateEventType, TeamWorkFlowArtifact teamArt, Date createdDate, IAtsUser createdBy, IAtsChangeSet changes) throws OseeCoreException {
+ boolean created = false;
if (stateEventType != StateEventType.CommitBranch && stateEventType != StateEventType.CreateBranch) {
throw new OseeStateException("Invalid stateEventType [%s]", stateEventType);
}
@@ -687,23 +701,26 @@ public class AtsBranchManagerCore {
for (IAtsDecisionReviewDefinition decRevDef : teamArt.getStateDefinition().getDecisionReviews()) {
if (decRevDef.getStateEventType() != null && decRevDef.getStateEventType().equals(stateEventType)) {
DecisionReviewArtifact decArt =
- DecisionReviewDefinitionManager.createNewDecisionReview(decRevDef, transaction, teamArt, createdDate,
+ DecisionReviewDefinitionManager.createNewDecisionReview(decRevDef, changes, teamArt, createdDate,
createdBy);
if (decArt != null) {
- decArt.persist(transaction);
+ created = true;
+ changes.add(decArt);
}
}
}
for (IAtsPeerReviewDefinition peerRevDef : teamArt.getStateDefinition().getPeerReviews()) {
if (peerRevDef.getStateEventType() != null && peerRevDef.getStateEventType().equals(stateEventType)) {
PeerToPeerReviewArtifact peerArt =
- PeerReviewDefinitionManager.createNewPeerToPeerReview(peerRevDef, transaction, teamArt, createdDate,
+ PeerReviewDefinitionManager.createNewPeerToPeerReview(peerRevDef, changes, teamArt, createdDate,
createdBy);
if (peerArt != null) {
- peerArt.persist(transaction);
+ created = true;
+ changes.add(peerArt);
}
}
}
+ return created;
}
public static Result deleteWorkingBranch(TeamWorkFlowArtifact teamArt, boolean pend) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
index 51a1b052bf..f467cb6782 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
@@ -22,10 +22,13 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.ev.IAtsEarnedValueService;
import org.eclipse.osee.ats.api.query.IAtsQuery;
+import org.eclipse.osee.ats.api.review.IAtsReviewService;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUserService;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
+import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
import org.eclipse.osee.ats.core.client.IAtsClient;
import org.eclipse.osee.ats.core.client.IAtsUserAdmin;
@@ -38,6 +41,7 @@ import org.eclipse.osee.ats.core.client.internal.config.TeamDefinitionFactory;
import org.eclipse.osee.ats.core.client.internal.config.VersionFactory;
import org.eclipse.osee.ats.core.client.internal.ev.AtsEarnedValueImpl;
import org.eclipse.osee.ats.core.client.internal.query.AtsQuery;
+import org.eclipse.osee.ats.core.client.internal.review.AtsReviewServiceImpl;
import org.eclipse.osee.ats.core.client.internal.store.ActionableItemArtifactReader;
import org.eclipse.osee.ats.core.client.internal.store.ActionableItemArtifactWriter;
import org.eclipse.osee.ats.core.client.internal.store.AtsArtifactStore;
@@ -51,12 +55,13 @@ import org.eclipse.osee.ats.core.client.internal.user.AtsUserAdminImpl;
import org.eclipse.osee.ats.core.client.internal.workdef.AtsWorkDefinitionAdminImpl;
import org.eclipse.osee.ats.core.client.internal.workdef.AtsWorkDefinitionCache;
import org.eclipse.osee.ats.core.client.internal.workdef.AtsWorkDefinitionCacheProvider;
-import org.eclipse.osee.ats.core.client.search.AtsArtifactQuery;
import org.eclipse.osee.ats.core.client.internal.workdef.AtsWorkItemArtifactProviderImpl;
import org.eclipse.osee.ats.core.client.internal.workflow.AtsWorkItemServiceImpl;
import org.eclipse.osee.ats.core.client.search.AtsArtifactQuery;
import org.eclipse.osee.ats.core.client.team.ITeamWorkflowProviders;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
+import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
+import org.eclipse.osee.ats.core.client.workflow.AtsBranchServiceImpl;
import org.eclipse.osee.ats.core.config.IActionableItemFactory;
import org.eclipse.osee.ats.core.config.IAtsConfig;
import org.eclipse.osee.ats.core.config.ITeamDefinitionFactory;
@@ -68,7 +73,6 @@ import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -90,6 +94,8 @@ public class AtsClientImpl implements IAtsClient {
private IAtsEarnedValueService earnedValueService;
private IAtsUserService userService;
private IAtsWorkItemService workItemService;
+ private IAtsBranchService branchService;
+ private IAtsReviewService reviewService;
private static Boolean started = null;
public void setAtsWorkDefinitionService(IAtsWorkDefinitionService workDefService) {
@@ -141,6 +147,8 @@ public class AtsClientImpl implements IAtsClient {
workDefAdmin =
new AtsWorkDefinitionAdminImpl(workDefCacheProvider, workItemArtifactProvider, workItemService,
workDefService, atsTeamWorkflowProviders);
+ branchService = new AtsBranchServiceImpl();
+ reviewService = new AtsReviewServiceImpl();
started = true;
}
@@ -175,9 +183,9 @@ public class AtsClientImpl implements IAtsClient {
}
@Override
- public <T extends IAtsConfigObject> Artifact storeConfigObject(T configObject, SkynetTransaction transaction) throws OseeCoreException {
+ public <T extends IAtsConfigObject> Artifact storeConfigObject(T configObject, IAtsChangeSet changes) throws OseeCoreException {
AtsArtifactConfigCache atsConfigCache = getConfigCache();
- return artifactStore.store(atsConfigCache, configObject, transaction);
+ return artifactStore.store(atsConfigCache, configObject, changes);
}
@Override
@@ -387,4 +395,21 @@ public class AtsClientImpl implements IAtsClient {
return workItemArtifactProvider;
}
+ @Override
+ public IAtsBranchService getBranchService() throws OseeCoreException {
+ checkStarted();
+ return branchService;
+ }
+
+ @Override
+ public AbstractWorkflowArtifact getWorkflowArtifact(IAtsObject atsObject) throws OseeCoreException {
+ return (AbstractWorkflowArtifact) getArtifact(atsObject);
+ }
+
+ @Override
+ public IAtsReviewService getReviewService() throws OseeCoreException {
+ checkStarted();
+ return reviewService;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IAtsArtifactStore.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IAtsArtifactStore.java
index d9a2d5169b..cb2acfa75c 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IAtsArtifactStore.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IAtsArtifactStore.java
@@ -11,17 +11,17 @@
package org.eclipse.osee.ats.core.client.internal;
import org.eclipse.osee.ats.api.IAtsConfigObject;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.internal.config.AtsArtifactConfigCache;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
*/
public interface IAtsArtifactStore {
- <T extends IAtsConfigObject> Artifact store(AtsArtifactConfigCache cache, T configObject, SkynetTransaction transaction) throws OseeCoreException;
+ <T extends IAtsConfigObject> Artifact store(AtsArtifactConfigCache cache, T configObject, IAtsChangeSet changes) throws OseeCoreException;
<T extends IAtsConfigObject> T load(AtsArtifactConfigCache cache, Artifact artifact) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IAtsArtifactWriter.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IAtsArtifactWriter.java
index d6808d1d25..5a70152201 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IAtsArtifactWriter.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IAtsArtifactWriter.java
@@ -11,18 +11,18 @@
package org.eclipse.osee.ats.core.client.internal;
import org.eclipse.osee.ats.api.IAtsConfigObject;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.internal.config.AtsArtifactConfigCache;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
*/
public interface IAtsArtifactWriter<T extends IAtsConfigObject> {
- Artifact store(T atsConfgObject, Artifact artifact, AtsArtifactConfigCache cache, SkynetTransaction transaction) throws OseeCoreException;
+ Artifact store(T atsConfgObject, Artifact artifact, AtsArtifactConfigCache cache, IAtsChangeSet changes) throws OseeCoreException;
- Artifact store(T atsConfgObject, AtsArtifactConfigCache cache, SkynetTransaction transaction) throws OseeCoreException;
+ Artifact store(T atsConfgObject, AtsArtifactConfigCache cache, IAtsChangeSet changes) throws OseeCoreException;
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java
new file mode 100644
index 0000000000..6a22635c43
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.client.internal.review;
+
+import java.util.Collection;
+import java.util.Date;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
+import org.eclipse.osee.ats.api.review.IAtsDecisionReview;
+import org.eclipse.osee.ats.api.review.IAtsReviewService;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
+import org.eclipse.osee.ats.core.client.review.ReviewManager;
+import org.eclipse.osee.ats.core.client.review.ValidateReviewManager;
+import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+public class AtsReviewServiceImpl implements IAtsReviewService {
+
+ @Override
+ public boolean isValidationReviewRequired(IAtsWorkItem workItem) throws OseeCoreException {
+ return ((AbstractWorkflowArtifact) workItem).isValidationRequired();
+ }
+
+ @Override
+ public IAtsDecisionReview createValidateReview(IAtsTeamWorkflow teamWf, boolean force, Date transitionDate, IAtsUser transitionUser, IAtsChangeSet changes) throws OseeCoreException {
+ return ValidateReviewManager.createValidateReview((TeamWorkFlowArtifact) teamWf, false, transitionDate,
+ transitionUser, changes);
+ }
+
+ @Override
+ public Collection<IAtsAbstractReview> getReviewsFromCurrentState(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return ReviewManager.getReviewsFromCurrentState((TeamWorkFlowArtifact) teamWf);
+ }
+
+ @Override
+ public ReviewBlockType getReviewBlockType(IAtsAbstractReview review) throws OseeCoreException {
+ return ((AbstractReviewArtifact) review).getReviewBlockType();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AbstractAtsArtifactWriter.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AbstractAtsArtifactWriter.java
index bd252b3768..d1a592c2e8 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AbstractAtsArtifactWriter.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AbstractAtsArtifactWriter.java
@@ -15,6 +15,7 @@ import java.util.Collection;
import java.util.List;
import org.eclipse.osee.ats.api.IAtsConfigObject;
import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.internal.IAtsArtifactWriter;
import org.eclipse.osee.ats.core.client.internal.config.AtsArtifactConfigCache;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
@@ -24,7 +25,6 @@ import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -48,13 +48,13 @@ public abstract class AbstractAtsArtifactWriter<T extends IAtsConfigObject> impl
return newArts;
}
- protected Artifact getArtifactOrCreate(AtsArtifactConfigCache cache, IArtifactType artifactType, IAtsConfigObject atsObject, SkynetTransaction transaction) throws OseeCoreException {
+ protected Artifact getArtifactOrCreate(AtsArtifactConfigCache cache, IArtifactType artifactType, IAtsConfigObject atsObject, IAtsChangeSet changes) throws OseeCoreException {
Artifact artifact = cache.getArtifact(atsObject);
if (artifact == null) {
artifact =
ArtifactTypeManager.addArtifact(artifactType, AtsUtilCore.getAtsBranchToken(), atsObject.getName(),
atsObject.getGuid());
- artifact.persist(transaction);
+ changes.add(artifact);
}
return artifact;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/ActionableItemArtifactWriter.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/ActionableItemArtifactWriter.java
index 3f19a497aa..edeb2139af 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/ActionableItemArtifactWriter.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/ActionableItemArtifactWriter.java
@@ -15,6 +15,7 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.internal.config.AtsArtifactConfigCache;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.config.ActionableItems;
@@ -25,7 +26,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
/**
@@ -34,14 +34,14 @@ import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
public class ActionableItemArtifactWriter extends AbstractAtsArtifactWriter<IAtsActionableItem> {
@Override
- public Artifact store(IAtsActionableItem ai, AtsArtifactConfigCache cache, SkynetTransaction transaction) throws OseeCoreException {
- Artifact artifact = getArtifactOrCreate(cache, AtsArtifactTypes.ActionableItem, ai, transaction);
- store(ai, artifact, cache, transaction);
+ public Artifact store(IAtsActionableItem ai, AtsArtifactConfigCache cache, IAtsChangeSet changes) throws OseeCoreException {
+ Artifact artifact = getArtifactOrCreate(cache, AtsArtifactTypes.ActionableItem, ai, changes);
+ store(ai, artifact, cache, changes);
return artifact;
}
@Override
- public Artifact store(IAtsActionableItem ai, Artifact artifact, AtsArtifactConfigCache cache, SkynetTransaction transaction) throws OseeCoreException {
+ public Artifact store(IAtsActionableItem ai, Artifact artifact, AtsArtifactConfigCache cache, IAtsChangeSet changes) throws OseeCoreException {
artifact.setName(ai.getName());
artifact.setSoleAttributeValue(AtsAttributeTypes.Active, ai.isActive());
boolean actionable = artifact.getSoleAttributeValue(AtsAttributeTypes.Actionable, false);
@@ -59,7 +59,7 @@ public class ActionableItemArtifactWriter extends AbstractAtsArtifactWriter<IAts
artifact)) {
artifact.deleteRelations(AtsRelationTypes.TeamActionableItem_Team);
artifact.addRelation(AtsRelationTypes.TeamActionableItem_Team, teamDefArt);
- teamDefArt.persist(transaction);
+ changes.add(teamDefArt);
}
}
@@ -104,7 +104,7 @@ public class ActionableItemArtifactWriter extends AbstractAtsArtifactWriter<IAts
// if parent is null, add to top team definition
Artifact topAIArt = cache.getSoleArtifact(ActionableItems.getTopActionableItem());
topAIArt.addChild(artifact);
- topAIArt.persist(transaction);
+ changes.add(topAIArt);
} else {
// else reset parent if necessary
Artifact parentAiArt = artifact.getParent();
@@ -113,13 +113,13 @@ public class ActionableItemArtifactWriter extends AbstractAtsArtifactWriter<IAts
if (!parentAiArt.getGuid().equals(ai.getParentActionableItem().getGuid())) {
Artifact newParentAIArt = cache.getSoleArtifact(ai);
newParentAIArt.addChild(artifact);
- newParentAIArt.persist(transaction);
- parentAiArt.persist(transaction);
+ changes.add(newParentAIArt);
+ changes.add(parentAiArt);
}
}
}
}
- artifact.persist(transaction);
+ changes.add(artifact);
cache.cache(ai);
return artifact;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsArtifactStore.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsArtifactStore.java
index 81f4400cd3..83727e3127 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsArtifactStore.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsArtifactStore.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.core.client.internal.store;
import java.util.Map;
import org.eclipse.osee.ats.api.IAtsConfigObject;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.internal.IAtsArtifactReader;
import org.eclipse.osee.ats.core.client.internal.IAtsArtifactStore;
import org.eclipse.osee.ats.core.client.internal.IAtsArtifactWriter;
@@ -20,7 +21,6 @@ import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -36,15 +36,15 @@ public class AtsArtifactStore implements IAtsArtifactStore {
}
@Override
- public <T extends IAtsConfigObject> Artifact store(AtsArtifactConfigCache cache, T configObject, SkynetTransaction transaction) throws OseeCoreException {
+ public <T extends IAtsConfigObject> Artifact store(AtsArtifactConfigCache cache, T configObject, IAtsChangeSet changes) throws OseeCoreException {
Conditions.checkNotNull(cache, "cache");
Conditions.checkNotNull(configObject, "configObject");
- Conditions.checkNotNull(transaction, "transaction");
+ Conditions.checkNotNull(changes, "transaction");
IAtsArtifactWriter<T> writer = getWriter(configObject.getClass());
Conditions.checkNotNull(writer, "writer");
- return writer.store(configObject, cache, transaction);
+ return writer.store(configObject, cache, changes);
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/TeamDefinitionArtifactWriter.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/TeamDefinitionArtifactWriter.java
index 1dd9a4c49d..1f33a73b70 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/TeamDefinitionArtifactWriter.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/TeamDefinitionArtifactWriter.java
@@ -16,6 +16,7 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.internal.config.AtsArtifactConfigCache;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
@@ -26,7 +27,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
/**
@@ -35,14 +35,14 @@ import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
public class TeamDefinitionArtifactWriter extends AbstractAtsArtifactWriter<IAtsTeamDefinition> {
@Override
- public Artifact store(IAtsTeamDefinition teamDef, AtsArtifactConfigCache cache, SkynetTransaction transaction) throws OseeCoreException {
- Artifact artifact = getArtifactOrCreate(cache, AtsArtifactTypes.TeamDefinition, teamDef, transaction);
- store(teamDef, artifact, cache, transaction);
+ public Artifact store(IAtsTeamDefinition teamDef, AtsArtifactConfigCache cache, IAtsChangeSet changes) throws OseeCoreException {
+ Artifact artifact = getArtifactOrCreate(cache, AtsArtifactTypes.TeamDefinition, teamDef, changes);
+ store(teamDef, artifact, cache, changes);
return artifact;
}
@Override
- public Artifact store(IAtsTeamDefinition teamDef, Artifact artifact, AtsArtifactConfigCache cache, SkynetTransaction transaction) throws OseeCoreException {
+ public Artifact store(IAtsTeamDefinition teamDef, Artifact artifact, AtsArtifactConfigCache cache, IAtsChangeSet changes) throws OseeCoreException {
artifact.setName(teamDef.getName());
artifact.setSoleAttributeValue(AtsAttributeTypes.Active, teamDef.isActive());
boolean actionable = artifact.getSoleAttributeValue(AtsAttributeTypes.Actionable, false);
@@ -132,7 +132,7 @@ public class TeamDefinitionArtifactWriter extends AbstractAtsArtifactWriter<IAts
// if parent is null, add to top team definition
Artifact topTeamDefArt = cache.getSoleArtifact(TeamDefinitions.getTopTeamDefinition());
topTeamDefArt.addChild(artifact);
- topTeamDefArt.persist(transaction);
+ changes.add(topTeamDefArt);
} else {
// else reset parent if necessary
Artifact parentTeamDefArt = artifact.getParent();
@@ -141,13 +141,14 @@ public class TeamDefinitionArtifactWriter extends AbstractAtsArtifactWriter<IAts
if (!parentTeamDefArt.getGuid().equals(teamDef.getParentTeamDef().getGuid())) {
Artifact newParentTeamDefArt = cache.getSoleArtifact(teamDef);
newParentTeamDefArt.addChild(artifact);
- newParentTeamDefArt.persist(transaction);
- parentTeamDefArt.persist(transaction);
+ changes.add(newParentTeamDefArt);
+ changes.add(parentTeamDefArt);
}
}
}
}
- artifact.persist(transaction);
+ changes.add(artifact);
+
cache.cache(teamDef);
return artifact;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/VersionArtifactWriter.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/VersionArtifactWriter.java
index 33d478be20..26be3bac50 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/VersionArtifactWriter.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/VersionArtifactWriter.java
@@ -15,13 +15,13 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.core.client.internal.config.AtsArtifactConfigCache;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -29,14 +29,14 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
public class VersionArtifactWriter extends AbstractAtsArtifactWriter<IAtsVersion> {
@Override
- public Artifact store(IAtsVersion ai, AtsArtifactConfigCache cache, SkynetTransaction transaction) throws OseeCoreException {
- Artifact artifact = getArtifactOrCreate(cache, AtsArtifactTypes.Version, ai, transaction);
- store(ai, artifact, cache, transaction);
+ public Artifact store(IAtsVersion ai, AtsArtifactConfigCache cache, IAtsChangeSet changes) throws OseeCoreException {
+ Artifact artifact = getArtifactOrCreate(cache, AtsArtifactTypes.Version, ai, changes);
+ store(ai, artifact, cache, changes);
return artifact;
}
@Override
- public Artifact store(IAtsVersion version, Artifact artifact, AtsArtifactConfigCache cache, SkynetTransaction transaction) throws OseeCoreException {
+ public Artifact store(IAtsVersion version, Artifact artifact, AtsArtifactConfigCache cache, IAtsChangeSet changes) throws OseeCoreException {
artifact.setName(version.getName());
boolean allowCommitBranch = artifact.getSoleAttributeValue(AtsAttributeTypes.AllowCreateBranch, true);
if (allowCommitBranch != version.isAllowCommitBranch()) {
@@ -79,11 +79,11 @@ public class VersionArtifactWriter extends AbstractAtsArtifactWriter<IAtsVersion
if (teamDefArt != null) {
if (!teamDefArt.getRelatedArtifacts(AtsRelationTypes.TeamDefinitionToVersion_Version).contains(artifact)) {
teamDefArt.addRelation(AtsRelationTypes.TeamDefinitionToVersion_Version, artifact);
- teamDefArt.persist(transaction);
+ changes.add(teamDefArt);
}
}
}
- artifact.persist(transaction);
+ changes.add(artifact);
cache.cache(version);
return artifact;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImpl.java
index e9ff585b56..ebe4df66b4 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImpl.java
@@ -469,4 +469,9 @@ public class AtsWorkDefinitionAdminImpl implements IAtsWorkDefinitionAdmin {
public List<Artifact> get(Collection<? extends IAtsWorkItem> workItems, Class<Artifact> clazz) throws OseeCoreException {
return workItemArtifactProvider.get(workItems, clazz);
}
+
+ @Override
+ public IAtsStateDefinition getStateDefinitionByName(IAtsWorkItem workItem, String stateName) throws OseeCoreException {
+ return getWorkDefinition(workItem).getWorkDefinition().getStateByName(stateName);
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java
index fa0d39eb47..121fa95226 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java
@@ -115,4 +115,9 @@ public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
}
return attrs;
}
+
+ @Override
+ public void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException {
+ AtsClientService.get().getArtifact(workItem).deleteSoleAttribute(attributeType);
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsWorkItemServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsWorkItemServiceImpl.java
index e7d4f48454..ddb61b37a2 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsWorkItemServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsWorkItemServiceImpl.java
@@ -11,23 +11,31 @@
package org.eclipse.osee.ats.core.client.internal.workflow;
import java.util.Collection;
+import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workflow.IAtsAction;
import org.eclipse.osee.ats.api.workflow.IAtsTask;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.IAtsWorkData;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.internal.IAtsWorkItemArtifactService;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.validator.AtsXWidgetValidateManagerClient;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AtsWorkData;
+import org.eclipse.osee.ats.core.client.workflow.transition.TransitionListeners;
import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -35,6 +43,7 @@ import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -186,4 +195,43 @@ public class AtsWorkItemServiceImpl implements IAtsWorkItemService {
return isWrite;
}
+ @Override
+ public String getCurrentStateName(IAtsWorkItem workItem) {
+ return ((AbstractWorkflowArtifact) workItem).getCurrentStateName();
+ }
+
+ @Override
+ public void clearImplementersCache(IAtsWorkItem workItem) {
+ ((AbstractWorkflowArtifact) workItem).clearImplementersCache();
+ }
+
+ @Override
+ public Collection<WidgetResult> validateWidgetTransition(IAtsWorkItem workItem, IAtsStateDefinition toStateDef) throws OseeStateException {
+ return AtsXWidgetValidateManagerClient.instance.validateTransition((AbstractWorkflowArtifact) workItem,
+ toStateDef);
+ }
+
+ @Override
+ public Collection<IAtsTask> getTaskArtifacts(IAtsWorkItem workItem) throws OseeCoreException {
+ if (workItem.isTeamWorkflow()) {
+ return Collections.castAll(((TeamWorkFlowArtifact) workItem).getTaskArtifacts());
+ }
+ return java.util.Collections.emptyList();
+ }
+
+ @Override
+ public void transitioned(IAtsWorkItem workItem, IAtsStateDefinition fromState, IAtsStateDefinition toState, List<? extends IAtsUser> updatedAssigees, IAtsChangeSet changes) throws OseeCoreException {
+ ((AbstractWorkflowArtifact) workItem).transitioned(fromState, toState, updatedAssigees, changes);
+ }
+
+ @Override
+ public void setInTransition(IAtsWorkItem workItem, boolean inTransition) {
+ ((AbstractWorkflowArtifact) workItem).setInTransition(inTransition);
+ }
+
+ @Override
+ public Collection<ITransitionListener> getTransitionListeners() {
+ return TransitionListeners.getListeners();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewDefinitionManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewDefinitionManager.java
index d61df7d1a1..66ce2f7e5b 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewDefinitionManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewDefinitionManager.java
@@ -14,20 +14,21 @@ import java.util.Collection;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsDecisionReviewDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.StateEventType;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.log.LogType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionAdapter;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionAdapter;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
/**
@@ -40,7 +41,7 @@ public class DecisionReviewDefinitionManager extends TransitionAdapter {
/**
* Creates decision review if one of same name doesn't already exist
*/
- public static DecisionReviewArtifact createNewDecisionReview(IAtsDecisionReviewDefinition revDef, SkynetTransaction transaction, TeamWorkFlowArtifact teamArt, Date createdDate, IAtsUser createdBy) throws OseeCoreException {
+ public static DecisionReviewArtifact createNewDecisionReview(IAtsDecisionReviewDefinition revDef, IAtsChangeSet changes, TeamWorkFlowArtifact teamArt, Date createdDate, IAtsUser createdBy) throws OseeCoreException {
if (Artifacts.getNames(ReviewManager.getReviews(teamArt)).contains(revDef.getReviewTitle())) {
// Already created this review
return null;
@@ -60,7 +61,7 @@ public class DecisionReviewDefinitionManager extends TransitionAdapter {
decArt =
DecisionReviewManager.createNewDecisionReviewAndTransitionToDecision(teamArt, revDef.getReviewTitle(),
revDef.getDescription(), revDef.getRelatedToState(), revDef.getBlockingType(), revDef.getOptions(),
- users, createdDate, createdBy, transaction);
+ users, createdDate, createdBy, changes);
} else {
decArt =
DecisionReviewManager.createNewDecisionReview(teamArt, revDef.getBlockingType(), revDef.getReviewTitle(),
@@ -70,29 +71,30 @@ public class DecisionReviewDefinitionManager extends TransitionAdapter {
for (IReviewProvider provider : ReviewProviders.getAtsReviewProviders()) {
provider.reviewCreated(decArt);
}
- decArt.persist(transaction);
+ changes.add(decArt);
return decArt;
}
@Override
- public void transitioned(AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
+ public void transitioned(IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
// Create any decision or peerToPeer reviews for transitionTo and transitionFrom
- if (!sma.isTeamWorkflow()) {
+ if (!(workItem instanceof IAtsTeamWorkflow)) {
return;
}
Date createdDate = new Date();
IAtsUser createdBy = AtsCoreUsers.SYSTEM_USER;
- TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) sma;
+ TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) workItem;
for (IAtsDecisionReviewDefinition decRevDef : teamArt.getStateDefinition().getDecisionReviews()) {
if (decRevDef.getStateEventType() != null && decRevDef.getStateEventType().equals(StateEventType.TransitionTo)) {
DecisionReviewArtifact decArt =
- DecisionReviewDefinitionManager.createNewDecisionReview(decRevDef, transaction, teamArt, createdDate,
- createdBy);
+ DecisionReviewDefinitionManager.createNewDecisionReview(decRevDef, changes, teamArt,
+ createdDate, createdBy);
if (decArt != null) {
- decArt.persist(transaction);
+ changes.add(decArt);
}
}
}
}
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewManager.java
index 5b5918180d..bc0e8bb48e 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewManager.java
@@ -20,24 +20,24 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsDecisionReviewOption;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.StateType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.workdef.SimpleDecisionReviewOption;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* Methods in support of Decision Reviews
@@ -56,7 +56,7 @@ public class DecisionReviewManager {
*
* @param user User to transition to OR null if should use user of current state
*/
- public static Result transitionTo(DecisionReviewArtifact reviewArt, DecisionReviewState toState, IAtsUser user, boolean popup, SkynetTransaction transaction) throws OseeCoreException {
+ public static Result transitionTo(DecisionReviewArtifact reviewArt, DecisionReviewState toState, IAtsUser user, boolean popup, IAtsChangeSet changes) throws OseeCoreException {
Result result = Result.TrueResult;
// If in Prepare state, set data and transition to Decision
if (reviewArt.isInState(DecisionReviewState.Prepare)) {
@@ -65,7 +65,8 @@ public class DecisionReviewManager {
return result;
}
result =
- transitionToState(toState.getStateType(), popup, DecisionReviewState.Decision, reviewArt, user, transaction);
+ transitionToState(toState.getStateType(), popup, DecisionReviewState.Decision, reviewArt, user,
+ changes);
if (result.isFalse()) {
return result;
}
@@ -82,7 +83,7 @@ public class DecisionReviewManager {
return result;
}
- result = transitionToState(toState.getStateType(), popup, toState, reviewArt, user, transaction);
+ result = transitionToState(toState.getStateType(), popup, toState, reviewArt, user, changes);
if (result.isFalse()) {
return result;
}
@@ -101,12 +102,12 @@ public class DecisionReviewManager {
return Result.TrueResult;
}
- public static Result transitionToState(StateType StateType, boolean popup, IStateToken toState, DecisionReviewArtifact reviewArt, IAtsUser user, SkynetTransaction transaction) throws OseeCoreException {
+ public static Result transitionToState(StateType StateType, boolean popup, IStateToken toState, DecisionReviewArtifact reviewArt, IAtsUser user, IAtsChangeSet changes) throws OseeCoreException {
TransitionHelper helper =
new TransitionHelper("Transition to " + toState.getName(), Arrays.asList(reviewArt), toState.getName(),
Arrays.asList((user == null ? reviewArt.getStateMgr().getAssignees().iterator().next() : user)), null,
- TransitionOption.None);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ changes, TransitionOption.None);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
if (results.isEmpty()) {
return Result.TrueResult;
@@ -127,17 +128,17 @@ public class DecisionReviewManager {
return Result.TrueResult;
}
- public static DecisionReviewArtifact createNewDecisionReviewAndTransitionToDecision(TeamWorkFlowArtifact teamArt, String reviewTitle, String description, String againstState, ReviewBlockType reviewBlockType, Collection<IAtsDecisionReviewOption> options, List<? extends IAtsUser> assignees, Date createdDate, IAtsUser createdBy, SkynetTransaction transaction) throws OseeCoreException {
+ public static DecisionReviewArtifact createNewDecisionReviewAndTransitionToDecision(TeamWorkFlowArtifact teamArt, String reviewTitle, String description, String againstState, ReviewBlockType reviewBlockType, Collection<IAtsDecisionReviewOption> options, List<? extends IAtsUser> assignees, Date createdDate, IAtsUser createdBy, IAtsChangeSet changes) throws OseeCoreException {
DecisionReviewArtifact decRev =
createNewDecisionReview(teamArt, reviewBlockType, reviewTitle, againstState, description, options, assignees,
createdDate, createdBy);
- decRev.persist(transaction);
+ changes.add(decRev);
// transition to decision
TransitionHelper helper =
new TransitionHelper("Transition to Decision", Arrays.asList(decRev), DecisionReviewState.Decision.getName(),
- assignees, null, TransitionOption.OverrideAssigneeCheck);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ assignees, null, changes, TransitionOption.OverrideAssigneeCheck);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
if (!results.isEmpty()) {
@@ -146,7 +147,7 @@ public class DecisionReviewManager {
}
// ensure assignees are as requested
decRev.getStateMgr().setAssignees(assignees);
- decRev.persist(transaction);
+ changes.add(decRev);
return decRev;
}
@@ -159,7 +160,8 @@ public class DecisionReviewManager {
public static List<IAtsDecisionReviewOption> getDefaultDecisionReviewOptions() throws OseeCoreException {
List<IAtsDecisionReviewOption> options = new ArrayList<IAtsDecisionReviewOption>();
- options.add(new SimpleDecisionReviewOption("Yes", true, Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser().getUserId())));
+ options.add(new SimpleDecisionReviewOption("Yes", true,
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser().getUserId())));
options.add(new SimpleDecisionReviewOption("No", false, null));
return options;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerReviewDefinitionManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerReviewDefinitionManager.java
index d81b4c4c4c..8e7e601831 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerReviewDefinitionManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerReviewDefinitionManager.java
@@ -12,26 +12,27 @@ package org.eclipse.osee.ats.core.client.review;
import java.util.Collection;
import java.util.Date;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsPeerReviewDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.StateEventType;
import org.eclipse.osee.ats.api.workflow.log.LogType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionAdapter;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionAdapter;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
/**
* Create PeerToPeer Review from transition if defined by StateDefinition.
- *
+ *
* @author Donald G. Dunne
*/
public class PeerReviewDefinitionManager extends TransitionAdapter {
@@ -39,7 +40,7 @@ public class PeerReviewDefinitionManager extends TransitionAdapter {
/**
* Creates PeerToPeer review if one of same name doesn't already exist
*/
- public static PeerToPeerReviewArtifact createNewPeerToPeerReview(IAtsPeerReviewDefinition peerRevDef, SkynetTransaction transaction, TeamWorkFlowArtifact teamArt, Date createdDate, IAtsUser createdBy) throws OseeCoreException {
+ public static PeerToPeerReviewArtifact createNewPeerToPeerReview(IAtsPeerReviewDefinition peerRevDef, IAtsChangeSet changes, TeamWorkFlowArtifact teamArt, Date createdDate, IAtsUser createdBy) throws OseeCoreException {
String title = peerRevDef.getReviewTitle();
if (!Strings.isValid(title)) {
title = String.format("Review [%s]", teamArt.getName());
@@ -50,7 +51,7 @@ public class PeerReviewDefinitionManager extends TransitionAdapter {
}
PeerToPeerReviewArtifact peerArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt, title, peerRevDef.getRelatedToState(), createdDate,
- createdBy, transaction);
+ createdBy, changes);
if (Strings.isValid(peerRevDef.getDescription())) {
peerArt.setSoleAttributeFromString(AtsAttributeTypes.Description, peerRevDef.getDescription());
}
@@ -61,7 +62,8 @@ public class PeerReviewDefinitionManager extends TransitionAdapter {
if (Strings.isValid(peerRevDef.getLocation())) {
peerArt.setSoleAttributeFromString(AtsAttributeTypes.Location, peerRevDef.getLocation());
}
- Collection<IAtsUser> assignees = AtsClientService.get().getUserAdmin().getUsersByUserIds(peerRevDef.getAssignees());
+ Collection<IAtsUser> assignees =
+ AtsClientService.get().getUserAdmin().getUsersByUserIds(peerRevDef.getAssignees());
if (assignees.size() > 0) {
peerArt.getStateMgr().setAssignees(assignees);
}
@@ -73,7 +75,8 @@ public class PeerReviewDefinitionManager extends TransitionAdapter {
}
@Override
- public void transitioned(AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
+ public void transitioned(IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
+ AbstractWorkflowArtifact sma = (AbstractWorkflowArtifact) workItem;
// Create any decision or peerToPeer reviews for transitionTo and transitionFrom
if (!sma.isTeamWorkflow()) {
return;
@@ -86,9 +89,9 @@ public class PeerReviewDefinitionManager extends TransitionAdapter {
if (peerRevDef.getStateEventType() != null && peerRevDef.getStateEventType().equals(
StateEventType.TransitionTo)) {
PeerToPeerReviewArtifact decArt =
- createNewPeerToPeerReview(peerRevDef, transaction, teamArt, createdDate, createdBy);
+ createNewPeerToPeerReview(peerRevDef, changes, teamArt, createdDate, createdBy);
if (decArt != null) {
- decArt.persist(transaction);
+ changes.add(decArt);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerToPeerReviewManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerToPeerReviewManager.java
index 6d49525d9f..5d8c62df71 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerToPeerReviewManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerToPeerReviewManager.java
@@ -19,10 +19,13 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.StateType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.review.defect.ReviewDefectItem;
import org.eclipse.osee.ats.core.client.review.defect.ReviewDefectManager;
@@ -30,14 +33,11 @@ import org.eclipse.osee.ats.core.client.review.role.UserRole;
import org.eclipse.osee.ats.core.client.review.role.UserRoleManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* Methods in support of programatically transitioning the Peer Review Workflow through it's states. Only to be used for
@@ -61,14 +61,14 @@ public class PeerToPeerReviewManager {
*
* @param user User to transition to OR null if should use user of current state
*/
- public static Result transitionTo(PeerToPeerReviewArtifact reviewArt, PeerToPeerReviewState toState, Collection<UserRole> roles, Collection<ReviewDefectItem> defects, IAtsUser user, boolean popup, SkynetTransaction transaction) throws OseeCoreException {
- Result result = setPrepareStateData(popup, reviewArt, roles, "DoThis.java", 100, .2, transaction);
+ public static Result transitionTo(PeerToPeerReviewArtifact reviewArt, PeerToPeerReviewState toState, Collection<UserRole> roles, Collection<ReviewDefectItem> defects, IAtsUser user, boolean popup, IAtsChangeSet changes) throws OseeCoreException {
+ Result result = setPrepareStateData(popup, reviewArt, roles, "DoThis.java", 100, .2, changes);
if (result.isFalse()) {
return result;
}
result =
transitionToState(PeerToPeerReviewState.Review.getStateType(), popup, reviewArt, PeerToPeerReviewState.Review,
- transaction);
+ changes);
if (result.isFalse()) {
return result;
}
@@ -76,26 +76,26 @@ public class PeerToPeerReviewManager {
return Result.TrueResult;
}
- result = setReviewStateData(reviewArt, roles, defects, 100, .2, transaction);
+ result = setReviewStateData(reviewArt, roles, defects, 100, .2, changes);
if (result.isFalse()) {
return result;
}
result =
transitionToState(PeerToPeerReviewState.Completed.getStateType(), popup, reviewArt,
- PeerToPeerReviewState.Completed, transaction);
+ PeerToPeerReviewState.Completed, changes);
if (result.isFalse()) {
return result;
}
return Result.TrueResult;
}
- private static Result transitionToState(StateType StateType, boolean popup, PeerToPeerReviewArtifact reviewArt, IStateToken toState, SkynetTransaction transaction) throws OseeCoreException {
+ private static Result transitionToState(StateType StateType, boolean popup, PeerToPeerReviewArtifact reviewArt, IStateToken toState, IAtsChangeSet changes) throws OseeCoreException {
TransitionHelper helper =
new TransitionHelper("Transition to " + toState.getName(), Arrays.asList(reviewArt), toState.getName(),
Arrays.asList(reviewArt.getStateMgr().getAssignees().iterator().next()), null,
- TransitionOption.OverrideAssigneeCheck);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ changes, TransitionOption.OverrideAssigneeCheck);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
if (results.isEmpty()) {
return Result.TrueResult;
@@ -103,7 +103,7 @@ public class PeerToPeerReviewManager {
return new Result("Error transitioning [%s]", results);
}
- public static Result setPrepareStateData(boolean popup, PeerToPeerReviewArtifact reviewArt, Collection<UserRole> roles, String reviewMaterials, int statePercentComplete, double stateHoursSpent, SkynetTransaction transaction) throws OseeCoreException {
+ public static Result setPrepareStateData(boolean popup, PeerToPeerReviewArtifact reviewArt, Collection<UserRole> roles, String reviewMaterials, int statePercentComplete, double stateHoursSpent, IAtsChangeSet changes) throws OseeCoreException {
if (!reviewArt.isInState(PeerToPeerReviewState.Prepare)) {
Result result = new Result("Action not in Prepare state");
if (result.isFalse() && popup) {
@@ -116,7 +116,7 @@ public class PeerToPeerReviewManager {
for (UserRole role : roles) {
roleMgr.addOrUpdateUserRole(role, reviewArt);
}
- roleMgr.saveToArtifact(transaction);
+ roleMgr.saveToArtifact(changes);
}
reviewArt.setSoleAttributeValue(AtsAttributeTypes.Location, reviewMaterials);
reviewArt.setSoleAttributeValue(AtsAttributeTypes.ReviewFormalType, ReviewFormalType.InFormal.name());
@@ -124,13 +124,13 @@ public class PeerToPeerReviewManager {
return Result.TrueResult;
}
- public static Result setReviewStateData(PeerToPeerReviewArtifact reviewArt, Collection<UserRole> roles, Collection<ReviewDefectItem> defects, int statePercentComplete, double stateHoursSpent, SkynetTransaction transaction) throws OseeCoreException {
+ public static Result setReviewStateData(PeerToPeerReviewArtifact reviewArt, Collection<UserRole> roles, Collection<ReviewDefectItem> defects, int statePercentComplete, double stateHoursSpent, IAtsChangeSet changes) throws OseeCoreException {
if (roles != null) {
UserRoleManager roleMgr = new UserRoleManager(reviewArt);
for (UserRole role : roles) {
roleMgr.addOrUpdateUserRole(role, reviewArt);
}
- roleMgr.saveToArtifact(transaction);
+ roleMgr.saveToArtifact(changes);
}
if (defects != null) {
ReviewDefectManager defectManager = new ReviewDefectManager(reviewArt);
@@ -143,34 +143,34 @@ public class PeerToPeerReviewManager {
return Result.TrueResult;
}
- public static PeerToPeerReviewArtifact createNewPeerToPeerReview(TeamWorkFlowArtifact teamArt, String reviewTitle, String againstState, SkynetTransaction transaction) throws OseeCoreException {
+ public static PeerToPeerReviewArtifact createNewPeerToPeerReview(TeamWorkFlowArtifact teamArt, String reviewTitle, String againstState, IAtsChangeSet changes) throws OseeCoreException {
return createNewPeerToPeerReview(teamArt, reviewTitle, againstState, new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), changes);
}
- public static PeerToPeerReviewArtifact createNewPeerToPeerReview(IAtsWorkDefinition workDefinition, TeamWorkFlowArtifact teamArt, String reviewTitle, String againstState, SkynetTransaction transaction) throws OseeCoreException {
+ public static PeerToPeerReviewArtifact createNewPeerToPeerReview(IAtsWorkDefinition workDefinition, TeamWorkFlowArtifact teamArt, String reviewTitle, String againstState, IAtsChangeSet changes) throws OseeCoreException {
return createNewPeerToPeerReview(workDefinition, teamArt, reviewTitle, againstState, new Date(),
- AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), changes);
}
- public static PeerToPeerReviewArtifact createNewPeerToPeerReview(TeamWorkFlowArtifact teamArt, String reviewTitle, String againstState, Date createdDate, IAtsUser createdBy, SkynetTransaction transaction) throws OseeCoreException {
+ public static PeerToPeerReviewArtifact createNewPeerToPeerReview(TeamWorkFlowArtifact teamArt, String reviewTitle, String againstState, Date createdDate, IAtsUser createdBy, IAtsChangeSet changes) throws OseeCoreException {
return createNewPeerToPeerReview(
AtsClientService.get().getWorkDefinitionAdmin().getWorkDefinitionForPeerToPeerReviewNotYetCreated(teamArt).getWorkDefinition(),
- teamArt, reviewTitle, againstState, createdDate, createdBy, transaction);
+ teamArt, reviewTitle, againstState, createdDate, createdBy, changes);
}
- public static PeerToPeerReviewArtifact createNewPeerToPeerReview(IAtsActionableItem actionableItem, String reviewTitle, String againstState, Date createdDate, IAtsUser createdBy, SkynetTransaction transaction) throws OseeCoreException {
+ public static PeerToPeerReviewArtifact createNewPeerToPeerReview(IAtsActionableItem actionableItem, String reviewTitle, String againstState, Date createdDate, IAtsUser createdBy, IAtsChangeSet changes) throws OseeCoreException {
PeerToPeerReviewArtifact peerArt =
createNewPeerToPeerReview(
AtsClientService.get().getWorkDefinitionAdmin().getWorkDefinitionForPeerToPeerReviewNotYetCreatedAndStandalone(
actionableItem).getWorkDefinition(), null, reviewTitle, againstState, createdDate, createdBy,
- transaction);
+ changes);
peerArt.getActionableItemsDam().addActionableItem(actionableItem);
- peerArt.persist(transaction);
+ changes.add(peerArt);
return peerArt;
}
- public static PeerToPeerReviewArtifact createNewPeerToPeerReview(IAtsWorkDefinition workDefinition, TeamWorkFlowArtifact teamArt, String reviewTitle, String againstState, Date createdDate, IAtsUser createdBy, SkynetTransaction transaction) throws OseeCoreException {
+ public static PeerToPeerReviewArtifact createNewPeerToPeerReview(IAtsWorkDefinition workDefinition, TeamWorkFlowArtifact teamArt, String reviewTitle, String againstState, Date createdDate, IAtsUser createdBy, IAtsChangeSet changes) throws OseeCoreException {
PeerToPeerReviewArtifact peerToPeerRev =
(PeerToPeerReviewArtifact) ArtifactTypeManager.addArtifact(AtsArtifactTypes.PeerToPeerReview,
AtsUtilCore.getAtsBranch(), reviewTitle == null ? "Peer to Peer Review" : reviewTitle);
@@ -187,9 +187,7 @@ public class PeerToPeerReviewManager {
peerToPeerRev.setSoleAttributeValue(AtsAttributeTypes.RelatedToState, againstState);
}
peerToPeerRev.setSoleAttributeValue(AtsAttributeTypes.ReviewBlocks, ReviewBlockType.None.name());
- if (transaction != null) {
- peerToPeerRev.persist(transaction);
- }
+ changes.add(peerToPeerRev);
AtsReviewCache.decache(teamArt);
return peerToPeerRev;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/ReviewManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/ReviewManager.java
index 89fa6b43fa..eaee9c5421 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/ReviewManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/ReviewManager.java
@@ -16,6 +16,7 @@ import java.util.Set;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
@@ -23,6 +24,7 @@ import org.eclipse.osee.ats.core.util.HoursSpentUtil;
import org.eclipse.osee.ats.core.util.PercentCompleteTotalUtil;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -76,8 +78,8 @@ public class ReviewManager {
return AtsReviewCache.getReviewArtifacts(teamArt);
}
- public static Collection<AbstractReviewArtifact> getReviewsFromCurrentState(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- return getReviews(teamArt, teamArt.getStateMgr().getCurrentState());
+ public static Collection<IAtsAbstractReview> getReviewsFromCurrentState(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
+ return Collections.castAll(getReviews(teamArt, teamArt.getStateMgr().getCurrentState()));
}
public static Collection<AbstractReviewArtifact> getReviews(TeamWorkFlowArtifact teamArt, IStateToken state) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/ValidateReviewManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/ValidateReviewManager.java
index dfef807153..5ed1e27431 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/ValidateReviewManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/ValidateReviewManager.java
@@ -16,21 +16,22 @@ import java.util.Date;
import java.util.HashSet;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.RuleDefinitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* Convenience methods used to create a validation decision review if so selected on the new action wizard
@@ -56,15 +57,15 @@ public class ValidateReviewManager {
*
* @param force will force the creation of the review without checking that a review should be created
*/
- public static DecisionReviewArtifact createValidateReview(TeamWorkFlowArtifact teamArt, boolean force, Date createdDate, IAtsUser createdBy, SkynetTransaction transaction) throws OseeCoreException {
+ public static DecisionReviewArtifact createValidateReview(TeamWorkFlowArtifact teamArt, boolean force, Date createdDate, IAtsUser createdBy, IAtsChangeSet changes) throws OseeCoreException {
// If not validate page, don't do anything
if (!force && !isValidatePage(teamArt.getStateDefinition())) {
return null;
}
// If validate review already created for this state, return
if (!force && ReviewManager.getReviewsFromCurrentState(teamArt).size() > 0) {
- for (AbstractReviewArtifact rev : ReviewManager.getReviewsFromCurrentState(teamArt)) {
- if (rev.getName().equals(VALIDATE_REVIEW_TITLE)) {
+ for (IAtsAbstractReview review : ReviewManager.getReviewsFromCurrentState(teamArt)) {
+ if (review.getName().equals(VALIDATE_REVIEW_TITLE)) {
return null;
}
}
@@ -83,9 +84,9 @@ public class ValidateReviewManager {
TransitionHelper helper =
new TransitionHelper("Transition to Decision", Arrays.asList(decRev),
- DecisionReviewState.Decision.getName(), Arrays.asList(teamArt.getCreatedBy()), null,
+ DecisionReviewState.Decision.getName(), Arrays.asList(teamArt.getCreatedBy()), null, changes,
TransitionOption.None);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
if (!results.isEmpty()) {
OseeLog.logf(Activator.class, OseeLevel.SEVERE_POPUP,
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/XDecisionOptions.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/XDecisionOptions.java
index 4f5387ec8d..ca1b4995c0 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/XDecisionOptions.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/XDecisionOptions.java
@@ -14,11 +14,13 @@ import java.lang.ref.WeakReference;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResult;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.internal.Activator;
+import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
-import org.eclipse.osee.ats.core.workflow.transition.TransitionResult;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -33,6 +35,10 @@ public class XDecisionOptions {
private final WeakReference<AbstractWorkflowArtifact> smaRef;
private final IAttributeType attributeType;
+ public XDecisionOptions(IAtsWorkItem workItem) throws OseeCoreException {
+ this((AbstractWorkflowArtifact) AtsClientService.get().getArtifact(workItem));
+ }
+
public XDecisionOptions(AbstractWorkflowArtifact sma) {
this.smaRef = new WeakReference<AbstractWorkflowArtifact>(sma);
this.attributeType = AtsAttributeTypes.DecisionReviewOptions;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/UserRoleManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/UserRoleManager.java
index 3ceae0a4ee..3f977ce8cf 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/UserRoleManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/UserRoleManager.java
@@ -16,9 +16,11 @@ import java.util.List;
import java.util.logging.Level;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.notify.AtsNotifyType;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.notify.AtsNotificationManager;
@@ -37,7 +39,6 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -122,16 +123,16 @@ public class UserRoleManager {
return storedUserRoles;
}
- public void saveToArtifact(SkynetTransaction transaction) throws OseeCoreException {
+ public void saveToArtifact(IAtsChangeSet changes) throws OseeCoreException {
if (valueProvider instanceof ArtifactValueProvider) {
- saveToArtifact(((ArtifactValueProvider) valueProvider).getArtifact(), transaction);
+ saveToArtifact(((ArtifactValueProvider) valueProvider).getArtifact(), changes);
} else {
throw new OseeArgumentException(
"Can't saveToArtifact unless provider is ArtifactValueProvider, use saveToArtifact(Artifact artifact, SkynetTransaction transaction)");
}
}
- public void saveToArtifact(Artifact artifact, SkynetTransaction transaction) {
+ public void saveToArtifact(Artifact artifact, IAtsChangeSet changes) {
try {
List<UserRole> storedUserRoles = getStoredUserRoles(artifact);
@@ -162,7 +163,7 @@ public class UserRoleManager {
}
rollupHoursSpentToReviewState(artifact);
validateUserRolesCompleted(artifact, storedUserRoles, userRoles);
- artifact.persist(transaction);
+ changes.add((IAtsObject) artifact);
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, "Can't create ats review role document", ex);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AbstractTaskableArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AbstractTaskableArtifact.java
index 46287734c3..b9bc82c15c 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AbstractTaskableArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AbstractTaskableArtifact.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.core.client.internal.Activator;
@@ -39,7 +40,6 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -65,10 +65,10 @@ public abstract class AbstractTaskableArtifact extends AbstractWorkflowArtifact
}
@Override
- public void transitioned(IAtsStateDefinition fromState, IAtsStateDefinition toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
- super.transitioned(fromState, toState, toAssignees, transaction);
+ public void transitioned(IAtsStateDefinition fromState, IAtsStateDefinition toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
+ super.transitioned(fromState, toState, toAssignees, changes);
for (TaskArtifact taskArt : getTaskArtifacts()) {
- taskArt.parentWorkFlowTransitioned(fromState, toState, toAssignees, transaction);
+ taskArt.parentWorkFlowTransitioned(fromState, toState, toAssignees, changes);
}
}
@@ -243,14 +243,14 @@ public abstract class AbstractTaskableArtifact extends AbstractWorkflowArtifact
return spent / taskArts.size();
}
- public Collection<TaskArtifact> createTasks(List<String> titles, List<IAtsUser> assignees, Date createdDate, IAtsUser createdBy, SkynetTransaction transaction) throws OseeCoreException {
- return createTasks(titles, assignees, createdDate, createdBy, null, transaction);
+ public Collection<TaskArtifact> createTasks(List<String> titles, List<IAtsUser> assignees, Date createdDate, IAtsUser createdBy, IAtsChangeSet changes) throws OseeCoreException {
+ return createTasks(titles, assignees, createdDate, createdBy, null, changes);
}
/**
* @param relatedToState State name Tasks must be completed in or null
*/
- public Collection<TaskArtifact> createTasks(List<String> titles, List<IAtsUser> assignees, Date createdDate, IAtsUser createdBy, String relatedToState, SkynetTransaction transaction) throws OseeCoreException {
+ public Collection<TaskArtifact> createTasks(List<String> titles, List<IAtsUser> assignees, Date createdDate, IAtsUser createdBy, String relatedToState, IAtsChangeSet changes) throws OseeCoreException {
List<TaskArtifact> tasks = new ArrayList<TaskArtifact>();
for (String title : titles) {
TaskArtifact taskArt = createNewTask(title, createdDate, createdBy, relatedToState);
@@ -262,7 +262,7 @@ public abstract class AbstractTaskableArtifact extends AbstractWorkflowArtifact
taskArt.getStateMgr().setAssignees(users);
}
tasks.add(taskArt);
- taskArt.persist(transaction);
+ changes.add(taskArt);
}
return tasks;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskArtifact.java
index f8962dc9af..0f35358a0d 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskArtifact.java
@@ -17,20 +17,21 @@ import java.util.List;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workflow.IAtsTask;
import org.eclipse.osee.ats.api.workflow.log.IAtsLog;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.api.workflow.log.LogType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.util.Result;
@@ -38,7 +39,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.IATSStateMachineArtifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -67,20 +67,20 @@ public class TaskArtifact extends AbstractWorkflowArtifact implements IAtsTask,
}
}
- public Result parentWorkFlowTransitioned(IAtsStateDefinition fromState, IAtsStateDefinition toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
+ public Result parentWorkFlowTransitioned(IAtsStateDefinition fromState, IAtsStateDefinition toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
if (toState.getName().equals(TeamState.Cancelled.getName()) && isInWork()) {
TransitionHelper helper =
new TransitionHelper("Transition to Cancelled", Arrays.asList(this), TaskStates.Cancelled.getName(), null,
- "Parent Cancelled", TransitionOption.None);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ "Parent Cancelled", changes, TransitionOption.None);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
+
if (!results.isEmpty()) {
return new Result("Transition Error %s", results.toString());
}
} else if (fromState.getName().equals(TeamState.Cancelled.getName()) && isCancelled()) {
Result result =
- TaskManager.transitionToInWork(this, AtsClientService.get().getUserAdmin().getCurrentUser(), 99, 0,
- transaction);
+ TaskManager.transitionToInWork(this, AtsClientService.get().getUserAdmin().getCurrentUser(), 99, 0, changes);
return result;
}
return Result.TrueResult;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskManager.java
index 2a5e9529fc..250e48a88f 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskManager.java
@@ -17,16 +17,17 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.workdef.WorkDefinitionMatch;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -46,7 +47,7 @@ public class TaskManager {
return null;
}
- public static Result transitionToCompleted(TaskArtifact taskArt, double estimatedHours, double additionalHours, SkynetTransaction transaction) {
+ public static Result transitionToCompleted(TaskArtifact taskArt, double estimatedHours, double additionalHours, IAtsChangeSet changes) {
if (taskArt.isInState(TeamState.Completed)) {
return Result.TrueResult;
}
@@ -61,9 +62,10 @@ public class TaskManager {
}
TransitionHelper helper =
new TransitionHelper("Transition to Completed", Arrays.asList(taskArt), TaskStates.Completed.getName(),
- null, null);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ null, null, changes);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
+
if (results.isEmpty()) {
return Result.TrueResult;
}
@@ -75,14 +77,14 @@ public class TaskManager {
}
}
- public static Result transitionToInWork(TaskArtifact taskArt, IAtsUser toUser, int percentComplete, double additionalHours, SkynetTransaction transaction) throws OseeCoreException {
+ public static Result transitionToInWork(TaskArtifact taskArt, IAtsUser toUser, int percentComplete, double additionalHours, IAtsChangeSet changes) throws OseeCoreException {
if (taskArt.isInState(TaskStates.InWork)) {
return Result.TrueResult;
}
TransitionHelper helper =
new TransitionHelper("Transition to InWork", Arrays.asList(taskArt), TaskStates.InWork.getName(),
- Arrays.asList(toUser), null, TransitionOption.OverrideAssigneeCheck);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ Arrays.asList(toUser), null, changes, TransitionOption.OverrideAssigneeCheck);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
if (!results.isEmpty()) {
return new Result("Transition Error %s", results.toString());
@@ -90,8 +92,8 @@ public class TaskManager {
if (taskArt.getStateMgr().getPercentComplete(taskArt.getCurrentStateName()) != percentComplete || additionalHours > 0) {
taskArt.getStateMgr().updateMetrics(taskArt.getStateDefinition(), additionalHours, percentComplete, true);
}
- if (transaction != null) {
- taskArt.saveSMA(transaction);
+ if (changes != null) {
+ taskArt.saveSMA(changes);
}
return Result.TrueResult;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/AbstractTaskOp.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/AbstractTaskOp.java
index 861cf4abea..18f22fc0db 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/AbstractTaskOp.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/AbstractTaskOp.java
@@ -12,9 +12,9 @@ package org.eclipse.osee.ats.core.client.task.createtasks;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Shawn F. Cook
@@ -22,7 +22,7 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
public abstract class AbstractTaskOp implements ITaskOperation {
@Override
- public abstract IStatus execute(TaskMetadata metadata, SkynetTransaction transaction) throws OseeCoreException;
+ public abstract IStatus execute(TaskMetadata metadata, IAtsChangeSet changes) throws OseeCoreException;
protected Status generateGenericOkStatus(TaskEnum taskEnum, String task, String parentTeamWf, String changedArt) {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/CreateTasksOperation.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/CreateTasksOperation.java
index e7b0f2ef7d..c2d9cd4937 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/CreateTasksOperation.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/CreateTasksOperation.java
@@ -25,6 +25,7 @@ import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.CreateTeamOption;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.config.ActionableItemManager;
@@ -42,7 +43,6 @@ import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.revision.ChangeData;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Shawn F. Cook
@@ -54,10 +54,10 @@ public class CreateTasksOperation extends AbstractOperation {
private final TeamWorkFlowArtifact reqTeamWf;
private final boolean reportOnly;
private final XResultData resultData;
- private final SkynetTransaction transaction;
private final ITaskTitleProvider taskTitleProvider;
+ private final IAtsChangeSet changes;
- public CreateTasksOperation(IAtsVersion destinationVersion, IAtsActionableItem actionableItemArt, ChangeData changeData, TeamWorkFlowArtifact reqTeamWf, boolean reportOnly, XResultData resultData, SkynetTransaction transaction, OperationLogger logger, ITaskTitleProvider taskTitleProvider) {
+ public CreateTasksOperation(IAtsVersion destinationVersion, IAtsActionableItem actionableItemArt, ChangeData changeData, TeamWorkFlowArtifact reqTeamWf, boolean reportOnly, XResultData resultData, IAtsChangeSet changes, OperationLogger logger, ITaskTitleProvider taskTitleProvider) {
super("Create Tasks Operation for [" + reqTeamWf.getName() + "]", Activator.PLUGIN_ID, logger);
this.destVersion = destinationVersion;
this.actionableItemArt = actionableItemArt;
@@ -65,7 +65,7 @@ public class CreateTasksOperation extends AbstractOperation {
this.reqTeamWf = reqTeamWf;
this.reportOnly = reportOnly;
this.resultData = resultData;
- this.transaction = transaction;
+ this.changes = changes;
this.taskTitleProvider = taskTitleProvider;
}
@@ -105,7 +105,7 @@ public class CreateTasksOperation extends AbstractOperation {
// Ensure the destination workflow exists. - destTeamWf is only necessary if NOT reportOnly
TeamWorkFlowArtifact destTeamWf =
- ensureDestTeamWfExists(reqTeamWf, actionableItemArt, destVersion, transaction, reportOnly);
+ ensureDestTeamWfExists(reqTeamWf, actionableItemArt, destVersion, changes, reportOnly);
if (destTeamWf == null) {
String msg = "CreateTasksOperation: Failed to create new team workflow for [" + reqTeamWf.getName() + "]";
OseeLog.log(Activator.class, Level.SEVERE, msg);
@@ -117,7 +117,7 @@ public class CreateTasksOperation extends AbstractOperation {
// Execute taskOps
ExecuteTaskOpList executeTaskOpList = new ExecuteTaskOpList();
- Map<TaskMetadata, IStatus> statusMap = executeTaskOpList.execute(metadatas, ops, transaction);
+ Map<TaskMetadata, IStatus> statusMap = executeTaskOpList.execute(metadatas, ops, changes);
// Populate status report
resultData.addRaw("Status report for creating tasks for workflow:" + reqTeamWf.toStringWithId());
@@ -176,10 +176,8 @@ public class CreateTasksOperation extends AbstractOperation {
/**
* Get the team workflow related to the teamWf parameter via the 'derived from' relationship that is also targeted
* for the version parameter. If such a workflow does not exist then return null.
- *
- * @throws OseeCoreException
*/
- private TeamWorkFlowArtifact ensureDestTeamWfExists(TeamWorkFlowArtifact reqTeamWf, IAtsActionableItem actionableItemArt, IAtsVersion destVersion, SkynetTransaction transaction, boolean reportOnly) throws OseeCoreException {
+ private TeamWorkFlowArtifact ensureDestTeamWfExists(TeamWorkFlowArtifact reqTeamWf, IAtsActionableItem actionableItemArt, IAtsVersion destVersion, IAtsChangeSet changes, boolean reportOnly) throws OseeCoreException {
Date createdDate = new Date();
IAtsUser createdBy = AtsClientService.get().getUserAdmin().getCurrentUser();
@@ -192,8 +190,8 @@ public class CreateTasksOperation extends AbstractOperation {
destTeamWf =
ActionManager.createTeamWorkflow(actionArt, teamDef, Collections.singleton(actionableItemArt),
- Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), transaction, createdDate, createdBy, null,
- CreateTeamOption.Duplicate_If_Exists);
+ Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), changes, createdDate, createdBy,
+ null, CreateTeamOption.Duplicate_If_Exists);
if (destTeamWf != null) {
AtsVersionService.get().setTargetedVersionAndStore(destTeamWf, destVersion);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/ExecuteTaskOpList.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/ExecuteTaskOpList.java
index 501cb0dfaf..3816cac657 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/ExecuteTaskOpList.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/ExecuteTaskOpList.java
@@ -14,19 +14,19 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Shawn F. Cook
*/
public class ExecuteTaskOpList {
- public Map<TaskMetadata, IStatus> execute(List<TaskMetadata> metadatas, Map<TaskEnum, ITaskOperation> ops, SkynetTransaction transaction) throws OseeCoreException {
+ public Map<TaskMetadata, IStatus> execute(List<TaskMetadata> metadatas, Map<TaskEnum, ITaskOperation> ops, IAtsChangeSet changes) throws OseeCoreException {
Map<TaskMetadata, IStatus> statusMap = new HashMap<TaskMetadata, IStatus>();
for (TaskMetadata metadata : metadatas) {
ITaskOperation operation = ops.get(metadata.getTaskEnum());
- IStatus status = operation.execute(metadata, transaction);
+ IStatus status = operation.execute(metadata, changes);
statusMap.put(metadata, status);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/ITaskOperation.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/ITaskOperation.java
index 0d8d63f980..d014267455 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/ITaskOperation.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/ITaskOperation.java
@@ -11,8 +11,8 @@
package org.eclipse.osee.ats.core.client.task.createtasks;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Shawn F. Cook
@@ -20,5 +20,5 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
public interface ITaskOperation {
public final static String AUTO_GENERATED_STATIC_ID = "taskAutoGen";
- IStatus execute(TaskMetadata metadata, SkynetTransaction transaction) throws OseeCoreException;
+ IStatus execute(TaskMetadata metadata, IAtsChangeSet changes) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpCreate.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpCreate.java
index 56f0c0e1b0..dd446bb36a 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpCreate.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpCreate.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.ats.core.client.task.createtasks;
import java.util.Date;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
@@ -20,7 +21,6 @@ import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Shawn F. Cook
@@ -34,22 +34,21 @@ public class TaskOpCreate extends AbstractTaskOp {
}
@Override
- public IStatus execute(TaskMetadata metadata, SkynetTransaction transaction) throws OseeCoreException {
+ public IStatus execute(TaskMetadata metadata, IAtsChangeSet changes) throws OseeCoreException {
TeamWorkFlowArtifact parentTeamWf = metadata.getParentTeamWf();
Artifact changedArtifact = metadata.getChangedArtifact();
String taskTitle = taskTitleProvider.getTaskTitle(metadata);
Date creationDate = new Date();
- TaskArtifact taskArt =
- parentTeamWf.createNewTask(taskTitle, creationDate, AtsCoreUsers.SYSTEM_USER);
+ TaskArtifact taskArt = parentTeamWf.createNewTask(taskTitle, creationDate, AtsCoreUsers.SYSTEM_USER);
// create for Implement state regardless of which state workflow is in
taskArt.setSoleAttributeValue(AtsAttributeTypes.RelatedToState, TeamState.Implement.getName());
taskArt.setSingletonAttributeValue(CoreAttributeTypes.StaticId, AUTO_GENERATED_STATIC_ID);
taskArt.setSoleAttributeFromString(AtsAttributeTypes.TaskToChangedArtifactReference, changedArtifact.getGuid());
- taskArt.persist(transaction);
- parentTeamWf.persist(transaction);
+ changes.add(taskArt);
+ changes.add(parentTeamWf);
return generateGenericOkStatus(metadata.getTaskEnum(), taskArt.toStringWithId(),
metadata.getParentTeamWf().toStringWithId(), changedArtifact.toStringWithId());
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpDoNothing.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpDoNothing.java
index ec658f9cb2..3931b3a1e7 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpDoNothing.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpDoNothing.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.ats.core.client.task.createtasks;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
/**
* @author Shawn F. Cook
@@ -25,7 +25,7 @@ public class TaskOpDoNothing extends AbstractTaskOp {
}
@Override
- public IStatus execute(TaskMetadata metadata, SkynetTransaction transaction) {
+ public IStatus execute(TaskMetadata metadata, IAtsChangeSet changes) {
String taskTitle = taskTitleProvider.getTaskTitle(metadata);
String changedArt = "[no changed artifact]";
return generateGenericOkStatus(metadata.getTaskEnum(), taskTitle, metadata.getParentTeamWf().toStringWithId(),
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpModify.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpModify.java
index a41719ee8b..7a133ced2d 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpModify.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/createtasks/TaskOpModify.java
@@ -12,10 +12,10 @@ package org.eclipse.osee.ats.core.client.task.createtasks;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Shawn F. Cook
@@ -24,7 +24,7 @@ public class TaskOpModify extends AbstractTaskOp {
public static final String NO_MATCHING_CHANGE_REPORT_ARTIFACT = "No Match to Change Report Artifact; ";
@Override
- public IStatus execute(TaskMetadata metadata, SkynetTransaction transaction) throws OseeCoreException {
+ public IStatus execute(TaskMetadata metadata, IAtsChangeSet changes) throws OseeCoreException {
TaskArtifact taskArt = metadata.getTaskArtifact();
String currentNoteValue = taskArt.getSoleAttributeValueAsString(AtsAttributeTypes.SmaNote, "");
if (!currentNoteValue.contains(NO_MATCHING_CHANGE_REPORT_ARTIFACT)) {
@@ -37,7 +37,7 @@ public class TaskOpModify extends AbstractTaskOp {
}
}
- taskArt.persist(transaction);
+ changes.add(taskArt);
return generateGenericOkStatus(metadata.getTaskEnum(), taskArt.toStringWithId(),
metadata.getParentTeamWf().toStringWithId(), "[no changed artifact]");
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
index bbc9193e8f..53ffd53108 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
@@ -82,10 +83,22 @@ public class TeamWorkFlowArtifact extends AbstractTaskableArtifact implements IA
super.saveSMA(transaction);
try {
ActionArtifact parentAction = getParentActionArtifact();
- if (parentAction != null) {
- ActionArtifactRollup rollup = new ActionArtifactRollup(parentAction, transaction);
- rollup.resetAttributesOffChildren();
- }
+ ActionArtifactRollup rollup = new ActionArtifactRollup(parentAction);
+ rollup.resetAttributesOffChildren();
+ parentAction.persist(transaction);
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, "Can't reset Action parent of children", ex);
+ }
+ }
+
+ @Override
+ public void saveSMA(IAtsChangeSet changes) {
+ super.saveSMA(changes);
+ try {
+ ActionArtifact parentAction = getParentActionArtifact();
+ ActionArtifactRollup rollup = new ActionArtifactRollup(parentAction);
+ rollup.resetAttributesOffChildren();
+ changes.add(parentAction);
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, "Can't reset Action parent of children", ex);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowManager.java
index 632511c347..c6e4c5f6ab 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowManager.java
@@ -25,17 +25,18 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.client.workflow.ITeamWorkflowProvider;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.util.Conditions;
@@ -47,7 +48,6 @@ import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* Methods in support of programatically transitioning the DefaultWorkFlow through it's states. Only to be used for the
@@ -71,8 +71,8 @@ public class TeamWorkFlowManager {
*
* @param user Users to be assigned after transition and that did the current state work
*/
- public Result transitionTo(TeamState toState, IAtsUser user, boolean popup, SkynetTransaction transaction) throws OseeCoreException {
- return transitionTo(toState, user, Arrays.asList(user), popup, transaction);
+ public Result transitionTo(TeamState toState, IAtsUser user, boolean popup, IAtsChangeSet changes) throws OseeCoreException {
+ return transitionTo(toState, user, Arrays.asList(user), popup, changes);
}
/**
@@ -82,7 +82,7 @@ public class TeamWorkFlowManager {
* @param transitionToAssignees Users to be assigned after transition
* @param currentStateUser User that did work on current state
*/
- public Result transitionTo(TeamState toState, IAtsUser currentStateUser, Collection<IAtsUser> transitionToAssignees, boolean popup, SkynetTransaction transaction) throws OseeCoreException {
+ public Result transitionTo(TeamState toState, IAtsUser currentStateUser, Collection<IAtsUser> transitionToAssignees, boolean popup, IAtsChangeSet changes) throws OseeCoreException {
Assert.isNotNull(currentStateUser);
Conditions.checkNotNullOrEmpty(transitionToAssignees, "transitionToAssignees");
Date date = new Date();
@@ -93,8 +93,7 @@ public class TeamWorkFlowManager {
return Result.TrueResult;
}
if (teamArt.isInState(TeamState.Endorse)) {
- Result result =
- processEndorseState(popup, teamArt, currentStateUser, transitionToAssignees, date, transaction);
+ Result result = processEndorseState(popup, teamArt, currentStateUser, transitionToAssignees, date, changes);
if (result.isFalse()) {
return result;
}
@@ -104,8 +103,7 @@ public class TeamWorkFlowManager {
}
if (teamArt.isInState(TeamState.Analyze)) {
- Result result =
- processAnalyzeState(popup, teamArt, currentStateUser, transitionToAssignees, date, transaction);
+ Result result = processAnalyzeState(popup, teamArt, currentStateUser, transitionToAssignees, date, changes);
if (result.isFalse()) {
return result;
}
@@ -116,8 +114,7 @@ public class TeamWorkFlowManager {
}
if (teamArt.isInState(TeamState.Authorize)) {
- Result result =
- processAuthorizeState(popup, teamArt, currentStateUser, transitionToAssignees, date, transaction);
+ Result result = processAuthorizeState(popup, teamArt, currentStateUser, transitionToAssignees, date, changes);
if (result.isFalse()) {
return result;
}
@@ -128,7 +125,7 @@ public class TeamWorkFlowManager {
}
if (teamArt.isInState(TeamState.Implement)) {
- Result result = transitionToState(popup, teamArt, TeamState.Completed, transitionToAssignees, transaction);
+ Result result = transitionToState(popup, teamArt, TeamState.Completed, transitionToAssignees, changes);
if (result.isFalse()) {
return result;
}
@@ -137,47 +134,47 @@ public class TeamWorkFlowManager {
}
- private Result processAuthorizeState(boolean popup, TeamWorkFlowArtifact teamArt, IAtsUser currentStateUser, Collection<IAtsUser> transitionToAssignees, Date date, SkynetTransaction transaction) throws OseeCoreException {
+ private Result processAuthorizeState(boolean popup, TeamWorkFlowArtifact teamArt, IAtsUser currentStateUser, Collection<IAtsUser> transitionToAssignees, Date date, IAtsChangeSet changes) throws OseeCoreException {
Result result = setAuthorizeData(popup, 100, .2, currentStateUser, date);
if (result.isFalse()) {
return result;
}
- result = transitionToState(popup, teamArt, TeamState.Implement, transitionToAssignees, transaction);
+ result = transitionToState(popup, teamArt, TeamState.Implement, transitionToAssignees, changes);
if (result.isFalse()) {
return result;
}
return Result.TrueResult;
}
- private Result processAnalyzeState(boolean popup, TeamWorkFlowArtifact teamArt, IAtsUser currentStateUser, Collection<IAtsUser> transitionToAssignees, Date date, SkynetTransaction transaction) throws OseeCoreException {
+ private Result processAnalyzeState(boolean popup, TeamWorkFlowArtifact teamArt, IAtsUser currentStateUser, Collection<IAtsUser> transitionToAssignees, Date date, IAtsChangeSet changes) throws OseeCoreException {
Result result = setAnalyzeData(popup, null, null, 1, 100, .2, currentStateUser, date);
if (result.isFalse()) {
return result;
}
- result = transitionToState(popup, teamArt, TeamState.Authorize, transitionToAssignees, transaction);
+ result = transitionToState(popup, teamArt, TeamState.Authorize, transitionToAssignees, changes);
if (result.isFalse()) {
return result;
}
return Result.TrueResult;
}
- private Result processEndorseState(boolean popup, TeamWorkFlowArtifact teamArt, IAtsUser currentStateUser, Collection<IAtsUser> transitionToAssignees, Date date, SkynetTransaction transaction) throws OseeCoreException {
+ private Result processEndorseState(boolean popup, TeamWorkFlowArtifact teamArt, IAtsUser currentStateUser, Collection<IAtsUser> transitionToAssignees, Date date, IAtsChangeSet changes) throws OseeCoreException {
Result result = setEndorseData(popup, null, 100, .2, currentStateUser, date);
if (result.isFalse()) {
return result;
}
- result = transitionToState(popup, teamArt, TeamState.Analyze, transitionToAssignees, transaction);
+ result = transitionToState(popup, teamArt, TeamState.Analyze, transitionToAssignees, changes);
if (result.isFalse()) {
return result;
}
return Result.TrueResult;
}
- private Result transitionToState(boolean popup, TeamWorkFlowArtifact teamArt, IStateToken toState, Collection<IAtsUser> transitionToAssignees, SkynetTransaction transaction) {
+ private Result transitionToState(boolean popup, TeamWorkFlowArtifact teamArt, IStateToken toState, Collection<IAtsUser> transitionToAssignees, IAtsChangeSet changes) {
TransitionHelper helper =
new TransitionHelper("Transition to " + toState.getName(), Arrays.asList(teamArt), toState.getName(),
- transitionToAssignees, null, transitionOptions);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ transitionToAssignees, null, changes, transitionOptions);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
if (results.isEmpty()) {
return Result.TrueResult;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java
new file mode 100644
index 0000000000..855a7fc31e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.client.util;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsChangeSet implements IAtsChangeSet {
+
+ private String comment;
+ private final Set<Object> objects = new HashSet<Object>();
+
+ public AtsChangeSet(String comment) {
+ this.comment = comment;
+ }
+
+ @Override
+ public void add(Object obj) throws OseeCoreException {
+ Conditions.checkNotNull(obj, "object");
+ objects.add(obj);
+ }
+
+ @Override
+ public void execute() throws OseeCoreException {
+ Conditions.checkNotNull(comment, "comment");
+ Conditions.checkNotNullOrEmpty(objects, "objects");
+ SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtilCore.getAtsBranchToken(), comment);
+ for (Object obj : objects) {
+ if (obj instanceof Artifact) {
+ ((Artifact) obj).persist(transaction);
+ } else {
+ throw new OseeArgumentException("Unhandled object type: " + obj);
+ }
+ }
+ transaction.execute();
+ objects.clear();
+ }
+
+ public Set<Object> getObjects() {
+ return objects;
+ }
+
+ public void setComment(String comment) {
+ this.comment = comment;
+ }
+
+ @Override
+ public void clear() {
+ objects.clear();
+ }
+
+ public void addTo(SkynetTransaction transaction) throws OseeCoreException {
+ Conditions.checkNotNull(transaction, "transaction");
+ for (Object obj : objects) {
+ if (obj instanceof Artifact) {
+ ((Artifact) obj).persist(transaction);
+ } else {
+ throw new OseeArgumentException("Unhandled object type");
+ }
+ }
+ }
+
+ public void reset(String comment) {
+ clear();
+ this.comment = comment;
+ }
+
+ public boolean isEmpty() {
+ return objects.isEmpty();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/SubscribeManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/SubscribeManager.java
index b894784688..81dedf43cf 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/SubscribeManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/SubscribeManager.java
@@ -16,31 +16,30 @@ import java.util.Collection;
import java.util.List;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
/**
* @author Donald G. Dunne
*/
public class SubscribeManager {
- public static void addSubscribed(AbstractWorkflowArtifact workflow, IAtsUser user, SkynetTransaction transaction) throws OseeCoreException {
+ public static void addSubscribed(AbstractWorkflowArtifact workflow, IAtsUser user, IAtsChangeSet changes) throws OseeCoreException {
if (!workflow.getRelatedArtifacts(AtsRelationTypes.SubscribedUser_User).contains(user)) {
workflow.addRelation(AtsRelationTypes.SubscribedUser_User,
AtsClientService.get().getUserAdmin().getOseeUser(user));
- workflow.persist(transaction);
+ changes.add(workflow);
}
}
- public static void removeSubscribed(AbstractWorkflowArtifact workflow, IAtsUser user, SkynetTransaction transaction) throws OseeCoreException {
+ public static void removeSubscribed(AbstractWorkflowArtifact workflow, IAtsUser user, IAtsChangeSet changes) throws OseeCoreException {
workflow.deleteRelation(AtsRelationTypes.SubscribedUser_User,
AtsClientService.get().getUserAdmin().getOseeUser(user));
- workflow.persist(transaction);
+ changes.add(workflow);
}
public static boolean isSubscribed(AbstractWorkflowArtifact workflow, IAtsUser user) throws OseeCoreException {
@@ -69,20 +68,17 @@ public class SubscribeManager {
public static void toggleSubscribe(Collection<AbstractWorkflowArtifact> awas) throws OseeCoreException {
if (SubscribeManager.amISubscribed(awas.iterator().next())) {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), "Toggle Subscribed");
+ AtsChangeSet changes = new AtsChangeSet("Toggle Subscribed");
for (AbstractWorkflowArtifact awa : awas) {
- SubscribeManager.removeSubscribed(awa, AtsClientService.get().getUserAdmin().getCurrentUser(),
- transaction);
+ SubscribeManager.removeSubscribed(awa, AtsClientService.get().getUserAdmin().getCurrentUser(), changes);
}
- transaction.execute();
+ changes.execute();
} else {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), "Toggle Subscribed");
+ AtsChangeSet changes = new AtsChangeSet("Toggle Subscribed");
for (AbstractWorkflowArtifact awa : awas) {
- SubscribeManager.addSubscribed(awa, AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
+ SubscribeManager.addSubscribed(awa, AtsClientService.get().getUserAdmin().getCurrentUser(), changes);
}
- transaction.execute();
+ changes.execute();
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java
index 1b8e4a8cdb..1c625a8d3d 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java
@@ -25,6 +25,7 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.notify.AtsNotifyType;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
@@ -50,11 +51,11 @@ import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.log.ArtifactLog;
import org.eclipse.osee.ats.core.client.workflow.note.ArtifactNote;
import org.eclipse.osee.ats.core.client.workflow.note.AtsNote;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.ats.core.util.PercentCompleteTotalUtil;
import org.eclipse.osee.ats.core.workdef.WorkDefinitionMatch;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -347,6 +348,21 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
return Result.FalseResult;
}
+ public void saveSMA(IAtsChangeSet changes) {
+ try {
+ Set<Artifact> artifacts = new HashSet<Artifact>();
+ getSmaArtifactsOneLevel(this, artifacts);
+ for (Artifact artifact : artifacts) {
+ if (artifact instanceof AbstractWorkflowArtifact) {
+ ((AbstractWorkflowArtifact) artifact).getStateMgr().writeToStore();
+ }
+ changes.add(artifact);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, "Can't save artifact " + getAtsId(), ex);
+ }
+ }
+
public void saveSMA(SkynetTransaction transaction) {
try {
Set<Artifact> artifacts = new HashSet<Artifact>();
@@ -387,7 +403,7 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
* to transition.
*/
@SuppressWarnings("unused")
- public void transitioned(IAtsStateDefinition fromState, IAtsStateDefinition toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
+ public void transitioned(IAtsStateDefinition fromState, IAtsStateDefinition toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
// provided for subclass implementation
}
@@ -701,10 +717,12 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
return stateMgr;
}
+ @Override
public boolean isTeamWorkflow() {
return this.isOfType(AtsArtifactTypes.TeamWorkflow);
}
+ @Override
public boolean isTask() {
return this.isOfType(AtsArtifactTypes.Task);
}
@@ -788,4 +806,9 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
setSoleAttributeFromString(AtsAttributeTypes.AtsId, atsId);
}
+ @Override
+ public String getTypeName() {
+ return getArtifactTypeName();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java
new file mode 100644
index 0000000000..14202bb9c1
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.client.workflow;
+
+import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsBranchServiceImpl implements IAtsBranchService {
+
+ @Override
+ public boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return AtsBranchManagerCore.isBranchInCommit((TeamWorkFlowArtifact) teamWf);
+ }
+
+ @Override
+ public boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return AtsBranchManagerCore.isWorkingBranchInWork(teamWf);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelperAdapter.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelperAdapter.java
index 06d1d50b1a..f84d425b89 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelperAdapter.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelperAdapter.java
@@ -10,10 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.client.workflow.transition;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
-import org.eclipse.osee.ats.core.client.internal.AtsClientService;
-import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionHelper;
+import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -38,23 +38,23 @@ public abstract class TransitionHelperAdapter implements ITransitionHelper {
}
@Override
- public boolean isWorkingBranchInWork(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- return AtsBranchManagerCore.isWorkingBranchInWork(teamArt);
+ public boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return AtsCore.getBranchService().isWorkingBranchInWork(teamWf);
}
@Override
- public boolean isBranchInCommit(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- return AtsBranchManagerCore.isBranchInCommit(teamArt);
+ public boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return AtsCore.getBranchService().isBranchInCommit(teamWf);
}
@Override
public boolean isSystemUser() throws OseeCoreException {
- return AtsCoreUsers.isAtsCoreUser(AtsClientService.get().getUserAdmin().getCurrentUser());
+ return AtsCoreUsers.isAtsCoreUser(AtsCore.getUserService().getCurrentUser());
}
@Override
- public boolean isSystemUserAssingee(AbstractWorkflowArtifact awa) throws OseeCoreException {
- return awa.getStateMgr().getAssignees().contains(AtsCoreUsers.GUEST_USER) || awa.getStateMgr().getAssignees().contains(
+ public boolean isSystemUserAssingee(IAtsWorkItem workItem) throws OseeCoreException {
+ return workItem.getStateMgr().getAssignees().contains(AtsCoreUsers.GUEST_USER) || workItem.getStateMgr().getAssignees().contains(
AtsCoreUsers.SYSTEM_USER);
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionListeners.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionListeners.java
index 6459af7512..c3e1778bff 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionListeners.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionListeners.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.core.client.workflow.transition;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
import org.eclipse.osee.ats.core.client.review.DecisionReviewDefinitionManager;
import org.eclipse.osee.ats.core.client.review.PeerReviewDefinitionManager;
import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
@@ -33,11 +34,11 @@ public final class TransitionListeners {
* org.eclipse.osee.ats.core.AtsTransitionListener extension point. <br/>
* Public method available in TransitionManager
*/
- protected static void addListener(ITransitionListener listener) {
+ public static void addListener(ITransitionListener listener) {
listeners.add(listener);
}
- protected static void removeListener(ITransitionListener listener) {
+ public static void removeListener(ITransitionListener listener) {
listeners.remove(listener);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionManager.java
deleted file mode 100644
index 59434a0329..0000000000
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionManager.java
+++ /dev/null
@@ -1,564 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.transition;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.api.user.IAtsUser;
-import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
-import org.eclipse.osee.ats.api.workdef.IStateToken;
-import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
-import org.eclipse.osee.ats.api.workdef.RuleDefinitionOption;
-import org.eclipse.osee.ats.api.workdef.WidgetResult;
-import org.eclipse.osee.ats.api.workflow.log.LogType;
-import org.eclipse.osee.ats.core.client.internal.Activator;
-import org.eclipse.osee.ats.core.client.internal.AtsClientService;
-import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
-import org.eclipse.osee.ats.core.client.review.ReviewManager;
-import org.eclipse.osee.ats.core.client.review.ValidateReviewManager;
-import org.eclipse.osee.ats.core.client.task.AbstractTaskableArtifact;
-import org.eclipse.osee.ats.core.client.task.TaskArtifact;
-import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.client.validator.AtsXWidgetValidateManagerClient;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.config.AtsVersionService;
-import org.eclipse.osee.ats.core.users.AtsCoreUsers;
-import org.eclipse.osee.ats.core.workflow.WorkflowManagerCore;
-import org.eclipse.osee.ats.core.workflow.state.TeamState;
-import org.eclipse.osee.ats.core.workflow.transition.TransitionResult;
-import org.eclipse.osee.framework.core.util.Result;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
-
-/**
- * @author Donald G. Dunne
- */
-public class TransitionManager {
-
- private final ITransitionHelper helper;
- private String completedCancellationReason = null;
- private SkynetTransaction transaction;
- private IAtsUser transitionAsUser;
- private Date transitionOnDate;
- private final Map<AbstractWorkflowArtifact, List<IAtsUser>> awasToAssignees =
- new HashMap<AbstractWorkflowArtifact, List<IAtsUser>>();
-
- public TransitionManager(ITransitionHelper helper) {
- this(helper, null);
- }
-
- public TransitionManager(ITransitionHelper helper, SkynetTransaction transaction) {
- this.helper = helper;
- this.transaction = transaction;
- }
-
- public TransitionResults handleAll() {
- TransitionResults results = new TransitionResults();
-
- handleTransitionValidation(results);
- if (results.isCancelled() || !results.isEmpty()) {
- return results;
- }
- handleTransitionUi(results);
- if (results.isCancelled() || !results.isEmpty()) {
- return results;
- }
- try {
- for (AbstractWorkflowArtifact awa : helper.getAwas()) {
- awa.setInTransition(true);
- }
- handleTransition(results);
- } finally {
- for (AbstractWorkflowArtifact awa : helper.getAwas()) {
- awa.setInTransition(false);
- }
- }
- return results;
- }
-
- /**
- * Validate AbstractWorkflowArtifact for transition including checking widget validation, rules, assignment, etc.
- *
- * @return Result.isFalse if failure
- */
- public void handleTransitionValidation(TransitionResults results) {
- try {
- if (helper.getAwas().isEmpty()) {
- results.addResult(TransitionResult.NO_WORKFLOWS_PROVIDED_FOR_TRANSITION);
- return;
- }
- if (helper.getToStateName() == null) {
- results.addResult(TransitionResult.TO_STATE_CANT_BE_NULL);
- return;
- }
- if (helper.isSystemUser()) {
- results.addResult(TransitionResult.CAN_NOT_TRANSITION_AS_SYSTEM_USER);
- return;
- }
- } catch (OseeCoreException ex) {
- results.addResult(new TransitionResult(String.format("Exception while validating transition [%s]",
- helper.getName()), ex));
- }
- for (AbstractWorkflowArtifact awa : helper.getAwas()) {
- try {
- // Validate toState valid
- IAtsStateDefinition fromStateDef = awa.getStateDefinition();
- IAtsStateDefinition toStateDef = awa.getStateDefinitionByName(helper.getToStateName());
- if (toStateDef == null) {
- results.addResult(
- awa,
- new TransitionResult(String.format(
- "Transition-To State [%s] does not exist for Work Definition [%s]", helper.getToStateName(),
- awa.getWorkDefinition().getName())));
- continue;
- }
-
- //Ignore transitions to the same state
- if (!fromStateDef.equals(toStateDef)) {
- // Validate transition from fromState and toState
- if (!helper.isOverrideTransitionValidityCheck() && !fromStateDef.getToStates().contains(toStateDef) && !fromStateDef.getStateType().isCompletedOrCancelledState()) {
- String errStr =
- String.format("Work Definition [%s] is not configured to transition from \"[%s]\" to \"[%s]\"",
- toStateDef.getName(), fromStateDef.getName(), toStateDef.getName());
- OseeLog.log(Activator.class, Level.SEVERE, errStr);
- results.addResult(awa, new TransitionResult(errStr));
- continue;
- }
-
- // Validate Editable
- boolean stateIsEditable =
- WorkflowManagerCore.isEditable(awa, awa.getStateDefinition(), helper.isPrivilegedEditEnabled());
- boolean currentlyUnAssigned = awa.getStateMgr().getAssignees().contains(AtsCoreUsers.UNASSIGNED_USER);
- awa.getStateMgr().validateNoBootstrapUser();
- boolean overrideAssigneeCheck = helper.isOverrideAssigneeCheck();
- // Allow anyone to transition any task to completed/cancelled/working if parent is working
- if (awa.isTask() && awa.getParentTeamWorkflow().isCompletedOrCancelled()) {
- results.addResult(awa, TransitionResult.TASK_CANT_TRANSITION_IF_PARENT_COMPLETED);
- continue;
-
- }
- // Else, only allow transition if...
- else if (!awa.isTask() && !stateIsEditable && !currentlyUnAssigned && !overrideAssigneeCheck) {
- results.addResult(awa, TransitionResult.MUST_BE_ASSIGNED);
- continue;
- }
-
- // Validate Working Branch
- isWorkingBranchTransitionable(results, awa, toStateDef);
- if (results.isCancelled()) {
- continue;
- }
-
- // Validate Assignees (UnAssigned ok cause will be resolve to current user upon transition
- if (!overrideAssigneeCheck && !toStateDef.getStateType().isCancelledState() && helper.isSystemUserAssingee(awa)) {
- results.addResult(awa, TransitionResult.CAN_NOT_TRANSITION_WITH_SYSTEM_USER_ASSIGNED);
- continue;
- }
-
- // Validate state, widgets, rules unless OverrideAttributeValidation is set or transitioning to cancel
- isStateTransitionable(results, awa, toStateDef);
- if (results.isCancelled()) {
- continue;
- }
-
- // Validate transition with extensions
- isTransitionValidForExtensions(results, awa, fromStateDef, toStateDef);
- if (results.isCancelled()) {
- continue;
- }
- }
- } catch (OseeCoreException ex) {
- results.addResult(awa,
- new TransitionResult(String.format("Exception while validating transition [%s]", helper.getName()), ex));
- }
- }
- }
-
- public void isTransitionValidForExtensions(TransitionResults results, AbstractWorkflowArtifact awa, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) {
- // Check extension points for valid transition
- for (ITransitionListener listener : TransitionListeners.getListeners()) {
- try {
- listener.transitioning(results, awa, fromStateDef, toStateDef, getToAssignees(awa, toStateDef));
- if (results.isCancelled() || !results.isEmpty()) {
- continue;
- }
- } catch (OseeCoreException ex) {
- results.addResult(
- awa,
- new TransitionResult(String.format("Exception [%s] while validating transition extensions 1 [%s]",
- ex.getMessage(), helper.getName()), ex));
- }
-
- }
-
- // clear cache, so can be re-computed if above extension calls changed assignees
- awasToAssignees.remove(awa);
-
- // Check again in case first check made changes that would now keep transition from happening
- if (results.isEmpty()) {
- for (ITransitionListener listener : TransitionListeners.getListeners()) {
- try {
- listener.transitioning(results, awa, fromStateDef, toStateDef, getToAssignees(awa, toStateDef));
- if (results.isCancelled() || !results.isEmpty()) {
- continue;
- }
- } catch (OseeCoreException ex) {
- results.addResult(
- awa,
- new TransitionResult(String.format("Exception [%s] while validating transition extensions 2 [%s]",
- ex.getMessage(), helper.getName()), ex));
- }
-
- }
- }
- }
-
- /**
- * Request extra information if transition requires hours spent prompt, cancellation reason, etc.
- *
- * @return Result.isFalse if failure or Result.isCancelled if canceled
- */
- public void handleTransitionUi(TransitionResults results) {
- Result result = helper.getCompleteOrCancellationReason();
- if (result.isCancelled()) {
- results.setCancelled(true);
- return;
- }
- if (result.isTrue()) {
- completedCancellationReason = result.getText();
- }
- result = helper.handleExtraHoursSpent();
- if (result.isCancelled()) {
- results.setCancelled(true);
- } else if (result.isFalse()) {
- results.addResult(new TransitionResult(result.getText()));
- }
- }
-
- /**
- * Process transition and persist changes to given skynet transaction
- *
- * @return Result.isFalse if failure
- */
- public void handleTransition(TransitionResults results) {
- try {
- if (transaction == null) {
- transaction = TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), helper.getName());
- }
- for (AbstractWorkflowArtifact awa : helper.getAwas()) {
- try {
- IAtsStateDefinition fromState = awa.getStateDefinition();
- IAtsStateDefinition toState = awa.getStateDefinitionByName(helper.getToStateName());
-
- //Ignore transitions to the same state
- if (!fromState.equals(toState)) {
- Date transitionDate = getTransitionOnDate();
- IAtsUser transitionUser = getTransitionAsUser();
- // Log transition
- if (fromState.getStateType().isCancelledState()) {
- logWorkflowUnCancelledEvent(awa, toState);
- } else if (fromState.getStateType().isCompletedState()) {
- logWorkflowUnCompletedEvent(awa, toState);
- }
- if (toState.getStateType().isCancelledState()) {
- logWorkflowCancelledEvent(awa, fromState, toState, completedCancellationReason, transitionDate,
- transitionUser);
- } else if (toState.getStateType().isCompletedState()) {
- logWorkflowCompletedEvent(awa, fromState, toState, completedCancellationReason, transitionDate,
- transitionUser);
- } else {
- logStateCompletedEvent(awa, awa.getStateMgr().getCurrentStateName(), completedCancellationReason,
- transitionDate, transitionUser);
- }
- logStateStartedEvent(awa, toState, transitionDate, transitionUser);
-
- // Get transition to assignees, do some checking to ensure someone is assigneed and UnAssigned
- List<? extends IAtsUser> updatedAssigees = getToAssignees(awa, toState);
-
- awa.getStateMgr().transitionHelper(updatedAssigees, fromState, toState, completedCancellationReason);
-
- if (awa.isValidationRequired() && awa.isTeamWorkflow()) {
- ValidateReviewManager.createValidateReview((TeamWorkFlowArtifact) awa, false, transitionDate,
- transitionUser, transaction);
- }
-
- // Persist
- awa.persist(transaction);
-
- awa.transitioned(fromState, toState, updatedAssigees, transaction);
-
- // Notify extension points of transition
- for (ITransitionListener listener : TransitionListeners.getListeners()) {
- listener.transitioned(awa, fromState, toState, updatedAssigees, transaction);
- }
- if (toState.getStateType().isCompletedOrCancelledState()) {
- awa.clearImplementersCache();
- }
- }
- } catch (Exception ex) {
- results.addResult(awa,
- new TransitionResult(String.format("Exception while transitioning [%s]", helper.getName()), ex));
- }
- }
- } catch (Exception ex) {
- results.addResult(new TransitionResult(String.format("Exception while transitioning [%s]", helper.getName()),
- ex));
- }
-
- }
-
- private void isWorkingBranchTransitionable(TransitionResults results, AbstractWorkflowArtifact awa, IAtsStateDefinition toStateDef) throws OseeCoreException {
- if (awa.isTeamWorkflow() && helper.isWorkingBranchInWork((TeamWorkFlowArtifact) awa)) {
- if (toStateDef.getName().equals(TeamState.Cancelled.getName())) {
- results.addResult(awa, TransitionResult.DELETE_WORKING_BRANCH_BEFORE_CANCEL);
- }
- if (helper.isBranchInCommit((TeamWorkFlowArtifact) awa)) {
- results.addResult(awa, TransitionResult.WORKING_BRANCH_BEING_COMMITTED);
- }
- if (!toStateDef.hasRule(RuleDefinitionOption.AllowTransitionWithWorkingBranch.name())) {
- results.addResult(awa, TransitionResult.WORKING_BRANCH_EXISTS);
- }
- }
- }
-
- private void isStateTransitionable(TransitionResults results, AbstractWorkflowArtifact awa, IAtsStateDefinition toStateDef) throws OseeCoreException {
- boolean isOverrideAttributeValidationState =
- helper.isOverrideTransitionValidityCheck() || awa.getStateDefinition().getOverrideAttributeValidationStates().contains(
- toStateDef);
- if (toStateDef.getStateType().isCancelledState()) {
- validateTaskCompletion(results, awa, toStateDef);
- validateReviewsCancelled(results, awa, toStateDef);
- } else if (!toStateDef.getStateType().isCancelledState() && !isOverrideAttributeValidationState) {
-
- // Validate XWidgets for transition
- Collection<WidgetResult> widgetResults =
- AtsXWidgetValidateManagerClient.instance.validateTransition(awa, toStateDef);
- for (WidgetResult widgetResult : widgetResults) {
- if (!widgetResult.isValid()) {
- results.addResult(awa, widgetResult);
- }
- }
-
- validateTaskCompletion(results, awa, toStateDef);
-
- // Don't transition without targeted version if so configured
- boolean teamDefRequiresTargetedVersion = awa.teamDefHasRule(RuleDefinitionOption.RequireTargetedVersion);
- boolean pageRequiresTargetedVersion =
- awa.getStateDefinition().hasRule(RuleDefinitionOption.RequireTargetedVersion.name());
-
- // Only check this if TeamWorkflow, not for reviews
- if (awa.isOfType(AtsArtifactTypes.TeamWorkflow) && (teamDefRequiresTargetedVersion || pageRequiresTargetedVersion) && //
- !AtsVersionService.get().hasTargetedVersion(awa) && //
- !toStateDef.getStateType().isCancelledState()) {
- results.addResult(awa, TransitionResult.MUST_BE_TARGETED_FOR_VERSION);
- }
-
- // Loop through this state's blocking reviews to confirm complete
- if (awa.isTeamWorkflow()) {
- for (AbstractReviewArtifact reviewArt : ReviewManager.getReviewsFromCurrentState((TeamWorkFlowArtifact) awa)) {
- if (reviewArt.getReviewBlockType() == ReviewBlockType.Transition && !reviewArt.isCompletedOrCancelled()) {
- results.addResult(awa, TransitionResult.COMPLETE_BLOCKING_REVIEWS);
- }
- }
- }
- }
- }
-
- private void validateReviewsCancelled(TransitionResults results, AbstractWorkflowArtifact awa, IAtsStateDefinition toStateDef) throws OseeCoreException {
- if (awa instanceof TeamWorkFlowArtifact && toStateDef.getStateType().isCancelledState()) {
- for (AbstractReviewArtifact reviewArt : ReviewManager.getReviewsFromCurrentState((TeamWorkFlowArtifact) awa)) {
- if (reviewArt.getReviewBlockType() == ReviewBlockType.Transition && !reviewArt.isCompletedOrCancelled()) {
- results.addResult(awa, TransitionResult.CANCEL_REVIEWS_BEFORE_CANCEL);
- break;
- }
- }
- }
- }
-
- private void validateTaskCompletion(TransitionResults results, AbstractWorkflowArtifact awa, IAtsStateDefinition toStateDef) throws OseeCoreException {
- // Loop through this state's tasks to confirm complete
- boolean checkTasksCompletedForState = true;
- // Don't check for task completion if transition to working state and AllowTransitionWithoutTaskCompletion rule is set
- if (awa.getStateDefinition().hasRule(RuleDefinitionOption.AllowTransitionWithoutTaskCompletion.name()) && toStateDef.getStateType().isWorkingState()) {
- checkTasksCompletedForState = false;
- }
- if (checkTasksCompletedForState && awa instanceof AbstractTaskableArtifact && !awa.isCompletedOrCancelled()) {
- Set<TaskArtifact> tasksToCheck = new HashSet<TaskArtifact>();
- // If transitioning to completed/cancelled, all tasks must be completed/cancelled
- if (toStateDef.getStateType().isCompletedOrCancelledState()) {
- tasksToCheck.addAll(((AbstractTaskableArtifact) awa).getTaskArtifacts());
- }
- // Else, just check current state tasks
- else {
- tasksToCheck.addAll(((AbstractTaskableArtifact) awa).getTaskArtifactsFromCurrentState());
- }
- for (TaskArtifact taskArt : tasksToCheck) {
- if (taskArt.isInWork()) {
- results.addResult(awa, TransitionResult.TASKS_NOT_COMPLETED);
- break;
- }
- }
- }
- }
-
- public static void logWorkflowCancelledEvent(AbstractWorkflowArtifact awa, IAtsStateDefinition fromState, IAtsStateDefinition toState, String reason, Date cancelDate, IAtsUser cancelBy) throws OseeCoreException {
- awa.getLog().addLog(LogType.StateCancelled, fromState.getName(), reason, cancelDate, cancelBy);
- if (awa.isAttributeTypeValid(AtsAttributeTypes.CreatedBy)) {
- awa.setSoleAttributeValue(AtsAttributeTypes.CancelledBy, cancelBy.getUserId());
- awa.setSoleAttributeValue(AtsAttributeTypes.CancelledDate, cancelDate);
- awa.setSoleAttributeValue(AtsAttributeTypes.CancelledReason, reason);
- awa.setSoleAttributeValue(AtsAttributeTypes.CancelledFromState, fromState.getName());
- }
- validateUpdatePercentCompleteAttribute(awa, toState);
- }
-
- public static void logWorkflowUnCancelledEvent(AbstractWorkflowArtifact awa, IAtsStateDefinition toState) throws OseeCoreException {
- if (awa.isAttributeTypeValid(AtsAttributeTypes.CreatedBy)) {
- awa.deleteSoleAttribute(AtsAttributeTypes.CancelledBy);
- awa.deleteSoleAttribute(AtsAttributeTypes.CancelledDate);
- awa.deleteSoleAttribute(AtsAttributeTypes.CancelledReason);
- awa.deleteSoleAttribute(AtsAttributeTypes.CancelledFromState);
- }
- validateUpdatePercentCompleteAttribute(awa, toState);
- }
-
- private void logWorkflowCompletedEvent(AbstractWorkflowArtifact awa, IAtsStateDefinition fromState, IAtsStateDefinition toState, String reason, Date cancelDate, IAtsUser cancelBy) throws OseeCoreException {
- awa.getLog().addLog(LogType.StateComplete, fromState.getName(), Strings.isValid(reason) ? reason : "",
- cancelDate, cancelBy);
- if (awa.isAttributeTypeValid(AtsAttributeTypes.CreatedBy)) {
- awa.setSoleAttributeValue(AtsAttributeTypes.CompletedBy, cancelBy.getUserId());
- awa.setSoleAttributeValue(AtsAttributeTypes.CompletedDate, cancelDate);
- awa.setSoleAttributeValue(AtsAttributeTypes.CompletedFromState, fromState.getName());
- }
- validateUpdatePercentCompleteAttribute(awa, toState);
- }
-
- public static void logWorkflowUnCompletedEvent(AbstractWorkflowArtifact awa, IAtsStateDefinition toState) throws OseeCoreException {
- if (awa.isAttributeTypeValid(AtsAttributeTypes.CreatedBy)) {
- awa.deleteSoleAttribute(AtsAttributeTypes.CompletedBy);
- awa.deleteSoleAttribute(AtsAttributeTypes.CompletedDate);
- awa.deleteSoleAttribute(AtsAttributeTypes.CompletedFromState);
- }
- validateUpdatePercentCompleteAttribute(awa, toState);
- }
-
- private static void validateUpdatePercentCompleteAttribute(AbstractWorkflowArtifact awa, IAtsStateDefinition toState) throws OseeCoreException {
- Integer percent = awa.getSoleAttributeValue(AtsAttributeTypes.PercentComplete, 0);
- if (toState.getStateType().isCompletedOrCancelledState() && percent != 100) {
- awa.setSoleAttributeValue(AtsAttributeTypes.PercentComplete, 100);
- } else if (toState.getStateType().isWorkingState() && percent == 100) {
- awa.setSoleAttributeValue(AtsAttributeTypes.PercentComplete, 0);
- }
- }
-
- private void logStateCompletedEvent(AbstractWorkflowArtifact awa, String fromStateName, String reason, Date date, IAtsUser user) throws OseeCoreException {
- awa.getLog().addLog(LogType.StateComplete, fromStateName, Strings.isValid(reason) ? reason : "", date, user);
- }
-
- public static void logStateStartedEvent(AbstractWorkflowArtifact awa, IStateToken state, Date date, IAtsUser user) throws OseeCoreException {
- awa.getLog().addLog(LogType.StateEntered, state.getName(), "", date, user);
- }
-
- public SkynetTransaction getTransaction() {
- return transaction;
- }
-
- /**
- * Add listener for notification. This is not the recommended method of listening, use
- * org.eclipse.osee.ats.core.AtsTransitionListener extension point.
- */
- public static void addListener(ITransitionListener listener) {
- TransitionListeners.addListener(listener);
- }
-
- public static void removeListener(ITransitionListener listener) {
- TransitionListeners.removeListener(listener);
- }
-
- /**
- * Allow transition date to be used in log to be overridden for importing Actions from other systems and other
- * programatic transitions.
- */
- public IAtsUser getTransitionAsUser() throws OseeCoreException {
- if (transitionAsUser == null) {
- return AtsClientService.get().getUserAdmin().getCurrentUser();
- }
- return transitionAsUser;
- }
-
- public void setTransitionAsUser(IAtsUser transitionAsUser) {
- this.transitionAsUser = transitionAsUser;
- }
-
- /**
- * Allow transition date to be used in log to be overridden for importing Actions from other systems and other
- * programatic transitions.
- */
- public Date getTransitionOnDate() {
- if (transitionOnDate == null) {
- return new Date();
- }
- return transitionOnDate;
- }
-
- public void setTransitionOnDate(Date transitionOnDate) {
- this.transitionOnDate = transitionOnDate;
- }
-
- /**
- * Get transition to assignees. Verify that UnAssigned is not selected with another assignee. Ensure an assignee is
- * entered, else use current user or UnAssigneed if current user is SystemUser.
- */
- public List<? extends IAtsUser> getToAssignees(AbstractWorkflowArtifact awa, IAtsStateDefinition toState) throws OseeCoreException {
- List<IAtsUser> assignees = awasToAssignees.get(awa);
- if (assignees != null && toState.getStateType().isCompletedOrCancelledState()) {
- assignees.clear();
- }
- if (assignees == null) {
- assignees = new ArrayList<IAtsUser>();
- awasToAssignees.put(awa, assignees);
- if (!toState.getStateType().isCompletedOrCancelledState()) {
- Collection<? extends IAtsUser> requestedAssignees = helper.getToAssignees(awa);
- if (requestedAssignees != null) {
- for (IAtsUser user : requestedAssignees) {
- assignees.add(user);
- }
- }
- if (assignees.contains(AtsCoreUsers.UNASSIGNED_USER)) {
- assignees.remove(AtsCoreUsers.UNASSIGNED_USER);
- assignees.add(AtsClientService.get().getUserAdmin().getCurrentUser());
- }
- if (assignees.isEmpty()) {
- if (helper.isSystemUser()) {
- assignees.add(AtsCoreUsers.UNASSIGNED_USER);
- } else {
- assignees.add(AtsClientService.get().getUserAdmin().getCurrentUser());
- }
- }
- }
- }
- return assignees;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionToOperation.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionToOperation.java
index dc3a3fe115..ee4e887ba0 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionToOperation.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionToOperation.java
@@ -12,15 +12,17 @@ package org.eclipse.osee.ats.core.client.workflow.transition;
import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionHelper;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResult;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.internal.Activator;
-import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.workflow.transition.TransitionResult;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
/**
* @author Donald G. Dunne
@@ -38,22 +40,22 @@ public class TransitionToOperation extends AbstractOperation {
@Override
protected void doWork(IProgressMonitor monitor) throws Exception {
try {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), helper.getName() + ".preSave");
- for (AbstractWorkflowArtifact awa : helper.getAwas()) {
+ AtsChangeSet changes = new AtsChangeSet(helper.getName() + ".preSave");
+ for (IAtsWorkItem workItem : helper.getWorkItems()) {
+ AbstractWorkflowArtifact awa = (AbstractWorkflowArtifact) workItem;
if (awa.isDirty()) {
- awa.persist(transaction);
+ changes.add(awa);
}
}
- transaction.execute();
+ changes.execute();
- transaction = TransactionManager.createTransaction(AtsUtilCore.getAtsBranch(), helper.getName());
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ changes.reset(helper.getName());
+ TransitionManager transitionMgr = new TransitionManager(helper);
results = transitionMgr.handleAll();
if (results.isCancelled()) {
return;
} else if (results.isEmpty()) {
- transaction.execute();
+ changes.execute();
}
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java
index 91218369c3..d964300ca5 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java
@@ -163,4 +163,19 @@ public class MockWorkItem implements IAtsWorkItem {
this.atsId = atsId;
}
+ @Override
+ public boolean isTask() {
+ return false;
+ }
+
+ @Override
+ public boolean isTeamWorkflow() {
+ return false;
+ }
+
+ @Override
+ public String getTypeName() {
+ return null;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/transition/TransitionResultTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/transition/TransitionResultTest.java
index 5fb231f719..65c838361b 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/transition/TransitionResultTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/transition/TransitionResultTest.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.transition;
-import org.eclipse.osee.ats.core.workflow.transition.TransitionResult;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResult;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.junit.Assert;
import org.junit.Test;
diff --git a/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
index f8c2f02d2f..9114938595 100644
--- a/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
@@ -24,11 +24,13 @@ Import-Package: com.google.inject,
org.eclipse.osee.ats.api.rule,
org.eclipse.osee.ats.api.team,
org.eclipse.osee.ats.api.user,
+ org.eclipse.osee.ats.api.util,
org.eclipse.osee.ats.api.version,
org.eclipse.osee.ats.api.workdef,
org.eclipse.osee.ats.api.workflow,
org.eclipse.osee.ats.api.workflow.log,
org.eclipse.osee.ats.api.workflow.state,
+ org.eclipse.osee.ats.api.workflow.transition,
org.eclipse.osee.ats.dsl,
org.eclipse.osee.ats.dsl.atsDsl,
org.eclipse.osee.ats.dsl.atsDsl.impl,
diff --git a/plugins/org.eclipse.osee.ats.core/OSGI-INF/ats.core.xml b/plugins/org.eclipse.osee.ats.core/OSGI-INF/ats.core.xml
index 3bc7c53359..9d0e4ffec6 100644
--- a/plugins/org.eclipse.osee.ats.core/OSGI-INF/ats.core.xml
+++ b/plugins/org.eclipse.osee.ats.core/OSGI-INF/ats.core.xml
@@ -6,4 +6,6 @@
<reference bind="setAtsUserService" cardinality="1..1" interface="org.eclipse.osee.ats.api.user.IAtsUserService" name="IAtsUserService" policy="static"/>
<reference bind="setAtsNotificationService" cardinality="1..1" interface="org.eclipse.osee.ats.api.notify.IAtsNotificationService" name="IAtsNotificationService" policy="static"/>
<reference bind="setAtsWorkItemServiceProvider" cardinality="1..1" interface="org.eclipse.osee.ats.api.workflow.IAtsWorkItemServiceProvider" name="IAtsWorkItemServiceProvider" policy="static"/>
+ <reference bind="setAtsReviewServiceProvider" cardinality="1..1" interface="org.eclipse.osee.ats.api.review.IAtsReviewServiceProvider" name="IAtsReviewServiceProvider" policy="static"/>
+ <reference bind="setAtsBranchServiceProvider" cardinality="1..1" interface="org.eclipse.osee.ats.api.workflow.IAtsBranchServiceProvider" name="IAtsBranchServiceProvider" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/AtsCore.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/AtsCore.java
index 814164b77c..0c8850dd52 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/AtsCore.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/AtsCore.java
@@ -11,9 +11,13 @@
package org.eclipse.osee.ats.core;
import org.eclipse.osee.ats.api.notify.IAtsNotificationService;
+import org.eclipse.osee.ats.api.review.IAtsReviewService;
+import org.eclipse.osee.ats.api.review.IAtsReviewServiceProvider;
import org.eclipse.osee.ats.api.user.IAtsUserService;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
+import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
+import org.eclipse.osee.ats.api.workflow.IAtsBranchServiceProvider;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemServiceProvider;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogFactory;
@@ -43,6 +47,8 @@ public class AtsCore {
private static IAtsUserService userService;
private static Boolean started = null;
private static IAtsWorkItemServiceProvider workItemServiceProvider;
+ private static IAtsBranchServiceProvider branchServiceProvider;
+ private static IAtsReviewServiceProvider reviewServiceProvider;
public void setAtsUserService(IAtsUserService userService) {
AtsCore.userService = userService;
@@ -64,12 +70,22 @@ public class AtsCore {
AtsCore.attrResolver = attrResolver;
}
+ public static void setAtsBranchServiceProvider(IAtsBranchServiceProvider branchServiceProvider) {
+ AtsCore.branchServiceProvider = branchServiceProvider;
+ }
+
+ public static void setAtsReviewServiceProvider(IAtsReviewServiceProvider reviewServiceProvider) {
+ AtsCore.reviewServiceProvider = reviewServiceProvider;
+ }
+
public void start() throws OseeCoreException {
Conditions.checkNotNull(userService, "IAtsUserService");
Conditions.checkNotNull(workDefService, "IAtsWorkDefinitionService");
Conditions.checkNotNull(workItemServiceProvider, "IAtsWorkItemServiceProvider");
Conditions.checkNotNull(attrResolver, "IAttributeResolver");
Conditions.checkNotNull(notifyService, "IAtsNotificationService");
+ Conditions.checkNotNull(branchServiceProvider, "IAtsBranchServiceProvider");
+ Conditions.checkNotNull(reviewServiceProvider, "IAtsReviewServiceProvider");
started = true;
}
@@ -129,4 +145,12 @@ public class AtsCore {
return AtsConfigUtility.getAtsConfigProvider().getAtsConfig();
}
+ public static IAtsBranchService getBranchService() throws OseeCoreException {
+ return branchServiceProvider.getBranchService();
+ }
+
+ public static IAtsReviewService getReviewService() throws OseeCoreException {
+ return reviewServiceProvider.getReviewService();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelper.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelper.java
index 58fd4660fa..9882434c1d 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelper.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelper.java
@@ -8,16 +8,23 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.transition;
+package org.eclipse.osee.ats.core.workflow.transition;
import java.util.Collection;
import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.core.internal.Activator;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.logging.OseeLog;
/**
* @author Donald G. Dunne
@@ -25,18 +32,21 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
public class TransitionHelper extends TransitionHelperAdapter {
private final String cancellationReason;
- private final Collection<? extends AbstractWorkflowArtifact> awas;
+ private final Collection<? extends IAtsWorkItem> workItems;
private final String name;
private TransitionOption[] transitionOption;
private final Collection<? extends IAtsUser> toAssignees;
private String toStateName;
+ private final IAtsChangeSet changes;
+ private boolean executeChanges;
- public TransitionHelper(String name, Collection<? extends AbstractWorkflowArtifact> awas, String toStateName, Collection<? extends IAtsUser> toAssignees, String cancellationReason, TransitionOption... transitionOption) {
+ public TransitionHelper(String name, Collection<? extends IAtsWorkItem> awas, String toStateName, Collection<? extends IAtsUser> toAssignees, String cancellationReason, IAtsChangeSet changes, TransitionOption... transitionOption) {
this.name = name;
- this.awas = awas;
+ this.workItems = awas;
this.toStateName = toStateName;
this.toAssignees = toAssignees;
this.cancellationReason = cancellationReason;
+ this.changes = changes;
this.transitionOption = transitionOption;
}
@@ -56,8 +66,8 @@ public class TransitionHelper extends TransitionHelperAdapter {
}
@Override
- public Collection<? extends AbstractWorkflowArtifact> getAwas() {
- return awas;
+ public Collection<? extends IAtsWorkItem> getWorkItems() {
+ return workItems;
}
@Override
@@ -75,7 +85,7 @@ public class TransitionHelper extends TransitionHelperAdapter {
@SuppressWarnings("unused")
@Override
- public Collection<? extends IAtsUser> getToAssignees(AbstractWorkflowArtifact awa) throws OseeCoreException {
+ public Collection<? extends IAtsUser> getToAssignees(IAtsWorkItem workItem) throws OseeCoreException {
return toAssignees;
}
@@ -109,4 +119,32 @@ public class TransitionHelper extends TransitionHelperAdapter {
this.toStateName = toStateName;
}
+ @Override
+ public IAtsChangeSet getChangeSet() {
+ return changes;
+ }
+
+ @Override
+ public void setInTransition(IAtsWorkItem workItem, boolean inTransition) throws OseeCoreException {
+ AtsCore.getWorkItemService().setInTransition(workItem, inTransition);
+ }
+
+ @Override
+ public boolean isExecuteChanges() {
+ return executeChanges;
+ }
+
+ public void setExecuteChanges(boolean executeChanges) {
+ this.executeChanges = executeChanges;
+ }
+
+ @Override
+ public Collection<ITransitionListener> getTransitionListeners() {
+ try {
+ return AtsCore.getWorkItemService().getTransitionListeners();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return java.util.Collections.emptyList();
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapter.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapter.java
new file mode 100644
index 0000000000..bbfe9a9ca7
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapter.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.workflow.transition;
+
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionHelper;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.core.users.AtsCoreUsers;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class TransitionHelperAdapter implements ITransitionHelper {
+
+ @Override
+ public boolean isPrivilegedEditEnabled() {
+ return false;
+ }
+
+ @Override
+ public boolean isOverrideTransitionValidityCheck() {
+ return false;
+ }
+
+ @Override
+ public boolean isOverrideAssigneeCheck() {
+ return false;
+ }
+
+ @Override
+ public boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return AtsCore.getBranchService().isWorkingBranchInWork(teamWf);
+ }
+
+ @Override
+ public boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return AtsCore.getBranchService().isBranchInCommit(teamWf);
+ }
+
+ @Override
+ public boolean isSystemUser() throws OseeCoreException {
+ return AtsCoreUsers.isAtsCoreUser(AtsCore.getUserService().getCurrentUser());
+ }
+
+ @Override
+ public boolean isSystemUserAssingee(IAtsWorkItem workItem) throws OseeCoreException {
+ return workItem.getStateMgr().getAssignees().contains(AtsCoreUsers.GUEST_USER) || workItem.getStateMgr().getAssignees().contains(
+ AtsCoreUsers.SYSTEM_USER);
+ }
+
+ @Override
+ public boolean isExecuteChanges() {
+ return false;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
new file mode 100644
index 0000000000..a772bcdf54
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
@@ -0,0 +1,558 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.workflow.transition;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
+import org.eclipse.osee.ats.api.review.IAtsDecisionReview;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
+import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
+import org.eclipse.osee.ats.api.workdef.RuleDefinitionOption;
+import org.eclipse.osee.ats.api.workdef.WidgetResult;
+import org.eclipse.osee.ats.api.workflow.IAtsTask;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.log.LogType;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionHelper;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResult;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.core.config.AtsVersionService;
+import org.eclipse.osee.ats.core.users.AtsCoreUsers;
+import org.eclipse.osee.ats.core.workflow.WorkflowManagerCore;
+import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.logging.OseeLog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TransitionManager {
+
+ private final ITransitionHelper helper;
+ private String completedCancellationReason = null;
+ private IAtsUser transitionAsUser;
+ private Date transitionOnDate;
+ private final Map<IAtsWorkItem, List<IAtsUser>> workItemToAssignees = new HashMap<IAtsWorkItem, List<IAtsUser>>();
+
+ public TransitionManager(ITransitionHelper helper) {
+ this.helper = helper;
+ }
+
+ public TransitionResults handleAll() {
+ TransitionResults results = new TransitionResults();
+
+ handleTransitionValidation(results);
+ if (results.isCancelled() || !results.isEmpty()) {
+ return results;
+ }
+ handleTransitionUi(results);
+ if (results.isCancelled() || !results.isEmpty()) {
+ return results;
+ }
+ try {
+ for (IAtsWorkItem workItem : helper.getWorkItems()) {
+ helper.setInTransition(workItem, true);
+ }
+ handleTransition(results);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsCore.class, Level.SEVERE, ex);
+ } finally {
+ for (IAtsWorkItem workItem : helper.getWorkItems()) {
+ try {
+ helper.setInTransition(workItem, false);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsCore.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ return results;
+ }
+
+ /**
+ * Validate AbstractWorkflowArtifact for transition including checking widget validation, rules, assignment, etc.
+ *
+ * @return Result.isFalse if failure
+ */
+ public void handleTransitionValidation(TransitionResults results) {
+ try {
+ if (helper.getWorkItems().isEmpty()) {
+ results.addResult(TransitionResult.NO_WORKFLOWS_PROVIDED_FOR_TRANSITION);
+ return;
+ }
+ if (helper.getToStateName() == null) {
+ results.addResult(TransitionResult.TO_STATE_CANT_BE_NULL);
+ return;
+ }
+ if (helper.isSystemUser()) {
+ results.addResult(TransitionResult.CAN_NOT_TRANSITION_AS_SYSTEM_USER);
+ return;
+ }
+ } catch (OseeCoreException ex) {
+ results.addResult(new TransitionResult(String.format("Exception while validating transition [%s]",
+ helper.getName()), ex));
+ }
+ for (IAtsWorkItem workItem : helper.getWorkItems()) {
+ try {
+ helper.getChangeSet().add(workItem);
+ // Validate toState valid
+ IAtsStateDefinition fromStateDef = workItem.getStateDefinition();
+ IAtsStateDefinition toStateDef = workItem.getWorkDefinition().getStateByName(helper.getToStateName());
+ if (toStateDef == null) {
+ results.addResult(
+ workItem,
+ new TransitionResult(String.format(
+ "Transition-To State [%s] does not exist for Work Definition [%s]", helper.getToStateName(),
+ workItem.getWorkDefinition().getName())));
+ continue;
+ }
+
+ //Ignore transitions to the same state
+ if (!fromStateDef.equals(toStateDef)) {
+ // Validate transition from fromState and toState
+ if (!helper.isOverrideTransitionValidityCheck() && !fromStateDef.getToStates().contains(toStateDef) && !fromStateDef.getStateType().isCompletedOrCancelledState()) {
+ String errStr =
+ String.format("Work Definition [%s] is not configured to transition from \"[%s]\" to \"[%s]\"",
+ toStateDef.getName(), fromStateDef.getName(), toStateDef.getName());
+ OseeLog.log(AtsCore.class, Level.SEVERE, errStr);
+ results.addResult(workItem, new TransitionResult(errStr));
+ continue;
+ }
+
+ // Validate Editable
+ boolean stateIsEditable =
+ WorkflowManagerCore.isEditable(workItem, workItem.getStateDefinition(),
+ helper.isPrivilegedEditEnabled());
+ boolean currentlyUnAssigned =
+ workItem.getStateMgr().getAssignees().contains(AtsCoreUsers.UNASSIGNED_USER);
+ workItem.getStateMgr().validateNoBootstrapUser();
+ boolean overrideAssigneeCheck = helper.isOverrideAssigneeCheck();
+ // Allow anyone to transition any task to completed/cancelled/working if parent is working
+ if (workItem.isTask() && workItem.getParentTeamWorkflow().getWorkData().isCompletedOrCancelled()) {
+ results.addResult(workItem, TransitionResult.TASK_CANT_TRANSITION_IF_PARENT_COMPLETED);
+ continue;
+ }
+ // Else, only allow transition if...
+ else if (!workItem.isTask() && !stateIsEditable && !currentlyUnAssigned && !overrideAssigneeCheck) {
+ results.addResult(workItem, TransitionResult.MUST_BE_ASSIGNED);
+ continue;
+ }
+
+ // Validate Working Branch
+ isWorkingBranchTransitionable(results, workItem, toStateDef);
+ if (results.isCancelled()) {
+ continue;
+ }
+
+ // Validate Assignees (UnAssigned ok cause will be resolve to current user upon transition
+ if (!overrideAssigneeCheck && !toStateDef.getStateType().isCancelledState() && helper.isSystemUserAssingee(workItem)) {
+ results.addResult(workItem, TransitionResult.CAN_NOT_TRANSITION_WITH_SYSTEM_USER_ASSIGNED);
+ continue;
+ }
+
+ // Validate state, widgets, rules unless OverrideAttributeValidation is set or transitioning to cancel
+ isStateTransitionable(results, workItem, toStateDef);
+ if (results.isCancelled()) {
+ continue;
+ }
+
+ // Validate transition with extensions
+ isTransitionValidForExtensions(results, workItem, fromStateDef, toStateDef);
+ if (results.isCancelled()) {
+ continue;
+ }
+
+ if (helper.isExecuteChanges()) {
+ helper.getChangeSet().execute();
+ }
+ }
+ } catch (OseeCoreException ex) {
+ results.addResult(workItem,
+ new TransitionResult(String.format("Exception while validating transition [%s]", helper.getName()), ex));
+ }
+ }
+ }
+
+ public void isTransitionValidForExtensions(TransitionResults results, IAtsWorkItem workItem, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) {
+ // Check extension points for valid transition
+ for (ITransitionListener listener : helper.getTransitionListeners()) {
+ try {
+ listener.transitioning(results, workItem, fromStateDef, toStateDef, getToAssignees(workItem, toStateDef));
+ if (results.isCancelled() || !results.isEmpty()) {
+ continue;
+ }
+ } catch (OseeCoreException ex) {
+ results.addResult(
+ workItem,
+ new TransitionResult(String.format("Exception [%s] while validating transition extensions 1 [%s]",
+ ex.getMessage(), helper.getName()), ex));
+ }
+
+ }
+
+ // clear cache, so can be re-computed if above extension calls changed assignees
+ workItemToAssignees.remove(workItem);
+
+ // Check again in case first check made changes that would now keep transition from happening
+ if (results.isEmpty()) {
+ for (ITransitionListener listener : helper.getTransitionListeners()) {
+ try {
+ listener.transitioning(results, workItem, fromStateDef, toStateDef, getToAssignees(workItem, toStateDef));
+ if (results.isCancelled() || !results.isEmpty()) {
+ continue;
+ }
+ } catch (OseeCoreException ex) {
+ results.addResult(
+ workItem,
+ new TransitionResult(String.format("Exception [%s] while validating transition extensions 2 [%s]",
+ ex.getMessage(), helper.getName()), ex));
+ }
+
+ }
+ }
+ }
+
+ /**
+ * Request extra information if transition requires hours spent prompt, cancellation reason, etc.
+ *
+ * @return Result.isFalse if failure or Result.isCancelled if canceled
+ */
+ public void handleTransitionUi(TransitionResults results) {
+ Result result = helper.getCompleteOrCancellationReason();
+ if (result.isCancelled()) {
+ results.setCancelled(true);
+ return;
+ }
+ if (result.isTrue()) {
+ completedCancellationReason = result.getText();
+ }
+ result = helper.handleExtraHoursSpent();
+ if (result.isCancelled()) {
+ results.setCancelled(true);
+ } else if (result.isFalse()) {
+ results.addResult(new TransitionResult(result.getText()));
+ }
+ }
+
+ /**
+ * Process transition and persist changes to given skynet transaction
+ *
+ * @return Result.isFalse if failure
+ */
+ public void handleTransition(TransitionResults results) {
+ try {
+ for (IAtsWorkItem workItem : helper.getWorkItems()) {
+ try {
+ IAtsStateDefinition fromState = workItem.getStateDefinition();
+ IAtsStateDefinition toState =
+ workItem.getWorkDefinition().getStateDefinitionByName(helper.getToStateName());
+
+ //Ignore transitions to the same state
+ if (!fromState.equals(toState)) {
+ Date transitionDate = getTransitionOnDate();
+ IAtsUser transitionUser = getTransitionAsUser();
+ // Log transition
+ if (fromState.getStateType().isCancelledState()) {
+ logWorkflowUnCancelledEvent(workItem, toState);
+ } else if (fromState.getStateType().isCompletedState()) {
+ logWorkflowUnCompletedEvent(workItem, toState);
+ }
+ if (toState.getStateType().isCancelledState()) {
+ logWorkflowCancelledEvent(workItem, fromState, toState, completedCancellationReason,
+ transitionDate, transitionUser);
+ } else if (toState.getStateType().isCompletedState()) {
+ logWorkflowCompletedEvent(workItem, fromState, toState, completedCancellationReason,
+ transitionDate, transitionUser);
+ } else {
+ logStateCompletedEvent(workItem, workItem.getStateMgr().getCurrentStateName(),
+ completedCancellationReason, transitionDate, transitionUser);
+ }
+ logStateStartedEvent(workItem, toState, transitionDate, transitionUser);
+
+ // Get transition to assignees, do some checking to ensure someone is assigneed and UnAssigned
+ List<? extends IAtsUser> updatedAssigees = getToAssignees(workItem, toState);
+
+ workItem.getStateMgr().transitionHelper(updatedAssigees, fromState, toState,
+ completedCancellationReason);
+
+ // Create validation review if in correct state and TeamWorkflow
+ if (AtsCore.getReviewService().isValidationReviewRequired(workItem) && workItem.isTeamWorkflow()) {
+ IAtsDecisionReview review =
+ AtsCore.getReviewService().createValidateReview((IAtsTeamWorkflow) workItem, false,
+ transitionDate, transitionUser, helper.getChangeSet());
+ if (review != null) {
+ helper.getChangeSet().add(review);
+ }
+ }
+
+ AtsCore.getWorkItemService().transitioned(workItem, fromState, toState, updatedAssigees,
+ helper.getChangeSet());
+
+ // Notify extension points of transition
+ for (ITransitionListener listener : helper.getTransitionListeners()) {
+ listener.transitioned(workItem, fromState, toState, updatedAssigees, helper.getChangeSet());
+ }
+ if (toState.getStateType().isCompletedOrCancelledState()) {
+ AtsCore.getWorkItemService().clearImplementersCache(workItem);
+ }
+ }
+ } catch (Exception ex) {
+ results.addResult(workItem,
+ new TransitionResult(String.format("Exception while transitioning [%s]", helper.getName()), ex));
+ }
+ }
+ } catch (Exception ex) {
+ results.addResult(new TransitionResult(String.format("Exception while transitioning [%s]", helper.getName()),
+ ex));
+ }
+
+ }
+
+ private void isWorkingBranchTransitionable(TransitionResults results, IAtsWorkItem workItem, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ if (workItem.isTeamWorkflow() && helper.isWorkingBranchInWork((IAtsTeamWorkflow) workItem)) {
+ if (toStateDef.getName().equals(TeamState.Cancelled.getName())) {
+ results.addResult(workItem, TransitionResult.DELETE_WORKING_BRANCH_BEFORE_CANCEL);
+ }
+ if (helper.isBranchInCommit((IAtsTeamWorkflow) workItem)) {
+ results.addResult(workItem, TransitionResult.WORKING_BRANCH_BEING_COMMITTED);
+ }
+ if (!toStateDef.hasRule(RuleDefinitionOption.AllowTransitionWithWorkingBranch.name())) {
+ results.addResult(workItem, TransitionResult.WORKING_BRANCH_EXISTS);
+ }
+ }
+ }
+
+ private void isStateTransitionable(TransitionResults results, IAtsWorkItem workItem, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ boolean isOverrideAttributeValidationState =
+ helper.isOverrideTransitionValidityCheck() || workItem.getStateDefinition().getOverrideAttributeValidationStates().contains(
+ toStateDef);
+ if (toStateDef.getStateType().isCancelledState()) {
+ validateTaskCompletion(results, workItem, toStateDef);
+ validateReviewsCancelled(results, workItem, toStateDef);
+ } else if (!toStateDef.getStateType().isCancelledState() && !isOverrideAttributeValidationState) {
+
+ // Validate XWidgets for transition
+ Collection<WidgetResult> widgetResults =
+ AtsCore.getWorkItemService().validateWidgetTransition(workItem, toStateDef);
+ for (WidgetResult widgetResult : widgetResults) {
+ if (!widgetResult.isValid()) {
+ results.addResult(workItem, widgetResult);
+ }
+ }
+
+ validateTaskCompletion(results, workItem, toStateDef);
+
+ // Don't transition without targeted version if so configured
+ boolean teamDefRequiresTargetedVersion =
+ AtsCore.getWorkDefService().teamDefHasRule(workItem, RuleDefinitionOption.RequireTargetedVersion);
+ boolean pageRequiresTargetedVersion =
+ workItem.getStateDefinition().hasRule(RuleDefinitionOption.RequireTargetedVersion.name());
+
+ // Only check this if TeamWorkflow, not for reviews
+ if (workItem.isTeamWorkflow() && (teamDefRequiresTargetedVersion || pageRequiresTargetedVersion) && //
+ !AtsVersionService.get().hasTargetedVersion(workItem) && //
+ !toStateDef.getStateType().isCancelledState()) {
+ results.addResult(workItem, TransitionResult.MUST_BE_TARGETED_FOR_VERSION);
+ }
+
+ // Loop through this state's blocking reviews to confirm complete
+ if (workItem.isTeamWorkflow()) {
+ for (IAtsAbstractReview review : AtsCore.getReviewService().getReviewsFromCurrentState(
+ (IAtsTeamWorkflow) workItem)) {
+ if (AtsCore.getReviewService().getReviewBlockType(review) == ReviewBlockType.Transition && !AtsCore.getWorkItemService().getWorkData(
+ review).isCompletedOrCancelled()) {
+ results.addResult(workItem, TransitionResult.COMPLETE_BLOCKING_REVIEWS);
+ }
+ }
+ }
+ }
+ }
+
+ private void validateReviewsCancelled(TransitionResults results, IAtsWorkItem workItem, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ if (workItem.isTeamWorkflow() && toStateDef.getStateType().isCancelledState()) {
+ for (IAtsAbstractReview review : AtsCore.getReviewService().getReviewsFromCurrentState(
+ (IAtsTeamWorkflow) workItem)) {
+ if (AtsCore.getReviewService().getReviewBlockType(review) == ReviewBlockType.Transition && !AtsCore.getWorkItemService().getWorkData(
+ workItem).isCompletedOrCancelled()) {
+ results.addResult(workItem, TransitionResult.CANCEL_REVIEWS_BEFORE_CANCEL);
+ break;
+ }
+ }
+ }
+ }
+
+ private void validateTaskCompletion(TransitionResults results, IAtsWorkItem workItem, IAtsStateDefinition toStateDef) throws OseeCoreException {
+ // Loop through this state's tasks to confirm complete
+ boolean checkTasksCompletedForState = true;
+ // Don't check for task completion if transition to working state and AllowTransitionWithoutTaskCompletion rule is set
+ if (workItem.getStateDefinition().hasRule(RuleDefinitionOption.AllowTransitionWithoutTaskCompletion.name()) && toStateDef.getStateType().isWorkingState()) {
+ checkTasksCompletedForState = false;
+ }
+ if (checkTasksCompletedForState && workItem.isTeamWorkflow() && !AtsCore.getWorkItemService().getWorkData(
+ workItem).isCompletedOrCancelled()) {
+ Set<IAtsTask> tasksToCheck = new HashSet<IAtsTask>();
+ // If transitioning to completed/cancelled, all tasks must be completed/cancelled
+ if (toStateDef.getStateType().isCompletedOrCancelledState()) {
+ tasksToCheck.addAll(AtsCore.getWorkItemService().getTaskArtifacts(workItem));
+ }
+ // Else, just check current state tasks
+ else {
+ tasksToCheck.addAll(AtsCore.getWorkItemService().getTaskArtifacts(workItem));
+ }
+ for (IAtsTask taskArt : tasksToCheck) {
+ if (AtsCore.getWorkItemService().getWorkData(taskArt).isInWork()) {
+ results.addResult(workItem, TransitionResult.TASKS_NOT_COMPLETED);
+ break;
+ }
+ }
+ }
+ }
+
+ public static void logWorkflowCancelledEvent(IAtsWorkItem workItem, IAtsStateDefinition fromState, IAtsStateDefinition toState, String reason, Date cancelDate, IAtsUser cancelBy) throws OseeCoreException {
+ workItem.getLog().addLog(LogType.StateCancelled, fromState.getName(), reason, cancelDate, cancelBy);
+ if (AtsCore.getAttrResolver().isAttributeTypeValid(workItem, AtsAttributeTypes.CreatedBy)) {
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledBy, cancelBy.getUserId());
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledDate, cancelDate);
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledReason, reason);
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledFromState,
+ fromState.getName());
+ }
+ validateUpdatePercentCompleteAttribute(workItem, toState);
+ }
+
+ public static void logWorkflowUnCancelledEvent(IAtsWorkItem workItem, IAtsStateDefinition toState) throws OseeCoreException {
+ if (AtsCore.getAttrResolver().isAttributeTypeValid(workItem, AtsAttributeTypes.CreatedBy)) {
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledBy);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledDate);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledReason);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledFromState);
+ }
+ validateUpdatePercentCompleteAttribute(workItem, toState);
+ }
+
+ private void logWorkflowCompletedEvent(IAtsWorkItem workItem, IAtsStateDefinition fromState, IAtsStateDefinition toState, String reason, Date cancelDate, IAtsUser cancelBy) throws OseeCoreException {
+ workItem.getLog().addLog(LogType.StateComplete, fromState.getName(), Strings.isValid(reason) ? reason : "",
+ cancelDate, cancelBy);
+ if (AtsCore.getAttrResolver().isAttributeTypeValid(workItem, AtsAttributeTypes.CreatedBy)) {
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CompletedBy, cancelBy.getUserId());
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CompletedDate, cancelDate);
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CompletedFromState,
+ fromState.getName());
+ }
+ validateUpdatePercentCompleteAttribute(workItem, toState);
+ }
+
+ public static void logWorkflowUnCompletedEvent(IAtsWorkItem workItem, IAtsStateDefinition toState) throws OseeCoreException {
+ if (AtsCore.getAttrResolver().isAttributeTypeValid(workItem, AtsAttributeTypes.CreatedBy)) {
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CompletedBy);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CompletedDate);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CompletedFromState);
+ }
+ validateUpdatePercentCompleteAttribute(workItem, toState);
+ }
+
+ private static void validateUpdatePercentCompleteAttribute(IAtsWorkItem workItem, IAtsStateDefinition toState) throws OseeCoreException {
+ Integer percent = AtsCore.getAttrResolver().getSoleAttributeValue(workItem, AtsAttributeTypes.PercentComplete, 0);
+ if (toState.getStateType().isCompletedOrCancelledState() && percent != 100) {
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.PercentComplete, 100);
+ } else if (toState.getStateType().isWorkingState() && percent == 100) {
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.PercentComplete, 0);
+ }
+ }
+
+ private void logStateCompletedEvent(IAtsWorkItem workItem, String fromStateName, String reason, Date date, IAtsUser user) throws OseeCoreException {
+ workItem.getLog().addLog(LogType.StateComplete, fromStateName, Strings.isValid(reason) ? reason : "", date, user);
+ }
+
+ public static void logStateStartedEvent(IAtsWorkItem workItem, IStateToken state, Date date, IAtsUser user) throws OseeCoreException {
+ workItem.getLog().addLog(LogType.StateEntered, state.getName(), "", date, user);
+ }
+
+ /**
+ * Allow transition date to be used in log to be overridden for importing Actions from other systems and other
+ * programatic transitions.
+ */
+ public IAtsUser getTransitionAsUser() throws OseeCoreException {
+ if (transitionAsUser == null) {
+ return AtsCore.getUserService().getCurrentUser();
+ }
+ return transitionAsUser;
+ }
+
+ public void setTransitionAsUser(IAtsUser transitionAsUser) {
+ this.transitionAsUser = transitionAsUser;
+ }
+
+ /**
+ * Allow transition date to be used in log to be overridden for importing Actions from other systems and other
+ * programatic transitions.
+ */
+ public Date getTransitionOnDate() {
+ if (transitionOnDate == null) {
+ return new Date();
+ }
+ return transitionOnDate;
+ }
+
+ public void setTransitionOnDate(Date transitionOnDate) {
+ this.transitionOnDate = transitionOnDate;
+ }
+
+ /**
+ * Get transition to assignees. Verify that UnAssigned is not selected with another assignee. Ensure an assignee is
+ * entered, else use current user or UnAssigneed if current user is SystemUser.
+ */
+ public List<? extends IAtsUser> getToAssignees(IAtsWorkItem workItem, IAtsStateDefinition toState) throws OseeCoreException {
+ List<IAtsUser> assignees = workItemToAssignees.get(workItem);
+ if (assignees != null && toState.getStateType().isCompletedOrCancelledState()) {
+ assignees.clear();
+ }
+ if (assignees == null) {
+ assignees = new ArrayList<IAtsUser>();
+ workItemToAssignees.put(workItem, assignees);
+ if (!toState.getStateType().isCompletedOrCancelledState()) {
+ Collection<? extends IAtsUser> requestedAssignees = helper.getToAssignees(workItem);
+ if (requestedAssignees != null) {
+ for (IAtsUser user : requestedAssignees) {
+ assignees.add(user);
+ }
+ }
+ if (assignees.contains(AtsCoreUsers.UNASSIGNED_USER)) {
+ assignees.remove(AtsCoreUsers.UNASSIGNED_USER);
+ assignees.add(AtsCore.getUserService().getCurrentUser());
+ }
+ if (assignees.isEmpty()) {
+ if (helper.isSystemUser()) {
+ assignees.add(AtsCoreUsers.UNASSIGNED_USER);
+ } else {
+ assignees.add(AtsCore.getUserService().getCurrentUser());
+ }
+ }
+ }
+ }
+ return assignees;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionStatusData.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionStatusData.java
index 62c3a9a7a0..6fedc6cd29 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionStatusData.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionStatusData.java
@@ -8,16 +8,16 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.transition;
+package org.eclipse.osee.ats.core.workflow.transition;
import java.util.Collection;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.framework.core.util.Result;
/**
* Input data object that provides data fields for Edit Status and Transitioning and error checking based on certain
* criteria.
- *
+ *
* @author Donald G. Dunne
*/
public class TransitionStatusData {
@@ -25,10 +25,10 @@ public class TransitionStatusData {
private Integer percent, defaultPercent;
private Double additionalHours;
private boolean applyHoursToEachItem = false, splitHoursBetweenItems = true, showPercent;
- private Collection<? extends AbstractWorkflowArtifact> awas;
+ private Collection<? extends IAtsWorkItem> workItems;
- public TransitionStatusData(Collection<? extends AbstractWorkflowArtifact> awas, boolean showPercent) {
- this.awas = awas;
+ public TransitionStatusData(Collection<? extends IAtsWorkItem> workItems, boolean showPercent) {
+ this.workItems = workItems;
this.showPercent = showPercent;
}
@@ -45,7 +45,7 @@ public class TransitionStatusData {
if (!isHoursSet()) {
return new Result("Hours must be entered.");
}
- if (awas.size() > 1) {
+ if (workItems.size() > 1) {
if (!splitHoursBetweenItems && !applyHoursToEachItem) {
return new Result("Either \"Split Hours Spent\" or \"Apply Hours Spent\" must be selected");
}
@@ -88,12 +88,12 @@ public class TransitionStatusData {
this.splitHoursBetweenItems = splitHoursBetweenItems;
}
- public Collection<? extends AbstractWorkflowArtifact> getAwas() {
- return awas;
+ public Collection<? extends IAtsWorkItem> getWorkItems() {
+ return workItems;
}
- public void setAwas(Collection<? extends AbstractWorkflowArtifact> awas) {
- this.awas = awas;
+ public void setAwas(Collection<? extends IAtsWorkItem> workItems) {
+ this.workItems = workItems;
}
public boolean isPercentRequired() {
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/model/WorkDefinition.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/model/WorkDefinition.java
index 4734a1ccc6..19b00e614a 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/model/WorkDefinition.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/model/WorkDefinition.java
@@ -119,4 +119,9 @@ public class WorkDefinition extends AbstractWorkDefItem implements IAtsWorkDefin
return false;
}
+ @Override
+ public IAtsStateDefinition getStateDefinitionByName(String name) {
+ return getStateByName(name);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/MockWorkDefinition.java b/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/MockWorkDefinition.java
index c3968bec93..65c1bb0db5 100644
--- a/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/MockWorkDefinition.java
+++ b/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/MockWorkDefinition.java
@@ -134,4 +134,9 @@ public class MockWorkDefinition implements IAtsWorkDefinition {
return null;
}
+ @Override
+ public IAtsStateDefinition getStateDefinitionByName(String stateName) {
+ return getStateByName(stateName);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
index 961b32731d..62414e8c1a 100644
--- a/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
@@ -75,6 +75,7 @@ Import-Package: com.google.inject,
org.eclipse.osee.ats.api.ev,
org.eclipse.osee.ats.api.notify,
org.eclipse.osee.ats.api.query,
+ org.eclipse.osee.ats.api.review,
org.eclipse.osee.ats.api.rule,
org.eclipse.osee.ats.api.team,
org.eclipse.osee.ats.api.user,
@@ -83,8 +84,9 @@ Import-Package: com.google.inject,
org.eclipse.osee.ats.api.workdef,
org.eclipse.osee.ats.api.workflow,
org.eclipse.osee.ats.api.workflow.log,
- org.eclipse.osee.ats.core.ai,
org.eclipse.osee.ats.api.workflow.state,
+ org.eclipse.osee.ats.api.workflow.transition,
+ org.eclipse.osee.ats.core.ai,
org.eclipse.osee.ats.core.client,
org.eclipse.osee.ats.core.client.access,
org.eclipse.osee.ats.core.client.action,
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/WorkflowPortingBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/WorkflowPortingBlam.java
index a128837988..85feb9e325 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/WorkflowPortingBlam.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/WorkflowPortingBlam.java
@@ -21,17 +21,16 @@ import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.CreateTeamOption;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.internal.AtsClientService;
-import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.world.AtsWorldEditorRenderer;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
@@ -52,18 +51,15 @@ public class WorkflowPortingBlam extends AbstractBlam {
getActionableItems((IAtsActionableItem) variableMap.getValue(ACTIONABLE_ITEM));
Conditions.checkNotNullOrEmpty(actionableItems, ACTIONABLE_ITEM);
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Create Porting Workflow(s)");
-
- List<Artifact> destinationWorkflows = createDestinationWorkflows(transaction, actionableItems);
-
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet("Create Porting Workflow(s)");
+ List<Artifact> destinationWorkflows = createDestinationWorkflows(changes, actionableItems);
+ changes.execute();
AtsWorldEditorRenderer renderer = new AtsWorldEditorRenderer();
renderer.open(destinationWorkflows, PresentationType.SPECIALIZED_EDIT);
}
- private List<Artifact> createDestinationWorkflows(SkynetTransaction transaction, List<IAtsActionableItem> actionableItems) throws OseeCoreException {
+ private List<Artifact> createDestinationWorkflows(IAtsChangeSet changes, List<IAtsActionableItem> actionableItems) throws OseeCoreException {
IAtsTeamDefinition teamDefinition = actionableItems.get(0).getTeamDefinition();
List<Artifact> destinationWorkflows = new ArrayList<Artifact>();
IAtsUser createdBy = AtsClientService.get().getUserAdmin().getCurrentUser();
@@ -76,14 +72,14 @@ public class WorkflowPortingBlam extends AbstractBlam {
destinationWorkflow =
ActionManager.createTeamWorkflow(sourceWorkflow.getParentActionArtifact(), teamDefinition,
- actionableItems, assignees, transaction, createdDate, createdBy, null,
+ actionableItems, assignees, changes, createdDate, createdBy, null,
CreateTeamOption.Duplicate_If_Exists);
destinationWorkflow.setName(sourceWorkflow.getName());
- destinationWorkflow.persist(transaction);
+ changes.add(destinationWorkflow);
sourceWorkflow.addRelation(AtsRelationTypes.Port_To, destinationWorkflow);
- sourceWorkflow.persist(transaction);
+ changes.add(sourceWorkflow);
} else {
destinationWorkflow = sourceWorkflow.getRelatedArtifact(AtsRelationTypes.Port_To);
log("Reusing destination workflow " + destinationWorkflow);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ConvertActionableItemsAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ConvertActionableItemsAction.java
index 7ea9ae7e75..c79e27281c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ConvertActionableItemsAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ConvertActionableItemsAction.java
@@ -182,8 +182,9 @@ public class ConvertActionableItemsAction extends Action {
teamArt.setTeamDefinition(teamDef);
}
SkynetTransaction transaction = TransactionManager.createTransaction(branch, "Convert Actionable Item");
- ActionArtifactRollup rollup = new ActionArtifactRollup(teamArt.getParentActionArtifact(), transaction);
+ ActionArtifactRollup rollup = new ActionArtifactRollup(teamArt.getParentActionArtifact());
rollup.resetAttributesOffChildren();
+ teamArt.getParentActionArtifact().persist(transaction);
teamArt.persist(transaction);
transaction.execute();
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewGoal.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewGoal.java
index 63096c1904..af078f3533 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewGoal.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewGoal.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.ats.actions;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.artifact.GoalManager;
import org.eclipse.osee.ats.core.client.artifact.GoalArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.editor.SMAEditor;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -42,8 +43,9 @@ public class NewGoal extends AbstractAtsAction {
}
}
if (Strings.isValid(title)) {
- GoalArtifact goalArt = GoalManager.createGoal(title);
- goalArt.persist(getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ GoalArtifact goalArt = GoalManager.createGoal(title, changes);
+ changes.execute();
SMAEditor.editArtifact(goalArt);
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java
index 4b2a17d527..50182e179c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java
@@ -12,9 +12,9 @@ package org.eclipse.osee.ats.actions.wizard;
import java.util.Collection;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* Allows the New Action wizard to be extended with custom widgets when the appropriate Actionable Items are selected
@@ -48,7 +48,7 @@ public interface IAtsWizardItem {
* Callback with created action upon completion and creation of the action and it's workflows.
* hasWizardXWidgetExtenstions will be called to determine if this method should be called.
*/
- void wizardCompleted(Artifact actionArt, NewActionWizard wizard, SkynetTransaction transaction) throws Exception;
+ void wizardCompleted(Artifact actionArt, NewActionWizard wizard, IAtsChangeSet changes) throws Exception;
/**
* Validation that the data entered is valid and the wizard can be finished. This will be called after every
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java
index 3ef06deaee..5fe25cc2dd 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.ats.AtsOpenOption;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.action.INewActionListener;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
@@ -29,8 +30,6 @@ import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationManager;
/**
@@ -69,22 +68,23 @@ public class NewActionJob extends Job {
if (actionableItems.isEmpty()) {
throw new OseeArgumentException("Actionable Items can not be empty for New Action");
}
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Create New Action");
if ("tt".equals(title)) {
title += " " + AtsUtil.getAtsDeveloperIncrementingNum();
}
+ AtsChangeSet changes = new AtsChangeSet("Create New Action");
actionArt =
ActionManager.createAction(monitor, title, desc, changeType, priority, validationRequired, needByDate,
- actionableItems, new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), newActionListener, transaction);
+ actionableItems, new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), newActionListener,
+ changes);
if (wizard != null) {
- wizard.notifyAtsWizardItemExtensions(actionArt, transaction);
+ wizard.notifyAtsWizardItemExtensions(actionArt, changes);
}
if (monitor != null) {
monitor.subTask("Persisting");
}
- transaction.execute();
+ changes.execute();
// Because this is a job, it will automatically kill any popups that are created during.
// Thus, if multiple teams were selected to create, don't popup on openAction or dialog
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java
index 444d10c450..5b05df1a4b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java
@@ -21,6 +21,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.workflow.ATSXWidgetOptionResolver;
import org.eclipse.osee.framework.core.util.Conditions;
@@ -29,7 +30,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.util.XWidgetPage;
@@ -59,11 +59,11 @@ public class NewActionPage3 extends WizardPage {
getWizardXWidgetExtensions();
}
- public void notifyAtsWizardItemExtensions(Artifact action, SkynetTransaction transaction) {
+ public void notifyAtsWizardItemExtensions(Artifact action, IAtsChangeSet changes) {
for (IAtsWizardItem item : wizardExtensionItems) {
try {
if (item.hasWizardXWidgetExtensions(wizard.getSelectedIAtsActionableItems())) {
- item.wizardCompleted(action, wizard, transaction);
+ item.wizardCompleted(action, wizard, changes);
}
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java
index d9ba297fbf..0608424f43 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.action.INewActionListener;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
import org.eclipse.osee.ats.internal.Activator;
@@ -25,7 +26,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
@@ -127,9 +127,9 @@ public class NewActionWizard extends Wizard implements INewWizard {
return ((XDate) page2.getXWidget("Deadline")).getDate();
}
- public void notifyAtsWizardItemExtensions(Artifact action, SkynetTransaction transaction) {
+ public void notifyAtsWizardItemExtensions(Artifact action, IAtsChangeSet changes) {
if (page3 != null) {
- page3.notifyAtsWizardItemExtensions(action, transaction);
+ page3.notifyAtsWizardItemExtensions(action, changes);
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalManager.java
index c0bb634a4e..accc23151f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalManager.java
@@ -23,6 +23,7 @@ import java.util.Set;
import org.eclipse.jface.window.Window;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.artifact.GoalArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.goal.GoalLabelProvider;
@@ -172,12 +173,14 @@ public final class GoalManager {
}
}
- public static GoalArtifact createGoal(String title) throws OseeCoreException {
+ public static GoalArtifact createGoal(String title, IAtsChangeSet changes) throws OseeCoreException {
GoalArtifact goalArt =
(GoalArtifact) ArtifactTypeManager.addArtifact(AtsArtifactTypes.Goal, AtsUtil.getAtsBranch(), title);
// Initialize state machine
- goalArt.initializeNewStateMachine(Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()), new Date(), AtsClientService.get().getUserAdmin().getCurrentUser());
+ goalArt.initializeNewStateMachine(Arrays.asList(AtsClientService.get().getUserAdmin().getCurrentUser()),
+ new Date(), AtsClientService.get().getUserAdmin().getCurrentUser());
+ changes.add(goalArt);
return goalArt;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigOperation.java
index d6526fea0d..9638ed1fe3 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigOperation.java
@@ -21,9 +21,11 @@ import org.eclipse.osee.ats.AtsOpenOption;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.core.client.config.AtsArtifactToken;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
@@ -44,8 +46,6 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
import org.eclipse.ui.progress.UIJob;
@@ -102,44 +102,43 @@ public class AtsConfigOperation extends AbstractOperation {
checkWorkItemNamespaceUnique();
monitor.worked(calculateWork(0.10));
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Configure ATS for Default Team");
+ AtsChangeSet changes = new AtsChangeSet("Configure ATS for Default Team");
- teamDefinition = createTeamDefinition(transaction);
+ teamDefinition = createTeamDefinition(changes);
- actionableItems = createActionableItems(transaction, teamDefinition);
+ actionableItems = createActionableItems(changes, teamDefinition);
- createVersions(transaction, teamDefinition);
+ createVersions(changes, teamDefinition);
XResultData resultData = new XResultData();
- IAtsWorkDefinition workDefinition = createWorkflow(transaction, resultData, teamDefinition);
+ IAtsWorkDefinition workDefinition = createWorkflow(changes, resultData, teamDefinition);
- transaction.execute();
+ changes.execute();
monitor.worked(calculateWork(0.30));
display.openAtsConfigurationEditors(teamDefinition, actionableItems, workDefinition);
monitor.worked(calculateWork(0.10));
}
- private IAtsTeamDefinition createTeamDefinition(SkynetTransaction transaction) throws OseeCoreException {
+ private IAtsTeamDefinition createTeamDefinition(IAtsChangeSet changes) throws OseeCoreException {
IAtsTeamDefinition teamDef = AtsClientService.get().createTeamDefinition(GUID.create(), teamDefName);
teamDef.getLeads().add(AtsClientService.get().getUserAdmin().getCurrentUser());
teamDef.getMembers().add(AtsClientService.get().getUserAdmin().getCurrentUser());
TeamDefinitions.getTopTeamDefinition().getChildrenTeamDefinitions().add(teamDef);
- AtsClientService.get().storeConfigObject(teamDef, transaction);
+ AtsClientService.get().storeConfigObject(teamDef, changes);
return teamDef;
}
- private Collection<IAtsActionableItem> createActionableItems(SkynetTransaction transaction, IAtsTeamDefinition teamDef) throws OseeCoreException {
+ private Collection<IAtsActionableItem> createActionableItems(IAtsChangeSet changes, IAtsTeamDefinition teamDef) throws OseeCoreException {
Collection<IAtsActionableItem> aias = new ArrayList<IAtsActionableItem>();
// Create top actionable item
IAtsActionableItem topAia = AtsClientService.get().createActionableItem(GUID.create(), teamDefName);
topAia.setActionable(false);
topAia.setTeamDefinition(teamDef);
- AtsClientService.get().storeConfigObject(topAia, transaction);
+ AtsClientService.get().storeConfigObject(topAia, changes);
teamDef.getActionableItems().add(topAia);
- AtsClientService.get().storeConfigObject(teamDef, transaction);
+ AtsClientService.get().storeConfigObject(teamDef, changes);
aias.add(topAia);
@@ -149,38 +148,38 @@ public class AtsConfigOperation extends AbstractOperation {
childAi.setActionable(true);
topAia.getChildrenActionableItems().add(childAi);
childAi.setParentActionableItem(topAia);
- AtsClientService.get().storeConfigObject(childAi, transaction);
+ AtsClientService.get().storeConfigObject(childAi, changes);
aias.add(childAi);
}
- AtsClientService.get().storeConfigObject(topAia, transaction);
+ AtsClientService.get().storeConfigObject(topAia, changes);
return aias;
}
- private void createVersions(SkynetTransaction transaction, IAtsTeamDefinition teamDef) throws OseeCoreException {
+ private void createVersions(IAtsChangeSet changes, IAtsTeamDefinition teamDef) throws OseeCoreException {
if (versionNames != null) {
for (String name : versionNames) {
IAtsVersion version = AtsClientService.get().createVersion(name);
teamDef.getVersions().add(version);
- AtsClientService.get().storeConfigObject(version, transaction);
+ AtsClientService.get().storeConfigObject(version, changes);
AtsVersionService.get().setTeamDefinition(version, teamDef);
}
}
}
- private IAtsWorkDefinition createWorkflow(SkynetTransaction transaction, XResultData resultData, IAtsTeamDefinition teamDef) throws OseeCoreException {
+ private IAtsWorkDefinition createWorkflow(IAtsChangeSet changes, XResultData resultData, IAtsTeamDefinition teamDef) throws OseeCoreException {
WorkDefinitionMatch workDefMatch = AtsClientService.get().getWorkDefinitionAdmin().getWorkDefinition(name);
IAtsWorkDefinition workDef = null;
// If can't be found, create a new one
if (!workDefMatch.isMatched()) {
- workDef = generateDefaultWorkflow(name, resultData, transaction, teamDef);
+ workDef = generateDefaultWorkflow(name, resultData, changes, teamDef);
try {
String workDefXml = AtsClientService.get().getWorkDefinitionAdmin().getStorageString(workDef, resultData);
Artifact workDefArt =
AtsWorkDefinitionImporter.get().importWorkDefinitionToDb(workDefXml, workDef.getName(), name,
- resultData, transaction);
+ resultData, changes);
Artifact folder = AtsUtilCore.getFromToken(AtsArtifactToken.WorkDefinitionsFolder);
folder.addChild(workDefArt);
- folder.persist(transaction);
+ changes.add(folder);
} catch (Exception ex) {
throw new OseeWrappedException(ex);
}
@@ -189,11 +188,11 @@ public class AtsConfigOperation extends AbstractOperation {
}
// Relate new team def to workflow artifact
teamDef.setWorkflowDefinition(workDef.getId());
- AtsClientService.get().storeConfigObject(teamDef, transaction);
+ AtsClientService.get().storeConfigObject(teamDef, changes);
return workDef;
}
- private IAtsWorkDefinition generateDefaultWorkflow(String name, XResultData resultData, SkynetTransaction transaction, IAtsTeamDefinition teamDef) throws OseeCoreException {
+ private IAtsWorkDefinition generateDefaultWorkflow(String name, XResultData resultData, IAtsChangeSet changes, IAtsTeamDefinition teamDef) throws OseeCoreException {
IAtsWorkDefinition defaultWorkDef =
AtsClientService.get().getWorkDefinitionAdmin().getWorkDefinition(
AtsWorkDefinitionSheetProviders.WORK_DEF_TEAM_DEFAULT).getWorkDefinition();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
index a7064e6a51..85d8528d7b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
@@ -15,6 +15,7 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.core.client.IAtsWorkDefinitionAdmin;
import org.eclipse.osee.ats.core.client.config.AtsArtifactToken;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsGroup;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsUtil;
@@ -44,19 +45,18 @@ public class AtsDatabaseConfig implements IDbInitializationTask {
ArtifactQuery.getArtifactFromToken(AtsArtifactToken.TopTeamDefinition, AtsUtil.getAtsBranchToken());
IAtsTeamDefinition teamDef = AtsClientService.get().getConfigObject(topTeamDefArt);
teamDef.setWorkflowDefinition(IAtsWorkDefinitionAdmin.TeamWorkflowDefaultDefinitionId);
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), "Set Top Team Work Definition");
- AtsClientService.get().storeConfigObject(teamDef, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet("Set Top Team Work Definition");
+ AtsClientService.get().storeConfigObject(teamDef, changes);
+ changes.execute();
// load top ai into cache
Artifact topAiArt =
ArtifactQuery.getArtifactFromToken(AtsArtifactToken.TopActionableItem, AtsUtil.getAtsBranchToken());
IAtsActionableItem aia = AtsClientService.get().getConfigObject(topAiArt);
aia.setActionable(false);
- transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), "Set Top AI to Non Actionable");
- AtsClientService.get().storeConfigObject(aia, transaction);
- transaction.execute();
+ changes.reset("Set Top AI to Non Actionable");
+ AtsClientService.get().storeConfigObject(aia, changes);
+ changes.execute();
AtsWorkDefinitionSheetProviders.initializeDatabase(new XResultData(false));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java
index fc44105f9d..9e48bf38fa 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/copy/CopyAtsConfigurationOperation.java
@@ -16,6 +16,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.api.IAtsConfigObject;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
@@ -23,7 +24,9 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.config.AtsBulkLoad;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsUtil;
@@ -31,9 +34,8 @@ import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.skynet.results.XResultDataUI;
/**
@@ -49,7 +51,6 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
private final Map<IAtsTeamDefinition, IAtsTeamDefinition> fromTeamDefToNewTeamDefMap =
new HashMap<IAtsTeamDefinition, IAtsTeamDefinition>();
- private SkynetTransaction transaction;
public CopyAtsConfigurationOperation(ConfigData data, XResultData resultData) {
super("Copy ATS Configuration", Activator.PLUGIN_ID);
@@ -68,16 +69,16 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
if (resultData.isErrors()) {
return;
}
- transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
+ AtsChangeSet changes = new AtsChangeSet(getName());
getCopyAtsValidation().validate();
if (resultData.isErrors()) {
- persistOrUndoChanges(transaction);
+ persistOrUndoChanges(changes);
return;
}
if (data.isPersistChanges()) {
- resultData.log("Persisting Changes");
+ resultData.log("Persisting Changes ");
} else {
resultData.log("Report-Only, Changes are not persisted");
}
@@ -86,22 +87,24 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
existingArtifacts = new HashSet<Artifact>(50);
processedFromAis = new HashSet<Artifact>(10);
- createTeamDefinitions(transaction, data.getTeamDef(), data.getParentTeamDef());
+ createTeamDefinitions(changes, data.getTeamDef(), data.getParentTeamDef());
if (resultData.isErrors()) {
- persistOrUndoChanges(transaction);
+ persistOrUndoChanges(changes);
return;
}
- createActionableItems(transaction, data.getActionableItem(), data.getParentActionableItem());
+ createActionableItems(changes, data.getActionableItem(), data.getParentActionableItem());
if (resultData.isErrors()) {
- persistOrUndoChanges(transaction);
+ persistOrUndoChanges(changes);
return;
}
AtsBulkLoad.reloadConfig(true);
- persistOrUndoChanges(transaction);
+ persistOrUndoChanges(changes);
XResultDataUI.report(resultData, getName());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
} finally {
monitor.subTask("Done");
}
@@ -109,10 +112,8 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
/**
* Has potential of returning null if this fromAi has already been processed.
- *
- * @param transaction
*/
- protected IAtsActionableItem createActionableItems(SkynetTransaction transaction, IAtsActionableItem fromAi, IAtsActionableItem parentAi) throws OseeCoreException {
+ protected IAtsActionableItem createActionableItems(IAtsChangeSet changes, IAtsActionableItem fromAi, IAtsActionableItem parentAi) throws OseeCoreException {
Artifact fromAiArt = AtsClientService.get().getConfigArtifact(fromAi);
if (processedFromAis.contains(fromAiArt)) {
@@ -121,15 +122,17 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
} else {
processedFromAis.add(fromAiArt);
}
- Artifact parentAiArt = AtsClientService.get().storeConfigObject(parentAi, transaction);
+ Artifact parentAiArt = AtsClientService.get().storeConfigObject(parentAi, changes);
// Get or create new team definition
- Artifact newAiArt = duplicateTeamDefinitionOrActionableItem(fromAiArt);
+ Artifact newAiArt = duplicateTeamDefinitionOrActionableItem(changes, fromAiArt);
+ changes.add(newAiArt);
IAtsActionableItem newAi = AtsClientService.get().getConfigObject(newAiArt);
newAi.setParentActionableItem(parentAi);
parentAi.getChildrenActionableItems().add(newAi);
parentAiArt.addChild(newAiArt);
+ changes.add(parentAiArt);
existingArtifacts.add(parentAiArt);
newArtifacts.add(newAiArt);
// Relate new Ais to their TeamDefs just like other config
@@ -145,9 +148,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
} else {
Artifact newTeamDefArt = AtsClientService.get().getConfigArtifact(newTeamDef);
newAiArt.addRelation(AtsRelationTypes.TeamActionableItem_Team, newTeamDefArt);
- if (data.isPersistChanges()) {
- newTeamDefArt.persist(transaction);
- }
+ changes.add(newTeamDefArt);
}
}
@@ -156,39 +157,41 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
if (childFromAiArt.isOfType(AtsArtifactTypes.ActionableItem)) {
IAtsActionableItem childAi = AtsClientService.get().getConfigObject(childFromAiArt);
IAtsActionableItem newChildAi = AtsClientService.get().getConfigObject(newAiArt);
- createActionableItems(transaction, childAi, newChildAi);
+ createActionableItems(changes, childAi, newChildAi);
}
}
return newAi;
}
- protected IAtsTeamDefinition createTeamDefinitions(SkynetTransaction transaction, IAtsTeamDefinition fromTeamDef, IAtsTeamDefinition parentTeamDef) throws OseeCoreException {
+ protected IAtsTeamDefinition createTeamDefinitions(IAtsChangeSet changes, IAtsTeamDefinition fromTeamDef, IAtsTeamDefinition parentTeamDef) throws OseeCoreException {
// Get or create new team definition
Artifact parentTeamDefArt = AtsClientService.get().getConfigArtifact(parentTeamDef);
Artifact fromTeamDefArt = AtsClientService.get().getConfigArtifact(fromTeamDef);
- Artifact newTeamDefArt = duplicateTeamDefinitionOrActionableItem(fromTeamDefArt);
+ Artifact newTeamDefArt = duplicateTeamDefinitionOrActionableItem(changes, fromTeamDefArt);
+ changes.add(newTeamDefArt);
IAtsTeamDefinition newTeamDef = AtsClientService.get().getConfigObject(newTeamDefArt);
parentTeamDefArt.addChild(newTeamDefArt);
+ changes.add(parentTeamDefArt);
existingArtifacts.add(parentTeamDefArt);
newArtifacts.add(newTeamDefArt);
fromTeamDefToNewTeamDefMap.put(fromTeamDef, newTeamDef);
if (data.isRetainTeamLeads()) {
- duplicateTeamLeadsAndMembers(fromTeamDef, newTeamDef);
+ duplicateTeamLeadsAndMembers(changes, fromTeamDef, newTeamDef);
}
// handle all children
for (Artifact childFromTeamDefArt : fromTeamDefArt.getChildren()) {
if (childFromTeamDefArt.isOfType(AtsArtifactTypes.TeamDefinition)) {
IAtsTeamDefinition childFromTeamDef = AtsClientService.get().getConfigObject(childFromTeamDefArt);
AtsClientService.get().getAtsConfig().getSoleByGuid(childFromTeamDefArt.getGuid(), IAtsTeamDefinition.class);
- createTeamDefinitions(transaction, childFromTeamDef, newTeamDef);
+ createTeamDefinitions(changes, childFromTeamDef, newTeamDef);
}
}
return newTeamDef;
}
- private void duplicateTeamLeadsAndMembers(IAtsTeamDefinition fromTeamDef, IAtsTeamDefinition newTeamDef) throws OseeCoreException {
+ private void duplicateTeamLeadsAndMembers(IAtsChangeSet changes, IAtsTeamDefinition fromTeamDef, IAtsTeamDefinition newTeamDef) throws OseeCoreException {
Artifact fromTeamDefArt = AtsClientService.get().getConfigArtifact(fromTeamDef);
Artifact newTeamDefArt = AtsClientService.get().getConfigArtifact(newTeamDef);
@@ -196,6 +199,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
for (Artifact user : fromTeamDefArt.getRelatedArtifacts(AtsRelationTypes.TeamLead_Lead)) {
if (!leads.contains(user)) {
existingArtifacts.add(user);
+ changes.add(user);
newTeamDefArt.addRelation(AtsRelationTypes.TeamLead_Lead, user);
resultData.log(" - Relating team lead " + user);
}
@@ -204,6 +208,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
for (Artifact user : fromTeamDefArt.getRelatedArtifacts(AtsRelationTypes.TeamMember_Member)) {
if (!members.contains(user)) {
existingArtifacts.add(user);
+ changes.add(user);
newTeamDefArt.addRelation(AtsRelationTypes.TeamMember_Member, user);
resultData.log(" - Relating team member " + user);
}
@@ -211,18 +216,16 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
for (Artifact user : fromTeamDefArt.getRelatedArtifacts(AtsRelationTypes.PrivilegedMember_Member)) {
if (!members.contains(user)) {
existingArtifacts.add(user);
+ changes.add(user);
newTeamDefArt.addRelation(AtsRelationTypes.PrivilegedMember_Member, user);
resultData.log(" - Relating privileged member " + user);
}
}
}
- private void persistOrUndoChanges(SkynetTransaction transaction) throws OseeCoreException {
+ private void persistOrUndoChanges(AtsChangeSet changes) throws OseeCoreException {
if (data.isPersistChanges()) {
- for (Artifact art : newArtifacts) {
- art.persist(transaction);
- }
- transaction.execute();
+ changes.execute();
AtsClientService.get().invalidateConfigCache();
} else {
resultData.log("\n\nCleanup of created / modified artifacts\n\n");
@@ -245,7 +248,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
}
}
- private Artifact duplicateTeamDefinitionOrActionableItem(Artifact fromArtifact) throws OseeCoreException {
+ private Artifact duplicateTeamDefinitionOrActionableItem(IAtsChangeSet changes, Artifact fromArtifact) throws OseeCoreException {
String newName = CopyAtsUtil.getConvertedName(data, fromArtifact.getName());
if (newName.equals(fromArtifact.getName())) {
throw new OseeArgumentException("Could not get new name from name conversion.");
@@ -254,6 +257,7 @@ public class CopyAtsConfigurationOperation extends AbstractOperation {
Artifact newTeamDef =
fromArtifact.duplicate(AtsUtil.getAtsBranch(), Arrays.asList(AtsAttributeTypes.BaselineBranchGuid));
newTeamDef.setName(newName);
+ changes.add(newTeamDef);
resultData.log("Creating new " + newTeamDef.getArtifactTypeName() + ": " + newTeamDef);
String fullName = newTeamDef.getSoleAttributeValue(AtsAttributeTypes.FullName, null);
if (fullName != null) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeHoursSpent.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeHoursSpent.java
index 28d5bc749b..2a32b7db68 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeHoursSpent.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeHoursSpent.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.ats.editor;
import java.util.Arrays;
import java.util.Collection;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionStatusData;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionStatusData;
import org.eclipse.osee.ats.util.widgets.dialog.TransitionStatusDialog;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeStatus.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeStatus.java
index 03b7c5a7ab..009bfaf1b8 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeStatus.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeStatus.java
@@ -12,12 +12,13 @@ package org.eclipse.osee.ats.editor;
import java.util.Arrays;
import java.util.Collection;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionStatusData;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionStatusData;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.util.widgets.dialog.TransitionStatusDialog;
@@ -96,22 +97,22 @@ public class SMAPromptChangeStatus {
return Result.FalseResult;
}
- public static void performChangeStatus(Collection<? extends AbstractWorkflowArtifact> awas, String selectedOption, double hours, int percent, boolean splitHours, boolean persist) throws OseeCoreException {
+ public static void performChangeStatus(Collection<? extends IAtsWorkItem> workItems, String selectedOption, double hours, int percent, boolean splitHours, boolean persist) throws OseeCoreException {
if (splitHours) {
- hours = hours / awas.size();
+ hours = hours / workItems.size();
}
SkynetTransaction transaction = null;
if (persist) {
transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "ATS Prompt Change Status");
}
- for (AbstractWorkflowArtifact awa : awas) {
- if (awa.getStateMgr().isUnAssigned()) {
- awa.getStateMgr().removeAssignee(AtsCoreUsers.UNASSIGNED_USER);
- awa.getStateMgr().addAssignee(AtsClientService.get().getUserAdmin().getCurrentUser());
+ for (IAtsWorkItem workItem : workItems) {
+ if (workItem.getStateMgr().isUnAssigned()) {
+ workItem.getStateMgr().removeAssignee(AtsCoreUsers.UNASSIGNED_USER);
+ workItem.getStateMgr().addAssignee(AtsClientService.get().getUserAdmin().getCurrentUser());
}
- awa.getStateMgr().updateMetrics(awa.getStateDefinition(), hours, percent, true);
+ workItem.getStateMgr().updateMetrics(workItem.getStateDefinition(), hours, percent, true);
if (persist) {
- awa.persist(transaction);
+ AtsClientService.get().getArtifact(workItem).persist(transaction);
}
}
if (persist) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WETransitionComposite.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WETransitionComposite.java
index 2e42590f11..0a14492540 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WETransitionComposite.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WETransitionComposite.java
@@ -21,18 +21,23 @@ import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.RuleDefinitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionHelper;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.ITransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelperAdapter;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionStatusData;
import org.eclipse.osee.ats.core.client.workflow.transition.TransitionToOperation;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelperAdapter;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionStatusData;
import org.eclipse.osee.ats.editor.stateItem.AtsStateItemManager;
import org.eclipse.osee.ats.editor.stateItem.IAtsStateItem;
import org.eclipse.osee.ats.internal.Activator;
@@ -183,7 +188,7 @@ public class WETransitionComposite extends Composite {
private void handleTransitionButtonSelection(final SMAEditor editor, final boolean isEditable) {
editor.doSave(null);
- final List<AbstractWorkflowArtifact> awas = Arrays.asList(awa);
+ final List<IAtsWorkItem> workItems = Arrays.asList((IAtsWorkItem) awa);
final IAtsStateDefinition toStateDef = (IAtsStateDefinition) transitionToStateCombo.getSelected();
final IAtsStateDefinition fromStateDef = awa.getStateDefinition();
ITransitionHelper helper = new TransitionHelperAdapter() {
@@ -199,7 +204,8 @@ public class WETransitionComposite extends Composite {
}
@Override
- public Collection<? extends IAtsUser> getToAssignees(AbstractWorkflowArtifact awa) throws OseeCoreException {
+ public Collection<? extends IAtsUser> getToAssignees(IAtsWorkItem workItem) throws OseeCoreException {
+ AbstractWorkflowArtifact awa = (AbstractWorkflowArtifact) AtsClientService.get().getArtifact(workItem);
return awa.getTransitionAssignees();
}
@@ -222,7 +228,7 @@ public class WETransitionComposite extends Composite {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
result.set(false);
result.setText(String.format("Error processing extra hours spent for [%s]",
- awas.iterator().next().toStringWithId()));
+ workItems.iterator().next().toStringWithId()));
}
if (!resultBool) {
result.setCancelled(true);
@@ -240,25 +246,49 @@ public class WETransitionComposite extends Composite {
@Override
public void run() {
- IAtsStateDefinition toStateDef =
- getAwas().iterator().next().getStateDefinitionByName(getToStateName());
- if (toStateDef.getStateType().isCancelledState()) {
- EntryDialog cancelDialog = new EntryDialog("Cancellation Reason", "Enter cancellation reason.");
- if (cancelDialog.open() != 0) {
- result.setCancelled(true);
+ IAtsStateDefinition toStateDef;
+ try {
+ toStateDef =
+ AtsClientService.get().getWorkDefinitionAdmin().getStateDefinitionByName(awa, getToStateName());
+ if (toStateDef.getStateType().isCancelledState()) {
+ EntryDialog cancelDialog = new EntryDialog("Cancellation Reason", "Enter cancellation reason.");
+ if (cancelDialog.open() != 0) {
+ result.setCancelled(true);
+ }
+ result.set(true);
+ result.setText(cancelDialog.getEntry());
}
- result.set(true);
- result.setText(cancelDialog.getEntry());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
}
-
}
}, true);
return result;
}
@Override
- public Collection<AbstractWorkflowArtifact> getAwas() {
- return awas;
+ public Collection<IAtsWorkItem> getWorkItems() {
+ return workItems;
+ }
+
+ @Override
+ public void setInTransition(IAtsWorkItem workItem, boolean inTransition) throws OseeCoreException {
+ AtsClientService.get().getWorkflowArtifact(workItem).setInTransition(inTransition);
+ }
+
+ @Override
+ public IAtsChangeSet getChangeSet() {
+ return new AtsChangeSet(getName());
+ }
+
+ @Override
+ public Collection<ITransitionListener> getTransitionListeners() {
+ try {
+ return AtsCore.getWorkItemService().getTransitionListeners();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return java.util.Collections.emptyList();
}
};
@@ -396,7 +426,8 @@ public class WETransitionComposite extends Composite {
uld.setMessage("Select users to transition to.");
uld.setInitialSelections(AtsClientService.get().getUserAdmin().getOseeUsers(aba.getTransitionAssignees()));
if (awa.getParentTeamWorkflow() != null) {
- uld.setTeamMembers(AtsClientService.get().getUserAdmin().getOseeUsers(awa.getParentTeamWorkflow().getTeamDefinition().getMembersAndLeads()));
+ uld.setTeamMembers(AtsClientService.get().getUserAdmin().getOseeUsers(
+ awa.getParentTeamWorkflow().getTeamDefinition().getMembersAndLeads()));
}
if (uld.open() != 0) {
return;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java
index 51d895db98..cf47653070 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java
@@ -11,16 +11,16 @@
package org.eclipse.osee.ats.editor.stateItem;
import java.util.Collection;
-import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.review.IAtsDecisionReview;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.review.DecisionReviewState;
import org.eclipse.osee.ats.core.client.review.XDecisionOptions;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.ITransitionListener;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -37,17 +37,16 @@ public class AtsDecisionReviewPrepareStateItem extends AtsStateItem implements I
}
@Override
- public void transitioning(TransitionResults results, AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) throws OseeCoreException {
- if (sma.isOfType(AtsArtifactTypes.DecisionReview) && fromState.getName().equals(
- DecisionReviewState.Prepare.getName()) && toState.getName().equals(
+ public void transitioning(TransitionResults results, IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) throws OseeCoreException {
+ if ((workItem instanceof IAtsDecisionReview) && fromState.getName().equals(DecisionReviewState.Prepare.getName()) && toState.getName().equals(
DecisionReviewState.Decision.getName())) {
- XDecisionOptions decOptions = new XDecisionOptions(sma);
+ XDecisionOptions decOptions = new XDecisionOptions(workItem);
decOptions.validateDecisionOptions(results);
}
}
@Override
- public void transitioned(AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) {
+ public void transitioned(IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) {
// do nothing
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java
index 2c90e3a4c0..26d4ea0880 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java
@@ -11,16 +11,18 @@
package org.eclipse.osee.ats.editor.stateItem;
import java.util.Collection;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.RuleDefinitionOption;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.ITransitionListener;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -37,12 +39,13 @@ public class AtsForceAssigneesToTeamLeadsStateItem extends AtsStateItem implemen
}
@Override
- public void transitioned(AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
- if (sma.isTeamWorkflow() && isForceAssigneesToTeamLeads(sma.getStateDefinitionByName(toState.getName()))) {
- Collection<IAtsUser> teamLeads = ((TeamWorkFlowArtifact) sma).getTeamDefinition().getLeads();
+ public void transitioned(IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
+ if ((workItem instanceof IAtsTeamWorkflow) && isForceAssigneesToTeamLeads(AtsClientService.get().getWorkDefinitionAdmin().getStateDefinitionByName(
+ workItem, toState.getName()))) {
+ Collection<IAtsUser> teamLeads = ((TeamWorkFlowArtifact) workItem).getTeamDefinition().getLeads();
if (!teamLeads.isEmpty()) {
- sma.getStateMgr().setAssignees(teamLeads);
- sma.persist(transaction);
+ workItem.getStateMgr().setAssignees(teamLeads);
+ changes.add(workItem);
}
}
}
@@ -52,7 +55,7 @@ public class AtsForceAssigneesToTeamLeadsStateItem extends AtsStateItem implemen
}
@Override
- public void transitioning(TransitionResults results, AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
+ public void transitioning(TransitionResults results, IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
// do nothing
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java
index bf35d4f034..e7c01a2172 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java
@@ -75,6 +75,11 @@ public class AtsLogWorkPage extends StateXWidgetPage {
public boolean matches(Identity<?>... identities) {
return false;
}
+
+ @Override
+ public IAtsStateDefinition getStateDefinitionByName(String name) {
+ return null;
+ }
}
public AtsLogWorkPage(String title) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java
index 7f9407e7fd..c72c0b651c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java
@@ -13,18 +13,18 @@ package org.eclipse.osee.ats.editor.stateItem;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
-import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.review.IAtsPeerToPeerReview;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewState;
import org.eclipse.osee.ats.core.client.review.role.UserRole;
import org.eclipse.osee.ats.core.client.review.role.UserRoleManager;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.ITransitionListener;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -41,26 +41,25 @@ public class AtsPeerToPeerReviewReviewStateItem extends AtsStateItem implements
}
@Override
- public void transitioned(AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
- if (sma.isOfType(AtsArtifactTypes.PeerToPeerReview) && toState.getName().equals(
- PeerToPeerReviewState.Review.getName())) {
+ public void transitioned(IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
+ if ((workItem instanceof IAtsPeerToPeerReview) && toState.getName().equals(PeerToPeerReviewState.Review.getName())) {
// Set Assignees to all user roles users
Set<IAtsUser> assignees = new HashSet<IAtsUser>();
- PeerToPeerReviewArtifact peerArt = (PeerToPeerReviewArtifact) sma;
+ PeerToPeerReviewArtifact peerArt = (PeerToPeerReviewArtifact) workItem;
for (UserRole uRole : UserRoleManager.getUserRoles(peerArt)) {
if (!uRole.isCompleted()) {
assignees.add(uRole.getUser());
}
}
- assignees.addAll(sma.getStateMgr().getAssignees());
+ assignees.addAll(workItem.getStateMgr().getAssignees());
- sma.getStateMgr().setAssignees(assignees);
- sma.persist(transaction);
+ workItem.getStateMgr().setAssignees(assignees);
+ changes.add(workItem);
}
}
@Override
- public void transitioning(TransitionResults results, AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
+ public void transitioning(TransitionResults results, IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
// do nothing
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsStateItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsStateItem.java
index 8281eab1cb..6eadb2aacb 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsStateItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsStateItem.java
@@ -13,8 +13,11 @@ package org.eclipse.osee.ats.editor.stateItem;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
+import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
import org.eclipse.osee.framework.core.util.Result;
@@ -109,4 +112,8 @@ public abstract class AtsStateItem implements IAtsStateItem {
public String toString() {
return getName();
}
+
+ @SuppressWarnings("unused")
+ public void transitioned(IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java
index 37b3f4d616..f31eca99aa 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/ReviewInfoXWidget.java
@@ -18,19 +18,21 @@ import java.util.logging.Level;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.DecisionReviewManager;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewManager;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.editor.SMAEditor;
import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
import org.eclipse.osee.ats.internal.Activator;
@@ -302,7 +304,9 @@ public class ReviewInfoXWidget extends XLabelValueBase {
}
try {
List<AbstractWorkflowArtifact> awas = new ArrayList<AbstractWorkflowArtifact>();
- for (AbstractReviewArtifact revArt : ReviewManager.getReviewsFromCurrentState(teamArt)) {
+ for (IAtsAbstractReview review : ReviewManager.getReviewsFromCurrentState(teamArt)) {
+ AbstractReviewArtifact revArt =
+ (AbstractReviewArtifact) AtsClientService.get().getArtifact(review);
if (!revArt.isCompletedOrCancelled()) {
if (revArt.getStateMgr().isUnAssigned()) {
revArt.getStateMgr().setAssignee(AtsClientService.get().getUserAdmin().getCurrentUser());
@@ -310,15 +314,16 @@ public class ReviewInfoXWidget extends XLabelValueBase {
awas.add(revArt);
}
}
+ AtsChangeSet changes = new AtsChangeSet("Admin Auto-Complete Reviews");
TransitionHelper helper =
new TransitionHelper("ATS Auto Complete Reviews", awas, TeamState.Completed.getName(), null,
- null, TransitionOption.OverrideTransitionValidityCheck, TransitionOption.None);
+ null, changes, TransitionOption.OverrideTransitionValidityCheck, TransitionOption.None);
TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
if (!results.isEmpty()) {
AWorkbench.popup(String.format("Transition Error %s", results.toString()));
}
- transitionMgr.getTransaction().execute();
+ changes.execute();
smaWorkflowSection.getEditor().refreshPages();
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java
index 1185eb29eb..26d4bcd0e5 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/widget/TaskInfoXWidget.java
@@ -15,22 +15,21 @@ import java.util.logging.Level;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.task.AbstractTaskableArtifact;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.task.TaskStates;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.widgets.XLabelValueBase;
import org.eclipse.osee.framework.ui.swt.Displays;
@@ -127,17 +126,17 @@ public class TaskInfoXWidget extends XLabelValueBase {
return;
}
try {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "ATS Auto Complete Tasks");
+ AtsChangeSet changes = new AtsChangeSet("ATS Auto Complete Tasks");
for (TaskArtifact taskArt : taskableArt.getTaskArtifacts(forState)) {
if (!taskArt.isCompletedOrCancelled()) {
if (taskArt.getStateMgr().isUnAssigned()) {
- taskArt.getStateMgr().setAssignee(AtsClientService.get().getUserAdmin().getCurrentUser());
+ taskArt.getStateMgr().setAssignee(
+ AtsClientService.get().getUserAdmin().getCurrentUser());
}
TransitionHelper helper =
new TransitionHelper("Transition to Completed", Arrays.asList(taskArt),
TaskStates.Completed.getName(), null, null,
- TransitionOption.OverrideTransitionValidityCheck, TransitionOption.None);
+ changes, TransitionOption.OverrideTransitionValidityCheck, TransitionOption.None);
TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
if (!results.isEmpty()) {
@@ -146,7 +145,7 @@ public class TaskInfoXWidget extends XLabelValueBase {
}
}
}
- transaction.execute();
+ changes.execute();
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
index ac108f9c8e..44d749fd02 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
@@ -51,12 +51,12 @@ import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.util.AtsTaskCache;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsUtil;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsRemoteEventTestItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsRemoteEventTestItem.java
index a327f249b6..41c14b212d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsRemoteEventTestItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsRemoteEventTestItem.java
@@ -24,17 +24,18 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
import org.eclipse.osee.ats.core.client.workflow.ChangeTypeUtil;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionManager;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsUtil;
@@ -48,8 +49,6 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
@@ -193,16 +192,16 @@ public class AtsRemoteEventTestItem extends WorldXNavigateItemAction {
}
private void makeChanges7(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Remote Event Test");
+ AtsChangeSet changes = new AtsChangeSet("Remote Event Test");
TransitionHelper helper =
new TransitionHelper("Remote Event Test", Arrays.asList(teamArt), TeamState.Analyze.getName(),
- Collections.singleton(AtsClientService.get().getUserAdmin().getCurrentUser()), null, TransitionOption.None);
- TransitionManager transitionMgr = new TransitionManager(helper, transaction);
+ Collections.singleton(AtsClientService.get().getUserAdmin().getCurrentUser()), null, changes, TransitionOption.None);
+ TransitionManager transitionMgr = new TransitionManager(helper);
TransitionResults results = transitionMgr.handleAll();
if (!results.isEmpty()) {
throw new OseeStateException(results.toString());
}
- transaction.execute();
+ changes.execute();
}
private void makeChanges6(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationTransitionListener.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationTransitionListener.java
index 2a4e154290..9b7f34772d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationTransitionListener.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/notify/AtsNotificationTransitionListener.java
@@ -11,15 +11,17 @@
package org.eclipse.osee.ats.notify;
import java.util.Collection;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.notify.AtsNotifyType;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.notify.AtsNotificationManager;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.ITransitionListener;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationManager;
/**
@@ -28,14 +30,15 @@ import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationManager;
public class AtsNotificationTransitionListener implements ITransitionListener {
@Override
- public void transitioning(TransitionResults results, AbstractWorkflowArtifact sma, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
+ public void transitioning(TransitionResults results, IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees) {
// do nothing
}
@Override
- public void transitioned(AbstractWorkflowArtifact awa, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
+ public void transitioned(IAtsWorkItem workItem, IStateToken fromState, IStateToken toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
- AtsNotificationManager.notify(awa, AtsNotifyType.Subscribed, AtsNotifyType.Completed, AtsNotifyType.Cancelled);
+ AtsNotificationManager.notify((AbstractWorkflowArtifact) AtsClientService.get().getArtifact(workItem),
+ AtsNotifyType.Subscribed, AtsNotifyType.Completed, AtsNotifyType.Cancelled);
OseeNotificationManager.getInstance().sendNotifications();
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateActionFromTaskBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateActionFromTaskBlam.java
index f7e72289ca..05bbc3e2b2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateActionFromTaskBlam.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateActionFromTaskBlam.java
@@ -25,6 +25,7 @@ import org.eclipse.osee.ats.core.client.action.ActionArtifact;
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
import org.eclipse.osee.ats.editor.SMAEditor;
@@ -40,8 +41,6 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
@@ -123,8 +122,7 @@ public class CreateActionFromTaskBlam extends AbstractBlam {
private void handleCreateActions(Collection<TaskArtifact> tasks, String title, Collection<IAtsActionableItem> aias, ChangeType changeType, String priority, IProgressMonitor monitor) throws OseeCoreException {
Set<TeamWorkFlowArtifact> newTeamArts = new HashSet<TeamWorkFlowArtifact>();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Create Actions from Tasks");
+ AtsChangeSet changes = new AtsChangeSet("Create Actions from Tasks");
for (TaskArtifact task : tasks) {
String useTitle = title;
if (!Strings.isValid(useTitle)) {
@@ -132,15 +130,15 @@ public class CreateActionFromTaskBlam extends AbstractBlam {
}
ActionArtifact action =
ActionManager.createAction(monitor, useTitle, getDescription(task), changeType, priority, false, null,
- aias, new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), null, transaction);
+ aias, new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
for (TeamWorkFlowArtifact teamArt : action.getTeams()) {
newTeamArts.add(teamArt);
teamArt.addRelation(CoreRelationTypes.SupportingInfo_SupportingInfo, task);
- teamArt.persist(transaction);
+ changes.add(teamArt);
}
}
- transaction.execute();
+ changes.execute();
if (newTeamArts.size() == 1) {
SMAEditor.editArtifact(newTeamArts.iterator().next());
} else {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java
index 23240161bc..343a813c53 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java
@@ -29,6 +29,7 @@ import org.eclipse.osee.ats.core.client.task.AbstractTaskableArtifact;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.ITeamWorkflowProvider;
import org.eclipse.osee.ats.editor.SMAEditor;
@@ -126,8 +127,7 @@ public class DuplicateWorkflowBlam extends AbstractBlam {
private void handleCreateNewWorkflow(Collection<TeamWorkFlowArtifact> teamArts, String title) throws OseeCoreException {
Set<TeamWorkFlowArtifact> newTeamArts = new HashSet<TeamWorkFlowArtifact>();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Duplicate Workflow");
+ AtsChangeSet changes = new AtsChangeSet("Duplicate Workflow");
Date createdDate = new Date();
IAtsUser createdBy = AtsClientService.get().getUserAdmin().getCurrentUser();
for (TeamWorkFlowArtifact teamArt : teamArts) {
@@ -138,15 +138,15 @@ public class DuplicateWorkflowBlam extends AbstractBlam {
}
TeamWorkFlowArtifact newTeamArt =
ActionManager.createTeamWorkflow(teamArt.getParentActionArtifact(), teamArt.getTeamDefinition(),
- teamArt.getActionableItemsDam().getActionableItems(), assignees, transaction, createdDate, createdBy,
- null, CreateTeamOption.Duplicate_If_Exists);
+ teamArt.getActionableItemsDam().getActionableItems(), assignees, changes, createdDate, createdBy, null,
+ CreateTeamOption.Duplicate_If_Exists);
if (Strings.isValid(title)) {
newTeamArt.setName(title);
}
- newTeamArt.persist(transaction);
+ changes.add(newTeamArt);
newTeamArts.add(newTeamArt);
}
- transaction.execute();
+ changes.execute();
for (TeamWorkFlowArtifact newTeamArt : newTeamArts) {
SMAEditor.editArtifact(newTeamArt);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java
index 4a9111e629..948ace05d5 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java
@@ -22,18 +22,16 @@ import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.column.RelatedToStateColumn;
import org.eclipse.osee.ats.core.client.task.AbstractTaskableArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.editor.SMAEditor;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
-import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
@@ -102,13 +100,12 @@ public class ImportTasksFromSimpleList extends AbstractBlam {
}
try {
final TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) artifact;
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Import Tasks from Simple List");
+ AtsChangeSet changes = new AtsChangeSet("Import Tasks from Simple List");
Date createdDate = new Date();
IAtsUser createdBy = AtsClientService.get().getUserAdmin().getCurrentUser();
- teamArt.createTasks(titles, assignees, createdDate, createdBy, stateCombo.get(), transaction);
- teamArt.persist(transaction);
- transaction.execute();
+ teamArt.createTasks(titles, assignees, createdDate, createdBy, stateCombo.get(), changes);
+ changes.add(teamArt);
+ changes.execute();
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
return;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java
index e460f97b46..bdbb5ba731 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java
@@ -19,16 +19,14 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.core.client.task.AbstractTaskableArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.editor.SMAEditor;
-import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.util.Import.ExcelAtsTaskArtifactExtractor;
import org.eclipse.osee.ats.util.Import.TaskImportJob;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
@@ -121,13 +119,12 @@ public class ImportTasksFromSpreadsheet extends AbstractBlam {
}
File file = new File(filename);
try {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Import Tasks from Spreadsheet");
+ AtsChangeSet changes = new AtsChangeSet("Import Tasks from Spreadsheet");
Job job =
Jobs.startJob(new TaskImportJob(file, new ExcelAtsTaskArtifactExtractor(
- (TeamWorkFlowArtifact) artifact, emailPocs, transaction)));
+ (TeamWorkFlowArtifact) artifact, emailPocs, changes)));
job.join();
- transaction.execute();
+ changes.execute();
} catch (Exception ex) {
log(ex);
return;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ModifyActionableItemsBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ModifyActionableItemsBlam.java
index 48fc32e885..bc447f562a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ModifyActionableItemsBlam.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ModifyActionableItemsBlam.java
@@ -37,6 +37,7 @@ import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.ai.ModifyActionableItems;
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.core.config.TeamDefinitionUtility;
import org.eclipse.osee.ats.internal.Activator;
@@ -54,8 +55,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
@@ -342,28 +341,25 @@ public class ModifyActionableItemsBlam extends AbstractBlam {
@Override
protected void doWork(IProgressMonitor monitor) throws Exception {
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getName());
+ AtsChangeSet changes = new AtsChangeSet(getName());
Date createdDate = new Date();
for (CreateTeamData data : job.getTeamDatas()) {
TeamWorkFlowArtifact teamArt =
ActionManager.createTeamWorkflow(teamWf.getParentActionArtifact(), data.getTeamDef(),
- data.getActionableItems(), new LinkedList<IAtsUser>(data.getAssignees()), transaction, createdDate,
+ data.getActionableItems(), new LinkedList<IAtsUser>(data.getAssignees()), changes, createdDate,
data.getCreatedBy(), null, data.getCreateTeamOption());
- teamArt.persist(transaction);
newTeamWfs.add(teamArt);
}
for (IAtsActionableItem checkedAi : job.getAddAis()) {
results.logWithFormat("Actionable Item [%s] will be added to this workflow\n", checkedAi);
teamWf.getActionableItemsDam().addActionableItem(checkedAi);
- teamWf.persist(transaction);
}
for (IAtsActionableItem currAi : job.getRemoveAis()) {
results.logWithFormat("Actionable Item [%s] will be removed from this workflow\n", currAi);
teamWf.getActionableItemsDam().removeActionableItem(currAi);
- teamWf.persist(transaction);
}
- transaction.execute();
+ changes.execute();
}
public List<TeamWorkFlowArtifact> getNewTeamWfs() {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewItem.java
index deb3a520e0..47b670b4f3 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewItem.java
@@ -17,6 +17,7 @@ import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.AtsOpenOption;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewManager;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsUtil;
@@ -24,8 +25,6 @@ import org.eclipse.osee.ats.util.widgets.dialog.ActionableItemListDialog;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
@@ -56,13 +55,13 @@ public class NewPeerToPeerReviewItem extends XNavigateItemAction {
AWorkbench.popup("Must select at least one Actionable Item");
return;
}
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "New Stand-alone Peer To Peer Review");
+
+ AtsChangeSet changes = new AtsChangeSet("New Stand-alone Peer To Peer Review");
PeerToPeerReviewArtifact peerArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(ld.getSelected().iterator().next(), ed.getEntry(),
- null, new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), transaction);
- peerArt.persist(transaction);
- transaction.execute();
+ null, new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), changes);
+ changes.execute();
+
AtsUtil.openATSAction(peerArt, AtsOpenOption.OpenAll);
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewJob.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewJob.java
index e5943ede7e..9d1fd832f2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewJob.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewJob.java
@@ -19,10 +19,9 @@ import org.eclipse.osee.ats.AtsOpenOption;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.util.AtsUtil;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
/**
* @author Donald G. Dunne
@@ -43,11 +42,10 @@ public class NewPeerToPeerReviewJob extends Job {
@Override
public IStatus run(final IProgressMonitor monitor) {
try {
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "New Peer To Peer Review");
+ AtsChangeSet changes = new AtsChangeSet("New Peer To Peer Review");
PeerToPeerReviewArtifact peerArt =
- PeerToPeerReviewManager.createNewPeerToPeerReview(teamParent, reviewTitle, againstState, transaction);
- peerArt.persist(transaction);
- transaction.execute();
+ PeerToPeerReviewManager.createNewPeerToPeerReview(teamParent, reviewTitle, againstState, changes);
+ changes.execute();
AtsUtil.openATSAction(peerArt, AtsOpenOption.OpenOneOrPopupSelect);
} catch (Exception ex) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java
index 426bab4cbd..dee085574b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java
@@ -13,17 +13,20 @@ package org.eclipse.osee.ats.util;
import java.util.Date;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.StateEventType;
import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
import org.eclipse.osee.ats.editor.stateItem.AtsStateItemManager;
import org.eclipse.osee.ats.editor.stateItem.IAtsStateItem;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.util.Result;
@@ -31,8 +34,6 @@ import org.eclipse.osee.framework.jdk.core.type.MutableBoolean;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.conflict.ConflictManagerExternal;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.skynet.commandHandlers.branch.commit.CommitHandler;
import org.eclipse.osee.framework.ui.swt.Displays;
@@ -68,7 +69,8 @@ public class AtsBranchCommitOperation extends AbstractOperation {
// Confirm that all blocking reviews are completed
// Loop through this state's blocking reviews to confirm complete
if (teamArt.isTeamWorkflow()) {
- for (AbstractReviewArtifact reviewArt : ReviewManager.getReviewsFromCurrentState(teamArt)) {
+ for (IAtsAbstractReview review : ReviewManager.getReviewsFromCurrentState(teamArt)) {
+ AbstractReviewArtifact reviewArt = (AbstractReviewArtifact) AtsClientService.get().getArtifact(review);
if (reviewArt.getReviewBlockType() == ReviewBlockType.Commit && !reviewArt.isCompletedOrCancelled()) {
throw new OseeStateException("Blocking Review must be completed before commit.");
}
@@ -114,11 +116,13 @@ public class AtsBranchCommitOperation extends AbstractOperation {
}
if (branchCommitted) {
// Create reviews as necessary
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Create Reviews upon Commit");
- AtsBranchManagerCore.createNecessaryBranchEventReviews(StateEventType.CommitBranch, teamArt, new Date(),
- AtsCoreUsers.SYSTEM_USER, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet("Create Reviews upon Commit");
+ boolean added =
+ AtsBranchManagerCore.createNecessaryBranchEventReviews(StateEventType.CommitBranch, teamArt, new Date(),
+ AtsCoreUsers.SYSTEM_USER, changes);
+ if (added) {
+ changes.execute();
+ }
}
} finally {
if (workflowWorkingBranch != null) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/CreateActionUsingAllActionableItems.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/CreateActionUsingAllActionableItems.java
index e60ce99c22..b38e72d232 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/CreateActionUsingAllActionableItems.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/CreateActionUsingAllActionableItems.java
@@ -18,6 +18,7 @@ import org.eclipse.osee.ats.AtsOpenOption;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
import org.eclipse.osee.ats.core.client.action.ActionManager;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.internal.Activator;
@@ -26,8 +27,6 @@ import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
@@ -72,12 +71,11 @@ public class CreateActionUsingAllActionableItems extends XNavigateItemAction {
}
}
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Create Action using all AIs");
+ AtsChangeSet changes = new AtsChangeSet("Create Action using all AIs");
ActionArtifact action =
ActionManager.createAction(null, "Big Action Test - Delete Me", "Description", ChangeType.Improvement, "1",
- false, null, aias, new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), null, transaction);
- transaction.execute();
+ false, null, aias, new Date(), AtsClientService.get().getUserAdmin().getCurrentUser(), null, changes);
+ changes.execute();
return action;
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java
index 2ba8095288..b9b24aca1b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java
@@ -34,6 +34,7 @@ import org.eclipse.osee.ats.api.notify.AtsNotifyType;
import org.eclipse.osee.ats.api.team.CreateTeamOption;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workflow.IAtsGoal;
import org.eclipse.osee.ats.core.client.action.ActionManager;
@@ -59,7 +60,6 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.results.XResultDataUI;
import org.xml.sax.InputSource;
@@ -169,7 +169,7 @@ public class ExcelAtsActionArtifactExtractor {
return rd;
}
- public void createArtifactsAndNotify(SkynetTransaction transaction) {
+ public void createArtifactsAndNotify(IAtsChangeSet changes) {
AtsUtilCore.setEmailEnabled(false);
Set<TeamWorkFlowArtifact> teamWfs = new HashSet<TeamWorkFlowArtifact>();
Date createdDate = new Date();
@@ -182,9 +182,9 @@ public class ExcelAtsActionArtifactExtractor {
actionArt =
ActionManager.createAction(null, aData.title, aData.desc, ChangeType.getChangeType(aData.changeType),
aData.priorityStr, false, null, ActionableItems.getActionableItems(aData.actionableItems),
- createdDate, createdBy, null, transaction);
+ createdDate, createdBy, null, changes);
newTeamArts = ActionManager.getTeams(actionArt);
- addToGoal(newTeamArts, transaction);
+ addToGoal(newTeamArts, changes);
actionNameToAction.put(aData.title, actionArt);
actionArts.add(actionArt);
} else {
@@ -194,14 +194,14 @@ public class ExcelAtsActionArtifactExtractor {
TeamWorkFlowArtifact teamWorkflow =
ActionManager.createTeamWorkflow(actionArt, entry.getKey(), entry.getValue(), aData.assignees,
- transaction, createdDate, createdBy, null, CreateTeamOption.Duplicate_If_Exists);
+ changes, createdDate, createdBy, null, CreateTeamOption.Duplicate_If_Exists);
teamWorkflow.setSoleAttributeValue(AtsAttributeTypes.Description, aData.desc);
if (Strings.isValid(aData.priorityStr) && !aData.priorityStr.equals("<Select>")) {
teamWorkflow.setSoleAttributeValue(AtsAttributeTypes.PriorityType, aData.priorityStr);
}
teamWorkflow.setSoleAttributeValue(AtsAttributeTypes.ChangeType, aData.changeType);
newTeamArts.add(teamWorkflow);
- addToGoal(Collections.singleton(teamWorkflow), transaction);
+ addToGoal(Collections.singleton(teamWorkflow), changes);
}
}
if (!aData.version.equals("")) {
@@ -226,7 +226,7 @@ public class ExcelAtsActionArtifactExtractor {
}
}
for (TeamWorkFlowArtifact team : newTeamArts) {
- team.persist(transaction);
+ changes.add(team);
}
teamWfs.addAll(newTeamArts);
}
@@ -243,7 +243,7 @@ public class ExcelAtsActionArtifactExtractor {
}
}
- private void addToGoal(Collection<TeamWorkFlowArtifact> newTeamArts, SkynetTransaction transaction) throws OseeCoreException {
+ private void addToGoal(Collection<TeamWorkFlowArtifact> newTeamArts, IAtsChangeSet changes) throws OseeCoreException {
if (toGoal != null) {
GoalArtifact goal = (GoalArtifact) AtsClientService.get().getArtifact(toGoal);
if (goal == null) {
@@ -252,7 +252,7 @@ public class ExcelAtsActionArtifactExtractor {
for (Artifact art : newTeamArts) {
goal.addMember(art);
}
- goal.persist(transaction);
+ changes.add(goal);
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java
index b4feb067c3..e83802ca53 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java
@@ -23,6 +23,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.notify.AtsNotifyType;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.notify.AtsNotificationManager;
import org.eclipse.osee.ats.core.client.task.AbstractTaskableArtifact;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
@@ -40,7 +41,6 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.jdk.core.util.io.xml.ExcelSaxHandler;
import org.eclipse.osee.framework.jdk.core.util.io.xml.RowProcessor;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
@@ -53,13 +53,13 @@ public class ExcelAtsTaskArtifactExtractor {
private final AbstractWorkflowArtifact sma;
private final boolean emailPOCs;
- private final SkynetTransaction transaction;
+ private final IAtsChangeSet changes;
private IProgressMonitor monitor;
- public ExcelAtsTaskArtifactExtractor(TeamWorkFlowArtifact artifact, boolean emailPOCs, SkynetTransaction transaction) {
+ public ExcelAtsTaskArtifactExtractor(TeamWorkFlowArtifact artifact, boolean emailPOCs, IAtsChangeSet changes) {
this.emailPOCs = emailPOCs;
- this.transaction = transaction;
+ this.changes = changes;
this.sma = artifact;
}
@@ -70,8 +70,8 @@ public class ExcelAtsTaskArtifactExtractor {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
- xmlReader.setContentHandler(new ExcelSaxHandler(
- new InternalRowProcessor(monitor, transaction, sma, emailPOCs), true));
+ xmlReader.setContentHandler(new ExcelSaxHandler(new InternalRowProcessor(monitor, changes, sma, emailPOCs),
+ true));
xmlReader.parse(new InputSource(new InputStreamReader(source.toURL().openStream(), "UTF-8")));
} catch (Exception ex) {
OseeExceptions.wrapAndThrow(ex);
@@ -103,14 +103,14 @@ public class ExcelAtsTaskArtifactExtractor {
private int rowNum;
private final IProgressMonitor monitor;
private final AbstractWorkflowArtifact sma;
- private final SkynetTransaction transaction;
+ private final IAtsChangeSet changes;
private final boolean emailPOCs;
private final Date createdDate;
private final IAtsUser createdBy;
- protected InternalRowProcessor(IProgressMonitor monitor, SkynetTransaction transaction, AbstractWorkflowArtifact sma, boolean emailPOCs) throws OseeCoreException {
+ protected InternalRowProcessor(IProgressMonitor monitor, IAtsChangeSet changes, AbstractWorkflowArtifact sma, boolean emailPOCs) throws OseeCoreException {
this.monitor = monitor;
- this.transaction = transaction;
+ this.changes = changes;
this.emailPOCs = emailPOCs;
this.sma = sma;
createdDate = new Date();
@@ -188,13 +188,13 @@ public class ExcelAtsTaskArtifactExtractor {
}
AtsUtilCore.setEmailEnabled(true);
if (taskArt.isCompleted()) {
- Result result = TaskManager.transitionToCompleted(taskArt, 0.0, 0, transaction);
+ Result result = TaskManager.transitionToCompleted(taskArt, 0.0, 0, changes);
if (result.isFalse()) {
AWorkbench.popup(result);
}
}
// always persist
- taskArt.persist(transaction);
+ changes.add(taskArt);
if (emailPOCs && !taskArt.isCompleted() && !taskArt.isCancelled()) {
AtsNotificationManager.notify(sma, AtsNotifyType.Assigned);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ImportActionsViaSpreadsheetBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ImportActionsViaSpreadsheetBlam.java
index 42f4ff6464..b746d313c3 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ImportActionsViaSpreadsheetBlam.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ImportActionsViaSpreadsheetBlam.java
@@ -15,8 +15,8 @@ import java.util.Arrays;
import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.api.workflow.IAtsGoal;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.internal.Activator;
-import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.world.WorldEditor;
import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
import org.eclipse.osee.framework.core.util.XResultData;
@@ -25,8 +25,6 @@ import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.plugin.core.PluginUtil;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
@@ -102,11 +100,10 @@ public class ImportActionsViaSpreadsheetBlam extends AbstractBlam {
XResultDataUI.report(rd, "Ats Action Import Errors");
}
} else {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Import Actions from Spreadsheet");
- extractor.createArtifactsAndNotify(transaction);
+ AtsChangeSet changes = new AtsChangeSet("Import Actions from Spreadsheet");
+ extractor.createArtifactsAndNotify(changes);
WorldEditor.open(new WorldEditorSimpleProvider("Imported Action Artifacts", extractor.getActionArts()));
- transaction.execute();
+ changes.execute();
}
return rd;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TransitionStatusDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TransitionStatusDialog.java
index 8b37bfd389..e0357b8d0b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TransitionStatusDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TransitionStatusDialog.java
@@ -15,7 +15,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionStatusData;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionStatusData;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.util.Result;
@@ -69,7 +69,7 @@ public class TransitionStatusDialog extends MessageDialog {
statusLabel.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
updateStatusLabel();
- if (data.getAwas().size() > 1) {
+ if (data.getWorkItems().size() > 1) {
Label label = new Label(parent, SWT.NONE);
label.setText("Mulitple objects being statused. All objects will be set to percent\ncomplete and hours spent will be split or added into each item.");
}
@@ -87,9 +87,10 @@ public class TransitionStatusDialog extends MessageDialog {
data.setPercent(defaultPercent);
percent.set(defaultPercent);
percentSet = true;
- } else if (data.getAwas().size() == 1) {
+ } else if (data.getWorkItems().size() == 1) {
int currentPercent = 0;
- AbstractWorkflowArtifact awa = data.getAwas().iterator().next();
+ AbstractWorkflowArtifact awa =
+ (AbstractWorkflowArtifact) AtsClientService.get().getArtifact(data.getWorkItems().iterator().next());
if (!AtsClientService.get().getWorkDefinitionAdmin().isStateWeightingEnabled(awa.getWorkDefinition())) {
currentPercent = awa.getSoleAttributeValue(AtsAttributeTypes.PercentComplete, 0);
} else {
@@ -146,7 +147,7 @@ public class TransitionStatusDialog extends MessageDialog {
};
});
- if (data.getAwas().size() > 1) {
+ if (data.getWorkItems().size() > 1) {
Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout(2, false));
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java
index 77524fcbbd..510f7a9d3f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java
@@ -23,6 +23,7 @@ import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
import org.eclipse.nebula.widgets.xviewer.util.EnumStringSingleSelectionDialog;
import org.eclipse.osee.ats.core.client.review.role.Role;
import org.eclipse.osee.ats.core.client.review.role.UserRole;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -30,8 +31,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.User;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.UserListDialog;
import org.eclipse.osee.framework.ui.swt.Displays;
@@ -261,15 +260,13 @@ public class UserRoleXViewer extends XViewer {
}
public boolean executeTransaction(Collection<UserRole> userRoles) throws OseeCoreException {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(xUserRoleViewer.getReviewArt().getArtifact().getBranch(),
- "Modify Review Roles");
+ AtsChangeSet changes = new AtsChangeSet("Modify Review Roles");
for (UserRole userRole : userRoles) {
xUserRoleViewer.getUserRoleMgr().addOrUpdateUserRole(userRole, xUserRoleViewer.getReviewArt());
update(userRole, null);
}
- xUserRoleViewer.getUserRoleMgr().saveToArtifact(transaction);
- transaction.execute();
+ xUserRoleViewer.getUserRoleMgr().saveToArtifact(changes);
+ changes.execute();
xUserRoleViewer.refresh();
xUserRoleViewer.notifyXModifiedListeners();
return true;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
index 4ddfff2e29..896a234275 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
@@ -27,12 +27,14 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.window.Window;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.review.defect.ReviewDefectManager;
import org.eclipse.osee.ats.core.client.review.role.UserRole;
import org.eclipse.osee.ats.core.client.review.role.UserRoleError;
import org.eclipse.osee.ats.core.client.review.role.UserRoleManager;
import org.eclipse.osee.ats.core.client.review.role.UserRoleValidator;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.framework.core.util.Result;
@@ -47,8 +49,6 @@ import org.eclipse.osee.framework.skynet.core.event.filter.IEventFilter;
import org.eclipse.osee.framework.skynet.core.event.listener.IArtifactEventListener;
import org.eclipse.osee.framework.skynet.core.event.model.ArtifactEvent;
import org.eclipse.osee.framework.skynet.core.event.model.Sender;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
@@ -298,20 +298,19 @@ public class XUserRoleViewer extends GenericXWidget implements IArtifactWidget,
"Are You Sure You Wish to Delete the Roles(s):\n\n" + builder.toString());
if (delete) {
try {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(reviewArt.getBranch(), "Delete Review Roles");
- removeUserRoleHelper(items, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet("Delete Review Roles");
+ removeUserRoleHelper(items, changes);
+ changes.execute();
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
}
}
- private void removeUserRoleHelper(List<UserRole> items, SkynetTransaction transaction) throws OseeCoreException {
+ private void removeUserRoleHelper(List<UserRole> items, IAtsChangeSet changes) throws OseeCoreException {
for (UserRole userRole : items) {
roleMgr.removeUserRole(userRole);
- roleMgr.saveToArtifact(transaction);
+ roleMgr.saveToArtifact(changes);
xViewer.remove(userRole);
}
loadTable();
@@ -336,15 +335,13 @@ public class XUserRoleViewer extends GenericXWidget implements IArtifactWidget,
return;
}
try {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(reviewArt.getArtifact().getBranch(), "Add Review Roles");
+ AtsChangeSet changes = new AtsChangeSet("Add Review Roles");
for (IAtsUser user : dialog.getUsers()) {
UserRole userRole = new UserRole(dialog.getRole(), user);
roleMgr.addOrUpdateUserRole(userRole, reviewArt);
- reviewArt.persist(transaction);
+ changes.add(reviewArt);
}
- roleMgr.saveToArtifact(transaction);
- transaction.execute();
+ changes.execute();
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java
index 5a72973710..9d330def93 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java
@@ -18,12 +18,13 @@ import java.util.List;
import java.util.Set;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
-import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.util.XResultData;
@@ -31,9 +32,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
@@ -83,10 +81,9 @@ public class CreateNewVersionItem extends XNavigateItemAction {
newVersionNames.add(str);
}
XResultData resultData = new XResultData(false);
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Create New Version(s)");
+ AtsChangeSet changes = new AtsChangeSet("Create New Version(s)");
Collection<IAtsVersion> newVersions =
- createVersions(resultData, transaction, teamDefHoldingVersions, newVersionNames);
+ createVersions(resultData, changes, teamDefHoldingVersions, newVersionNames);
if (resultData.isErrors()) {
resultData.log(String.format(
"\nErrors found while creating version(s) for [%s].\nPlease resolve and try again.",
@@ -94,7 +91,7 @@ public class CreateNewVersionItem extends XNavigateItemAction {
XResultDataUI.report(resultData, "Create New Version Error");
return;
}
- transaction.execute();
+ changes.execute();
if (newVersions.size() == 1) {
RendererManager.open(AtsClientService.get().getConfigArtifact(newVersions.iterator().next()),
PresentationType.DEFAULT_OPEN);
@@ -106,7 +103,7 @@ public class CreateNewVersionItem extends XNavigateItemAction {
}
}
- public static Collection<IAtsVersion> createVersions(XResultData resultData, SkynetTransaction transaction, IAtsTeamDefinition teamDefHoldingVersions, Collection<String> newVersionNames) {
+ public static Collection<IAtsVersion> createVersions(XResultData resultData, IAtsChangeSet changes, IAtsTeamDefinition teamDefHoldingVersions, Collection<String> newVersionNames) {
List<IAtsVersion> versions = new ArrayList<IAtsVersion>();
for (String newVer : newVersionNames) {
if (!Strings.isValid(newVer)) {
@@ -123,9 +120,8 @@ public class CreateNewVersionItem extends XNavigateItemAction {
for (String newVer : newVersionNames) {
IAtsVersion version = AtsClientService.get().createVersion(newVer);
versions.add(version);
- Artifact verArt = AtsClientService.get().storeConfigObject(version, transaction);
AtsVersionService.get().setTeamDefinition(version, teamDefHoldingVersions);
- verArt.persist(transaction);
+ changes.add(version);
}
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/ReleaseVersionItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/ReleaseVersionItem.java
index 94288057e9..cf6649b9d5 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/ReleaseVersionItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/ReleaseVersionItem.java
@@ -18,20 +18,18 @@ import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.version.VersionLockedType;
import org.eclipse.osee.ats.api.version.VersionReleaseType;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
-import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
import org.eclipse.osee.ats.util.widgets.dialog.VersionListDialog;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
@@ -98,10 +96,9 @@ public class ReleaseVersionItem extends XNavigateItemAction {
verArt.setReleased(true);
verArt.setReleaseDate(new Date());
verArt.setNextVersion(false);
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
- AtsClientService.get().storeConfigObject(verArt, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ AtsClientService.get().storeConfigObject(verArt, changes);
+ changes.execute();
if (MessageDialog.openQuestion(Displays.getActiveShell(), "Select NEW Next Release Version",
"Release Complete.\n\nSelect NEW Next Release Version?")) {
@@ -112,10 +109,9 @@ public class ReleaseVersionItem extends XNavigateItemAction {
if (result == 0) {
verArt = (IAtsVersion) ld.getResult()[0];
verArt.setNextVersion(true);
- transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranchToken(), getClass().getSimpleName());
- AtsClientService.get().storeConfigObject(verArt, transaction);
- transaction.execute();
+ changes.clear();
+ AtsClientService.get().storeConfigObject(verArt, changes);
+ changes.execute();
}
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/AtsWorkDefinitionSheetProviders.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/AtsWorkDefinitionSheetProviders.java
index 417de113b7..6c495dd46b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/AtsWorkDefinitionSheetProviders.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/AtsWorkDefinitionSheetProviders.java
@@ -23,9 +23,11 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.config.AtsArtifactToken;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.workdef.WorkDefinitionSheet;
import org.eclipse.osee.ats.dsl.atsDsl.AtsDsl;
import org.eclipse.osee.ats.internal.Activator;
@@ -45,7 +47,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.osgi.framework.Bundle;
/**
@@ -62,19 +63,18 @@ public final class AtsWorkDefinitionSheetProviders {
}
public static void initializeDatabase(XResultData resultData) throws OseeCoreException {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Import ATS Work Definitions, Teams and AIs");
+ AtsChangeSet changes = new AtsChangeSet("Import ATS Work Definitions, Teams and AIs");
Artifact folder =
OseeSystemArtifacts.getOrCreateArtifact(AtsArtifactToken.WorkDefinitionsFolder, AtsUtil.getAtsBranch());
if (folder.isDirty()) {
- folder.persist(transaction);
+ changes.add(folder);
}
List<WorkDefinitionSheet> sheets = getWorkDefinitionSheets();
Set<String> stateNames = new HashSet<String>();
- importWorkDefinitionSheets(resultData, transaction, folder, sheets, stateNames);
- createStateNameArtifact(stateNames, folder, transaction);
- importTeamsAndAis(resultData, transaction, folder, sheets);
- transaction.execute();
+ importWorkDefinitionSheets(resultData, changes, folder, sheets, stateNames);
+ createStateNameArtifact(stateNames, folder, changes);
+ importTeamsAndAis(resultData, changes, folder, sheets);
+ changes.execute();
}
/**
@@ -137,51 +137,51 @@ public final class AtsWorkDefinitionSheetProviders {
trans.addArtifact(stateNameArt);
}
- private static Artifact createStateNameArtifact(Set<String> stateNames, Artifact folder, SkynetTransaction transaction) throws OseeCoreException {
+ private static Artifact createStateNameArtifact(Set<String> stateNames, Artifact folder, IAtsChangeSet changes) throws OseeCoreException {
Artifact stateNameArt =
ArtifactTypeManager.addArtifact(org.eclipse.osee.ats.api.data.AtsArtifactToken.WorkDef_State_Names,
AtsUtil.getAtsBranchToken());
stateNameArt.addAttribute(CoreAttributeTypes.GeneralStringData,
org.eclipse.osee.framework.jdk.core.util.Collections.toString(",", stateNames));
- stateNameArt.persist(transaction);
+ changes.add(stateNameArt);
folder.addChild(stateNameArt);
- folder.persist(transaction);
+ changes.add(folder);
return stateNameArt;
}
- public static void importWorkDefinitionSheets(XResultData resultData, SkynetTransaction transaction, Artifact folder, Collection<WorkDefinitionSheet> sheets, Set<String> stateNames) throws OseeCoreException {
+ public static void importWorkDefinitionSheets(XResultData resultData, IAtsChangeSet changes, Artifact folder, Collection<WorkDefinitionSheet> sheets, Set<String> stateNames) throws OseeCoreException {
for (WorkDefinitionSheet sheet : sheets) {
OseeLog.logf(Activator.class, Level.INFO, "Importing ATS Work Definitions [%s]", sheet.getName());
Artifact artifact =
- AtsWorkDefinitionImporter.get().importWorkDefinitionSheetToDb(sheet, resultData, stateNames, transaction);
+ AtsWorkDefinitionImporter.get().importWorkDefinitionSheetToDb(sheet, resultData, stateNames, changes);
if (artifact != null) {
folder.addChild(artifact);
- artifact.persist(transaction);
+ changes.add(artifact);
}
}
}
- public static void importTeamsAndAis(XResultData resultData, SkynetTransaction transaction, Artifact folder, Collection<WorkDefinitionSheet> sheets) throws OseeCoreException {
+ public static void importTeamsAndAis(XResultData resultData, IAtsChangeSet changes, Artifact folder, Collection<WorkDefinitionSheet> sheets) throws OseeCoreException {
for (WorkDefinitionSheet sheet : sheets) {
OseeLog.logf(Activator.class, Level.INFO, "Importing ATS Teams and AIs [%s]", sheet.getName());
- importAIsAndTeamsToDb(sheet, transaction);
+ importAIsAndTeamsToDb(sheet, changes);
}
}
public static void importAIsAndTeamsToDatabase() throws OseeCoreException {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Import ATS AIs and Team Definitions");
+
+ AtsChangeSet changes = new AtsChangeSet("Import ATS AIs and Team Definitions");
for (WorkDefinitionSheet sheet : getWorkDefinitionSheets()) {
OseeLog.logf(Activator.class, Level.INFO, "Importing ATS AIs and Teams sheet [%s]", sheet.getName());
- importAIsAndTeamsToDb(sheet, transaction);
+ importAIsAndTeamsToDb(sheet, changes);
}
- transaction.execute();
+ changes.execute();
}
- public static void importAIsAndTeamsToDb(WorkDefinitionSheet sheet, SkynetTransaction transaction) throws OseeCoreException {
+ public static void importAIsAndTeamsToDb(WorkDefinitionSheet sheet, IAtsChangeSet changes) throws OseeCoreException {
String modelName = sheet.getFile().getName();
AtsDsl atsDsl = AtsDslUtil.getFromSheet(modelName, sheet);
- ImportAIsAndTeamDefinitionsToDb importer = new ImportAIsAndTeamDefinitionsToDb(modelName, atsDsl, transaction);
+ ImportAIsAndTeamDefinitionsToDb importer = new ImportAIsAndTeamDefinitionsToDb(modelName, atsDsl, changes);
importer.execute();
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
index b3a71c79bb..beeb3c981d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/config/ImportAIsAndTeamDefinitionsToDb.java
@@ -18,7 +18,9 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.IAtsUserAdmin;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.dsl.BooleanDefUtil;
@@ -44,7 +46,6 @@ import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
* @author Donald G. Dunne
@@ -52,16 +53,16 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
public class ImportAIsAndTeamDefinitionsToDb {
private final AtsDsl atsDsl;
- private final SkynetTransaction transaction;
+ private final IAtsChangeSet changes;
private final Map<String, Artifact> newTeams = new HashMap<String, Artifact>();
private final Map<String, Artifact> newAIs = new HashMap<String, Artifact>();
private final Map<String, Artifact> newVersions = new HashMap<String, Artifact>();
private final String modelName;
- public ImportAIsAndTeamDefinitionsToDb(String modelName, AtsDsl atsDsl, SkynetTransaction transaction) {
+ public ImportAIsAndTeamDefinitionsToDb(String modelName, AtsDsl atsDsl, IAtsChangeSet changes) {
this.modelName = modelName;
this.atsDsl = atsDsl;
- this.transaction = transaction;
+ this.changes = changes;
}
public void execute() throws OseeCoreException {
@@ -77,7 +78,8 @@ public class ImportAIsAndTeamDefinitionsToDb {
String dslUserName = Strings.unquote(dslUserDef.getName());
Artifact userArt = null;
if (dslUserDef.getUserDefOption().contains("GetOrCreate")) {
- userArt = UserManager.createUser(getOseeUser(dslUserDef), transaction);
+ userArt = UserManager.createUser(getOseeUser(dslUserDef), null);
+ changes.add(userArt);
}
if (userArt == null) {
userArt = ArtifactTypeManager.addArtifact(CoreArtifactTypes.User, AtsUtil.getAtsBranch(), dslUserName);
@@ -145,7 +147,7 @@ public class ImportAIsAndTeamDefinitionsToDb {
importVersionDefinitions(dslTeamDef.getVersion(), newTeam);
// process children
importTeamDefinitions(dslTeamDef.getChildren(), newTeam);
- newTeam.persis