托管 WPF 并在运行时动态编辑工作流服务?
给定一个具有 ReceiveRequest 和 SendResponse(暂时没有其他内容)的工作流服务 (testService.xamlx),是否可以将此服务部署到 IIS 并且仍然由用户编辑(使用重新托管的 WPF 设计器) ) 更改生效吗?
本质上,我想放弃我的基本服务流程,让用户在设计器中编辑工作流程,点击保存,然后让下一次调用使用新编辑的流程。我已经弄清楚如何重新托管设计器,但无法完全弄清楚如何在运行时加载/编辑/保存工作流服务。
任何帮助将不胜感激!
Given a workflow service (testService.xamlx) that has a ReceiveRequest and a SendResponse (and nothing else for the moment), is it possible to have this service deployed to IIS and still be edited by a user (using a re-hosted WPF designer) with changes taking effect?
Essentially I want to throw my base service flow out and let users edit the workflow in a designer, hit save, and have the next invocation use the newly edited flow. I've figured out how to re-host the designer, but can't quite figure out how to load/edit/save a workflow service at runtime.
Any help would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以这样做,但有一些重要的限制。首先,您需要使用新的工作流定义停止并重新启动 WorkflowServiceHost。其次,持久性存储中的所有现有工作流实例都将变得无效。简而言之,这只是实用的,因为没有持久性的运行工作流程非常少且只有短时间运行。
如果您采用此方法,则只需覆盖 XAMLX 文件(因为它未编译而是按原样使用),然后重新启动 WorkflowServiceHost 以获取更改。或者,您可以将工作流保存到 XAML 文件或任何与此相关的流,并使用 ActivityXamlServices 加载它。接下来,您可以使用此工作流定义实例化 WorkflowServiceHost。
You can do this but the are some important restrictions. First of all you need to stop and restart the WorkflowServiceHost with the new workflow definition. Secondly all existing workflow instances in a persistence store will become invalid. In short this is only practical is there are very few and only short running workflows without persistence.
If you go this route you can just overwrite the XAMLX file, as it isn't compiled but used as is, and restart the WorkflowServiceHost to pick up the changes. Alternatively you can save the workflow to a XAML file, or any stream for that matter, and load it using the ActivityXamlServices. Next you can instantiate a WorkflowServiceHost using this workflow definition.