I am describing my problem as follows.
I have placed transaction Scope Activity and in that TransactionScopeActivity, i placed 3 Instances of custom Activitiy which updates a database column with instance name.
so, after completion of transactionScope, database column will have "CustomActivity3"
here i need to implement a scenario which checks local variable "IsCommitable".
if (iscommittable)
{
sendmail
}
else
{
Compensate database column
}
The above If statement should implement with out using "IF Activity"
How to implement Such above scenario
My Experiences :
I placed a code Activity after TransactionScope and given code like this
if (iscommittable)
{
Send Mail //Add Activity Dynamically using WF changes
}
else
{
throw new Exception();
}
1) The "throw" statement is not catching the fault handler Why ( i placed fault handler and given Fault Type="System.Exception", fault=E [ An Exception variable in Workflow] )
2) Instead of C# "throw" statement i added "Throw Activity" dynamically using WF changes, but control is going to fault handler and coming back to the next Activity where we fired this Statement.

TransactionScope
JT673
Ok, since you have asked to exclude the use of 'IfElse' activity - one solution I can think of (which maybe an overkill) is to use CAG.
Here is my thought:
Use a CAG after the TransactionScope and drop a code activity and a throw activity. Set the "when condition" for code activity as isCommittable=true and "when condition" for throw as isCommittable=false.
Now for the CAG set the Until Condition to, say a boolean RunOnce and check if it is already true. Make sure the codeactivity resets the until condition for the CAG so we don't run multiple times the same activity.
As for the control getting to the activity after the fault is handled, we'd have to actually look at the workflow you have to comment appropriately. However, my guess is you hace a scope issue where the next activity is in the next scope from the faulting scope and hence control resumes after the fault is consumed. If you don't want this to happen but instead complete the workflow, have all the rest of the activities be a part of the faulting scope.
Let me know how it goes...
Thanks,
Vignesh
Marten Ataalla
i am using External RuleSet Editor for creating Rules and a policy Activity for evaluating rules.
so, when i place if Activity, CAG or any conditional Activity , a ".rules" will be created. we wanted to avoid that ".rules" file created by workflow designer and wanted to use ".rule" file which was created using ExternalRuleSet with policy Activity.
so, taking above situation how can we place/execute Activities which are based on condition and we should not place any avialable Conditonal Activities.