Integrate Comments in K2 Studio Workflow Task Form + SharePoint 2013

  • 18 August 2015
  • 3 replies
  • 0 views

Badge +6

Hi,

Did any one try to get comments on workflow task form. Workflow is created using K2 Studio on SharePoint 2013 list?

 

My workflow is 6 steps approval workflow and want to capture the commnets so that it can be displayed on form for next levels. E.g. Capturing previous steps comments.

My workflow is created using K2 Studio not K2 Designer.

 

Regards,

Ram


3 replies

Userlevel 3
Badge +9

I would use the sharepoint list or sql table to store comments. Save all comments with some unique ID corresponding to wrokflow for each comment.

creating a list view and useing get list method of smartobject passing the ID to pull all the comments and use that view on task form. 

Userlevel 5
Badge +16

Hi RamKumar,


 


Please follow steps below to achieve your requirements:


 


I created  two steps approval process:


 


14755i2F4AF173C91EC766.png


 


you will need to transfer the process instance ID to a data field when the workflow starts:


 


Assign the source and the destination


 


13039iE50CD71879C51722.png


 


 


 


16041i111D450614C85CDE.png


 


 


Create the following items in order to Add/View the comments


 


11470i85E29C3817A70B25.png


 


let's start with the views


 


1- workflow Comment Item 


 


13416i7CDEC181DAD211DE.png


 


2- Workflow Comment List


 


Notice That I added a data label on the top of the list (make it invisible)


 


10847iBDF84F65F78BA682.png


 


The start form:


 


Notice That I added Data label on the top of the form (make it invisible)


11834i1F8A9026824B4F3F.png


 


Add the following rule on the Start Form:


 


15662i80D8130A3284ED2E.png


 


the previous rule is configured as the following:


 


10749iCBFDB8FFFFCDE4EF.png


 


In the first action "Start Workflow" I need to retrieve the process ID to the data label I have on my form:


 


14908iD7672730FB3F09FA.png


 


In the last action I check if the comment area is not empty to insert the comment "add new record to workflow comments table" :


Notice that I pass the data label I have on my form which contains the process ID to Process instance ID 


 13886i5517EC0019202A85.png


 


we are done from the firs form.


 


lets check how to get the comments in the approval form


I have Comments list and Comment Item views on this form


the submit button to approve and create another comment if exists


14565i077BA5B12F4B79BD.png


 


here are the rules I have on this form:


 


14121iF188E1FD6711CB73.png


 


When the form Initialize rule is configured as the following:


 


16101i1091A250CE4CC688.png


 


the first two actions as we know they are automatically generated. we just need to pass the data field(Process Instance ID) from the workflow to the form to be able to list the comments related to specific instance:


 


configure the open actions as the following:


drag the data field to the data lable you added on the lis tview


16600iC9F41970EDAC720A.png


 


and now execute Get List Method of the Workflow Comments SO 


 


drag the data label from the list view which contains the process instance ID to the process instance ID (input property)


 


16458i6F6A1E5FC46B0E2E.png


 


Test Results:


 


12566i28CE6FE59CFA42A6.png


 


First Approval:


 


10841i3D32CBFCFD7580C8.png


 


Second Approval:


 


12451i305A16CA1729C74F.png


 


 


I made this tutorial upon your request, it's similar to the tutorial here


 


Note: My views are generated from the default SO provided by K2 "Workflow Comments" service.


Please let me know if you have any further questions :)

Badge +6

Thank you Mustafa, I like and enjoy your read/solution.

 

Regards,

Ram

Reply