}
public ValidationResult preEntitlement(Consumer consumer, Consumer host,
Pool entitlementPool, Integer quantity, CallerType caller) {
JsonJsContext args = new JsonJsContext(objectMapper);
args.put("consumer", consumer);
args.put("hostConsumer", host);
args.put("consumerEntitlements", consumer.getEntitlements());
args.put("standalone", config.getBoolean(ConfigProperties.STANDALONE));
args.put("pool", entitlementPool);
args.put("quantity", quantity);
args.put("caller", caller.getLabel());
args.put("log", log, false);
String json = jsRules.runJsFunction(String.class, "validate_pool", args);
ValidationResult result;
try {
result = objectMapper.toObject(json, ValidationResult.class);