Skip to main content

Hello!


I need to work out who performed a particular action in a Blackpearl workflow, and use that information to update a SharePoint list.


The action could be performed by someone other than the person it was originally assigned to, so using data fields in the workflow is out.


Basically - the action is in one activity and there is an outcome 'line' to the next activity - the step to update the SharePoint list is in the second activity.  The code to update the sharepoint list works lovely, but the code runs as the K2 service account, and we need it to run as the person who performed the action.


Any ideas how I can get hold of the user name or ID of the person who performed the acrion which causes the workflow to go down the 'action outcome' path?


Hope all this makes sense!!


Thanks,


Helen

Ok, first the code that updates the SharePoint list item will be run as the K2 service account if it is a SharePoint List Items event wizard.  So, if the question is 'how do I get K2 event wizard code to run-as an account other than the K2 service account', then the answer might not be what you are looking for and would require custom code and raises security questions.  If you simply want to update a column that contains User Name information (i.e. the person who actioned the work list item in the previous activity), then that is very easy:


Create a process level data field called 'LastUser' (or something along those lines).  After the client event (but in the same activity), use a Data Event to set the LastUser data field = Activity Instance Destination User.  Then, in the next activity, update the SharePoint column with the LastUser data field.


Reply