• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 微軟推出的工作流引擎:Windows Workflow Foudation

    發表于:2008-02-03來源:作者:點擊數: 標簽:工作流引擎
    微軟推出的工作流引擎:Windows Workflow Foudation,簡單介紹一下 這是原文: https://msdn.microsoft.com/windowsvista/building/workflow/default.aspx?pull=/library/en-us/dnlong/html/WWFGetStart.asp 這是下載地址 http://www.microsoft.com/downloads
    微軟推出的工作流引擎:Windows Workflow Foudation,簡單介紹一下

        這是原文:

        https://msdn.microsoft.com/windowsvista/building/workflow/default.aspx?pull=/library/en-us/dnlong/html/WWFGetStart.asp

        這是下載地址

        http://www.microsoft.com/downloads/details.aspx?familyid=7096d039-2638-4f63-8654-d2e5d98fa417&displaylang=en

        這個開發環境需要安裝在vs2005里面。

        可以選擇你的workflow引擎的Host

        他處理的主要有兩類工作流:順序工作流( Sequential Workflow )和狀態機工作流( State Machine Workflow ):

        A sequential workflow is ideal for operations expressed by a pipeline of steps that execute one after the next until the last activity completes. Sequential workflows, however, are not purely sequential in their execution. They can still receive external events or start parallel tasks, in which case the exact sequence of execution can vary somewhat.

        A state machine workflow is made up of a set of states, transitions, and actions. One state is denoted as a start state, and then, based on an event, a transition can be made to another state. The state machine workflow can have a final state that determines the end of the workflow.


        有可視化的設計界面,就像設計一個aspx頁面一樣,把各個活動( activities )當成控件向里拖放。每個工作項就像一個控件,那工作流則一個窗體,可以直接寫代碼,比如            MessageBox.Show.
        To continue with the Windows Forms analogy, a workflow is like a form, whereas activities are like controls.
        這個窗體也可以保存成xml格式的,但是.cs文件還是那樣子。這是他實際做的

        this.Activities.Add(this.code1);
        this.DynamicUpdateCondition = null;
        this.ID = "Workflow1";
        FirstName.Direction = System.Workflow.ComponentModel.ParameterDirection.In;
        FirstName.Name = "FirstName";
        FirstName.Type = typeof(string);

        可以設置端點調試工作流。

        傳遞數據:有兩種方式Param 和 event ??梢宰约涸O置需要的Param (就是一些共有的屬性而以)
        數據的提供和處理還是Host要做的,比如,要出低一些參數進來,還一個把Host上的時間聯系到workflow上。下邊是一個窗體(Host)的一個按鈕的事件處理代碼

        Dictionary parameters = new Dictionary();
        parameters.Add("FirstName", txtFirstName.Text);
        parameters.Add("LastName", txtLastName.Text);

        // Start the workflow
        Guid instanceID = Guid.NewGuid();
        _wr.StartWorkflow(workflowType, instanceID, parameters);

        流程處理上,功能很強大,可以設計諸如 IfElse,while,WaitForData,Suspend,Listen,Delay,EventDriven 等30多種。


        開發一個Activity:
        public partial class SendMailActivity : System.Workflow.ComponentModel.Activity
        {
        public SendMailActivity()
        {
        InitializeComponent();
        }

        protected override Status Execute(ActivityExecutionContext context)
        {
        :
        }
        }


        狀態機工作流比較麻煩,這是初始化一個狀態機工作流:

        private void StartWorkflowRuntime()
        {
        // Create a new Workflow Runtime for this application
        _runtime = new WorkflowRuntime();

        // Register event handlers for the WorkflowRuntime object
        _runtime.WorkflowTerminated += new
        EventHandler (WorkflowRuntime_WorkflowTerminated);
        _runtime.WorkflowCompleted += new
        EventHandler (WorkflowRuntime_WorkflowCompleted);

        // Create a new instance of the StateMachineTrackingService class
        _stateMachineTrackingService = new StateMachineTrackingService(_runtime);

        // Start the workflow runtime
        _runtime.StartRuntime();

        // Add a new instance of the OrderService to the runtime
        _orderService = new OrderService();
        _runtime.AddService(_orderService);
        }
        在.net2.0里面EventHandler其實做了功能上的擴充

        這是其中一步的處理

        private Guid StartOrderWorkflow(string orderID) { // Create a new GUID for the     WorkflowInstanceId Guid instanceID = Guid.NewGuid(); // Load the OrderWorkflows     assembly Assembly asm = Assembly.Load("OrderWorkflows"); // Get a type reference to the OrderWorkflows.Workflow1 class Type workflowType =         asm.GetType("OrderWorkflows.Workflow1"); // Start a new instance of the state         machine with state tracking support StateMachineInstance stateMachine =         _stateMachineTrackingService.RegisterInstance(workflowType, instanceID);             stateMachine.StateChanged += new EventHandler (StateMachine_StateChanged);         stateMachine.StartWorkflow(); _stateMachineInstances.Add(instanceID.ToString(), stateMachine); // Return the workflow GUID return instanceID; }

        可以和微軟其他的產品集成,比如biztalk,office之類的相對其他的工作流引擎,比如osworkflow,微軟的這一個算是功能強大的了

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>