summaryrefslogtreecommitdiffstats
path: root/rulemgt/src
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2017-10-14 02:35:11 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-14 02:35:11 +0000
commit646a660b1a7828013006619b4f7ec2d2f2f02f36 (patch)
tree5c2c8c408176bf721c1ab429e059d7f7e5862c9c /rulemgt/src
parent7d331f3d27fb8018d3f029609048d3df9a0c75a9 (diff)
parent973f3377b5e3590fd0cb71b6fd8d00ffc5aa55b8 (diff)
Merge "modify deploy rule bug"
Diffstat (limited to 'rulemgt/src')
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java
index 856171b..5c2a428 100644
--- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java
+++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java
@@ -73,10 +73,17 @@ public class RuleMgtWrapper {
if (ruleTemp != null) {
throw new CorrelationException("A rule with the same name already exists.");
}
+
String packageName = deployRule2Engine(correlationRule);
DmaapService.loopControlNames.put(packageName, ruleCreateRequest.getLoopControlName());
correlationRule.setPackageName(packageName);
- CorrelationRule result = correlationRuleDao.saveRule(correlationRule);
+ CorrelationRule result = null;
+ try {
+ result = correlationRuleDao.saveRule(correlationRule);
+ } catch (CorrelationException e) {
+ engineWarpper.deleteRuleFromEngine(packageName);
+ throw new CorrelationException(e.getMessage());
+ }
RuleAddAndUpdateResponse ruleAddAndUpdateResponse = new RuleAddAndUpdateResponse();
ruleAddAndUpdateResponse.setRuleId(result.getRid());
return ruleAddAndUpdateResponse;