2012-03-28 8 views
1

私は、Windowsワークフローの基礎を持つasp.net Webアプリケーションを構築しようとしています。ASP.NETをWindowsワークフローの基礎で使用する

私が発見したいくつかの有用なサイトが好き:

http://msdn.microsoft.com/en-us/library/bb628441%28v=vs.90%29.aspx

http://msdn.microsoft.com/en-us/library/bb675262%28v=vs.90%29.aspx

ワークフローは、私はASPを作成し

<Activity mc:Ignorable="sap" x:Class="ApproachWithWorkflows.WriteLineActivity" sap:VirtualizedContainerService.HintSize="654,676" mva:VisualBasic.Settings="Assembly references and imported namespaces for internal implementation" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> 
<Flowchart sad:XamlDebuggerXmlReader.FileName="C:\Documents and Settings\hauke\Desktop\Uni\Masterarbeit SVN SE\Software\Workflowansatz\ApproachWithWorkflows\ApproachWithWorkflows\WriteLineActivity.xaml" sap:VirtualizedContainerService.HintSize="614,636"> 
<sap:WorkflowViewStateService.ViewState> 
    <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
    <x:Boolean x:Key="IsExpanded">False</x:Boolean> 
    <av:Point x:Key="ShapeLocation">270,2.5</av:Point> 
    <av:Size x:Key="ShapeSize">60,75</av:Size> 
    <av:PointCollection x:Key="ConnectorLocation">300,77.5 300,107.5 295.5,107.5 295.5,129</av:PointCollection> 
    </scg3:Dictionary> 
</sap:WorkflowViewStateService.ViewState> 
<Flowchart.StartNode> 
    <x:Reference>__ReferenceID0</x:Reference> 
</Flowchart.StartNode> 
<FlowStep x:Name="__ReferenceID0"> 
    <sap:WorkflowViewStateService.ViewState> 
    <scg3:Dictionary x:TypeArguments="x:String, x:Object"> 
     <av:Point x:Key="ShapeLocation">190,129</av:Point> 
     <av:Size x:Key="ShapeSize">211,59</av:Size> 
    </scg3:Dictionary> 
    </sap:WorkflowViewStateService.ViewState> 
    <WriteLine sap:VirtualizedContainerService.HintSize="211,59" Text="worked.." /> 
</FlowStep> 

活動であります簡単なボタンと.NETプロジェクト:背後にあるコードで

<asp:Button Text="Purchase" ID="Label1" runat="server" OnClick="btnClick" /> 

、私はワークフローを呼び出そう(とのApplication_StartによってGlobal.asaxの中WorkflowRuntime初期化):今

WorkflowRuntime workflowRuntime = Application["WorkflowRuntime"] as WorkflowRuntime; 
ManualWorkflowSchedulerService manualScheduler = 
    workflowRuntime.GetService(typeof(ManualWorkflowSchedulerService)) 
    as ManualWorkflowSchedulerService; 

WorkflowInstance instance = workflowRuntime.CreateWorkflow(
    typeof(ApproachWithWorkflows.WriteLineActivity)); 
instance.Start(); 
manualScheduler.RunWorkflow(instance.InstanceId); 

Iをアプリケーションを実行してボタンを押すと、「入力ワークフロータイプはアクティビティでなければなりません。\ r \ nパラメータ名:workflowType」というエラーがCreateWorkflowに表示されます。

アクティビティはアクティビティです!私は間違って何をしていますか?

答えて

1

WF 4.0ランタイムクラスを使用してWF 4.0アクティビティを実行しているようです。 WorkflowInvokerまたはWorkflowApplicationを見てください。

+0

ありがとうございました。少なくとも例外はありません。しかし、ワークフローが実行されたかどうかは分かりません.WriteLineはコンソールに書き込まれません。それは別のスレッドで開始されますか?しかし、私は今どこを見なければならないのか知っています。 – Hauke

関連する問題