开发者

In WF4, how to define a custom activity that can be the scope of a Variable?

开发者 https://www.devze.com 2023-02-05 17:20 出处:网络
When I rehost a designer, I can declar开发者_如何学Pythone variables and their scopes. However, not all activities can be the scope of a variable. I notice Sequence, Parallel, PickBranch can be the ho

When I rehost a designer, I can declar开发者_如何学Pythone variables and their scopes. However, not all activities can be the scope of a variable. I notice Sequence, Parallel, PickBranch can be the host, but Pick, If, Delay, can't. And all of my custom activities currently cannot be the scope of a variable. What should I do to make a custom activity able to be the scope of variables?


It only makes sense to add variables to activities that can have multiple child activities execute. As a result If, Delay etc can't and Sequence, While etc can.

If you want to create you own composite activity add a public Collection<Variable> Variables { get; } to your activity and initialize the collection in the constructor.

0

精彩评论

暂无评论...
验证码 换一张
取 消