Update Process Instance data field value through worklistitem

  • 10 September 2015
  • 2 replies
  • 2 views

Badge +6

Hi All,

 

This is what I am trying to do:

 

SourceCode.Workflow.Client.Connection con = new Connection(); 

            con.Open("AKSGAKJH"); 
            Worklist wl = con.OpenWorklist("ASP","satya"); 
            foreach (WorklistItem wli in wl) 
            { 
                wli.Open(); 
                 wli.ProcessInstance.DataFields["Outcome"] .Value= "Approve";  // this is read only as suggested in K2 designer for Visual Studio

                 wli.Update();
                  wli.Actions["Approve"].Execute(); 
                
            } 
            con.Close();

 

 

But it sounds strange that , I am not able to assign value to a process instance datafield through worklist item . It seems it is read only.

I remember in K2.NET 2003 , it was possible to  update data field through worklistitem object.

 

Please guide.

Thanks ,

Satya


2 replies

Badge +4

Hi Satya,

I tried this without opening the worklist item and it worked correctly.

 

14832i94CCD13B055596DF.png

Regards
Pieter

Badge +6

Hi Noir,

 

Thanks for replying.

 

My mistake ..

 

I was using wli.ProcessInstance.DataFields["Outcome"] = "Approve" . I had not used .Value property but I had posted as

wli.ProcessInstance.DataFields["Outcome"] .Value= "Approve"

 

Thanks,

Satya

Reply