Jul 12, 2012 at 2:42 PM
Edited Jul 13, 2012 at 2:19 PM
I've been poking around with the workflow timer, and have successfully managed to get it to execute a custom list workflow.
The problem is, it errors somewhere in the process, and that causes the workflow to hang. When the timer runs again, it errors due to the workflow already running.
I have tested the workflow by itself, and when I run it manually, it functions fine. It's a simple process; iterate through all the list items and delete duplicates. Just to double-check, I ran it five times in quick succession, and each time,
it completed successfully. So the triggered workflow is fine.
The error I get is, "An error has occurred in <workflow name>", and that's from looking at the workflow I had to terminate manually. Checking the log files gives me, "ex.Message=Cannot complete this action. Please try again."
My last shot was to grab the source code and run it that way, to make use of the debugger. Unfortunately, even executing the solution through Visual Studio didn't bring up any exceptions, and I can't get it to hit any of the breakpoints I set.
Edit: I still can't get it to hit any of my breakpoints, but the debug code finally kicked in for the workflow history, so now I get: Exception of type 'System.Workflow.ComponentModel.WorkflowTerminatedException' was thrown.
It insists this is happening in my workflow code, but it won't hit the fault handler I have set up to catch Exceptions in the workflow.
Edit #2: I added in logToHistoryActivity actions before each action of the workflow, just to see if I could figure out exactly where it errors. When I run the workflow manually, I see all the logged actions appearing fine. When the timer triggers
the workflow, I get none of the actions; it errors before it even activates the workflow!
Anyone have any ideas on what to look for or what to do to resolve this?