基于 Windows 工作流的 UI

发布于 2024-07-18 11:01:51 字数 164 浏览 2 评论 0原文

使用 Windows 工作流时是否有任何内置的 UI 功能。

假设我有一个工作流需要一个小时才能运行,其中一直在发生不同的活动。 当它运行时,我想查看当前活动的活动、已经运行的活动等。

我是否必须自己编写此 UI 代码,或者 WF 是否具有以图形方式显示工作流状态等的内置功能?

Are there any build in UI capabilities when using Windows Workflow..

Lets say I have a workflow that takes an hour to run where different activities are happening all the time. While it's running I want to see what activity is currently active, what activities have already ran etc..

Do I have to code this UI myself or does WF have built in features that graphically show the status etc of the workflow?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

迟到的我 2024-07-25 11:01:51

为了查明工作流所处的状态,我订阅了 WorkflowIdled 事件并执行如下操作:

           private delegate void UpdateDelegate();
   void workflowRuntime_WorkflowIdled(object sender, WorkflowEventArgs e)
        {
            StateMachineWorkflowInstance stateMachineInstance = new StateMachineWorkflowInstance(MyManager.WorkflowRuntime, MyInstance.Id);
            UpdateDelegate LclUpdateDelgate = delegate()
            {
                // Update the workflow state on the form thread
                if (stateMachineInstance.CurrentState != null)
                    LabelWorkflowState.Text = stateMachineInstance.CurrentStateName;
                else
                    LabelWorkflowState.Text = "";

            };
            this.Invoke(LclUpdateDelgate);
        }

To find out which state a workflow is in, I subscribe to the WorkflowIdled event and do something like this:

           private delegate void UpdateDelegate();
   void workflowRuntime_WorkflowIdled(object sender, WorkflowEventArgs e)
        {
            StateMachineWorkflowInstance stateMachineInstance = new StateMachineWorkflowInstance(MyManager.WorkflowRuntime, MyInstance.Id);
            UpdateDelegate LclUpdateDelgate = delegate()
            {
                // Update the workflow state on the form thread
                if (stateMachineInstance.CurrentState != null)
                    LabelWorkflowState.Text = stateMachineInstance.CurrentStateName;
                else
                    LabelWorkflowState.Text = "";

            };
            this.Invoke(LclUpdateDelgate);
        }
深府石板幽径 2024-07-25 11:01:51

没有内置用户界面。

但是您可以通过订阅 WorflowInstance 上的事件(请参阅其他答案)或使用 跟踪服务

前者很容易设置为快速解决方案,但后者将与多个主机进程和长时间运行(卸载)的工作流实例一起使用。

There is no built in UI.

But you can create one, either by subscribing to events on the WorflowInstance (see other answer), or by using the Tracking Service.

The former is simple to set up for a quick solution but the latter will work with multiple host processes and long running (unloaded) workflow instances.

梦幻之岛 2024-07-25 11:01:51

Check out the this code sample over at MSDN:

http://msdn.microsoft.com/en-us/library/ms741706.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文