ASP.NET 工作流调用外部方法
我不确定我是否缺少明显的东西,而Windows Workflow在ASP.NET中使用了Windows WorkFlow,我真的不知道如何将工作流从ASP.NET工作流中获取输出。
我的工作流设置可以处理外部事件,因此我的网页可以调用它,哪个可以正常工作,但是如何再次获取信息? 我是否必须查询工作流对象才能找到所需的信息? 这似乎是错误的...
我认为我能做的就是使用工作流程中的callexternalMethod,但是由于运行时只能有一个工作流外部数据服务的实例,我不确定如何附加' '对单个页面?
我发现的所有示例似乎都使用页面工作流示例,其中工作流的输出(当它调用 CallExternalMethod 时)仅调用静态重定向方法。 例如,如果我不想重定向,而是将工作流程的结果打印到页面,我如何“捕获”该信息以便可以在页面中使用它? (假设运行时是从示例中的包装器中调用的,所以不能只做label1.text = bla,因为无法访问该变量)。
编辑:或者是使用工作流程持续到数据库的任何内容并将ASP.NET应用程序查询给定数据的问题(因为实例GUID可以用作PK?)
I'm not sure if I'm missing something obvious, with Windows Workflow used from within ASP.NET I don't really know how to get output from the Workflow back to the ASP.NET workflow.
I have my workflow setup to handle external event, so my web page can invoke it, which works fine, but how do I get the information out again? Do I have to query the Workflow object to find the information I want? This just seems wrong...
What I thought I could do was use the CallExternalMethod in the workflow, but since there can only be one instance of the Workflow External Data service in the runtime, I'm not sure how it can be 'attached' to the individual pages?
All examples I have found seem to use the Page Workflow example in which the output from the workflow (when it calls CallExternalMethod) just calls the static redirect method. If for example I didn't want to redirect, but print the result from the workflow to the page, how do i 'capture' that information so it can be used in the page? (assuming that the runtime is called from a wrapper like the examples, so cant just do Label1.Text = bla since there is no access to that variable).
Edit: Or is it a matter of using the workflow to persist anything to the database and have the ASP.NET app query the given data from there (since instance GUID can be used as PK?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此链接包含有关将信息传入和传出工作流程的信息:
http://books.google.com/books?id=s5eVXpNmQxgC&pg=PA32&dq=pro+windows+workflow+foundation#PPA241,M1
网页:
网页和上面链接中的 WinForm 示例的唯一区别是您需要使用 MaualWorkflowSchedulerService (这会捐赠网页使用的线程,而不是为工作流运行时创建一个新线程)。
因此,假设您正在通过单击按钮来调用ExternalMethod(DataEvents是您添加到处理/调用外部方法的运行时的服务):
然后是workflowEventsDataReceived处的方法,它是工作流内的 CallExternalMethod(通过您添加到 WorkflowrunTime 的服务)将能够更新您想要的所有标签。
不确定这些是否清楚,但如果需要更多帮助,请告诉我,上周末我自己也遇到了同样的问题。
This link has information about passing information in and out of workflows:
http://books.google.com/books?id=s5eVXpNmQxgC&pg=PA32&dq=pro+windows+workflow+foundation#PPA241,M1
In respect to a web page:
The only difference to a webpage and the WinForm example in the link above is that you need to use the MaualWorkflowSchedulerService (this donates the thread the webpage used instead of making a new one for the workflow runtime).
So, say you are invoking the ExternalMethod in a button click with somthing like this (DataEvents being the service you add to the run time for your Handle / Call external methods):
Then the method at workflowEventsDataReceived, which is the target of a CallExternalMethod inside the workflow (via the service you added to the WorkflowrunTime) will be able to update all the labels you want.
Not sure if any of that is clear, but let me know if need more help, was going through the same problem myself last weekend.