Accessing Arguments, Workflow Variables from custom activities

偶尔善良 提交于 2019-12-08 19:19:29

One way we've looked at this with our custom activities is using the Properties property available in the ActivityContext. We have an activity with an InArgument which adds an ExecutionProperty in the execute method, so you end up with:

public InArgument<Custom> MyObject {get;set;}

...

context.Properties.Add("Contact",MyObject.Get(context));

Then in your other activities you can check to see if this has been set

context.Properties.Find("Contact")

Obviously if you're doing this a lot I'd recommend using a constant somewhere rather than magic strings, but it should save you having to add the same argument over and over when designing.

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