Login  Register

Re: Re: Re: can't get 2 processor in 1 pipeline to work

Posted by fl.schmitt(ops-users) on May 12, 2011; 7:55am
URL: https://discuss.orbeon.com/can-t-get-2-processor-in-1-pipeline-to-work-tp3514050p3516699.html

James,

> Unfortunately, connecting the 2 processors did not work.

hmm - ok. I think connecting the processors is only part of the
solution. In your example code, the output of the second processor is
still in no way dependend on the output of the first one, so "lazy
evaluation" still may omit the first processor when generating the
output of the second one.

If this is correct, one solution would be to make the output of both
processors relevant to the reslut of the XPL, for example by aggregating
them (using the identity processor [1]), or by evaluating the content of
the first processor's output. In pseudocode:

p:pipeline input=in output=out
    p:processor id=first, input=#in output=firstresult (true|false)
    p:choose href=#firstresult
        p:when test=true
            p:processor id=second output=finalresult ref=out
        p:otherwise
           (generate null document, throw exception or anything else)
   /p:choose
/p:pipeline

Another (and easier) solution would be to let the "Null serializer" [2]
consume the output of the first processor. This way, the XPL engine has
to access the output of the first processor, but just to discard it.
Pseudocode again:

p:pipeline input=in output=out
    p:processor id=first, input=#in output=firstresult
    p:nullserializer input=#firstresult (no output, sort of /dev/null)

    p:processor id=second output=finalresult ref=out
/p:pipeline

If the second processor depends on the succesful execution of the first
one, i would recommend using p:choose (as in my first example) to
express this dependency explicitly in the XPL code.

HTW (hope this works ;) )
florian


[1]
http://wiki.orbeon.com/forms/doc/developer-guide/processors-other#TOC-Identity-processor
[2]
http://wiki.orbeon.com/forms/doc/developer-guide/processors-other-serializers#TOC-Null-serializer




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws