Is it possible to define a thing parameter to be multiline?

For a Query addon that I started to develop, I would like to have a parameter to be multiline.
Because I think that for queries is a lot easier and more readable to be able to define them in multiline format, specially Influx2 Flux queries that are like:

from(bucket:"example-bucket")
|> range(start:-1h)
|> filter(fn:(r) =>
  r._measurement == "cpu" and
  r.cpu == "cpu-total"
)
|> aggregateWindow(every: 1m, fn: mean)

To my understanding, it is not possible using things XML files, but it would be possible in the JSON/JSONDB config. But I haven’t found a multiline descriptor in the parameter definition.
Is it possible to do that? I want to confirm before creating an issue, as it seems a reasonable requirement, isn’t it?

A workaround would be to define that queries in a custom XML file, and then have the parameters to just be a reference to the XML, but it would be nicer to have native support.

Note: I’m targeting OH3.0 for the addon.

According to the source code it might work by giving the parameter the context script:

But this option isn’t mentioned in the official documentation, so I don’t know if it is actually supported:

2 Likes

Thanks @hilbrand.
I didn’t know about the context parameter.
I will check if it works as intended in new OH3.0 UI

Confirmed. At least with OH 3.0 works well: