Skip to main content
Hi,
I am trying to create a new workflow as given below.

Assuming there are 2 activities ActA, ActB
when the process ProcA is in ActB, I am creating another similar Process and using the code given below to create and jump to the activity.

The problem I am having is when the process ProcB is created, I see the worklist item for the newly created item is shown in ActA instead of ActB.
from the management console,I see that there are 3 worklist Items
1.ProcA with activity ActB(right)
2.ProcB with Activity ActA(wrong)
3.ProcB with Activity ActB(right)

Should I write code to make the WorklistItem also to move to appropriate activity so that in the above case the worklistItem 2( wrong WL item) does not appear in the worklist?

Code
------------------

K2Manager MGR = new SourceCode.K2Mng.K2Manager();
MGR.Login(new K2().ServerName,K2.PORT,K2.ADMIN_CONN_STR);



//populate the hashtable with data

Hashtable parms = new Hashtable();
parms.Add("oms_originator", System.Web.HttpContext.Current.User.Identity.Name);
// start a process instance
SourceCode.K2ROM.ProcessInstance p = new K2().StartProcessWithArgs(PROC_TYPE_ID,parms);

//goto the activity as per K2_workflow_task

MGR.GotoActivity(p.ID, activityName);

Would appreciate a quick response.
Regards
Keshav
Can you post a screenshot of your process definition for us to better understand the process logic?

Regards,
Ockert
A possible alternative to this would be to build a check activity in the process. It will typically be the first activity after the start activity. Place a server event in the test activity and do a check whether a GoTo needs to be performed for this particular process instance. To do the check, I would create a process variable and pass in the activity name to go to (if applicable) when the new process instance is started.

The code in the server event would look something like this:
.Value.ToString());
}
}

I would also suggest looking into using an IPC event to start the new process instances, but I don t have enough info on your process, so I ll leave it up to you.

Reply