Hi all,
I am writing a Gremlin-Java DSL based on the Maven archetype gremlin-archetype-dsl. The DSL compiles correctly in Maven and it works in a standard linear query such as this one in the Gremlin Console ("test" spawns the traverser):
>test.function1('arg1').
> function2('arg2','arg3').
> function2('arg2','arg3')
However, all the DSL functions return an error when they are nested inside another query function:
>test.function1('arg1').
> repeat(function2('arg2','arg3')).
> times(2)
No signature of method: groovysh_evaluate.function2() is applicable for argument types: (String, String) values: [arg2, arg3]
This happens regardless of the specific DSL function (AnonymousMethod or not, number & types of arguments, etc.) and the outer function (repeat, where, emit, choose, not, or, etc.). Standard Gremlin functions still work correctly.
Here are the imports in "TestTraversalDsl.java", some of which may be unnecessary:
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.IO;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.GremlinDsl;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.GremlinDsl.AnonymousMethod;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import static org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource.traversal;
import static org.apache.tinkerpop.gremlin.process.traversal.Operator.*;
import static org.apache.tinkerpop.gremlin.process.traversal.Order.*;
import static org.apache.tinkerpop.gremlin.process.traversal.P.*;
import static org.apache.tinkerpop.gremlin.process.traversal.Pop.*;
import static org.apache.tinkerpop.gremlin.process.traversal.SackFunctions.*;
import static org.apache.tinkerpop.gremlin.process.traversal.Scope.*;
import static org.apache.tinkerpop.gremlin.process.traversal.TextP.*;
import static org.apache.tinkerpop.gremlin.structure.Column.*;
import static org.apache.tinkerpop.gremlin.structure.Direction.*;
import static org.apache.tinkerpop.gremlin.structure.T.*;
import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*;
I am fairly new to Java + Gremlin. Am I missing something basic, or are nested DSL functions not supported?
Thanks,
Martin