简体   繁体   English

用户定义的动态工作流程和用户输入

[英]User-defined dynamic workflows and user input

I have recently been tasked to look into Workflow Foundation. 我最近的任务是调查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. 就个人而言,我以前从未使用过WF(并且在这里阅读,因此人们非常怀疑它 - 所以我正在阅读这些问题/答案),而且由于可用的学习资源稀少,我很难找到解决方法。

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). 他们指出WF可以“重新托管”设计器,以便最终用户可以在部署应用程序后定义自己的新工作流程(无需开发人员干预(?),这是我不太确定的部分) 。

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. 如果工作流可以是几乎任何性质,那么就需要成为数据 - 否则如果我们需要自己实现UI,那么这个“最终用户将工作流程集合在一起”就会变得毫无用处,因为它们仍然会在我们要求为各个步骤实施表格或某种数据输入。

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. 为了澄清它,我可以想象一些指定复杂类型的东西,它将是常规MVC应用程序中的视图模型(输入模型),然后我可以反思它,获取属性并基于此呈现输入字段。

Windows Workflow Foundation is about machine workflows, not business workflows. Windows Workflow Foundation是关于机器工作流程,而不是业务工作流程。 True, it is the foundational tool set Microsoft created for building their business workflow products. 确实,它是Microsoft为构建业务工作流产品而创建的基础工具集。 But out of the box WWF does not have the components you need to quickly and easily build business workflows. 但是开箱即用的WWF没有快速轻松地构建业务工作流程所需的组件。 If you want to send an email in a workflow, you have to write that from scratch. 如果要在工作流中发送电子邮件,则必须从头开始编写。 Just about anything you can think of doing from a business point of view you have to write from scratch. 从业务角度来看,您可以想到的任何事情都必须从头开始编写。

If you want to easily create business workflows using Microsoft products check out the workflow stuff in SharePoint. 如果要使用Microsoft产品轻松创建业务工作流,请查看SharePoint中的工作流内容。 It is the easiest of the Microsoft products to work with (in my experience.) If that does not meet your needs there are other products like BizTalk. 根据我的经验,它是最容易使用的Microsoft产品。如果这不符合您的需求,还有其他产品,如BizTalk。

K2 is another company with a business workflow product that uses WWF as their base to more easily build business workflows, the older K2 products actually create web pages automatically to collect the data from the user. K2是另一家拥有业务工作流产品的公司,它使用WWF作为更轻松地构建业务工作流的基础,旧的K2产品实际上自动创建网页以从用户收集数据。

WWF is very low level, arguably it lost traction after they re-wrote the whole thing in 4.0. 世界自然基金会的水平非常低,可以说他们在4.0中重写了整个事情后失去了牵引力。 While not publically stated by Microsoft, my personal opinion is Service Fabric (from Microsoft) achieves the goals WWF originally tried to solve which was a "more robust programming environment." 虽然微软没有公开声明,但我个人认为Service Fabric(来自微软)实现了WWF最初试图解决的目标,即“更强大的编程环境”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM