I have used a Client Event to assign an activity to a Role, which successfully creates worklist items for each user in the role. What I want to do, more for an exercise than any business need, is to allow a user to 'Claim' said workitem, which removes it from everyone else's work list. To do this, I've made a 'Claim' outcome of the main activity, which effectively closes the main activity and creates a new one, with the intent of making the destination user whover just closed the main activity. Trolling the forums gave me the idea that I'd need to set a data field equal to the ActivityInstanceDestination.User.Name like this:
K2.ProcessInstance.DataFields[
"CurrentUser"].Value = K2.ActivityInstanceDestination.User.Name;However, I'm not where sure *where* to make this call (I am a total beginner to blackpearl, K2 and workflow in general, so the simpler the answer the better!)
I've tried creating a server event in both the main activity and the 'Claim' activity (tied to the main activity via the 'Claim' outcome) and setting the desitnation user of my 'Claim' activity to the CurrentUser data field. The result of the former is an 'Object reference not set to an instance an object' error when trying to retrieve the activity instance destination and the result of the latter is the process going into limbo (it is marked as 'Running' in the workspace forever and does not appear on anyone's task list).
Am I going about this a totally backwards way? Even if there is a better approach, why doesn't what I am doing with the activity instance destination work?