Hi, I am an asp.net programer for several years but new to K2. I am having a question here hope someone can give me answer:
We have an asp.net application tries to hook up K2 blackpearl. While a k2 process running, we want to send instant messages in our application to the process starter and next activity destinations(if any). Instead programming in every activity, we want to call a message sending method every time process starts/action executes.
We do like this:
//Start process in sync mode
conn.StartProcessInstance(myProcess, true);
//Get process ID
string pid = myProcess.ID;
//Get next activity destination via SmartObject
...
SmartObjectClientServer socs= new SmartObjectClientServer();
...
SmartObject so= socs.GetSmartObject("Activity_Instance_Destination");
SmartListMethod getList = so.ListMethodst"List"];
so.MethodToExecute = getList.Name;
so.Propertiesr"ProcessInstanceID"].Value = pid
so.Propertiesr"Status"].Value = "Active";
SmartObjectList soList = socs.ExecuteList(so);
...
//loop the list to get users and send instant messages....
The problem is even we use the sync mode for process start and each action execute, sometime, we still get empty SmartObjectList (which means the next activity has not been created).
Did we do anything wrong or we should try diffrent approach?
thanks!