diff --git a/src/main/java/org/commcare/suite/model/Endpoint.java b/src/main/java/org/commcare/suite/model/Endpoint.java index 65e468bcc..0cdf0845a 100644 --- a/src/main/java/org/commcare/suite/model/Endpoint.java +++ b/src/main/java/org/commcare/suite/model/Endpoint.java @@ -86,22 +86,29 @@ public static void populateEndpointArgumentsToEvaluationContext(Endpoint endpoin } } - Vector unexpectedArguments = new Vector<>(); - for (String argumentId : argumentIds) { - if(!isValidArgumentId(endpointArguments, argumentId)){ - unexpectedArguments.add(argumentId); - } - } +// Vector unexpectedArguments = new Vector<>(); +// for (String argumentId : argumentIds) { +// if(!isValidArgumentId(endpointArguments, argumentId)){ +// unexpectedArguments.add(argumentId); +// } +// } - if (missingArguments.size() > 0 || unexpectedArguments.size() > 0) { - throw new InvalidEndpointArgumentsException(missingArguments, unexpectedArguments); - } +// if (missingArguments.size() > 0 || unexpectedArguments.size() > 0) { +// throw new InvalidEndpointArgumentsException(missingArguments, unexpectedArguments); +// } for (int i = 0; i < endpointArguments.size(); i++) { - String argumentName = endpointArguments.elementAt(i).getId(); + EndpointArgument argument = endpointArguments.elementAt(i); + String argumentName = argument.getId(); if (args.containsKey(argumentName)) { evaluationContext.setVariable(argumentName, args.get(argumentName)); } + if (argument.isInstanceArgument()) { + argumentName = "instance_id_" + argumentName; + if (args.containsKey(argumentName)) { + evaluationContext.setVariable(argumentName, args.get(argumentName)); + } + } } }