I am debugging some workflow code. I have found the following code is throwing the exception 'activity Instance(tcm:10-2988-131104) does not exist.'
private ActivityInstance FinishActity(ActivityInstance instance, string message,
Trustee nextAssignee, Session userSession)
{
try
{
ActivityFinish finishActivity = new ActivityFinish(message, nextAssignee, userSession);
return instance.Finish(finishActivity);
}
catch (PermissionDeniedException)
{
return null;
}
catch (InvalidActionException)
{
return null;
}
}
It seems like the activity instance no longer exists when execution reaches the statement return instance.Finish(finishActivity)
Is there an activity instance timeout that might be the cause of this?
If so, where would I configure that timeout?
Sometimes when activity is finished it is not appearing in assignment list. But we can see that in global work list. When we initiate the workflow for some other item then along with new item the previous item also appear in the assignment list. I am feeling in the above scenario the second time when workflow start it triggers the previous workflow as well.