C
Cesar
Hey folks.
This question is about Windows Workflow Foundation and exception handling.
I have a HandleExternalEventActivity activity that runs some code when the
user clicks an "Accept" button on my form. The activity includes several
tasks that involves database and eventually filesystem.
The problem is, when an exception occurs within that activity, the workflow
is set to Terminated. That ruins the flow, because even if I can trap the
exception (throw to the host)
, the user will not be able to click the Accept button anymore, because the
workflow state will be erased.
In short, is there a way to catch the exception inside the activity and
return it like if it was never called? (same as a rollback).
I tested FaultHandlers, not good. And I have searched a lot, but can't find
this "activity rollback" behaviour.
I appreciate help.
*Ps*.: just to know the way of working, I wish this:
1. user clicks accept button;
2. wwf throws an exception;
3. the host application traps and tells user to fix whatever data is wrong;
4. user clicks accept again;
5. wwf continues to trhow exception till everything is ok. If all ok, commit
the regular way long.
Cesar
This question is about Windows Workflow Foundation and exception handling.
I have a HandleExternalEventActivity activity that runs some code when the
user clicks an "Accept" button on my form. The activity includes several
tasks that involves database and eventually filesystem.
The problem is, when an exception occurs within that activity, the workflow
is set to Terminated. That ruins the flow, because even if I can trap the
exception (throw to the host)
, the user will not be able to click the Accept button anymore, because the
workflow state will be erased.
In short, is there a way to catch the exception inside the activity and
return it like if it was never called? (same as a rollback).
I tested FaultHandlers, not good. And I have searched a lot, but can't find
this "activity rollback" behaviour.
I appreciate help.
*Ps*.: just to know the way of working, I wish this:
1. user clicks accept button;
2. wwf throws an exception;
3. the host application traps and tells user to fix whatever data is wrong;
4. user clicks accept again;
5. wwf continues to trhow exception till everything is ok. If all ok, commit
the regular way long.
Cesar