Open jmauersberger opened 1 year ago
Did you try org.eclipse.acceleo.query.runtime.impl.Nothing
:
variables.put("myVariable", new Nothing("..."))
Let me try ...
@ylussaud if I do that it improves a bit, anyway, I still get warnings that there is actually no service on that Object type available, so it does not work as in OCL where I can just execute any Collection operation also on OclVoid, right?
I think this issue might be fixed with AQL 8.x by doing something like:
variables.put("myVariable", new NullValue(types))
Where types
is a Set
of IType
. This allows AQL to keep track of types for null values and prevent service lookup failures.
There is an experimental build of M2Doc with AQL 8.x, the update site is here. Note that this update site should be used for testing only.
Let me know if this helps with your issue.
I'm submitting a...
Current behavior
I can pass a map of variable -> value to the generate method, all works nice, I can pass single EMF objects, plain text and EMF collections. However, I can't pass null to express "Void" or "unset" (see also See also https://forum.mbse-capella.org/t/m2doc-how-to-use-optional-template-variables/4555/6)
Expected behavior
I would like to pass OclVoid or Null or any other value so that any AQL expression is not broken but evaluates to nothing.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
We use the m2doc API programatically, so variable definition and value assignment is on our end. We cant distinguish between "not set" and "empty" at the moment.
Environment