PrepAway - Latest Free Exam Questions & Answers

Author: admin

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?

Which code segment should you insert at line 05?

You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5.
You plan to create a RuleSet class named ruleSet.

You write the following code segment in the RuleSet class.

Int32 age;
Boolean adult;

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

01 RuleSet ruleSet = new RuleSet();
02 Rule ageRule = new Rule("AgeRule");
03 CodeThisReferenceExpression thisRef =
04 new CodeThisReferenceExpression();
06 CodeBinaryOperatorExpression ageValueTest = new
07 CodeBinaryOperatorExpression();
08 ageValueTest.Left = ageRef;
09 ageValueTest.Operator =
10 CodeBinaryOperatorType.GreaterThanOrEqual;
11 ageValueTest.Right = new
12 CodePrimitiveExpression(18);
13 ageRule.Condition = new
14 RuleExpressionCondition(ageValueTest);
15 CodeAssignStatement ageRuleAction = new
16 CodeAssignStatement(adultValueRef, new
17 CodePrimitiveExpression(true));
18 ageRule.ThenActions.Add(new
19 RuleStatementAction(ageRuleAction));
20 ruleSet.Rules.Add(ageRule);

You need to add a rule that sets the value of the adult field to true if the value of the age field is greater than or equal to 18. You also need to assign the highest priority to this rule.

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 workflow contains a custom activity named CustomActivity. The custom activity meets the following requirements:

It overrides the Execute method.
It retrieves customer information.

You need to stop the workflow if the customer information cannot be retrieved.

Which code segment should you use?