在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。后来它会被推广。 –