Re: V.next: empty parameters

"vojtech.toman@emc.com" <vojtech.toman@emc.com> writes:
> "If no explicit connection is provided for a primary parameter input
> port, then the port will be connected to the primary parameter input
> port of the pipeline which contains the step. If no connection is
> provided for a parameter input port other than the primary parameter
> input port, then the port will be connected to an empty sequence of
> documents."
>
> I wonder why.

Well. Consider this pipeline:

  <p:pipeline>
    <p:xslt>
      <p:input port="stylesheet"><p:document href="doc.xsl"/></p:input>
    </p:xslt>
  </p:pipeline>

The primary parameter input port isn't empty by default because if it
was, then you couldn't pass parameters to that p:xslt step.

Most often, you have to add a binding for the parameters port because
you've done this:

  <p:declare-step>
    <p:input port="source"/>
    <p:output port="result"/>
    <p:xslt>
      <p:input port="stylesheet"><p:document href="doc.xsl"/></p:input>
    </p:xslt>
  </p:pipeline>

You've explicitly created a pipeline where it isn't possible to pass parameters
to the p:xslt step. So you have to fix that. The easiest way is to add

  <p:input port="parameters" kind="parameter"/>

to your p:declare-step. Then everything will work the way you expect.

I suppose an alternative solution would have been to add a new rule to
say that if the pipeline which contains the step has no primary
parameter input port, then the port is empty by default.

Maybe that would have been better, but it would have been yet another
special rule and we were feeling awfully guilty about having so many
already.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
Lead Engineer
MarkLogic Corporation
Phone: +1 413 624 6676
www.marklogic.com

Received on Thursday, 9 February 2012 10:10:30 UTC