debugging pipeline that may or may not be executing

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

debugging pipeline that may or may not be executing

ajs6f@virginia.edu-2
Schrodinger's pipeline, as it were.

I understand from searching in the mail archives that OPS's pipeline
execution is "lazy" in the sense that if it's determined that there is
no output from a pipeline, it is never executed and thus debug
attributes therein do not get triggered into messages in the logs.

I have an app-in-the-making which is based on the bizdoc2 example
(because of the similar workflows). I am using an external eXist
instance and obviously different schemas, etc.

At the point in the pipelines where a document is to be updated into the
repository, I am having a silent failure. The eXist instance is not
receiving the XMLDB Query, and execution appears to be dying somewhere
between the two belowquoted OPS pipelines (the two that correspond to
save-document-action.xpl and update-document.xpl in bizdoc2 example). If
I purposefully insert a mistake into update-entry.xpl (my version of
update-document.xpl) I get a exception, which makes sense. But I never,
no matter what, get debug output in the logs from update-entry.xpl, as
though it isn't being executed.

I am wondering if it is possible that since eXist does not return
anything for the use of the XQuery Update extensions, which I am using,
if this pipeline is being treated as a "no-execute" pipeline, even tho'
it in fact has a great (in fact, crucial <grin>) role?

Sorry about the detailed narrative-- thanks for any help!

enc: two abovementioned files

---
A. Soroka ; Digital Research & Instructional Services /
Alderman Library / the University of Virginia

[ajs6f@francesca detail]$ cat save-entry-action.xpl

<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:shd="http://www.example.com/shd">

        <p:param name="instance" type="input"
schema-href="shd-form-schema.xsd"/>

   
    <!-- Strip instance of XForms annotations -->
        <p:processor name="oxf:xslt">
                <p:input name="data" href="#instance"/>
                <p:input name="config">
                        <xsl:transform version="2.0"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
                                <xsl:import
href="oxf:/oxf/xslt/utils/copy.xsl"/>
                                <xsl:template match="@xxforms:*"/>
                        </xsl:transform>
                </p:input>
                <p:output name="data" id="stripped-instance"
debug="stripped-instance"/>
        </p:processor>

    <!-- Retrieve existing document if possible -->
        <p:processor name="oxf:pipeline">
                <p:input name="config"
href="../summary/find-entry-action.xpl"/>
                <p:input name="instance" href="#stripped-instance"/>
                <p:output name="data" id="result" debug="found-entry"/>
        </p:processor>

           
    <!-- Update or insert  -->
        <p:choose href="#result">
                <p:when test="/entry/responsibility/id != '' ">
         

        <!-- Document exists already, call the data access layer to
update it -->
                        <p:processor name="oxf:pipeline">
                                <p:input name="config"
href="../data-access/exist/update-entry.xpl"
debug="update-entry-debug"/>
                                <p:input name="entry"
href="aggregate('entry',
#stripped-instance#xpointer(/entry/responsibility |
/entry/shd:episode))" debug="aggregate-entry"/>
                        </p:processor>
                </p:when>


                <p:otherwise>
          <!-- Document does not exist, call the data access layer to
insert it -->
                        <p:processor name="oxf:pipeline">
                                <p:input name="config"
href="../data-access/delegate/create-entry.xpl" debug="new-bad-entry"/>
                                <p:input name="entry"
href="aggregate('entry',
#stripped-instance#xpointer(/entry/responsibility |
/entry/shd:episode))"/>
                        </p:processor>
                </p:otherwise>
        </p:choose>

</p:config>

[ajs6f@francesca exist]$ cat update-entry.xpl
<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:xdb="http://orbeon.org/oxf/xml/xmldb"
          xmlns:shd="http://www.example.com/shd"
          xmlns:exist-query="http://exist.sourceforge.net/NS/exist">

    <p:param name="entry" type="input" schema-href="../entry-info.xsd"/>
    <p:param name="return" type="output" />

    <!-- Dynamically build query -->
    <p:processor name="oxf:debug">
        <p:input name="data" href="#entry"/>
        <p:input name="config">
            <config>Stuff that comes into update-entry.xpl</config>
        </p:input>
        <p:output name="data" id="entry2"/>
    </p:processor>
   
    <!-- Dynamically build query -->
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#entry2"
debug="update-document-info"/>
        <p:input name="config">
            <xdb:query collection="/db/shd" xsl:version="2.0">
               
                xquery version "1.0";
                declare namespace shd="http://www.example.com/shd";
                for $target in //entry[responsibility/id =
'<xsl:value-of select="/entry/responsibility/id"/>']/shd:episode
                return
                        update replace $target with <xsl:copy-of
select="/entry/shd:episode"/>
                 
           </xdb:query>
        </p:input>
        <p:output name="data" id="query" debug="update-query"/>
    </p:processor>
   
   

    <!-- Run query and return document-info -->
    <p:processor name="oxf:xmldb-query">
        <p:input name="datasource" href="datasource.xml"/>
        <p:input name="query" href="#query"/>
        <p:output name="data" ref="return" debug="return-stuff"/>
    </p:processor>

</p:config>


--

---
A. Soroka; [hidden email]



--
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