Hi,
I am new for K2 and just working on moving the first activity in workflow to the next.
I used event wizard to configure actions till two corresponding outcomes and lines are generated. Of course, I linked outcome lines to the next activities before deployment. However, after I executed action in aspx code behind, the process instance is marked as process finished instead of moving to the next activity.
Anybody knows why does that happen???!
Here is some of my code:
private void UpdateK2Data()
{
if (chkCancelClientFile.Checked)
DeclineWorklistItem(k2WorkItem);
else
ApproveWorklistItem(k2WorkItem);
}
public void ApproveWorklistItem(WorklistItem worklistitem)
{
ActionWorklistItem(worklistitem, "Approve");
CloseConnection();
}
public void ActionWorklistItem(WorklistItem worklistitem, string action)
{
//Loop through all the actions this item has
foreach (Action act in worklistitem.Actions.Cast<Action>().Where(act => act.Name == action))
{
act.Execute(false);
break;
}
}