![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | WWF Workflow changes committed but Activity.Execute() not called I have the following sequence activity within a Sequential Workflow // delegate for OnLoadFilters event public delegate void LoadFiltersEventHandler(); public partial class DynamicFilteringActivity : SequenceActivity { public event LoadFiltersEventHandler OnLoadFilters; protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext) { if(null != OnLoadFilters) { LogWriter.Trace("DynamicFilteringActivity::Loading filters"); OnLoadFilters(); } return (base.Execute(executionContext)); } } When this Activity is run, as you can see it simply raises the OnLoadFilters event, which is registered with the SequentialWorkflowActivity thus // in SequentialWorkflowActivity's designer.cs file this.FilteringSequence.OnLoadFilters += new e3.net.interfacing.activities.LoadFiltersEventHandler(this.OnLoadFilters_ExecuteCode); // in SequentialWorkflowActivity's .cs file private void OnLoadFilters_ExecuteCode() { // code ellided for the sake of berevity. // suffice it to say however, that DynamicFilterLoader, takes a few parameters and does the actual // business of adding the Activities to the Workflow DynamicFilterLoader.LoadFilters(ref workflowChanges, MessageSystem.MessageType, messagePath); try { ApplyWorkflowChanges(workflowChanges); } catch(InvalidOperationException ex) { // log error LogWriter.Exception(ex); throw; } catch(WorkflowValidationFailedException wvfe) { LogWriter.Exception(wvfe); var sb = new StringBuilder(); foreach(ValidationError error in wvfe.Errors) sb.AppendLine(error.ErrorText); LogWriter.Trace(sb.ToString()); throw; } } One of these "Filters" which is loaded at runtime, for example is FilterGender, whose constructors are defined as follows: [System.Diagnostics.DebuggerStepThrough] public FilterGender() { InitializeComponent(); } [System.Diagnostics.DebuggerStepThrough] public FilterGender(string gender, MessageResponses response) : base(response) { Genders = new List<string>(); Genders.AddRange(gender.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)); LogWriter.FilterRelatedTracing(string.Format("FilterGender::FilterGender(\"{0}\", {1}) constructed ... ", gender, response)); } So far so good, when the workflow is run, the approriate logic is used to determine whether or not our dynamic filters are required and the appropriate filter is indeed added to the workflow, this much is evident in the fact that our Trace file contains the expected trace "FilterGender::FilterGender(\"{0}\", {1}) constructed ... ", also when the DebuggerStepThrough attribute is commented out and we run the workflow in debug mode, we can set a breakpoint in the constructor. The problem is however, that although no exceptions are raised when the call to ApplyWorkflowChanges(workflowChanges); is made, the Execute method of the dynamically loaded filter is never called. If there is not enough information here let me know and I will provide more. Thanks in advance. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: WWF Workflow changes committed but Activity.Execute() not called Having discovered that the flaw actually lies in the ellided code that's doing the adding to the workflow, this post has become somewhat redundant. Thanks. "Bill Richards" <bill.richards@xxxxxx> wrote in message news:8E2AEF3C-E875-454E-86D7-E1A92246CE92@xxxxxx Quote: >I have the following sequence activity within a Sequential Workflow > > // delegate for OnLoadFilters event > public delegate void LoadFiltersEventHandler(); > > public partial class DynamicFilteringActivity : SequenceActivity > { > public event LoadFiltersEventHandler OnLoadFilters; > > protected override ActivityExecutionStatus > Execute(ActivityExecutionContext executionContext) > { > if(null != OnLoadFilters) > { > LogWriter.Trace("DynamicFilteringActivity::Loading > filters"); > OnLoadFilters(); > } > return (base.Execute(executionContext)); > } > } > > > When this Activity is run, as you can see it simply raises the > OnLoadFilters event, which is registered with the > SequentialWorkflowActivity thus > > // in SequentialWorkflowActivity's designer.cs file > this.FilteringSequence.OnLoadFilters += new > e3.net.interfacing.activities.LoadFiltersEventHandler(this.OnLoadFilters_ExecuteCode); > > // in SequentialWorkflowActivity's .cs file > private void OnLoadFilters_ExecuteCode() > { > // code ellided for the sake of berevity. > // suffice it to say however, that DynamicFilterLoader, takes a > few parameters and does the actual > // business of adding the Activities to the Workflow > > DynamicFilterLoader.LoadFilters(ref workflowChanges, > MessageSystem.MessageType, messagePath); > > try { ApplyWorkflowChanges(workflowChanges); } > catch(InvalidOperationException ex) > { > // log error > LogWriter.Exception(ex); > throw; > } > catch(WorkflowValidationFailedException wvfe) > { > LogWriter.Exception(wvfe); > var sb = new StringBuilder(); > foreach(ValidationError error in wvfe.Errors) > sb.AppendLine(error.ErrorText); > > LogWriter.Trace(sb.ToString()); > throw; > } > } > > One of these "Filters" which is loaded at runtime, for example is > FilterGender, whose constructors are defined as follows: > > [System.Diagnostics.DebuggerStepThrough] > public FilterGender() { InitializeComponent(); } > > [System.Diagnostics.DebuggerStepThrough] > public FilterGender(string gender, MessageResponses response) : > base(response) > { > Genders = new List<string>(); > Genders.AddRange(gender.Split(new[] { ',' }, > StringSplitOptions.RemoveEmptyEntries)); > > > LogWriter.FilterRelatedTracing(string.Format("FilterGender::FilterGender(\"{0}\", > {1}) constructed ... ", gender, response)); > } > > So far so good, when the workflow is run, the approriate logic is used to > determine whether or not our dynamic filters are required and the > appropriate filter is indeed added to the workflow, this much is evident > in the fact that our Trace file contains the expected trace > "FilterGender::FilterGender(\"{0}\", {1}) constructed ... ", also when the > DebuggerStepThrough attribute is commented out and we run the workflow in > debug mode, we can set a breakpoint in the constructor. > > The problem is however, that although no exceptions are raised when the > call to ApplyWorkflowChanges(workflowChanges); is made, the Execute > method of the dynamically loaded filter is never called. > > If there is not enough information here let me know and I will provide > more. > > Thanks in advance. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Windows Workflow - Jump to Activity | .NET General | |||
| Are sub-routines parameters called by reference or called by value? | VB Script | |||
| Execute error: Type Mismatch: 'Execute' | VB Script | |||