Windows Workflow Foundation MCQs

Windows Workflow Foundation MCQs

Answer these Windows Workflow Foundation MCQs and assess your grip on the subject of Windows Workflow Foundation.
Scroll below and get started!

1:

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application is a high-volume shopping cart system that processes over 100,000 transactions every day. The application tracks workflows by using the SqlTrackingService class. The application must partition data based on a 24-hour period. You need to configure the tracking service.

What should you do?


A.  

In the code segment used to create the SqlTrackingService class, set the PartitionOnCompletion property to true.Execute the stored procedure named dbo.PartitionCompletedWorkflowInstances.


B.  

In the code segment used to create the SqlTrackingService class, set the PartitionOnCompletion property to true.Execute the stored procedure named dbo.SetPartitionInterval by passing the parameter value d.

C.  

In the app.config file, set the PartitionOnCompletion attribute of the SqlTrackingService class to false.Execute the stored procedure named dbo.PartitionCompletedWorkflowInstances.


D.  

In the app.config file, set the PartitionOnCompletion attribute of the SqlTrackingService class to true.Execute the stored procedure named


2:

You create a workflow host application by using Microsoft .NET Framework 3.5. You use Windows Workflow Foundation to create the application. You need to configure the workflow runtime to ensure that all the workflow instances run asynchronously. Which code segment should you use?


A.  

WorkflowRuntime();runtime.StartRuntime();DefaultWorkflowSchedulerService scheduler = new DefaultWorkflowSchedulerService();runtime.AddService(scheduler);WorkflowInstance instance = runtime.CreateWorkflow(typeof(CustomerWorkflow));instance.Start();

B.  

ManualWorkflowSchedulerService();runtime.AddService(scheduler);runtime.StartRuntime();WorkflowInstance instance = runtime.CreateWorkflow(typeof(CustomerWorkflow));instance.Start();

C.  

WorkflowRuntime();runtime.StartRuntime();ManualWorkflowSchedulerService scheduler = runtime.GetService();WorkflowInstance instance = runtime.CreateWorkflow(typeof(CustomerWorkflow));scheduler.RunWorkflow(instance.InstanceId);


D.  

WorkflowRuntime runtime = new WorkflowRuntime();runtime.StartRuntime();WorkflowInstance instance = runtime.CreateWorkflow(typeof(CustomerWorkflow));instance.Start();

3:

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5.

The application uses a markup-only workflow.

The workflow will also require the use of a code-beside file.

The following code fragment is implemented in XAML.

You need to create a class declaration to implement the custom code.

Which code segment should you use?


A.  

public partial class ProcessNewCustomer : SequentialWorkflowActivity{ // Class implementation code appears here.}


B.  

public class ProcessNewCustomer : SequentialWorkflowActivity{ // Class implementation code appears here.}

C.  

public partial class ProcessCustomer : SequentialWorkflowActivity{ // Class implementation code appears here.}


4:

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. You plan to use an exception logging strategy to log unhandled exceptions that occur in the workflow. You need to identify a logging strategy that works for Sequential workflows and state machineCbased workflows. Which strategy should you use?

A.  

Declare a global EventDrivenActivity activity named ExceptionOccurred and add a FaultHandlersActivity activity to it. Include a FaultHandlerActivity activity that matches the System.Exception type. Log the exception by using the CodeActivity activity.


B.  

Create a custom class derived from WorkflowRuntimeService that binds an event handler to the WorkflowAborted event of the WorkflowRuntime instance in the host application. Log the workflow inline.


C.  

Add a FaultHandlersActivity activity to the workflow and include a FaultHandlerActivity activity that matches the System.Exception type. Log the exception by using the CodeActivity activity.


D.  

Bind an event handler to the WorkflowTerminated event of the WorkflowRuntime instance in the host application. Log the exception inline.


5:

You are creating a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. You add five WebServiceInputActivity activities to the workflow. You need to ensure that the workflow starts each time a client calls the workflow as a Web service method.

What should you do?


A.  

Set the Enabled property of all the WebServiceInputActivity activities to true. Set the IsActivating property of the first WebServiceInputActivity activity to true. Set the IsActivating property of the other WebServiceInputActivity activities to false.

B.  

Set the Enabled property of the first WebServiceInputActivity activity to false. Set the Enabled property of the other WebServiceInputActivity activities to true.

C.  

Set the Enabled property of the first WebServiceInputActivity activity to false. Set the IsActivating property of the first WebServiceInputActivity activity to true.

D.  

Set the Enabled property of the first WebServiceInputActivity activity to true. Set the Enabled property of the other WebServiceInputActivity activities to false.

6:

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application uses InvokeWebServiceActivity activities. You need to ensure that the application calls a logging module when a Web service call completes. What should you do?

A.  

Bind the StatusChanged event of the InvokeWebServiceActivity activity. If the current status is Compensating call the logging module from its event handler.


B.  

Bind the StatusChanged event of the InvokeWebServiceActivity activity. If the current status is Executing call the logging module from its event handler.

C.  

Bind an event handler to the Invoked event of the InvokeWebServiceActivity activity. Call the logging module from the event handler.


D.  

Bind an event handler to the Invoking event of the InvokeWebServiceActivity activity. Call the logging module from the event handler.


7:

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5.

The workflow must handle events raised by the application.

You create and compile the local communication contracts into an assembly.

You need to ensure that the application meets the following requirements:

Improves the design-time experience by using strong typing. Creates tightly-bound communication activities that correspond to the event parameters for the interface.

Which utility should you use?


A.  

The svcutil.exe utility

B.  

The xsd.exe utility


C.  

The wfc.exe utility


D.  

The wca.exe utility

8:

You are creating a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. You need to ensure that the application records event tracking information in the Windows Event Log. What should you do?

A.  

Derive one custom class each from the TrackingChannel class and the TrackingProfile class. Create an instance of the custom derived TrackingProfile class in the Send method. Write the tracking information to the Windows Event Log in the constructor of the custom class derived from the TrackingProfile class.

B.  

Derive one custom class each from the TrackingService class and the TrackingProfile class. Return the custom class derived from the TrackingProfile from the GetProfile method. Write the tracking information to the Windows Event Log in the constructor of the custom class derived from the TrackingProfile class.

C.  

Derive one custom class each from the TrackingService class and the TrackingChannel class. Return the custom class derived from the GetTrackingChannel method of the TrackingChannel class. Write the tracking information to the Windows Event Log in the GetProfile method.

D.  

Derive one custom class each from the TrackingService class and the TrackingChannel class. Return the custom class derived from the


9:

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application uses a sequential workflow. The workflow calls an external method to notify a list of users to carry out tasks. The list of users varies in size and composition from one workflow instance to another. The list is implemented as a string array. When a user completes a task, the host application raises a Task Completed event. You need to ensure that the users receive their notifications simultaneously. What should you do?

A.  

Set the While activity to loop through the entire string array.

B.  

Add the CallExternalMethodActivity and the HandleExternalEventActivity activities in a Replicator activity. Set the ExecutionType property of the Replicator activity to Sequence.


C.  

Add the CallExternalMethodActivity and the HandleExternalEventActivity activities in a Replicator activity. Set the ExecutionType property of the Replicator activity to Parallel.


D.  

Add a ParallelActivity activity to the workflow. Add branches to the activity such that the number of branches is equal to the number of persons to be notified. Add the CallExternalMethodActivity and the HandleExternalEventActivity activities to each branch.

10:

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application contains a state machine workflow. You need to ensure that the workflow can initialize variables before it enters the Processing Order state. What should you do?

A.  

Write the initialization code in an instance of the Code Activity class in the Processing Order state.

B.  

Create a new custom activity derived from the Code Activity class. Write the initialization code in the activity. Add the activity as the first activity in the Processing Order state.

C.  

Write the initialization code in a method in an external .NET Framework component. Invoke the component by using an instance of the CallExternalMethodActivity class in the Processing Order state.

D.  

Add an instance of the StateInitializationActivity class to the Processing Order state. Add an instance of the Code Activity class to the StateInitializationActivity class to perform the initialization.

11:

You are creating a Windows Workflow Foundation custom activity class named SmtpActivity by using Microsoft .NET Framework 3.5. You create an activity designer named SmtpActivityDesigner for the custom activity. You need to ensure that the Microsoft Visual Studio 2008 designer for Windows Workflow Foundation invokes the SmtpActivityDesigner designer each time the custom activity is placed in the workflow designer window. What should you do?

A.  

[ActivityDesignerTheme(typeof(SmtpActivity))]


B.  

[ActivityDesignerTheme(typeof(SmtpActivityDesigner))]


C.  

Place the following attribute on the SmtpActivityDesigner class. [Designer(typeof(SmtpActivity))]


D.  

Place the following attribute on the SmtpActivity class. [Designer(typeof(SmtpActivityDesigner))]

12:

You are creating a workflow by using Microsoft .NET Framework 3.5. You use Windows Workflow Foundation to create the workflow. You need to create a custom activity for the workflow that must not manage any child activity. Which base class should you use?

A.  

System.Workflow.Activities.StateActivity

B.  

System.Workflow.ComponentModel.Activity

C.  

System.Workflow.Activities.SequenceActivity


D.  

System.Workflow.Activities.SequentialWorkflowActivity

13:

You are creating a Windows Workflow Foundation custom activity by using Microsoft .NET Framework 3.5. The workflow has an event-based activity that waits for an item to arrive in a workflow queue. You need to ensure that the workflow queue is available for local services before the custom activity is executed. What should you do?

A.  

Override the Initialize method. Create and register the queue in the implementation of the Initialize method.

B.  

Override the InitializeProperties method. Create and register the queue in the implementation of the InitializeProperties method.

C.  

Provide a default constructor for the custom activity. Create and register the queue in the implementation of the constructor.

D.  

Override the OnWorkflowChangesCompleted method. Create and register the queue in the implementation of the OnWorkflowChangesCompleted method.

14:

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. You need to ensure that the workflow is able to correct previously completed work in the event of a downstream failure. What should you do?


A.  

Place the workflow logic in a TransactionScopeActivity activity. Set the IsolationLevel property to ReadUncommitted. Set the TimeoutDuration property long enough to ensure the transaction does not time out or set the TimeoutDuration property to 0 for an infinite timeout.

B.  

Place the workflow logic in a CompensatableTransactionScopeActivity activity. Set the IsolationLevel property to ReadUncommitted. Set the TimeoutDuration property long enough to ensure that the transaction does not time out or set the TimeoutDuration property to 0 for an infinite timeout.

C.  

Place the workflow logic in a CompensatableSequenceActivity activity. Implement the logic to undo the original steps in the compensation handler. Execute a CompensateActivity activity after an error occurs.

D.  

Place the workflow logic in a SequenceActivity activity. Implement the logic to undo the original steps in the fault handler of the workflow.

15:

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application uses a sequential workflow that contains five activities. You need to configure the workflow to continue processing even if an activity throws an error. What should you do?

A.  

Place the potentially offending activities in a SequenceActivity activity. Add one or more FaultHandlerActivity instances to the FaultHandlersActivity instance of the SequenceActivity activity. Ensure that the FaultHandlerActivity instances catch the System.Exception class.

B.  

Use the SequentialWorkflowActivity instance of the FaultHandlersActivity activity to add one or more instances of the FaultHandlerActivity activity. Ensure that one of the FaultHandlerActivity instances catches the System.Exception class.

C.  

Place the potentially offending activities in a TransactionScope activity. Set the IsolationLevel property of the TransactionScope activity to Serializable.

D.  

Subscribe to the WorkflowTerminated event in the host to capture errors thrown by workflow instances.