xProc - Pausing a pipeline and continue it when certain event occurs

83 Views Asked by At

I'm fairly new to xProc and xPath, but I've been asked to solve the following problem:

Step 2 receives data via the secondary port from step 1. Step 2 contains a p:for-each, which saves a document into a folder for each element that passes the for-each. (Part A)

These documents (let's say I receive 6 documents from for-each) lay in the same directory and get filtered by p:directory-list and are eventually stored in one single document, containing the whole path of every document the for-each created. (Part B)

So far, so good.

The problem is that Part A seems to be too slow. Part B already tries to read the data Step A stores while the directory is still empty. Meaning, I'm having a performance / synchronization problem.

And now comes the question: Is it possible to let the pipeline wait and to let it continue as soon as a certain event occurs?

That's what I'm imagining: Step B waits as long as necessary until the directory, which Step A stores the data in, is no longer empty. I read something about dbxml:breakpoint, but unfortunately I couldn't find more information than the name and a short description of what it seems to do:

Set a breakpoint, optionally based upon a condition, that will cause pipeline operation to pause at the breakpoint, possibly requiring user intervention to continue and/or issuing a message.

It would be awesome if you know more about it and could give an example of how it's used. It would also help if you know a workaround or another way to solve this problem.

UPDATE:

After searching google for half an eternity, I found SMIL which's timesheets seem to do the trick. Has anyone experience with throwing XML / xProc and SMIL together?

1

There are 1 best solutions below

0
Philip Fennell On

Back towards the end of 2009 I proposed the concept of 'Orchestrating XProc with SMIL' http://broadcast.oreilly.com/2009/09/xproc-and-smil-orchestrating-p.html in a blog post on the O'Reilly Network.

However, I'm not sure that this (XProc + Time) is the solution to your problem. It's not entirely clear, to me, from you description what's happening. Are you implying that you're trying to write something to disk and then read it in a subsequent step? You need to keep stuff in the pipeline in order to ensure you can connect outputs to subsequent inputs.