protected override ActivityExecutionStatus Execute(ActivityExecutionContext context) { // execute the activity // ... // close the activity context.CloseActivity(); return ActivityExecutionStatus.Closed; }
protected override ActivityExecutionStatus Execute(ActivityExecutionContext context) { // execute the activity // ... // stop the activity context.CloseActivity("CustomStopReason"); return ActivityExecutionStatus.Faulting; }Package library: This method is included in the System.Workflow.ComponentModel.dll package library, which is part of the Windows Workflow Foundation (WF) framework.