diff options
author | Guangrong Fu <fu.guangrong@zte.com.cn> | 2017-10-14 02:35:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-10-14 02:35:11 +0000 |
commit | 646a660b1a7828013006619b4f7ec2d2f2f02f36 (patch) | |
tree | 5c2c8c408176bf721c1ab429e059d7f7e5862c9c /rulemgt | |
parent | 7d331f3d27fb8018d3f029609048d3df9a0c75a9 (diff) | |
parent | 973f3377b5e3590fd0cb71b6fd8d00ffc5aa55b8 (diff) |
Merge "modify deploy rule bug"
Diffstat (limited to 'rulemgt')
-rw-r--r-- | rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java | 9 |
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;
|