3
votes

So I have a file uris.xqy that gets the document URI's that I want to operate on in corb.

Then I have docs.xqy that brings in the $URI declare variable $URI as xs:string external;

And then I do some processing on that document.

Now I want to pass in a parameter to corb from the command line such that ./ml ${Environment} corb --uris=/uris.xqy --modules=/docs.xqy --hello=world

When I execute the command above I would have access to hello and it's contents world in docs.xqy.

2

2 Answers

4
votes

I think what you are looking for is a Custom Property

PROCESS-MODULE.hello=world

The CORB2 wiki explains this at

https://github.com/marklogic/corb2/wiki/Other-Properties#custom-properties

To use a custom property, it must be prepended with the Task name and declared as an external variable in the XQuery.

To pass a collection name to the PROCESS task use:

PROCESS-MODULE.collectionName=nameOfCollectionToUse

1
votes

With Roxy v1.7.4+, you can now specify any CoRB options, to include custom module inputs, using either the -- or -D switches.

If you upgrade to Roxy 1.7.4.1 (or later), you can send the value to the docs.xqy module external variable named "hello" by executing the following:

./ml ${Environment} corb --uris=/uris.xqy --modules=/docs.xqy --PROCESS-MODULE.hello=world