I have a multi path process in the K2 for SharePoint web interface. I want to use the name of the person who completed the prior approval step for a couple of different things (like inserting it into a content control in a word document), but I can't find anything in the context browser.
Based upon some input data, one or more paths can be run, and at a point merged back into a single path. The business needs to know which approvals were executed and by whom.
I don't want to do the lookup of the person because with out of office or other delegations/redirections, the approver could be changed mid-instance. So I need to get the name of the person who actioned the step.
To answer my own question. I found a post that indicated that you had to get into the Advanced Wizard for the destinations and change it to plan per destination. This then populated the filed referenced above.. I found that it does get the username, but display name is not there. So I'll smart object look it up.
You can use a Data Event to save the name of the user that completed a step. As long as the event is in the same Activity as the Client event and as long as it is after the client event you will get the correct user saved.
Use the Activity Destination Instance > User > Name property and save it to a process data field.
Do this for all of your steps and you can then reuse them since process data fields are available throughout your process.
Hope this helps!
The statements and opinions made in my postings are my own. All information is provided as is with no warranties, express or implied, and grants no rights or licenses.
Thanks for a prompt reply..
Aren't your steps in K2 Studio though? Can I do this in the silverlight interface? I don't see any Activity Destination Instances listed in the context browser in the K2 for SharePoint designer.
Also... looking at the process in K2 Studio, I don't have a user property under the Destination branch of the XML. I only have email.
My path is <Activity Instance Name>_Destinations > Destinations > Destination > email
Am I looking in the right place?
Ah... I was looking in the wrong place. I see it now.. In K2 Studio..
Can I access this in the silverlight K2 for Sharepoint designer?
Because of the way the K2 Designer for SharePoint works you are not able to drop another event into a "Step" (Activity) using this designer and you would not be able to save the destination username who completed the event into a SmartObject.
You can create a data field that you display on the client page and educate the users to complete it or try to customize the page so that the data field is auto-populated with the username of the user who opens it. I don't have specific detail on how you would customize the client page, but I'm sure you can look through the documentation of other forums to gain more insight on how you would do it.
OK.. I am in K2 Studio now.
I'm writing a data event in the activity with the approval, but all I get is "k2server" for the ActivityInstanceDestUserName
Am I running into a timing issue where I can't read that field because it hasn't been updated yet? Is there a way to pause events inside an activity? Am I doing something wrong?
Glad you got it working.
I believe in the newer versions the Display name should actually be there. It will be called Participant Name when you drag it into your wizards.
But your way of looking it up using a SmartObject will also work just fine.