Workflow output automation and pop/push

Hello,

i'm working on an automation chain to execute at output of a workflow task node. As soon as I add a “pop/push document” operation in the chain, an exception is thrown when the workflow execute it. To be more precise, the exception is thrown by the operation next to the pop/push, which always fail with a message similar to :

Caught error: Cannot find any valid path in operation chain - no method found for operation 'XXXXXX' and for first input type 'org.nuxeo.ecm.core.api.impl.DocumentModelListImpl'

XXXXX is any operation waiting for a document input, next to the pop or the push.

I tried to call the operation chain outside of the workflow, using a context button on document, and it works well.

Any idea ? is there something “different” to do to get the context document on a workflow operation chain ?

I'm using nuxeo 5.8 HF15.

Anthony.

0 votes

1 answers

3113 views

ANSWER



Sorry, answer is in the bottom of the documentation ! :

Getting the first document of the document list in the automation chains ran from a workflow node Icon As we mentioned above, the workflow engine injects a document list in the automation chain, even when there is only one document. You may have sometime a “Cannot find any valid path in operation chain” exception, because the operation you put in the chain expects one document in input and the previous operation gives a list. You can avoid this situation, when you know you have only one document, by fetching this document first. To do so, you can use:

Execution Context > Restore input document from a script
script: This[0]

Then, for the rest of the chain, you will have only one document in input transiting from one operation to the other.

3 votes