04-20-2017 12:32 PM
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
04-25-2017 10:30 AM
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.
04-21-2017 06:06 PM
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
04-25-2017 10:30 AM
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.
Explore our Alfresco products with the links below. Use labels to filter content by product module.