Skip to main content
Actually i am working with VS2005 so using normal aspx forms and try to code for controlling flow but i am facing problem as in my flow it is defined that when a process level variable named Approval is "Approved" then it must go to next activity "Make Booking" but even after changing that variable my flow is not going anywhere there is no difference so is it so that if i am not using Smart Forms then i have to jump to activities via code plz confirm or i m making some mistake, i am also attaching a document which can give u some idea wt the actual problem m facing.

and if u have any sample code or u have tried something similer then plz Share.
Your problem has got nothing to do with VS2005 or K2.net SmartForms.
Your problem probably lies within your process definition in K2.net Studio OR in your aspx page in that the datafield is not set correctly.

Where is the document you were going to attach?

I would recommend running K2.net Server in console mode and executing a couple of Console.Writeline methods in your process in order to see what the value of the datafield is set to at various stages.

Regards,
Ockert
Thank's for ur reply , but problem is that when i change the value of process level variable from code and check from workspace it show the changed value but it don't start next activity , can i have ur personal mail id so that i can fwd u doc file which i have prepared to explaing my problem
SourceCode.K2ROM.Connection myconn = new Connection();
myconn.Open("hm-cnpb-dv58");

SourceCode.K2ROM.Worklist oWorkList;
oWorkList = myconn.OpenWorklist("ASP");

foreach (SourceCode.K2ROM.WorklistItem oWorkListItem in oWorkList)
{

if (oWorkListItem.ProcessInstance.ID == 190)
{
["Test"].Value = "Complete";
oWorkListItem.ProcessInstance.DataFields["Approval"].Value = "Approved";
//oWorkListItem.GotoActivity("Manager Approval"); // if i dont write this line of code then my activity is not started but as per my defined rule if Approval="Approved" then it must start and when i check o from work space it reflect the change value Force the process to another Activity contained in the same Process

oWorkListItem.ProcessInstance.Update() ;
oWorkListItem.Update();
oWorkList.Refresh();
return; }
}
From this code, it looks like you update the value of the process level datafield and update the worklist item as well as the process instance - explaining the fact that the datafield is updated in reporting.

It looks like your problem is in the fact that you do not FINISH the worklist item i.e. the worklist item stays Active. You need to call the worklist item's Finish method explicitly.

HTH,
Ockert
Ya it start working after calling finish method
Thank's

Reply