TS: Microsoft .NET Framework 3.5 -C Windows Workflow Foundation:70-504VB
科目编号:70-504VB
科目名称:TS: Microsoft .NET Framework 3.5 -C Windows Workflow Foundation
描述:
70-504VB 考试是 Microsoft 公司的 TS: Microsoft .NET Framework 3.5 -C Windows Workflow Foundation 认证考试官方代号,kaoccna 的 70-504VB 权威考试题库软件是 Microsoft 认证厂商的授权产品,kaoccna 绝对保证顺利通过,否则承诺全额退款!
TS: Microsoft .NET Framework 3.5 -C Windows Workflow Foundation 认证作为全球IT领域专家 Microsoft 热门认证之一,是许多大中 IT 企业选择人才标准的必备条件。 如果你正在准备 70-504VB 考试,为 Microsoft TS: Microsoft .NET Framework 3.5 -C Windows Workflow Foundation认证做最后冲刺,又苦于没有绝对权威的考试真题模拟
mcsepass 实行"一次不过全额退款"承诺。如果您购买我们 70-504VB 的考题,只要不是首次通过,凭盖有 PROMETRIC 或 VUE 考试中心钢印的考试成绩单,我们将退还您购买 70-504VB 考题大师的全部费用,绝对保证您的利益不受到任何的损失。
- 科目: 70-504VB
- 原价:
¥ 462.00 - 现价: ¥ 397.00
kaoccna 的优势
70-504VB 试题的质量和价值
mcsepass 模拟测试题具有最高的专业技术含量,只供具有相关专业知识的专家和学者学习和研究之用。
100% 保证您通过 70-504VB 的考试
如果你使用 mcsepass 模拟测试,我们将保证你的第一次参加考试即取得成功,否则,我们将全额退款!
试用后再购买
mcsepass 提供每种产品免费测试。在您决定购买之前,请检测联接,可能存在的问题及试题质量和适用性。
kaoccna认证考试题库网专业提供 Microsoft 70-504VB 最新题库下载,完全覆盖 mcsepass 考试原题。
部分考题展示
Exam : Microsoft 70-504VB
Title : TS: Microsoft .NET Framework 3.5 -C Windows Workflow Foundation
1. You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5.
The application uses a code-only workflow. You define the workflow logic by programmatically adding activities.
You write the following code segment.
Partial Public NotInheritable Class Workflow1
Inherits SequentialWorkflowActivity
...
End Class
You also write the following code segment to add a DelayActivity activity to a workflow.
Me.CanModifyActivities = True
Dim delay As New DelayActivity()
delay.TimeoutDuration = New TimeSpan(0, 0, 5)
Me.Activities.Add(delay)
Me.CanModifyActivities = False
You need to insert the DelayActivity activity code segment at the correct location in the workflow.
What should you do?
A. Place the following code segment in the class constructor.
Public Sub New()
...
End Sub
B. Use the following code segment to override the InitializeProperties method.
Protected Overrides Sub InitializeProperties()
...
End Sub
C. Use the following code segment to override the Execute method.
Protected Overrides Function Execute(ByVal executionContext _
As ActivityExecutionContext) As ActivityExecutionStatus
...
End Function
D. Override the Initialize method in the following manner.
Protected Overrides Sub Initialize(ByVal provider As IServiceProvider)
Dim activity As IServiceProvider = Nothing
MyBase.Initialize(activity)
...
End Sub
Answer: A
2. You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5.
The application uses a workflow host that runs in a console application. The workflow runtime uses the default threading behavior.
You plan to attach the workflow runtime to two events. You write the following code segment to handle the events.
Private Shared Sub runtime_WorkflowCompleted(ByVal _
sender As Object, ByVal e As _
WorkflowCompletedEventArgs)
waitHandle.Set()
End Sub
You also define the class fields in the following manner.
Private Shared waitHandle As AutoResetEvent = Nothing
Private Shared runtime As New WorkflowRuntime()
You write the following code segment in the Main method of the console application.
01 AddHandler runtime.WorkflowCompleted, AddressOf _
02 runtime_WorkflowCompleted
03 Dim wi As WorkflowInstance = _
04 runtime.CreateWorkflow(GetType(MyWorkflow))
05
You need to ensure that the console application does not exit before the workflow instance completes execution.
Which code segment should you insert at line 05?
A. waitHandle = New AutoResetEvent(False)
waitHandle.WaitOne()
wi.Start()
B. waitHandle = New AutoResetEvent(True)
wi.Start()
waitHandle.WaitOne()
C. waitHandle = New AutoResetEvent(False)
wi.Start()
waitHandle.WaitOne()
D. waitHandle = New AutoResetEvent(True)
waitHandle.WaitOne()
wi.Start()
Answer: C
3. A windows application invokes a workflow that performs complex calculations. When the calculation is done, the workflow returns the calculated value to the windows application, which must display the calculated value in a textbox control, as follows:
pubic sub showData(value as string)
mytextBox.Text = value
End Sub
You need to ensure the workflow updates the value in the textbox control.
What should you do?
A. Have the workflow directly call ShowData() method.
B. Have the workflow call a method in an interface decorated with an
<ExternalDataExchange()> attribute that invokes the ShowData() method directly
C. Set the workflow to call a method in an interface decorated with an <ExternalDataEventArg()> attribute that invokes the ShowData() method directly
D. Set the workflow to call a method in a interface decorated with an <ExternalDataExchange()> attribute that invokes the ShowData() method indirectly through a delegate if the this.InvokedRequired condition is true.
Answer: D
4. You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application uses a sequential workflow as shown in the following exhibit. (Click the Exhibit button for the sequential workflow image.)
The workflow implements an if condition as shown in the following exhibit. (Click the Exhibit button for the if condition image.)
A new business policy requires the application to check if the amount is less than 15,000 instead of the current default.
You write the following code segment in the host application. (Line numbers are included for reference only.)
01 Dim newAmount As Int32 = 15000
02 Dim workflowchanges As _
03 New WorkflowChanges(instance.GetWorkflowDefinition())
04 Dim transient As CompositeActivity = _
05 workflowchanges.TransientWorkflow
06 Dim ruleDefinitions As RuleDefinitions = CType( _
07 transient.GetValue(ruleDefinitions. _
08 RuleDefinitionsProperty), RuleDefinitions)
09 Dim conditions As RuleConditionCollection = _
10 ruleDefinitions.Conditions
11
12 TryCast(condition1.Expression, _
13 CodeBinaryOperatorExpression).Right = _
14 New CodePrimitiveExpression(newAmount)
15 instance.ApplyWorkflowChanges(workflowchanges)
You need to build a host application that modifies the condition according to the business requirement in workflow instances that are currently executing.
Which code segment should you insert at line 11?
A. Dim condition1 As RuleExpressionCondition = _
CType(conditions("Check"), RuleExpressionCondition)
B. Dim condition1 As RuleExpressionCondition = _
CType(conditions("ifElseBranch1"), _
RuleExpressionCondition)
C. Dim condition1 As RuleExpressionCondition = _
CType(conditions("ifElseBranch2"), _
RuleExpressionCondition)
D. Dim condition1 As RuleExpressionCondition = _
CType(conditions("Declarative Rule Condition"), _
RuleExpressionCondition)
Answer: A
5. You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application contains a sequential workflow.
A new business policy requires the workflow to execute all the activities except the POCreated activity.
You write the following code segment in the host application. (Line numbers are included for reference only.)
01 Dim instanceId As Guid = Guid.NewGuid()
02 Dim runtime As New WorkflowRuntime()
03 Dim workflowInstance As WorkflowInstance = _
04 runtime.GetWorkflow(instanceId)
05 Dim wRoot As Activity = _
06 workflowInstance.GetWorkflowDefinition()
07
The variable instanceId contains the ID of the workflow.
You need to ensure that the new business policy is applied.
Which code segment should you insert at line 07?
A. Dim changes As New WorkflowChanges(wRoot)
Dim POCreated As Activity = _
workflowInstance.GetWorkflowDefinition()
changes.TransientWorkflow.Activities.Remove(POCreated)
workflowInstance.Load()
B. Dim changes As New WorkflowChanges(wRoot)
Dim POCreated As Activity = _
changes.TransientWorkflow.Activities("POCreated")
changes.TransientWorkflow.Activities.Remove(POCreated)
workflowInstance.ApplyWorkflowChanges(changes)
C. workflowInstance.Unload()
Dim changes As New WorkflowChanges(wRoot)
Dim POCreated As Activity = _
changes.TransientWorkflow.Activities("POCreated")
changes.TransientWorkflow.Activities.Remove(POCreated)
workflowInstance.Load()
D. workflowInstance.Suspend("removing activity")
Dim changes As New WorkflowChanges(wRoot)
Dim POCreated As Activity = _
changes.TransientWorkflow.Activities("POCreated")
changes.TransientWorkflow.Activities.Remove(POCreated)
workflowInstance.Load()
Answer: B
6. You use a built-in tracking service to track specific workflow parameters.
You need to check whether the workflow parameters have been stored in the tracking database.
What should you do? (Each correct answer presents part of a solution. Choose two.)
A. Display the contents of the WorkflowInstance table of the tracking database.
B. Include the SqlTrackingQuery class in a code segment to retrieve tracked workflows and SqlTrackingWorkflowInstance class to inspect them.
C. Use the ActivityTrackingLocation class to determine if the value has been set to a database.
D. Display the contents of the TrackingDataItem table of the tracking database.
Answer: BD
7. 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.
Dim amount As Integer = 10
Dim runtime As New WorkflowRuntime()
Dim instance As WorkflowInstance = _
runtime.CreateWorkflow(GetType(DynamicUpdateWorkflow))
instance.Start()
Dim smwi As 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.)
A. If amount >= 1000 Then
smwi.SetState("HighValueState")
else
smwi.SetState("LowValueState")
End If
B. If amount >= 1000 Then
smwi.StateMachineWorkflow.SetValue _
(DynamicUpdateWorkflow.StatusProperty, "HighValueState")
else
smwi.StateMachineWorkflow.SetValue _
(DynamicUpdateWorkflow.StatusProperty, "LowValueState")
End If
C. If amount >= 1000 Then
instance.GetWorkflowDefinition().SetValue
(DynamicUpdateWorkflow.StatusProperty, "HighValueState")
else
instance.GetWorkflowDefinition().SetValue
(DynamicUpdateWorkflow.StatusProperty, "LowValueState")
End If
D. If amount >= 1000 Then
Dim high As StateActivity = _
CType(smwi.StateMachineWorkflow.Activities("HighValueState"), _
StateActivity)
smwi.SetState(high)
else
Dim low As StateActivity = _
CType(smwi.StateMachineWorkflow.Activities("LowValueState"), _
StateActivity)
smwi.SetState(low)
End If
Answer: AD
8. 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. Dim runtime As New WorkflowRuntime()
runtime.StartRuntime()
Dim instance As WorkflowInstance = _
runtime.CreateWorkflow(GetType(CustomerWorkflow))
instance.Start()
B. Dim runtime As New WorkflowRuntime()
runtime.StartRuntime()
Dim scheduler As ManualWorkflowSchedulerService = _
runtime.GetService(Of ManualWorkflowSchedulerService)()
Dim instance As WorkflowInstance = _
runtime.CreateWorkflow(GetType(CustomerWorkflow))
scheduler.RunWorkflow(instance.InstanceId)
C. Dim runtime As New WorkflowRuntime()
Dim scheduler As New ManualWorkflowSchedulerService()
runtime.AddService(scheduler)
runtime.StartRuntime()
Dim instance As WorkflowInstance = _
runtime.CreateWorkflow(GetType(CustomerWorkflow))
instance.Start()
D. Dim runtime As New WorkflowRuntime()
runtime.StartRuntime()
Dim scheduler As New DefaultWorkflowSchedulerService()
runtime.AddService(scheduler)
Dim instance As WorkflowInstance = _
runtime.CreateWorkflow(GetType(CustomerWorkflow))
instance.Start()
Answer: A
9. You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application uses a sequential workflow as shown in the following exhibit. (Click the Exhibit button.)
A new business policy specifies that the approval of the manager and the vice president must be obtained for certain work processes.
You write the following code segment in the host application. (Line numbers are included for reference only.)
01 Dim wid As Guid = Guid.NewGuid()
02 Dim runtime As New WorkflowRuntime()
03 Dim workflowInstance As WorkflowInstance = _
04 runtime.GetWorkflow(wid)
05 Dim vpapp As New VPApproval()
06 Dim workflowInstanceDef As Activity = _
07 workflowInstance.GetWorkflowDefinition()
08 Dim changesToMake As _
09 New WorkflowChanges(workflowInstanceDef)
10
You need to modify a particular instance of the workflow at runtime by adding the vpApproval activity to the TrueBranch activity.
Which code segment should you insert at line 10?
A. Dim ifelse As CompositeActivity = _
TryCast(changesToMake.TransientWorkflow.Activities( _
"IfAmountMoreThan5000"), CompositeActivity)
ifelse.Activities.Add(vpapp)
workflowInstance.ApplyWorkflowChanges(changesToMake)
B. Dim ifelse As CompositeActivity = _
TryCast(changesToMake.TransientWorkflow.Activities( _
"TrueBranch"), CompositeActivity)
changesToMake.TransientWorkflow.Activities.Add(vpapp)
workflowInstance.ApplyWorkflowChanges(changesToMake)
C. Dim ifelse As CompositeActivity = _
TryCast(changesToMake.TransientWorkflow.Activities( _
"IfAmountMoreThan5000"), CompositeActivity)
Dim trueBranch As CompositeActivity = _
TryCast(ifelse.Activities("TrueBranch"), _
CompositeActivity)
trueBranch.Activities.Add(vpapp)
workflowInstance.ApplyWorkflowChanges(changesToMake)
D. Dim ifelse As CompositeActivity = _
TryCast(changesToMake.TransientWorkflow.Activities( _
"IfAmountMoreThan5000"), CompositeActivity)
Dim trueBranch As CompositeActivity = _
TryCast(ifelse.Activities("TrueBranch"), _
CompositeActivity)
changesToMake.TransientWorkflow.Activities.Add(vpapp)
workflowInstance.ApplyWorkflowChanges(changesToMake)
Answer: C
10. You are writing a sequential console workflow that consists of a delay activity and a code activity, as shown in the exhibit. (Click the Exhibit button for the sequential console workflow image.)
In the execution code of the second activity, you try to modify the workflow as follows:
Private Sub delayActivity_InitializeTimeoutDuration(ByVal sender As System.Object, ByVal e As System.EventArgs)
Console.Title = "Modifiability of a Workflow"
Console.WriteLine("Wait ...")
End Sub
Private Sub codeActivity_ExecuteCode(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim delay As DelayActivity = CType(sender, DelayActivity)
Console.WriteLine(delay.Name)
Dim workflowChanges As New WorkflowChanges(Me)
Dim codeActivity As New CodeActivity()
codeActivity.Name = "codeActivity2"
AddHandler codeActivity.ExecuteCode, AddressOf Me.codeActivity2_ExecuteCode
workflowChanges.TransientWorkflow.Activities.Add(codeActivity)
Me.ApplyWorkflowChanges(workflowChanges)
End Sub
Private Sub codeActivity2_ExecuteCode(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim codeActivity As CodeActivity = CType(sender, CodeActivity)
Console.WriteLine(codeActivity.Name)
Console.ReadLine()
End Sub
You also have set the modifiability of the workflow to a code condition that is set to the following function:
Private Sub UpdateCondition(ByVal sender As System.Object, ByVal e As ConditionalEventArgs)
if (TimeSpan.Compare(Me.delayActivity.TimeoutDuration, New TimeSpan(0, 0, 5)) > 0) Then
e.Result = False
else
e.Result = True
End If
End Sub
Which code segment should you use to handle the exception?
A. workflowChanges.TransientWorkflow.Activities.Add(codeActivity)
Try
Me.ApplyWorkflowChanges(workflowChanges)
Catch ex As ArgumentOutOfRangeException
Console.WriteLine(ex.GetType().ToString())
Console.ReadLine()
End Try
B. workflowChanges.TransientWorkflow.Activities.Add(codeActivity)
Try
Me.ApplyWorkflowChanges(workflowChanges)
Catch ex As InvalidProgramException
Console.WriteLine(ex.GetType().ToString())
Console.ReadLine()
End Try
C. workflowChanges.TransientWorkflow.Activities.Add(codeActivity)
Try
Me.ApplyWorkflowChanges(workflowChanges)
Catch ex As InvalidOperationException
Console.WriteLine(ex.GetType().ToString())
Console.ReadLine()
End Try
D. workflowChanges.TransientWorkflow.Activities.Add(codeActivity)
Try
Me.ApplyWorkflowChanges(workflowChanges)
Catch ex As OverflowException
Console.WriteLine(ex.GetType().ToString())
Console.ReadLine()
End Try
Answer: C
11. You create an application in which users design simple sequential workflows. The designs are stored as XOML in a SQL database. You need to start one of these sequential workflows from within your own workflow.
What should you do?
A. Include a custom activity with a code segment that includes an invocation to the CreateWorkflow method of the WorkflowRuntime class and then starts the workflow. The signature of the CreateWorkflow method invoked uses only the workflowType parameter.
B. Include a custom activity with a code segment that includes an invocation to the CreateWorkflow method of WorkflowRuntime class and then starts the workflow. The signature of the CreateWorkflow method invoked uses only the XmlReader and workflowDefinitionReader parameters.
C. Include a custom activity with a code segment that includes an invocation to the CreateWorkflow method of the WorkflowRuntime class and then starts the workflow. The signature of the CreateWorkflow method invoked uses only the workflowType, Dictionary<string,Object> namedArgumentValues, and Guid instanceId parameters.
D. Include and configure an InvokeWorkflow activity
Answer: B
12. You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3. 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 Dim runtime As New WorkflowRuntime()
02 Dim instance As WorkflowInstance = _
03 runtime.CreateWorkflow(GetType(Workflow1))
04 instance.Start()
05
You need to identify the current state of the workflow.
Which code segment should you insert at line 05?
A. Dim currentstate As String = instance.GetWorkflowDefinition().ToString
B. Dim currentstate As String = _
instance.GetWorkflowDefinition().ExecutionStatus.ToString
C. Dim smwi As New StateMachineWorkflowInstance(runtime, _
instance.InstanceId)
Dim currentstate As String = smwi.StateHistory(0)
D. Dim smwi As New StateMachineWorkflowInstance(runtime, _
instance.InstanceId)
Dim currentstate As String = smwi.CurrentStateName
Answer: D
13. 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?
A. Dim runtime As New WorkflowRuntime()
Dim processOrders As New ProcessOrders()
processOrders.EmployeeID = "NBK"
Dim instance As WorkflowInstance = _
runtime.CreateWorkflow(GetType(ProcessOrders))
B. Dim runtime As New WorkflowRuntime()
Dim processOrders As New ProcessOrders()
processOrders.SetValue( _
processOrders.EmployeeIDProperty, "NBK")
Dim instance As WorkflowInstance = _
runtime.CreateWorkflow(GetType(ProcessOrders))
C. Dim runtime As New WorkflowRuntime()
Dim dict As Dictionary(Of String, Object) = _
New Dictionary(Of String, Object)()
dict.Add("EmployeeID", "NBK")
Dim instance As WorkflowInstance = _
runtime.CreateWorkflow(GetType(ProcessOrders), dict)
D. Dim runtime As New WorkflowRuntime()
Dim dict As Dictionary(Of String, Object) = _
New Dictionary(Of String, Object)()
dict.Add("EmployeeIDProperty", "NBK")
Dim instance As WorkflowInstance = _
runtime.CreateWorkflow(GetType(ProcessOrders), dict)
Answer: C
14. You create a Windows Workflow Foundation application by using Microsoft .NET Framework 3.5. The application uses a sequential workflow as shown in the following exhibit. (Click the Exhibit button.)
A new business policy specifies that the approval of the manager and the vice president must be obtained for certain work processes.
You write the following code segment in the host application. (Line numbers are included for reference only.)
01 WorkflowRuntime runtime = new WorkflowRuntime();
02 WorkflowInstance workflowInstance =
03 runtime.GetWorkflow(wid);
04 VPApproval vpapp = new VPApproval();
05 Activity workflowInstanceDef =
06 workflowInstance.GetWorkflowDefinition();
07 WorkflowChanges changesToMake =
08 new WorkflowChanges(workflowInstanceDef);
09
You need to modify a particular instance of the workflow at runtime by adding the vpApproval activity to the TrueBranch activity.
Which code segment should you insert at line 09?
A. CompositeActivity ifelse =
changesToMake.TransientWorkflow.Activities["IfAmountMoreThan5000"]
as CompositeActivity;
ifelse.Activities.Add(vpapp);
workflowInstance.ApplyWorkflowChanges(changesToMake);
B. CompositeActivity ifelse =
changesToMake.TransientWorkflow.Activities["TrueBranch"]
as CompositeActivity;
changesToMake.TransientWorkflow.Activities.Add(vpapp);
workflowInstance.ApplyWorkflowChanges(changesToMake);
C. CompositeActivity ifelse =
changesToMake.TransientWorkflow.Activities["IfAmountMoreThan5000"]
as CompositeActivity;
CompositeActivity trueBranch =
ifelse.Activities["TrueBranch"] as CompositeActivity;
trueBranch.Activities.Add(vpapp);
workflowInstance.ApplyWorkflowChanges(changesToMake);
D. CompositeActivity ifelse =
changesToMake.TransientWorkflow.Activities["IfAmountMoreThan5000"]
as CompositeActivity;
CompositeActivity trueBranch = ifelse.Activities["TrueBranch"]
as CompositeActivity;
changesToMake.TransientWorkflow.Activities.Add(vpapp);
workflowInstance.ApplyWorkflowChanges(changesToMake);
Answer: C