如何在TFS 2012构建流程模板的自定义活动中运行另一个活动? [英] How to run another activity in a customized activity of TFS 2012 build process template?

查看:84
本文介绍了如何在TFS 2012构建流程模板的自定义活动中运行另一个活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为TFS构建流程工作流编写自定义活动,例如准则此处.

I'm writing a customized activity for TFS build process workflow, e.g. guideline here.

在我的C#CodeActivity .Execute()方法中,我想运行另一个活动,例如ConvertWorkspaceItem此处所述.

In my C# CodeActivity .Execute() method, I want to run another activity, e.g. ConvertWorkspaceItem as descibed here.

我该怎么做?

推荐答案

尝试使用 NativeActivity 而不是CodeActivity进行一些研究,因此执行上下文允许您安排其他子活动. 例如:

Try doing some research with a NativeActivity instead of a CodeActivity, so the execution context allows you to schedule other child activities. E.g.:

class YourActivity : NativeActivity
{
    protected override void Execute(NativeActivityContext context)
    {
        ConvertWorkspaceItem it = new ConvertWorkspaceItem();
        context.ScheduleActivity(it);
    }
}

这篇关于如何在TFS 2012构建流程模板的自定义活动中运行另一个活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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