WF 4-长期运行,类型选择,托管 [英] WF 4 - Long running, type selection, hosting

查看:64
本文介绍了WF 4-长期运行,类型选择,托管的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows Workflow Foundation 4.0(WF 4.0)上我有几个问题

I have few questions on Windows Workflow Foundation 4.0 (WF 4.0)

我需要开发一种在工作流程选择方面具有很大灵活性的批准系统

I need to develop an approval system with great amount of flexibility on workflow selection

我不想将工作流作为要使用的服务公开给客户端应用程序,因为很难管理选择哪个工作流,在哪里选择

I do not want to expose workflows to client application as services to consume because it will be difficult to manage which workflow to select, where to

传递事件等.

动作将是相似的(批准,拒绝),但是在不同的工作流中,在不同的位置和发生的次数不同.

Actions are going to be similar (approve, reject) but in different workflows at different places and with different occurrences.

我正计划向客户端公开WFC服务,客户端将向其提供逻辑名称,初始数据和后续命令(批准,拒绝)

I am planning to expose a WFC service to client, client will provide a logical name, initial data and subsequent commands (approval, rejection) to same

关于WCF的方法.

WCF组件应足够智能,以加载所需的xaml WF并使WF满意或使用以下命令将事件(命令)传递给现有实例

WCF component should be intelligent enough to load required xaml WF and either insatiate WF or deliver the event (command) to existing instance using

相关.

我正在寻求有关实现上述目标(以及如何实现)的一些建议,也正在寻求关于后续目标的一些确认

I am looking for some suggestions on possibilities of achieving above (and how), also looking for few confirmation on following

 

1.我们是否可以在运行时按以下要求加载XAML工作流文件(以及如何加载)

1. Can we load XAML workflow file at runtime with following requirement (and how ?)

a.长时间运行

b.事件处理(批准,拒绝)

b. Event handling (approval, rejection)

2.如何托管这些(我有IIS 5.1,需要使用WCF托管)?我可以使用WorkflowApplication进行托管吗? WorkflowSErviceHost如何提供帮助?

2. How to host these (I have IIS 5.1 and need to use WCF to host) ? Can I use WorkflowApplication to host ? How WorkflowSErviceHost can help ?

谢谢.

拉胡尔·贾恩(Rahul Jain)

Rahul Jain

肯塔基州路易斯维尔

推荐答案

嗨Rahul,是的,您可以做所有您描述的事情:

Hi Rahul, yes you can do all what you describe:

http://adrianot75.wordpress.com/2010/11/05/sample-real-world-wf4-integration/

我们做到了,尽管这不是一个简单的任务,但您可以代理"通过事件端点"进行工作流.

We did it, and although is not a simple task you can "proxy" the workflows through a "event endpoint".

在我们的情况下,客户端应用程序注册"代理程序.到发布事件"的APM服务器.他们暴露出来,而论点"我们期望每个事件.

In our case the client applications "register" to the APM server publishing the "events" exposed by them, and the "arguments" that we expect for each event.

事件本身是一种接口",例如:应该由工作流定义"来实现的您可以设计.

The event itself is a sort of "interface" that should be implemented by the workflow "Definition" you can design.

在定义定义时,您可以访问输入参数,并使用活动的任意组合(例如自定义活动).

When desigining the definition, you can access the input argument, and use any combination of activities (custom activities for instance).

我们的实现允许在任何应用程序/应用程序/事件的实例上启用/禁用/跟踪任何定义.

Our implementation allows to enable/disable/track any definition on any Application/instance of application/event.

尝试响应您的要求,我们可以在运行时加载XAML工作流文件... bla bla bla":

Trying to respond to your reques, "Can we load XAML workflow file at runtime... bla bla bla":

1)是的,您可以在自己的实现中支持长期运行/持久化

1) Yes you can support long running/persistence in your own implementation

2)您应该根据需要公开所有内容,就我而言,我公开了对任何应用程序都通用的WCF终结点,该终结点允许进行某种多播"处理.侦听应用程序的定义,然后启动正确的Workflow实例.

2) You should expose the whole stuff as you like, in my case I exposed a WCF endpoint common to any application, that allows a sort of "multicast" to the definition listening to the application and starts the correct Workflow instance.

3)您可以通过WorkflowApplication自定义重新托管直接在自己的Windows服务上托管

3) You can Host directly on your own Windows Service through WorkflowApplication custom rehosting

例如,如果您想获得有关如何支持使用诸如延迟之类的标准活动的长期运行任务的提示,可以查看以下文章(我的文章和完整的Andrew Zhu文章):

If you want some hints on HOW to support long running tasks that use standard activities like delay, for instance, you can take a look at the following posts (mine and the complete one published Andrew Zhu):

http://adrianot75.wordpress.com/2010/11/04/wf4-persisnce-delay-and-execution-resume/

http://xhinker.com/post/WF4.aspx

希望那些帮助!

欢呼

 

 


这篇关于WF 4-长期运行,类型选择,托管的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆