cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create comments in documents from a workflow variable?

geekonspace
Star Contributor
Star Contributor

Hello friends, I am currently designing workflows in Nuxeo Studio, I defined a workflow variable (comment_workflow). How I can get the contents of this comment and make a comment to the document in which the workflow is available? I want to use automation chains.

alt text

I was reviewing the nuxeo explorer and I saw this: http://explorer.nuxeo.org/nuxeo/site/distribution/Nuxeo%20Platform-5.6/viewOperation/Document.Routin...

This operation does what I need? Where Can I found this operation in nuxeo studio?

1 ACCEPTED ANSWER

Mariana_Cedica
Star Contributor
Star Contributor

Hello,

No, this operation is only storing the number of comments on the workflow instance document and was added for performance reasons when comments were stored in Jena. There is no built in operation in Nuxeo to add comments to a document. You'll have to code this operation yourself and use the following method on the CommentManager service to create and add the comment to the document:

DocumentModel createComment(DocumentModel docModel, String comment, String author) throws ClientException

Than you call this operation form the workflow, by setting the chain as the Output operation chain at the step you want to create the comment.

View answer in original post

1 REPLY 1

Mariana_Cedica
Star Contributor
Star Contributor

Hello,

No, this operation is only storing the number of comments on the workflow instance document and was added for performance reasons when comments were stored in Jena. There is no built in operation in Nuxeo to add comments to a document. You'll have to code this operation yourself and use the following method on the CommentManager service to create and add the comment to the document:

DocumentModel createComment(DocumentModel docModel, String comment, String author) throws ClientException

Than you call this operation form the workflow, by setting the chain as the Output operation chain at the step you want to create the comment.