import javax.ws.rs.core.MediaType;
import lombok.extern.slf4j.Slf4j;
import org.jvnet.hk2.annotations.Service;
+import org.onap.holmes.common.dmaap.DmaapService;
import org.onap.holmes.common.exception.CorrelationException;
import org.onap.holmes.common.utils.ExceptionUtil;
import org.onap.holmes.common.utils.LanguageUtil;
@Produces(MediaType.APPLICATION_JSON)
@Timed
public CorrelationRuleResponse deployRule(
- @ApiParam(value = "The request entity of the HTTP call, which comprises two "
- + "fields: \"content\" and \"engineid\". "
+ @ApiParam(value = "The request entity of the HTTP call, which comprises three "
+ + "fields: \"content\" , \"loopcontrolname\" and \"engineid\". "
+ "The \"content\" should be a valid Drools rule string and the \"engineid\" "
+ "has to be \"engine-d\" in the Amsterdam release.", required = true) DeployRuleRequest deployRuleRequest,
@Context HttpServletRequest httpRequest) {
CorrelationRuleResponse crResponse = new CorrelationRuleResponse();
Locale locale = LanguageUtil.getLocale(httpRequest);
try {
-
String packageName = droolsEngine.deployRule(deployRuleRequest, locale);
+ DmaapService.loopControlNames
+ .put(packageName, deployRuleRequest.getLoopControlName());
log.info("Rule deployed. Package name: " + packageName);
crResponse.setPackageName(packageName);