changing data fields values

  • 8 November 2005
  • 2 replies
  • 1 view

Badge +3
I was able to start my process using K2ROM's StartProcessInstance. I've also appended to my workflow's data fields values from SQL. What I need to know now is how to change those data fields values. For example, I have a RequestStatus field from SQL. Upon starting the process, I have successfully passed this value ("New Request") to my workflow's K2RequestStatus data field. But next time I run my windows service (after checking on some conditions), I want this K2RequestStatus data field to change to "Rejected" . I have tried: (after looping through my worklist and finding the correct record)

myProc.DataFields["K2RequestStatus"].Value = "Rejected";

but it still doesn't change. Do you have any idea how to go about this?

Thank you so much for any help!

2 replies

Badge +11
Are you sure you're working with the correct worklist item?

Does your 'myProc' object refer to the worklist item's ProcessInstance property?

You'll probably have to call the worklist item's Update() method. You can also try the myProc.Update() method to update the Process Instance.

If you still do not succeed, you'll have to paste your full code for troubleshooting.

Hope this helps,
Ockert
Badge +3
eep! thanks for that clarification. i wasn't pointing to the worklist's process instance! what a dunce! so there!

thanks!!

the reason why i was doing this was because i was trying to set the data fields to reflect the values that would make the lines after the activity to be colored because i would be using the GotoActivity after that (haha, we're back to that issue again).

Reply