Windows Workflow Foundation 3


Composite Event-based activity with finalization step


Hi All,I'm trying to develop an activity that would allow to 'intercept' (in the AOP sense) a method call, do some checks, execute some child activities (if any), and then finally make the call to the intercepted method ... which means this is both a Composite & IEventActivity.I feel that I cannot break this activity into smaller parts because this is the use-case I will have to deal most of the time.I've managed to merge the Composite & Event aspects properly but I don't know how / when / where to put the 'finalization' step of my custom activity, which is the actual call to the intercepted method.Any help would be greatly appreciated Stiiifff
Hi,
 
Not sure I got your question correctly, but if Activity returns ActivityExecutionStatus.Completed - it is completed. As far as you develop an activity, then you know when you return and you can call just before.
 
In a case you execute other activities in a chain (like sequential activity does), then eventually you have to call:     
executionContext.CloseActivity(); Then you can call your method right before this.
 
Thanks,
Konstantin.
Hi,
 
Not sure I got your question correctly, but if Activity returns ActivityExecutionStatus.Completed - it is completed. As far as you develop an activity, then you know when you return and you can call just before.
 
In a case you execute other activities in a chain (like sequential activity does), then eventually you have to call:     
executionContext.CloseActivity(); Then you can call your method right before this.
 
Thanks,
Konstantin.
In the Execute method of my custom activity, I delegate the execution of child activities to a 'SequenceHelper' class (which I have copied from System.Workflow.ComponentModel.SequenceHelper), which handles that job in an asynchronoys way ... which means I return 'ActivityExecutionStatus.Executing' from the Execute method, and wait for the SequenceHelper to finish the job then notify my activity back through a IActivityEventListener<QueueEventArgs>.OnEvent handler or, in case there aren't any child activities, return ActivityExecutionStatus.Closed directly from Execute method.So, I have 2 exit point for my activity ... I guess it should be ok to call my 'finalization' work from those 2 places, but I was just wondering if there were a better way to do that ... ?Thanks in advance,Stiiifff

Related Links

Error in the Hands on lab 09
Workflow Designer
How do you load XOML only State Workflow in WFPad for WWFBeta 2.2 (with namespace for codebehind assembly, and activities)?
invoke sub StateMachine workflow
Using WWF to model and support "Tech Trees" in RTS games
RuleConditionDialog and intellisense
Workflow Persistence & Event Arguments
PersistenceService - Transaction Timeout
SimpleExpenseReport
SQLTrackingQuery from Workflow
CreateWorkflow failing validation
xbox live mic help
download code samples of Microsoft press' windows workflow foundation step by step - Kenn Scribner
Advantage and disadvantage of ASP.NET WorkFl
When do activities CANCEL and How do i force activities to cancel state?
Windows workflow 4.0 persistent issues

Categories

MSDN
Microsoft Azure
Apps for Office and Sh...
Learning
Microsoft Robotics
Dynamics
Orchard
Archived Forums X-Z
Archived Forums
Skype for Business
Virtualization
Microsoft R
Forums Issues (not pro...
Visual Studio Editor
Visual Studio Code Vis...
AdSDK Integration & Ad...
Media Foundation Devel...
Application Security f...
Windows Imaging Compon...
Windows Desktop Ribbon...
SharePoint 2013 - Usin...
SharePoint 2013 - Search
SharePoint Legacy Vers...
Azure Storage
Azure Marketplace
Azure Cache
Azure DocumentDB
Azure Data Factory
StorSimple
Azure DevTest Labs
Azure Database for MySQL
.NET Framework Class L...
Team Foundation Server...
Team Foundation Server...
BizTalk Server General
ADO.NET Entity Framewo...
Partnering with Microsoft
SyncFx - General [Read...
Microsoft Robotics - C...
Microsoft Device Emulator
Transact-SQL
SQL Server Replication
SQL Server High Availa...
Getting started with S...
Power Pivot
SQL Server Data Tools
SQL Server 2012 PowerP...
SQL Server 2012 Analys...
Windows Forms General
Windows Live Messenger...
Project Customization ...
Microsoft Lync Client ...
Microsoft Lync Server ...
Silverlight 5
Visual Studio & Silver...
Expression Studio
Connected Services Fra...
Search Server: Install...
Retired SharePoint Col...
Project Standard and P...
.NET Framework 4: Wind...
Announcements about pr...
Building Windows Store...
Building Windows Store...
Casablanca
Commerce Server 2002 a...
Core Coding Experience...
Dryad, DSC, and DryadL...
Game Technologies: Aud...
Getting Started With V...
LINQ Project General
Multimap API Developme...
Office Live Small Busi...
Parallel Computing Gen...
Phoenix
Popfly Bugs and Sugges...
Regular Expressions
NUI API and Programmin...
Parallel Programming w...
Sharepoint Development...
Service Bus EAI & EDI ...
Surface Application De...
SQL Server 2014 High A...
SQL Server 2014 Self-S...
SQL Server 2014 Master...
SQL Server 2014 Integr...
Tailoring your Windows...
Visual C# Language
Visual C++ MFC and ATL
Visual Studio Code Ana...
Visual Studio Editor i...
Visual Studio Lab Mana...
Visual Studio Performa...
WCF Data Services (Pre...
Windows Live Controls ...
Windows Presentation F...
Working with Data in W...
XML in Windows (MSXML ...
Microsoft R Open
Cortana Skills Kit

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile