PrepAway - Latest Free Exam Questions & Answers

Category: 70-504

Exam 70-504: TS: Microsoft .NET Framework 3.5 – Workflow

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 has the following features:

It implements the IEventActivity interface.
It implements the CreateWorkflowQueue method that configures and returns a WorkflowQueue object.

The Subscribe method of the custom activity receives the following parameters:

An ActivityExecutionContext parameter named parentContext An IActivityEventListener<QueueEventArgs> parameter named parentEventHandler

You need to use a WorkflowQueue object to implement the Subscribe method.

Which code segment should you use?

Which line of code should you use?

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application uses a sequential workflow.

The host application creates a workflow instance and stores it in a variable named instance. When the workflow is executed, a business requirement requires the workflow execution to pause for a few minutes.
The host uses the following code segment.

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

You need to ensure that the following requirements are met:

The workflow execution is temporarily paused.
The workflow state is preserved in memory.

Which line of code should you use?

Which code segment should you insert at line 05?

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

You use the state machine workflow in the application. You plan to implement a mechanism that allows a host application to query a state machine workflow instance that is currently executing.

You write the following code segment. (Line numbers are included for reference only.)

01 WorkflowRuntime runtime = new WorkflowRuntime();
02 WorkflowInstance instance =
03 runtime.CreateWorkflow(typeof(Workflow1));
04 instance.Start();
You need to identify the current state of the workflow.

Which code segment should you insert at line 05?

Which code segment should you use?

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.

<SequentialWorkflowActivity
x:Class="ProcessNewCustomer" Name="ProcessCustomer" xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/workflow"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</SequentialWorkflowActivity>

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

Which code segment should you use?

Which code segment should you use?

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. A Windows Forms application functions as the workflow host by using the DefaultWorkflowSchedulerService. You create a WorkflowRuntime instance in the Load event of the forms. You also subscribe to the WorkflowCompleted event. You need to ensure that the application displays the message in the Label control named lblStatus when the WorkflowCompleted event is raised.
Which code segment should you use?

Which activity should you insert in each branch?

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application uses a sequential workflow. You add an instance of the ParallelActivity class to the workflow to execute two activities simultaneously. The logic for simultaneous execution requires the activities to access a shared variable named count. You need to ensure that the branches of the ParallelActivity class execute until they are complete before the next branch commences.
Which activity should you insert in each branch?

Which code segment should you insert at line 03?

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

The application has a class named Order. You have an external rules file that contains rules to be executed against instances of the Order class.

You write the following code segment. (Line numbers are included for reference only.)

01 RuleSet set;
02 //Deserialize MyRules.rules file and read it into the ruleset You need to validate the rule set before its execution.

Which code segment should you insert at line 03?

Which code segment should you insert at line 01?

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

The application has a workflow that has a property named Discount.

The workflow contains three rules named RuleA, RuleB, and RuleC.

The RuleA rule has the following expression: "IF this.Discount > 10 THEN this.Discount = 10"

The RuleB rule has the following expression: "IF this.OrderAmount > 2000 THEN this.IncreaseDiscountBy(10) "

The RuleC rule has the following expression: "IF this.Items.Count > 10 THEN this.IncreaseDiscountBy(5)"

The rules have the same priority and the rule set uses Full Chaining.

You write the following code segment for the workflow. (Line numbers are included for reference only.) 02 private void IncreaseDiscountBy(int amt)
03 {
04 Discount += amt;
05 }

You need to ensure that the RuleA rule is re-evaluated after the execution of the RuleB rule or the RuleC rule.

Which code segment should you insert at line 01?

Which code segment should you insert at line 06?

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

Your application has a workflow named OrderWorkflow that has a rule set named OrderRuleSet.

You write the following code segment. (Line numbers are included for reference only.)

01 WorkflowRuntime workflowRuntime = new WorkflowRuntime(); 02 WorkflowInstance instance = workflowRuntime.CreateWorkflow(typeof(OrderWorkflow)); 03 Activity wfDefinition = instance.GetWorkflowDefinition(); 04 WorkflowChanges changes = new WorkflowChanges(wfDefinition); 05 CompositeActivity transientWf = changes.TransientWorkflow; You need to read the current definition of the OrderRuleSet rule set.

Which code segment should you insert at line 06?


Page 5 of 9« First...34567...Last »