OnTaskChanged event being fired within ListenActivity, but not OnWorkflowItemChanged

£可爱£侵袭症+ 提交于 2019-12-31 05:34:16

问题


I'm monitoring for either

  • Workflow Task Change
  • Workflow Item Change

OnApprovalTaskChanged is being fired, but not onWorkflowItemChanged. Is this a known issue and what could be a workaround?

If i remove ListenActivity, onWorkflowItemChanged gets triggered!

Here is part of my workflow: Workflow diagram http://img28.imageshack.us/img28/8397/ss20100217113727.png


回答1:


Solved this issue. This article helped me.

What you must do is to set InitializeWorkflow activity and create new correlation token for that activity. Parent for this correlation token must be set parent sequence activity. Then use this new token on OnWorkflowItemChanged event.

Everything for me works as expected if activities put in following order:

-Replicator (i have to create multiple tasks)
--Sequence
--some stuff 
---InitializeWorkflow (this activity is for bugfix, create new token, parent=Sequence)
---While (in my case: while task changed or wf item changed)
----ListenActivity
-----EventDriven (OnTaskChanged)
-----EventDriven (OnWorkflowItemChanged, use newly created token)

Putting another sequence and initializeworkflow in WHILE loop resulted in OnWorkflowItemChanged being called only first time item changes.



来源:https://stackoverflow.com/questions/2279813/ontaskchanged-event-being-fired-within-listenactivity-but-not-onworkflowitemcha

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