Hi all,
I'm developing a custom workflow, where I would like comments from the previous task to be shown in the task form for the next task. To achieve this, I have a custom 'previous comment' text property which is rendered as a read-only text area. In each task I also have a bpm:comment field for the user to add their comments when they complete the task (I need to use bpm:comment because otherwise the comments are not saved in the workflow history table).
In my workflow process, I set the 'previous comment' property to the value of the bpm:comment from the previous task, which works fine. However, on the next task, the bpm:comment field is shown containing the comment from the start task. I've attached an image displaying this (in this case, "Admin comments" is the first comment inputted when the workflow is started). I've also added my files. What I want to change, is for the bpm:comment field to be rendered with an empty text box, but I can't figure out how to do this. Any suggestions?
Marcus
Solved! Go to Solution.
Hi Jonathan
Thanks for adding this to the question. I tried this method but I was getting a script error from Alfresco which I couldn't solve. However, setting bpm_comment to null, after setting the value of vorwfrevComment, has solved the problem, while maintaining the comments field in the workflow history.
Marcus,
As stated in your double-post to StackOverflow:
please try by appending your comments to previous comments
ex:
var comment = ((execution.getVariable("vorwf_prevComment") !=null)?execution.getVariable("vorwf_prevComment"):"") +"\n<p>"+person.properties.userName+":</p>"+task.getVariableLocal('bpm_comment'); execution.setVariable("vorwf_prevComment",comment);
and after that set
bpm_comment
property to nullhope this will help you.
It is displaying in comment box because of by default while submitting the form
bpm_comment
property is set with the textbox's value of which you have entered. So setbpm_comment
to null.
Please respond for future users whether this has been helpful or we need to look deeper, for you.
Thanks,
-JEarles
bp3
Hi Jonathan
Thanks for adding this to the question. I tried this method but I was getting a script error from Alfresco which I couldn't solve. However, setting bpm_comment to null, after setting the value of vorwfrevComment, has solved the problem, while maintaining the comments field in the workflow history.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.