class RuleController {

	@ApiOperation(httpMethod = "POST", value = "API to invoke rule", response = Response.class, consumes = MediaType.APPLICATION_JSON_VALUE)
	@RequestMapping(path = "/invoke", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Object> invokeRule(
			@ApiParam(value = "provide valid rule id", required = true) @RequestParam("ruleId") String ruleId,
			@ApiParam(value = "provide rule optional params", required = false) @RequestBody(required = false) List<Map<String, Object>> ruleOptionalParams) {
		try {
			return ResponseUtils.buildSucessResponse(ruleService.invokeRule(ruleId, ruleOptionalParams));
		} catch (Exception exception) {
			log.error(UNEXPECTED_ERROR_OCCURRED, exception);
			return ResponseUtils.buildFailureResponse(new Exception(UNEXPECTED_ERROR_OCCURRED), exception.getMessage());
		}
	}

}