Which code segment should you use?

You are creating a Windows Workflow Foundation custom activity by using Microsoft .NET Framework 3.5.
The custom activity is derived from the System.Workflow.ComponentModel.CompositeActivity class.

The custom activity will manage one or more child activities.

You need to ensure that the custom activity performs the following tasks:

Runs each child activity exactly once.
Runs all the child activities in parallel.

Which code segment should you use?

You are creating a Windows Workflow Foundation custom activity by using Microsoft .NET Framework 3.5.
The custom activity is derived from the System.Workflow.ComponentModel.CompositeActivity class.

The custom activity will manage one or more child activities.

You need to ensure that the custom activity performs the following tasks:

Runs each child activity exactly once.
Runs all the child activities in parallel.

Which code segment should you use?

A.
protected override ActivityExecutionStatus Execute( ActivityExecutionContext context){ foreach
(Activity activity in EnabledActivities) { activity.Closed += activity_Closed; context.ExecuteActivity(activity); } return ActivityExecutionStatus.Closed;}

B.
protected override ActivityExecutionStatus Execute( ActivityExecutionContext context){ foreach (Activity activity in EnabledActivities) { activity.Closed += activity_Closed; context.ExecuteActivity(activity); } return ActivityExecutionStatus.Executing;}

C.
protected override ActivityExecutionStatus Execute( ActivityExecutionContext context){ foreach (ActivityExecutionContext childContext in context.ExecutionContextManager.ExecutionContexts) { childContext.Activity.Closed += activity_Closed; context.ExecuteActivity(childContext.Activity); } return ActivityExecutionStatus.Executing;}

D.
protected override ActivityExecutionStatus Execute( ActivityExecutionContext context){ foreach (ActivityExecutionContext childContext in context.ExecutionContextManager.ExecutionContexts) { childContext.Activity.Closed += activity_Closed; context.ExecuteActivity(childContext.Activity); } return ActivityExecutionStatus.Closed;}



Leave a Reply 0

Your email address will not be published. Required fields are marked *