Hi,
I have seen this behaviour if the code moved away (goto) or expiry the activity "First Review", while K2 was executing server event "Check Destination" and there was a client event following in the activity.
The reason why the "Wait for action" is still active is being:
When K2 is attempting to GOTO another activity, it also moved to the "Wait for Action" event. After it is planned, it will remain active even the process has moved on to the other activity.
To work around, we need to modify the code in the "check Destination" event from:
if (SearchManager() == "") // if we cannot find suitable managers , return false
{
K2.GoToActivity("NameOfNextActivity");
}
else
{
K2.ProcessInstance.DataFields["Dest"].Value = SearchManager();
}
TO
if (SearchManager() == "") // if we cannot find suitable managers , return false
{
K2.Synchronous = false; // Stop here after Goto statement
K2.GoToActivity("NameOfNextActivity");
}
else
{
K2.Synchronous = true; // Continue to next event when finished
K2.ProcessInstance.DataFields["Dest"].Value = SearchManager();
}
The statements and opinions made in my postings are my own, and do not reflect the opinions of SourceCode Technology Holdings, Inc. or its subsidiaries. All information is provided as is with no warranties, express or implied, and grants no rights or licenses.