Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-08-30 21:31:34 +0000
committerDonald Dunne2017-09-01 16:19:24 +0000
commit33459bad25f1b8ff5f8f8b053411901a8a0f7111 (patch)
tree88b5662a12ad6129c451761baafa58bd1235faea
parentcf02d9c184f5650f800e5e3b0a5326cdd6118c7f (diff)
downloadorg.eclipse.osee-33459bad25f1b8ff5f8f8b053411901a8a0f7111.tar.gz
org.eclipse.osee-33459bad25f1b8ff5f8f8b053411901a8a0f7111.tar.xz
org.eclipse.osee-33459bad25f1b8ff5f8f8b053411901a8a0f7111.zip
bug[ats_TW1863]: Create action is slow in 0.25.0
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsArtifactTypes.java1
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/CreateTaskRuleTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java49
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItem2.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinition2.java5
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java18
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java14
8 files changed, 66 insertions, 34 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsArtifactTypes.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsArtifactTypes.java
index b9c0ff33a0..75527e1284 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsArtifactTypes.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsArtifactTypes.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.framework.core.data.TokenFactory;
public final class AtsArtifactTypes {
// @formatter:off
+ public static final IArtifactType AtsConfigObject = TokenFactory.createArtifactType(801, "ats.Ats Config Artifact");
public static final IArtifactType Action = TokenFactory.createArtifactType(67, "Action");
public static final IArtifactType ActionableItem = TokenFactory.createArtifactType(69, "Actionable Item");
public static final IArtifactType Configuration = TokenFactory.createArtifactType(93802085744703L, "ATS Configuration");
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/CreateTaskRuleTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/CreateTaskRuleTest.java
index 06bb478dda..51f225ddba 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/CreateTaskRuleTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/workflow/CreateTaskRuleTest.java
@@ -34,6 +34,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -75,11 +76,13 @@ public class CreateTaskRuleTest {
}
@Test
+ @Ignore
public void testTeamDefConfig() {
test(DemoArtifactToken.SAW_Code, DemoArtifactToken.SAW_Code_AI, CREATE_TASK_ACTION_FROM_TEAM_DEF_TITLE);
}
@Test
+ @Ignore
public void testActionableItemConfig() {
test(DemoArtifactToken.SAW_Test_AI, DemoArtifactToken.SAW_Test_AI, CREATE_TASK_ACTION_FROM_AI_TITLE);
}
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 fc5adcf5ce..9182eb80d4 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
@@ -28,6 +28,7 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.config.JaxActionableItem;
import org.eclipse.osee.ats.api.config.JaxTeamDefinition;
import org.eclipse.osee.ats.api.data.AtsArtifactToken;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.notify.AtsNotificationCollector;
import org.eclipse.osee.ats.api.program.IAtsProgramService;
@@ -224,6 +225,10 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
@Override
public void run() {
try {
+ // load artifacts to ensure they're in ArtifactCache prior to ATS chaching
+ ArtifactQuery.getArtifactListFromTypeWithInheritence(AtsArtifactTypes.AtsConfigObject, getAtsBranch(),
+ DeletionFlag.EXCLUDE_DELETED);
+
cacheActionableItems(configProvider.getConfigurations().getIdToAi().get(
configProvider.getConfigurations().getTopActionableItem()));
cacheTeamDefinitions(configProvider.getConfigurations().getIdToTeamDef().get(
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
index b978709800..b5d7c84a6a 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
@@ -15,7 +15,6 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
-import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.eclipse.osee.ats.api.IAtsObject;
@@ -23,14 +22,10 @@ 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.util.IExecuteListener;
-import org.eclipse.osee.ats.api.workdef.RuleEventType;
-import org.eclipse.osee.ats.api.workdef.RunRuleData;
-import org.eclipse.osee.ats.api.workdef.RunRuleResults;
import org.eclipse.osee.ats.api.workflow.IAttribute;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.search.AtsArtifactQuery;
import org.eclipse.osee.ats.core.util.AbstractAtsChangeSet;
-import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.ats.core.util.AtsRelationChange;
import org.eclipse.osee.ats.core.util.AtsRelationChange.RelationOperation;
import org.eclipse.osee.framework.core.data.ArtifactId;
@@ -44,12 +39,11 @@ 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.Conditions;
+import org.eclipse.osee.framework.jdk.core.util.ElapsedTime;
import org.eclipse.osee.framework.jdk.core.util.Lib;
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.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
-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;
@@ -112,23 +106,30 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
}
AtsClientService.get().sendNotifications(getNotifications());
- if (!workItemsCreated.isEmpty()) {
- RunRuleData runRuleData = new RunRuleData();
- runRuleData.setRuleEventType(RuleEventType.CreateWorkflow);
- runRuleData.getWorkItemUuids().addAll(AtsObjects.toUuids(workItemsCreated));
- RunRuleResults results = AtsClientService.getRuleEp().runWorkflowRules(runRuleData);
-
- List<Artifact> changedArts = new LinkedList<>();
- for (Long changedUuid : results.getChangedWorkitemUuids()) {
- Artifact artifact = ArtifactCache.getActive(changedUuid, AtsClientService.get().getAtsBranch());
- if (artifact != null) {
- changedArts.add(artifact);
- }
- }
- if (!changedArts.isEmpty()) {
- ArtifactQuery.reloadArtifacts(changedArts);
- }
- }
+ /**
+ * Commented out on 0.25.0 due to performance issues; No users are using this feature. Will be re-enabled on
+ * 0.26.0 where analysis can be done and all action creation can be moved to the server. Same change in both
+ * AtsChangeSets. See action TW1864.
+ */
+ // if (!workItemsCreated.isEmpty()) {
+ // RunRuleData runRuleData = new RunRuleData();
+ // runRuleData.setRuleEventType(RuleEventType.CreateWorkflow);
+ // runRuleData.getWorkItemUuids().addAll(AtsObjects.toUuids(workItemsCreated));
+ // ElapsedTime time2 = new ElapsedTime("AtsChangeSet.runWorkflowRules");
+ // RunRuleResults results = AtsClientService.getRuleEp().runWorkflowRules(runRuleData);
+ // time2.end();
+ //
+ // List<Artifact> changedArts = new LinkedList<>();
+ // for (Long changedUuid : results.getChangedWorkitemUuids()) {
+ // Artifact artifact = ArtifactCache.getActive(changedUuid, AtsClientService.get().getAtsBranch());
+ // if (artifact != null) {
+ // changedArts.add(artifact);
+ // }
+ // }
+ // if (!changedArts.isEmpty()) {
+ // ArtifactQuery.reloadArtifacts(changedArts);
+ // }
+ // }
return transactionRecord;
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItem2.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItem2.java
index 213fdbe766..6eab6bf957 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItem2.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/ActionableItem2.java
@@ -105,4 +105,9 @@ public class ActionableItem2 extends AtsConfigObject implements IAtsActionableIt
true);
}
+ @Override
+ public boolean isActive() {
+ return jaxAI.isActive();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinition2.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinition2.java
index 3262380789..86d2c181ac 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinition2.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinition2.java
@@ -344,4 +344,9 @@ public class TeamDefinition2 extends AtsConfigObject implements IAtsTeamDefiniti
return result;
}
+ @Override
+ public boolean isActive() {
+ return jaxTeamDef.isActive();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
index 1692b3d812..97e1c59b2e 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
@@ -80,7 +80,6 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
public static String PLUGIN_ID = "org.eclipse.osee.ats.rest";
private OrcsApi orcsApi;
private AtsNotifierServiceImpl notifyService;
- private WorkItemNotificationProcessor workItemNotificationProcessor;
private AtsNotificationEventProcessor notificationEventProcessor;
private IAgileService agileService;
@@ -312,11 +311,20 @@ public class AtsServerImpl extends AtsCoreServiceImpl implements IAtsServer {
loggedNotificationDisabled = true;
}
} else {
- workItemNotificationProcessor =
+ WorkItemNotificationProcessor workItemNotificationProcessor =
new WorkItemNotificationProcessor(logger, this, workItemFactory, userService, attributeResolverService);
- notificationEventProcessor = new AtsNotificationEventProcessor(workItemNotificationProcessor, userService,
- getConfigValue("NoReplyEmail"));
- notificationEventProcessor.sendNotifications(notifications, notifiers);
+ Thread thread = new Thread("ATS Notification Sender") {
+
+ @Override
+ public void run() {
+ super.run();
+ notificationEventProcessor = new AtsNotificationEventProcessor(workItemNotificationProcessor,
+ userService, getConfigValue("NoReplyEmail"));
+ notificationEventProcessor.sendNotifications(notifications, notifiers);
+ }
+
+ };
+ thread.start();
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
index 4e55d9a03f..56a9e01673 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
@@ -21,7 +21,6 @@ import org.eclipse.osee.ats.api.notify.IAtsNotifier;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IExecuteListener;
import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
-import org.eclipse.osee.ats.api.workdef.RuleEventType;
import org.eclipse.osee.ats.api.workflow.IAttribute;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogFactory;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateFactory;
@@ -103,10 +102,15 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
}
notifier.sendNotifications(getNotifications());
- if (!workItemsCreated.isEmpty()) {
- WorkflowRuleRunner runner = new WorkflowRuleRunner(RuleEventType.CreateWorkflow, workItemsCreated, atsServer);
- runner.run();
- }
+ /**
+ * Commented out on 0.25.0 due to performance issues; No users are using this feature. Will be re-enabled on
+ * 0.26.0 where analysis can be done and all action creation can be moved to the server. Same change in both
+ * AtsChangeSets. See action TW1864.
+ */
+ // if (!workItemsCreated.isEmpty()) {
+ // WorkflowRuleRunner runner = new WorkflowRuleRunner(RuleEventType.CreateWorkflow, workItemsCreated, atsServer);
+ // runner.run();
+ // }
return transactionReadable;
}

Back to the top