在Windows工作流基礎序列工作流中,如何根據一定條件使用調用方法標籤?如何在XAML Windows工作流基礎中有條件地使用InvokeMethod
例如,
<Sequence>
<Sequence.Variables>
<Variable x:TypeArguments="x:String" Default="["this is an out param"]" Name="outParam" />
<Variable x:TypeArguments="x:Int32" Name="resultValue" />
<Variable x:TypeArguments="msi:TestClass" Default="[New TestClass()]" Name="varTestClass" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, s:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<WriteLine sap:VirtualizedContainerService.HintSize="299.663333333333,59.2766666666667" Text="["Instance method call"]" />
<InvokeMethod DisplayName="Instance Method Call" sap:VirtualizedContainerService.HintSize="299.663333333333,127.553333333333" MethodName="InstanceMethod1">
<InvokeMethod.TargetObject>
<InArgument x:TypeArguments="msi:TestClass">[New TestClass()]</InArgument>
</InvokeMethod.TargetObject>
</InvokeMethod>
<InvokeMethod DisplayName="Instance Method Call with Parameters" sap:VirtualizedContainerService.HintSize="299.663333333333,127.553333333333" MethodName="InstanceMethod">
<InvokeMethod.TargetObject>
<InArgument x:TypeArguments="msi:TestClass">[New TestClass()]</InArgument>
</InvokeMethod.TargetObject>
<InArgument x:TypeArguments="x:String">["My favorite number is"]</InArgument>
<InArgument x:TypeArguments="x:Int32">42</InArgument>
</InvokeMethod>
</Sequence>
想,我所說的上述活動,所有的調用方法將被觸發。
但是,什麼是需要的,是一樣的東西,
<Sequence>
<Sequence.Variables>
<Variable x:TypeArguments="x:String" Default="["this is an out param"]" Name="outParam" />
<Variable x:TypeArguments="x:Int32" Name="resultValue" />
<Variable x:TypeArguments="msi:TestClass" Default="[New TestClass()]" Name="varTestClass" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, s:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<WriteLine sap:VirtualizedContainerService.HintSize="299.663333333333,59.2766666666667" Text="["Instance method call"]" />
//If (stateArgument =="created")
//{
<InvokeMethod DisplayName="Instance Method Call" sap:VirtualizedContainerService.HintSize="299.663333333333,127.553333333333" MethodName="InstanceMethod1">
<InvokeMethod.TargetObject>
<InArgument x:TypeArguments="msi:TestClass">[New TestClass()]</InArgument>
</InvokeMethod.TargetObject>
</InvokeMethod>
//}
//else if(stateArguement == "running")
//{
<InvokeMethod DisplayName="Instance Method Call with Parameters" sap:VirtualizedContainerService.HintSize="299.663333333333,127.553333333333" MethodName="InstanceMethod">
<InvokeMethod.TargetObject>
<InArgument x:TypeArguments="msi:TestClass">[New TestClass()]</InArgument>
</InvokeMethod.TargetObject>
<InArgument x:TypeArguments="x:String">["My favorite number is"]</InArgument>
<InArgument x:TypeArguments="x:Int32">42</InArgument>
</InvokeMethod>
//}
</Sequence>
有人可以給一些知道如何去這件事嗎?
你手工編輯的.xaml文件? – Joao
是的,對於原型,我將手動編輯XAML。後來它會被推廣。 –