I've got a pipeline which has no
outputs, only inputs. I've been having trouble getting it to run:
nothing seems to happen, even with debug attributes throughout nothing
is logged.
I'm using the Java API to execute & read output from the pipeline. I've found that processors which aren't eventually connected to outputs of the pipeline *which are then read* aren't seeming to get executed. For example, in the attached pipeline the delegation processor should throw an error because the address isn't invalid: instead, the delegation processor seems to get skipped altogether & the pipeline runs ok. If you modify the final xslt processor to use the web-service-result document as an input (instead of web-service-call), then the delegation process is run, and you get the expected error. This seems totally wrong! Adrian <?xml version="1.0"?> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <p:param type="output" name="data" /> <p:param type="input" name="data"/> <p:processor name="oxf:xslt"> <p:input name="data" href="#data"/> <p:input name="config"> <hwynums xsl:version="2.0"> <xsl:value-of select="/parameters/highway"/> </hwynums> </p:input> <p:output name="data" id="xslt-result"/> </p:processor> <p:processor name="oxf:xinclude"> <p:input name="config"> <delegation:execute service="ca-traffic" operation="getTraffic" xmlns:delegation="http://orbeon.org/oxf/xml/delegation"> <xi:include href="input:xslt-result"/> </delegation:execute> </p:input> <p:input name="xslt-result" href="#xslt-result"/> <p:output name="data" id="web-service-call"/> </p:processor> <p:processor name="oxf:delegation"> <p:input name="interface"> <config> <service id="ca-traffic" type="webservice" endpoint="http://s121212121212dfdfervices.xmethods.net/soap/servlet/rpcrouter"> <operation nsuri="urn:xmethods-CATraffic" name="getTraffic"/> </service> </config> </p:input> <p:input name="call" href="#web-service-call"/> <p:output name="data" id="web-service-result" debug="true"/> </p:processor> <p:processor name="oxf:xslt"> <p:input name="data" href="#web-service-call"/> <p:input name="config"> <xsl:stylesheet version="2.0"> <xsl:import href="oxf:/oxf/xslt/utils/copy.xsl"/> <xsl:template match="/"> <xsl:copy-of select="." copy-namespaces="no"/> </xsl:template> </xsl:stylesheet> </p:input> <p:output name="data" ref="data"/> </p:processor> </p:config> -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Ok, so glancing through this
thread
(http://mail-archive.objectweb.org/ops-users/2005-01/msg00319.html) it
seems I have to connect the output of the processor in question to the
null serializer, to ensure it's executed. Perhaps this should be in the
FAQ somewhere (I looked there but saw nothing)?
Can I just mention this seems very arcane? We're aiming to provide hooks in our application for implementers to connect snippets of XPL to, to allow them to do their own integration. XPL will already be a bit of a learning curve for them, but just by following an example of tying together some inputs, an XSLT & a web service they can achieve a lot without being XPL experts. Requiring somewhat unintuitive steps like this makes it harder. When we're just using small bits of XPL as glue code metaphors like pipes & circuits are pretty obscure: the XPL pipeline is just a simple series of procedural steps, and it's confusing when it doesn't behave this way. Adrian Adrian Baker wrote: I've got a pipeline which has no outputs, only inputs. I've been having trouble getting it to run: nothing seems to happen, even with debug attributes throughout nothing is logged. -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Adrian Baker
You could use a null-serializer. This doesn't have an output so it will be called first, and because it will require the web-service-result input this will be called, and so on and so on. I believe the XPL works by trying to process all the outputs, and working backward through the pipe. This is just my understanding I could be wrong <p:processor name="oxf:null-serializer"> <p:input name="data" href="#web-service-result"/> </p:processor> Ryan Ryan Puddephatt "Measuring programming progress by lines of code is like
measuring aircraft building progress by weight." - Bill Gates Adrian Baker wrote: I've got a pipeline which has no outputs, only inputs. I've been having trouble getting it to run: nothing seems to happen, even with debug attributes throughout nothing is logged. -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Adrian Baker
Hi Adrian,
You are saying the you where running this pipeline but you were not reading its "data" output? As you discovered, if you don't read that output, all the processor required to produce that data just won't run, as that data is not needed. I understand that this can be confusing, but this behavior is really core to the "essence" of pipelines. The execution of a pipeline is not procedural, but is data-driven. The "need" for data drives the execution of processors. Alex On 4/10/07, Adrian Baker <[hidden email]> wrote: > > Ok, so glancing through this thread > (http://mail-archive.objectweb.org/ops-users/2005-01/msg00319.html) > it seems I have to connect the output of the processor in question to the > null serializer, to ensure it's executed. Perhaps this should be in the FAQ > somewhere (I looked there but saw nothing)? > > Can I just mention this seems very arcane? We're aiming to provide hooks in > our application for implementers to connect snippets of XPL to, to allow > them to do their own integration. XPL will already be a bit of a learning > curve for them, but just by following an example of tying together some > inputs, an XSLT & a web service they can achieve a lot without being XPL > experts. Requiring somewhat unintuitive steps like this makes it harder. > When we're just using small bits of XPL as glue code metaphors like pipes & > circuits are pretty obscure: the XPL pipeline is just a simple series of > procedural steps, and it's confusing when it doesn't behave this way. > > Adrian > > Adrian Baker wrote: > I've got a pipeline which has no outputs, only inputs. I've been having > trouble getting it to run: nothing seems to happen, even with debug > attributes throughout nothing is logged. > > I'm using the Java API to execute & read output from the pipeline. > > I've found that processors which aren't eventually connected to outputs of > the pipeline *which are then read* aren't seeming to get executed. For > example, in the attached pipeline the delegation processor should throw an > error because the address isn't invalid: instead, the delegation processor > seems to get skipped altogether & the pipeline runs ok. > > If you modify the final xslt processor to use the web-service-result > document as an input (instead of web-service-call), then the delegation > process is run, and you get the expected error. This seems totally wrong! > > Adrian > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit > http://www.messagelabs.com/email > ______________________________________________________________________ > ________________________________ > > <?xml version="1.0"?> > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" > xmlns:oxf="http://www.orbeon.com/oxf/processors" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:xi="http://www.w3.org/2001/XInclude" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > <p:param type="output" name="data" /> > <p:param type="input" name="data"/> > > <p:processor name="oxf:xslt"> > <p:input name="data" href="#data"/> > <p:input name="config"> > <hwynums xsl:version="2.0"> > <xsl:value-of select="/parameters/highway"/> > </hwynums> > </p:input> > <p:output name="data" id="xslt-result"/> > </p:processor> > > <p:processor name="oxf:xinclude"> > <p:input name="config"> > <delegation:execute service="ca-traffic" operation="getTraffic" > xmlns:delegation="http://orbeon.org/oxf/xml/delegation"> > <xi:include href="input:xslt-result"/> > </delegation:execute> > </p:input> > <p:input name="xslt-result" href="#xslt-result"/> > <p:output name="data" id="web-service-call"/> > </p:processor> > > <p:processor name="oxf:delegation"> > <p:input name="interface"> > <config> > <service id="ca-traffic" type="webservice" > endpoint="http://s121212121212dfdfervices.xmethods.net/soap/servlet/rpcrouter"> > <operation nsuri="urn:xmethods-CATraffic" name="getTraffic"/> > </service> > </config> > </p:input> > <p:input name="call" href="#web-service-call"/> > <p:output name="data" id="web-service-result" debug="true"/> > </p:processor> > > <p:processor name="oxf:xslt"> > <p:input name="data" href="#web-service-call"/> > <p:input name="config"> > <xsl:stylesheet version="2.0"> > <xsl:import href="oxf:/oxf/xslt/utils/copy.xsl"/> > <xsl:template match="/"> > <xsl:copy-of select="." copy-namespaces="no"/> > </xsl:template> > </xsl:stylesheet> > </p:input> > <p:output name="data" ref="data"/> > </p:processor> > > </p:config> > > > ________________________________ > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > -- Orbeon Forms - Web 2.0 Forms for the Enterprise http://www.orbeon.com/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Ryan Puddephatt
Hi Ryan,
On 4/11/07, Ryan Puddephatt <[hidden email]> wrote: > You could use a null-serializer. This doesn't have an output so it will > be called first, and because it will require the web-service-result input > this will be called, and so on and so on. I believe the XPL works by trying > to process all the outputs, and working backward through the pipe. This is > just my understanding I could be wrong Yes, exactly. Alex -- Orbeon Forms - Web 2.0 Forms for the Enterprise http://www.orbeon.com/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Alessandro Vernet
Hi Alex,
No doubt this has been discussed before here & in the XProc WG.. but.. In this case the purpose of the pipeline isn't to 'produce' any data, but to persist it using a web service call. It's the equivalent of a 'save' method with a void return. Generally you wouldn't skip execution of such a method just because it's return is void (or non-void, but not assigned). Perhaps the data-driven idea is useful for optimisation within the implementation, but is it at all useful for pipeline authors? More mundane control mechanisms like if..else would seem the obvious way to control processor execution. Internally the execution may not be procedural, but on casual inspection an XPL file *looks* and *feels* totally procedural (it's a sequence of steps). Even the documentation refers to the p:config element as containing "The list of statements that need to executed for this pipeline.". Should that then really read that as "a collection of statements, some, none or all of which are executed, dependent on what outputs are read"? Actually, does this mean by changing the order I read outputs I can control the order of execution of steps in the pipeline? Does it not strike you as somewhat.. unfortunate having to rely on the addition of a null serializer at the bottom of the pipeline to make it execute? Worse still, what if steps within the pipeline don't have any outputs (eg I invokes an audit service which records an audit event every time the pipeline is executed) - will I have to connect steps like these to null serializers as well? If this is a core concept, perhaps it needs to be documented somewhere (or is it already?), or at least have a FAQ entry. The person writing the pipeline couldn't figure out what was going on: when I had a look at it, it took me a long time to work out how to make it execute - and when I did, I was convinced the behaviour was a bug. Adrian Alessandro Vernet wrote: Hi Adrian, -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
On 4/11/07, Adrian Baker <[hidden email]> wrote:
> Perhaps the data-driven idea is useful for optimisation within the > implementation, but is it at all useful for pipeline authors? I guess one use case could go as follows. You write a pipeline with 2 outputs: max-salary and min-salary. Depending on which one gets read, different queries will be sent to the database to compute the max and min salary. If when you use that pipeline you read only max-salary and not min-salary, the code in the pipeline that produces min-salary just won't run. By extension, if you have one output to a pipeline, and you don't read that output, the code that produces that output won't run. It is arguable whether this is a good thing or not. I understand why this can be confusing. As far as XProc is concerned, it is unclear to me how this is supposed to work in XProc at this point, or even if there is a consensus about this amongst the members of the working groups. I just sent an email in the group list to check this. You are bringing up an interesting topic! Alex -- Orbeon Forms - Web 2.0 Forms for the Enterprise http://www.orbeon.com/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |