How to generate empty bpm:comment box in task form?

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

How to generate empty bpm:comment box in task form?

Jump to solution

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

1 Solution

Accepted Solutions
marcollirite
Active Member II

Re: How to generate empty bpm:comment box in task form?

Jump 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 vorwfSmiley TonguerevComment, has solved the problem, while maintaining the comments field in the workflow history.

View solution in original post

2 Replies
jearles
Established Member II

Re: How to generate empty bpm:comment box in task form?

Jump to solution

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 null

hope this will help you.

It is displaying in comment box because of by default while submitting the form bpm_commentproperty is set with the textbox's value of which you have entered. So set bpm_comment to null.

Please respond for future users whether this has been helpful or we need to look deeper, for you.

Thanks,
-JEarles
bp3

marcollirite
Active Member II

Re: How to generate empty bpm:comment box in task form?

Jump 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 vorwfSmiley TonguerevComment, has solved the problem, while maintaining the comments field in the workflow history.