How do I pass a document to a sub-process


I have a process that uses a document as an input for a REST connector.
The document is initialized from a file upload in an instantiation form.

Now I want to call this process as a call activity from another process.
How do I pass the document from the main process to the called sub-process ?

When I use a contract and my document assigned to contract input, I get : DocumentImpl{...} cannot be assigned to FILE.

1 answer



you can find the answer in the documentation ;)




Submitted by cjundt_1868075 on Thu, 06/18/2020 - 16:05

I did as stated in documentation but I get an exception :

"Declared return type interface org.bonitasoft.engine.bpm.document.Document is not compatible with evaluated type class org.bonitasoft.engine.bpm.document.DocumentValue for expression docEntree"

Submitted by romain.bioteau on Thu, 06/18/2020 - 16:23
import org.bonitasoft.engine.bpm.document.Document;
import org.bonitasoft.engine.bpm.document.DocumentValue;

def doc = apiAccessor.getProcessAPI().getDocument(subDocId)
new DocumentValue(apiAccessor.getProcessAPI().getDocumentContent(doc.getContentStorageId()), doc.getContentMimeType(), doc.getContentFileName()

The return type of the script must be org.bonitasoft.engine.bpm.document.DocumentValue The operation operator must be Document value

Submitted by cjundt_1868075 on Fri, 06/19/2020 - 11:09

Finally, I moved my code to a groovy scripting connector and it's working now.

Previously I had a task with no connectors at all and the code in an document assignment operation.
I think there may be a bug in case of a task having operations only (no connectors).

Thanks for your time

Submitted by romain.bioteau on Fri, 06/19/2020 - 11:11

I tried using operation only before posting and there was no issue. What version are you using ?

Submitted by cjundt_1868075 on Fri, 06/19/2020 - 11:20


But the way, is there a way to get a 7.11 beta build?
I'm not a java developer and I don't have the environment to build it by my own.

Submitted by romain.bioteau on Fri, 06/19/2020 - 11:36
Submitted by cjundt_1868075 on Fri, 06/19/2020 - 12:00

Great news, thank you.