In Workflow need to listen for multiple events

杀马特。学长 韩版系。学妹 提交于 2019-12-11 19:07:13

问题


I need a workflow where need to listen for multiple events any event will drive workflow further.

some actions --> Call external method --> Here there 3 events any one would be the response.

What kind of activity i can use there where i can have three event handler. Any event will drive it further.

Thought of using state machine workflow but if there is anything i can use instead?


回答1:


Whether you use a sequential workflow or state machine workflow activity as your root workflow type, you can still handle events. The state machine is much better for handling events and swapping states as it pretty much forces you to do both. In my opinion, it is much more powerful than sequential workflows and provide all of the same functionality plus some. Personally, I have no reason to ever use a sequential workflow again.

However, sequential workflows do have one great pro to them. They are SIMPLE. It doesn't get much easier to understand than a top-to-bottom workflow, and is great if you are actually making the designer available to your end users. In a sequential workflow, you can listen for events the same way using the ListenActivity. Drop the ListenActivity out, right click and add as many different forks as you will need, one per event you want to listen for. Finally, drop and configure the HandleEventActivity in each one, assigning them to the events you are wanting to subscribe.

Listening for Events in a Sequential Workflow

Listening for Events in a State Machine Workflow



来源:https://stackoverflow.com/questions/454690/in-workflow-need-to-listen-for-multiple-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!