PrepAway - Latest Free Exam Questions & Answers

Category: 70-504

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

Which XML code segment should you use?

A custom activity defined in an assembly named LitwareActivities is defined as follows:

namespace LitwareActivities
{
public class WriteLineActivity : Activity
{
protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext) {
Console.WriteLine(Message);
return ActivityExecutionStatus.Closed;
}
private string _message;
public string Message
{
get { return _message; }
set { _message = value; }
}

}
}
You need to create a sequential workflow where the execution path can be generated on the fly by an application.

Which XML code segment should you use?

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 9 of 9« First...56789