Hi Karim,
1?If you choose the "Service Way of working" (personally I prefer decoupling my workflow from this kind of stuff)
you can Suspend and Resume it in the service:
public void MakeTheUpdateHere(Guid aGuid)
{
WorkflowInstance instance = this.Runtime.GetWorkflow(aGuid)
insance...Suspend(...);
instance.ApplyWorkflowChanges(...)
instance.Resume();
}
2?If you choose Matt's idea:
Since ApplyWorkfllowChanges is protected, you can provide a public function at the WorkflowActivity level (ex: ApplyChanges) that will call the protected ApplyWorklowChanges
class MyWorkflow : SequentialWorkflowActivity {
public void ApplyChanges(....)
{
this.ApplyWorkflowChanges(...);
}
}
in your activity :
class MyCustomActivity : Activity {
protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext) {
Activity rootActivity ...get the root activity as you did
((MyWorkflow) rootWorkflow).ApplyChanges(...); return ActivityExecutionStatus.Closed; }
}
Hope this helps; let me know if that works (I haven't tested it)
Serge
Serge Luca; Guidance Belgium; blog: www.redwood.be |