在 MVC 中使用工作流 4 作为控制器

发布于 2024-09-13 22:25:22 字数 282 浏览 0 评论 0原文

我正在构建一个处理客户查询的应用程序,我希望在针对他们的查询采取一些自动操作之前,通过显示适当视图的决策树路由查询。有点像“20个问题”游戏!根据每个阶段的答案,应用程序的路径将会改变。

我正在考虑使用 MVC,因为只有几种“类型”的路线和结果 - 所以我可以通过这种方式构建更少的页面,一个处理每种类型而不是每个步骤一个。我还考虑使用 Workflow 4 来管理页面流,因为流程图模型非常适合我想要做的事情。

有谁知道有什么好的参考应用程序使用工作流程来做这种事情吗?

谢谢

理查德

I'm building an app that deals with customer queries, where I want to route the query through a decision tree showing appropriate views before taking some automated action against their query. Kind of like the game "20 questions"! Based on the answers at each stage, the path through the app will change.

I was thinking of using MVC, because there are only a few "types" of route and outcome - so I could build fewer pages that way, one to handle each type rather than one for each step. I was also thinking of using Workflow 4 to manage the page flow, because the flowchart model maps pretty nicely to what I'm trying to do.

Does anyone know any good reference apps that use Workflow for this kind of thing?

Thanks

Richard

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

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

发布评论

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

评论(2

浮光之海 2024-09-20 22:25:22

有很多使用 WF3 执行此类操作的示例,但我还没有看到 WF4 的任何示例。我想这是可以做到的,但这意味着同步运行工作流程并在其空闲时立即检查书签以查看当前启用了哪些操作。使用自定义 SynchronizationContext 进行同步操作并使用 WorklfowApplication 上的 Idle 回调来检查当前书签应该是可能的。

There where a number of examples using WF3 doing this sort of thing but I haven't seen any for WF4. I suppose it is possible to do but it means running the workflow synchronously and checking the bookmarks as soon as it becomes idle to see which operations are enabled at the moment. That should be possible using a custom SynchronizationContext that does things synchronous and using the Idle callback on the WorklfowApplication to check the current bookmarks.

中二柚 2024-09-20 22:25:22

实际上,我最终选择了不同的选项 - 我编写了一个“GetNextAction”函数,该函数根据我的流程图逻辑和对象状态返回一个 ActionResult 对象。控制器处理收到的任何形式输入,更新对象,然后调用 GetNextAction 并返回该函数的结果。看来锻炼得还不错啊!

I actually went with a different option in the end - I wrote a "GetNextAction" function that returned an ActionResult object based on my flowchart logic and state of objects. The controller processes whatever form inputs it's received, updates the object, then calls GetNextAction and returns the result of that function. Seems to be working out ok!

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