Update DataField for a particular Destination User

  • 21 November 2007
  • 4 replies
  • 0 views

Badge +9

Hi All,


How to do this ?


I have an activity having 5 destination Users. Once a worklist is created for them, at some point of time, I need to update a datafield value(say Name) to a particular value depending on who is the destination user ?


Can this be done. I think here I have to go for Activity DataField .


Please guide


Thanks and Regards


 


 


4 replies

Badge +11

Hi sourcecode,


Yes, you would need to use Activity level datafields. Don't try to update the datafield in the K2Studio process design itself - otherwise each ActivityInstanceDestination object will just contain the name of the applicable Destination user.  Rather update the datafield in you end user's UI - SmartForms, ASP.NET, WinForms or InfoPath - whatever you use.


HTH,


Ockert

Badge +1

hi,


how can i set the activity datafield in my UI?


i need syntax..............


thanks.

Badge +11

Once you connect to the server in your web page (there are many examples in the Developer's Reference) you can open the WorkListItem.  From there you can access properties to get/set process and activity level variables:


SourceCode.Workflow.Client.Connection conn= new SourceCode.Workflow.Client.Connection();
conn.Open("MyConnectionStringl"); 


SourceCode.Workflow.Client.WorklistItem wli = conn.OpenWorklistItem(Request.QueryString["SN"]);
 
tbProcessField.Text = wli.ProcessInstance.DataFields["MyProcessField"].Value.ToString(); 
tbActivityField.Text = wli.ActivityInstanceDestination.DataFields["MyActivityField"].Value.ToString(); 


You will need to add appropriate error handling then close & dispose the connection. 

Badge +1
I did as you said before asking my question..but the datafield is not updated...i can get ti it's value..and in the form change it, but after i look in the process viewer i see nothing has been changed....why is that? do i need to cange any of the datafield properties??

Reply