Je crée un FlowChart dans un projet Windows Workflow 4.0 dans Visual Studio 2010. J'ai ajouté un FlowSwitch
avec l'expression d'une variable passée en In Argument
au Activity
. Je peux déboguer et voir les valeurs sont passées correctement, cependant mon FlowSwitch ne passe pas du tout à un cas qui est défini comme la valeur transmise. J'ai défini le FlowSwitch allant à l'activité comme la valeur numérique que le In Argument
devrait être égal à. Y a-t-il quelque chose qui me manque?Windows Workflow 4.0 FlowSwitch ne fonctionne pas
Répondre
Un FlowSwitch fonctionne avec des valeurs de chaîne pour le moment. Essayez de convertir l'InArgument en chaîne.
Exemple XAML:
<p:Activity mc:Ignorable="" x:Class="WorkflowConsoleApplication2.Flowchart1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities/design" xmlns:__Flowchart1="clr-namespace:WorkflowConsoleApplication2;" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<p:Flowchart StartNode="{x:Reference __ReferenceID0}" sad:XamlDebuggerXmlReader.FileName="c:\temp\WorkflowConsoleApplication2\WorkflowConsoleApplication2\Flowchart1.xaml">
<WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, s:Object">
<av:Point x:Key="ShapeLocation">275,10</av:Point>
<av:Size x:Key="ShapeSize">50,50</av:Size>
<av:PointCollection x:Key="ConnectorLocation">300,60 300,110</av:PointCollection>
</scg:Dictionary>
</WorkflowViewStateService.ViewState>
<p:FlowSwitch x:Name="__ReferenceID0" Expression="["2"]">
<p:FlowSwitch.Default>
<p:FlowStep x:Name="__ReferenceID1">
<WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, s:Object">
<av:Point x:Key="ShapeLocation">235,293</av:Point>
<av:Size x:Key="ShapeSize">200,34</av:Size>
</scg:Dictionary>
</WorkflowViewStateService.ViewState>
<p:WriteLine>["Default"]</p:WriteLine>
</p:FlowStep>
</p:FlowSwitch.Default>
<WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, s:Object">
<av:Point x:Key="ShapeLocation">270,110</av:Point>
<av:Size x:Key="ShapeSize">60,60</av:Size>
<av:PointCollection x:Key="Default">300,170 285,170 285,283 335,283 335,293</av:PointCollection>
<av:PointCollection x:Key="1Connector">300,170 300,205 330,205</av:PointCollection>
<av:PointCollection x:Key="2Connector">300,170 300,180 290,180 290,270 340,270</av:PointCollection>
</scg:Dictionary>
</WorkflowViewStateService.ViewState>
<p:FlowStep x:Name="__ReferenceID2">
<x:Key>
<x:String>1</x:String>
</x:Key>
<WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, s:Object">
<av:Point x:Key="ShapeLocation">330,188</av:Point>
<av:Size x:Key="ShapeSize">200,34</av:Size>
</scg:Dictionary>
</WorkflowViewStateService.ViewState>
<p:WriteLine>["Its 1 "]</p:WriteLine>
</p:FlowStep>
<p:FlowStep x:Name="__ReferenceID3">
<x:Key>
<x:String>2</x:String>
</x:Key>
<WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, s:Object">
<av:Point x:Key="ShapeLocation">340,253</av:Point>
<av:Size x:Key="ShapeSize">200,34</av:Size>
</scg:Dictionary>
</WorkflowViewStateService.ViewState>
<p:WriteLine>["Its 2"]</p:WriteLine>
</p:FlowStep>
</p:FlowSwitch>
<x:Reference>__ReferenceID2</x:Reference>
<x:Reference>__ReferenceID3</x:Reference>
<x:Reference>__ReferenceID1</x:Reference>
</p:Flowchart>
</p:Activity>
J'ai essayé Argument.ToString et même codé en dur une chaîne "15000" et ça ne marche toujours pas. Des pensées? –
Cela fonctionne pour moi :-) Dans l'expression FlowSwitch j'ai entré "2" (y compris les guillemets) ou 2.ToString(). Dans le FlowStep j'ai entré 2 (sans guillemets car c'est une chaîne pas une expression.) Si j'ai ajouté le XAML que j'utilise à la publication originale – Maurice
J'ai reçu la bêta 2. Aujourd'hui, je n'apprécie pas vos efforts. –
- 1. Propriétés attachées dans Windows Workflow Foundation 4.0?
- 2. Le proxy ne fonctionne pas dans HttpClient 4.0 beta2
- 3. MSDeploy ne fonctionne pas
- 4. L'authentification Windows connexion sécurisée ne fonctionne pas
- 5. Workflow Sharepoint vs workflow Windows
- 6. Service .NET Windows ne fonctionne pas dans Windows Server 2008
- 7. Windows Workflow Foundation NullReferenceException
- 8. Windows Workflow foundatation scheduling
- 9. fastcgi ne fonctionne pas - wrapper déchargé ne fonctionne pas
- 10. Workflow Windows et infrastructure compacte
- 11. L'appel InitiateSystemShutdown ne fonctionne pas
- 12. L'applet JavaFX ne fonctionne pas
- 13. Jmap ne fonctionne pas sous Windows Server 2003
- 14. Python sur Windows: Pourquoi cela ne fonctionne-t-il pas?
- 15. Spring Security ne fonctionne pas sous Windows 7
- 16. Le script epylint ne fonctionne pas sous Windows
- 17. CBT Hook ne fonctionne pas sous Windows Vista
- 18. Comment faire pour résoudre Windows tâche planifiée ne fonctionne pas?
- 19. Flymake ne fonctionne pas pour moi sur Windows Emacs
- 20. MySQL ne fonctionne soudainement pas sur Windows Server 2003
- 21. jQuery ne fonctionne pas sous Windows Server 2008, IIS 7
- 22. FastCGI code de nettoyage ne fonctionne pas sous Windows
- 23. g ++ ne fonctionne pas sur l'invite de commande Windows
- 24. filemtime() ne fonctionne pas sous Windows PHP-CLI
- 25. AspNetWindowsTokenRoleProvider ne fonctionne pas correctement pour l'authentification Windows dans ASP.NET
- 26. url.action ne fonctionne pas sur Vista/Windows 2008
- 27. InvokeWorkflowActivity n'appelle pas workflow
- 28. Hébergement de Windows Workflow Designer
- 29. ToolStripManager ne fonctionne pas
- 30. gets() ne fonctionne pas
Il suce quand le logiciel bêta a des bugs, hé? – leppie
Surtout sur quelque chose d'aussi élémentaire à son ensemble de fonctionnalités. J'essaie de tester FlowCharts par rapport aux activités habituelles et cela ne fonctionne pas. –
Cela ne fonctionne même pas avec les valeurs codées en dur. –