1

I have recently been tasked to look into Workflow Foundation. The actual goal would be to implement a system in which the end users can define custom workflows in the deployed application (and of course, use them). Personally I have never used WF before (and reading around here on SO people are very doubtful about it - so am I reading those questions/answers), and I am having a hard time finding my way around it given the sparse learning resources available.

Anyway, there are some questions, for example, this, which mention something they call dynamic or user-defined workflows. They point out that WF makes it possible to "rehost" the designer, so that end-users can define their own new workflows after the application is deployed (without developer intervention (?), this is the part I am not really sure about).

I have been told by fellow employees that this way we could implement an application in which once this feature is implemented we would no longer have to keep modifying the application every time a new workflow is to be implemented. However, they also pointed out that they just "heard it", they don't have firsthand experience themselves either.

I have been looking around for samples online but the best thing I could find was a number guess app - barely more than a simple hello world. So not much that would point me to the right direction of how this user-defined workflow feature actually works and how it can be used, what its limitations are etc.

My primary concern is this: it is alright that one can define custom workflows but no workflow is worth a penny without the possibility of actually inputting data throughout the process. For example, even if the only thing I need to do is to register a customer in a complaint management system, I would need the customer's name, contact, etc. If the end user should be able to define any workflow the given toolset makes possible then of course there needs to be a way to provide the workflow consumers with a way of inputting data through forms. If the workflow can be of pretty much any nature then so needs to be the data - otherwise if we need to implement the UIs ourselves then this "end-user throws together a workflow" feature is kind of useless because they would still end up at us requiring to implement a form or some sort of data input for the individual steps.

So I guess that there should be a way of defining the "shape" of the data that needs to be filled at any given user interaction phase of the workflow which I can investigate and dynamically generate forms based on the data. So for example, if I found that the required data was made up of a name and a date of birth, then I would need to render a textbox and a datepicker on the page.

What I couldn't really figure out from the Q&As here and elsewhere is whether this is even possible. Can I define and then later "query" the structure of the data to be passed to the workflow at any point? If so, how? If not, how should this user-defined workflow feature even be used, what is it good for?

To clarify it a little, I could imagine something as specifying a complex type, which would be the view model (input model) in a regular MVC app, and then I could reflect over it, get the properties and render input fields based on that.

4

1 回答 1

3

Windows Workflow Foundation 是关于机器工作流,而不是业务工作流。诚然,它是 Microsoft 为构建其业务工作流产品而创建的基础工具集。但开箱即用的 WWF 没有您快速轻松地构建业务工作流所需的组件。如果您想在工作流程中发送电子邮件,则必须从头开始编写。从商业角度来看,几乎所有你能想到的事情,你都必须从头开始编写。

如果您想使用 Microsoft 产品轻松创建业务工作流,请查看 SharePoint 中的工作流内容。它是最容易使用的 Microsoft 产品(根据我的经验)。如果这不能满足您的需求,还有其他产品,例如 BizTalk。

K2 是另一家拥有业务流程产品的公司,它使用 WWF 作为其基础来更轻松地构建业务工作流程,较旧的 K2 产品实际上会自动创建网页以从用户那里收集数据。

WWF 的水平非常低,可以说在他们在 4.0 中重新编写了整个内容之后它就失去了吸引力。虽然微软没有公开声明,但我个人认为 Service Fabric(来自微软)实现了 WWF 最初试图解决的目标,即“更强大的编程环境”。

于 2017-02-10T14:40:31.880 回答