jobs:eval as a service, "no variables allowed"
Hi,
when I try to register jobs:eval as a service, BaseX 9.2 says: "no variables allowed".
Is it not possible to register a service with a variable?
Not working:
jobs:eval("declare variable $xml external; $xml", map { 'xml': 'XML' }, map { 'id':'TEST', 'start':'11:31:50', 'interval':'P1D', 'service': true() })
working:
jobs:eval("declare variable $xml external; $xml", map { 'xml': 'XML' }, map { 'id':'TEST', 'start':'11:31:50', 'interval':'P1D', 'service': false() })
http://docs.basex.org/wiki/Jobs_Module#jobs:eval
Thanks, Daniel
Hi Daniel,
no variables can be bound if services are registered, that’s true (values that are bound to variables might potentially be huge, and blow up the initial startup time of BaseX). I have added a comment to our documentation.
Best, Christian
Quoted text · Daniel · 24 lines
On Wed, Apr 3, 2019 at 11:57 AM Zimmel, Daniel <D.Zimmel at esvmedien.de> wrote: > > Hi, > > when I try to register jobs:eval as a service, BaseX 9.2 says: "no variables allowed". > > Is it not possible to register a service with a variable? > > Not working: > > jobs:eval("declare variable $xml external; $xml", > map { 'xml': 'XML' }, > map { 'id':'TEST', 'start':'11:31:50', 'interval':'P1D', 'service': true() }) > > working: > > jobs:eval("declare variable $xml external; $xml", > map { 'xml': 'XML' }, > map { 'id':'TEST', 'start':'11:31:50', 'interval':'P1D', 'service': false() }) > > http://docs.basex.org/wiki/Jobs_Module#jobs:eval > > Thanks, Daniel >
Thanks for the clarification. This sound like a wise thing to do.
Quoted text · Christian Grün · 44 lines
> -----Ursprüngliche Nachricht----- > Von: Christian Grün [mailto:christian.gruen at gmail.com] > Gesendet: Mittwoch, 3. April 2019 13:18 > An: Zimmel, Daniel > Cc: BaseX > Betreff: Re: [basex-talk] jobs:eval as a service, "no variables allowed" > > Hi Daniel, > > no variables can be bound if services are registered, that’s true > (values that are bound to variables might potentially be huge, and > blow up the initial startup time of BaseX). I have added a comment to > our documentation. > > Best, > Christian > > > On Wed, Apr 3, 2019 at 11:57 AM Zimmel, Daniel <D.Zimmel at esvmedien.de> > wrote: > > > > Hi, > > > > when I try to register jobs:eval as a service, BaseX 9.2 says: "no variables > allowed". > > > > Is it not possible to register a service with a variable? > > > > Not working: > > > > jobs:eval("declare variable $xml external; $xml", > > map { 'xml': 'XML' }, > > map { 'id':'TEST', 'start':'11:31:50', 'interval':'P1D', 'service': true() }) > > > > working: > > > > jobs:eval("declare variable $xml external; $xml", > > map { 'xml': 'XML' }, > > map { 'id':'TEST', 'start':'11:31:50', 'interval':'P1D', 'service': false() }) > > > > http://docs.basex.org/wiki/Jobs_Module#jobs:eval > > > > Thanks, Daniel > >
Written for BaseX 9.1. BaseX may have changed since: please check the current documentation.