How to store the comments of workflow in attributes of other entity

0
HI experts, I have created a workflow which approves or rejects the nomination. Under that workflow we have inbuilt comments option. So when user type that comments to while approve or reject in workflow page, I want to store that comments in one of the attributes of my another entity in another module. For eg: User commented, Approving as per policy on comments under workflow page.  This comment shoudl be should in Attribute called: Reason which is in Entity called Approval in different module. How do i store it and where exactly can I find the comments. Below screenshot is the page I am talking about:
asked
2 answers
0

Comments are stored in the Domain Model [WorkflowCommons] in the WorkflowComment entity.

If you want to save them in another entity, you will have to rework the microflow which is used to submit them. Remember, however, not to do this directly in the Workflow module, but to create a new one to be used, as any update will erase all your changes if you do it directly in the module.

 

answered
0

I would do it like this:

Copy the microflow + 2 snippets from the WorkfloCommons module

image.png

 

Create in your Domain Model an entity called Message with an attribute Content and connect it 1:1 with Workflow comment, adding "On Delete object" to also delete Message if you delete comment and if you need in the other direction.

image.png

Next, in your copied ACT_WorkflowCommentHelper_SaveNew, add create object and add to it $WorkflowCommentHelper/Content with association to NewWorkflowComment (of course, if you want them to be assigned to a specific project, you will have to do it in your microflow).

image.png

Next, in Snip_WorkflowView_CommentsAndAttachments, replace the Submit button with your microflow ACT_WorkflowCommentHelper_SaveNew. In Snip_UserTask_AttachmentAndComments, place the snippet previously modified Snip_WorkflowView_CommentsAndAttachments.

 

You will use this snippet modified by you, Snip_UserTask_AttachmentAndComments, on your Workflow pages.

 

Picture111.png

 

Picture322.png

 

 

answered