Add support for multiple labels in shortestPath() function
Resolves:
@@ -123,7 +123,16 @@ public class OSQLFunctionShortestPath extends OSQLFunctionMathAbstract {
if (iParams.length > 3) {
ctx.edgeType = iParams[3] == null ? null : "" + iParams[3];
}
+ if (iParams != null && iParams.length > 2 && iParams[3] instanceof Collection) {
+ ctx.edgeTypeParam = new String[((Collection) iParams[3]).size()];
+ Collection coll = (Collection) iParams[3];
+ int i = 0;
+ for (Object o : coll) {
+ ctx.edgeTypeParam[i++] = "" + o;
+ }
+ } else {
ctx.edgeTypeParam = new String[] { ctx.edgeType };
+ }
if (iParams.length > 4) {
bindAdditionalParams(iParams[4], ctx);
