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

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.Routing.UpdateCommentsInfoOnDocument

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

1 votes

1 answers

3768 views

ANSWER



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.

1 votes