Skip to main content

I am getting this error when trying to call back to a process from another process in a server event. The original code setting up the asynchronous event looks like:


 



K2.Synchronous =



false;


K2.ProcessInstance.DataFieldss"SerialNumber"].Value = K2.SerialNumber;


Pretty simple, and then from the second processs there is this code in a server event:




SourceCode.Workflow.Client.



ProcessInstance _pi = _conn.OpenProcessInstance(Convert.ToInt32(K2.ProcessInstance.DataFieldss"ParentProcessID"].Value));

 



String serialNumber = _pi.DataFieldsd"SerialNumber"].Value.ToString();

 



//Open and complete the ServerItem



 



ServerItem serverItem = _conn.OpenServerItem(serialNumber);

serverItem.Finish();


 


So the quirky thing is, the process that calls to finish the original process is successfully doing so.  Meaning the original process is taken out of it's pause state and continues. But the calling process goes int an error state with the following error:


25225 Server Item Not Found with Serial 7206_60


I would assume that it is not finding the process if it weren't for the fact that the original process completes the activity that it is paused on when this call is made. Any ideas?



Without your complete code and process in the post, my answer may not be relevant but here is my thought on this.


The activity in the process that calls the code can potentially have an advanced destination rule. I.e. plan per destination, with multiple slots configured. In cases like these, the events in the activity will execute once for every slot, so only the first call will succeed, the rest will fail. 


Excellent suggestion, but unfortunately the event does not have a destination at all. I am thinking along the same lines. I think for some reason the process is trying to call the parent process twice. I just can't figure out why.


That does seem quite strange. How about, just for a test, you create a simple SmartObject that holds an ID, SerialNo, a datetime and an int (process instance ID), then call the create method for this in a SmartObject event before the event where the code that completes the async event executes. This way you can check how many times that executes, when and by which process.


Reply