(SequentialWorkflowActivity)OnEvent -> context.CloseActivity()

Hellow, everybody.

I have the follow activity:

publicpartialclassWorkflowActivity :SequentialWorkflowActivity,IActivityEventListener<ActivityExecutionStatusChangedEventArgs>

{..}

I'veRegistered For Status Change of some child-activities, but when the last activity had been closed, i've got the event (even if i haven't registered for it's status change). How can i recognize, that it is the last activity (haven't active childs) and i should callcontext.CloseActivity();

TIA,

Nikolay

[1087 byte] By [Anon.] at [2007-12-25]
# 1

One easy way is to iterate through the EnabledActivities collection and test the status of each activity. You'll want all of them to be closed in order to close your own activity.

If you want more information about how the activity closed, you can check the ActivityExecutionResult to see if it completed successfully, faulted, etc.

Matt

MattMilner-Pluralsight at 2007-9-3 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified