index > Windows Workflow Foundation > Derived from HandleExternalEvent / Filtering events

Derived from HandleExternalEvent / Filtering events

I derived my own Control from HandleExternalEvent, using wca.exe. I want this control to behave the following:

- The Event args (derived from ExternalDataEventArgs ) of the event which is to be handled include a Property A, which can be either 1, 2 or 3
- My derived Control has a user-settable "Filter" property which can be set to 1, 2 or 3
- Only if Property A of the received Event is set to the Filter value, the event is "handled".

To my surprise I discovered that the "Execute" method of HandleExternalEvent is sealed, so I cannot implement my filter in an override of this method.

Does anyone have a solution to this (other than write my own HandleExternalEvent control from ground up)?

Thanks for any help,

Urs

Urs__Eichmann

One solution is to create a queue in the Excecute Method of a Custom activity (derived from Activity, not HandleExternalEvent, because this method is sealed), to have a service posting an event in the queue, to dequeue the info in the queueItemAvailable event on the activity side and to check if your event property A matches your filter value. It's quite simple, robust and that works.

You can download the following sample from Paul Andrew blog.

Hope this helps

Serge




Serge Luca; Guidance Belgium; blog: www.redwood.be
Serge Luca
reply 2

You can use google to search for other answers

 

More Articles

• Modify running workflowinstance in the runtime
• Dynamically load policyActivity ruleSet
• Could not deserialize object. The type 'WorkflowLibrary1.BaseOrd...
• About new WWF beta 1.2
• Compile error - type resolution
• How to get an ActivityExecutionContext in a custom rule expressio...
• InfoPath Task form not pre-filling
• Windows Worlflow Foundation Beta 2.2
• How to debug with RunWorkflow method?
• problems communicating with the host
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Problem Integrating WF with Visual Studio
• wrong use of ActivityDesigner makes app
• "WORKFLOW FAILED VALIDATION ERROR&q
• What is Dependency Property
• how to disallow free-form entry in prope
• How to pass parameters from workflow to
• Switch ... case workflow
• Opening a derived workflow in workflow d
• Confusing statement in MSDN article on WWF
• How to determine if WorkflowInstance is
• Saving data with SqlPersistance
• How to finish the Rollback operation?
• SetState - how to create a Role Based one?
• WinWf, SharePoint and OnActivated
• Problems with Rehosting work flow design

Hot Articles

• Beta2 Workflow Error
• Where do I get WCF Activities
• Problem with CallExternalMethodActivity
• WWF and MS CRM
• Workflow instance does not exists
• avoid an activity to be removed
• How one can create workflow project?
• Windows Workflow and .net Frustration
• Issue loading & resuming an unloaded
• How to troubleshoot custom designer for
• Where's the beef? (actually, the runtime
• Problem getting started
• SharedConnectionWorkflowCommitWorkBatchS
• Labs\Lab01\Resources
• How return the parameter back to the hos

Recommend Articles

• Dynamically load policyActivity ruleSet
• Problems defragmenting
• Sequential workflow 'caches' event
• Setting return value for List<string&
• Samples
• Using Dynamic rules in workflow
• Hiding workflow tabs (Exceptions, events
• Converting SqlServer related workflow se
• Workflow designer
• Problem with Tutorial - Creating a Seque
• Creating a workflow instance using a com
• Replicator Nested inside While Loop
• Interrupt State execution in State Machi
• SqlTrackingQuery comments and questions
• Unable to load persistent Workflows into