Which code segment should you use?
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?
Which code segment should you use?
You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application uses a sequential workflow. The workflow is implemented in a class named ProcessOrders. The workflow contains a dependency property named EmployeeID. You need to ensure that the EmployeeID property is assigned a value when the host application tries to create a new workflow instance. Which code segment should you use?
What are the two possible code segments that you can use to achieve this goal?
You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application contains a state workflow.
You write the following code segment.
WorkflowRuntime runtime = new WorkflowRuntime();
WorkflowInstance instance = runtime.CreateWorkflow(
typeof(DynamicUpdateWorkflow));
instance.Start();
StateMachineWorkflowInstance smwi =
new StateMachineWorkflowInstance(runtime,
instance.InstanceId);
A dependency property named Status is defined in this workflow.
The value of a variable named amount is used to set the state of the workflow. You need to ensure that the host application changes the state of the workflow on the basis of the value of the amount variable.
What are the two possible code segments that you can use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
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 use?
You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application has a workflow named OrderWorkflow. The application also has a rule set named MyRules that is placed in the OrderWorkflow.rules file. You need to dynamically create a policy activity to reference the MyRules rule set. Which 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 class should you use?
You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. You need to create a RuleSet that evaluates whether a variable named OrderValue has a value greater than 500. Which class should you use?
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 configuration setting should you use?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You need to configure a single service endpoint with the following logical and physical addresses:
Logical: http://localhost:8080/internal
Physical: http://localhost:8080/examservice
Which configuration setting should you use?
Which structure will the data contract produce?
You create a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You define the following data contract.
[DataContract(Namespace="urn:Company.Project")]
public class Person {
[DataMember]
public string FirstName;
[DataMember]
public string LastName;
[DataMember]
public IList<Person> Children;
[DataMember(Name="DateOfBirth")]
public DateTime Birthday;
}
You need to identify the structure of the resulting XML instance document.
Which structure will the data contract produce?