动态选择要安排的活动? [英] Dynamically selecting activity to schedule?

查看:53
本文介绍了动态选择要安排的活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

由于各种条件,我想安排的活动是在运行时确定的.这意味着我基本上有一个复合活动,它是NativeActivity,并且在其Execute方法中决定要安排哪个活动.所选的活动正在实例化,现在应该调用ScheduleActivity.

当我调用ScheduleActivity时,我得到一个System.ArgumentException异常,消息为所提供的活动不属于此工作流定义,元数据正在处理中. ...".是的,这很明显,因为在CacheMetadata方法中尚不知道应该安排哪个活动,因此我无法在CacheMetadata中调用AddImplementationChild方法.

为了使它可行,我错过了什么?安排我动态决定的活动?


最好的问候,

Henrik Dahl

Hello!

I have a situation where the activity I would like to schedule is determined at runtime, due to various conditions. It means I basically have a compound activity which is a NativeActivity and in its Execute method the decision making of which activity to schedule is done. The activity chosen is being instantiated and now ScheduleActivity should be called.

As I invoke ScheduleActivity I get a System.ArgumentException exception having the message "The provided activity was not part of this workflow definition when its metadata was being processed. ...". Yes, this is obvious because within the CacheMetadata method it's not known yet which activity should be scheduled so I can't invoke the AddImplementationChild method inside CacheMetadata.

What do I miss in order to make it feasible to schedule the activity I dynamically decide upon?


Best regards,

Henrik Dahl

推荐答案

Henrik,

使用可组合的DynamicActivity方案是否适用于您的方案? DynamicActivity允许您在运行时构造复合工作流定义. http://msdn.microsoft.com/en-us/library/ee358722(VS .100).aspx

希望有帮助.

Henrik,

Would using the composable DynamicActivity scenario be applicable to your scenario? DynamicActivity allows you to construct a composite workflow definition at runtime. http://msdn.microsoft.com/en-us/library/ee358722(VS.100).aspx

Hope this helps.


这篇关于动态选择要安排的活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆