How can I display comments from a previous workflow task in the form for the following task?

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member II

How can I display comments from a previous workflow task in the form for the following task?

Jump to solution

I'm creating a workflow for a document review process. I've successfully implemented a "comments" box for the review tasks allowing the reviewers to leave comments about the document. These comments can be viewed in the workflow details in share.

What I would like the workflow to do is to display these comments as part of the form in the following task (e.g. if a document is rejected, the workflow will more to an "Amend Document" task, and when this task form is viewed, I would like the comments from the reviewer to be displayed as part of the form).

My plan is to define a workflow process comments variable, set it at the end of each task, and then display it in the next form. I am able to set the variable, but I am unsure on how to display this in another task, and whether this needs to be done in the  workflow bpmn file or in the share-config-custom.xml.

Any help would be greatly appreciated!

1 Solution

Accepted Solutions
Highlighted
Active Member II

Re: How can I display comments from a previous workflow task in the form for the following task?

Jump to solution

Hi Greg

Apologies for the late reply - I have not been able to do much work on Alfresco since I asked the original question!

I have managed to partially figure out how to do this, and it is actually quite simple. I've defined an aspect for the "previous task comment" in my workflow model, and applied this aspect to my tasks. Then, in the model file, I set the value of this aspect to the value of the bpm:Comment from the previous task, and render it in the task form as a read-only text area. I am still having one small issue, in that for some reason the bpm:comment boxes for the tasks are being rendered with text already existing in them, although this isn't preventing the operation of the workflow. I've made that into another question on the alfresco community, if anyone has any ideas regarding that:  

View solution in original post

4 Replies
Highlighted
Intermediate

Re: How can I display comments from a previous workflow task in the form for the following task?

Jump to solution

If you are using ACtiviti Enterprise you should use the Alfresco document widget within the forms editor to display the documents.

The following blog post should help you out:

https://community.alfresco.com/community/bpm/blog/2016/12/01/activiti-enterprise-developer-series-st... 

Thanks,
Greg

Highlighted
Active Member II

Re: How can I display comments from a previous workflow task in the form for the following task?

Jump to solution

Hi Greg

Thanks for your answer.  Unfortunately I am not using Activiti Enterprise as I'm working with Alfresco Community Edition, so I'm hand building the workflows myself.

Thanks

Highlighted
Intermediate

Re: How can I display comments from a previous workflow task in the form for the following task?

Jump to solution

Can't speak to "share" I know nothing about it.

I assume you are using the "comments" feature of the workflow engine:

Activiti User Guide - Create a new comment on a task 

There is also the ability to create comments on the process instance :
Activiti User Guide - Create a new comment on a historic process instance 

Not sure which one you are using but suffice to say, there are ways to retrieve both these entities.

Perhaps I dont understand what you are doing, a process model, form definition and screen shots may help.

Greg

Highlighted
Active Member II

Re: How can I display comments from a previous workflow task in the form for the following task?

Jump to solution

Hi Greg

Apologies for the late reply - I have not been able to do much work on Alfresco since I asked the original question!

I have managed to partially figure out how to do this, and it is actually quite simple. I've defined an aspect for the "previous task comment" in my workflow model, and applied this aspect to my tasks. Then, in the model file, I set the value of this aspect to the value of the bpm:Comment from the previous task, and render it in the task form as a read-only text area. I am still having one small issue, in that for some reason the bpm:comment boxes for the tasks are being rendered with text already existing in them, although this isn't preventing the operation of the workflow. I've made that into another question on the alfresco community, if anyone has any ideas regarding that:  

View solution in original post