创建自定义工作流活动的详细指南
在开发工作流时,自定义活动能够极大地扩展系统的功能。本文将详细介绍如何创建一个自定义活动,用于在 SharePoint 的日历列表中创建新事件。
1. 实现自定义活动
首先,模板会生成一个活动设计器。右键单击该文件,选择“查看代码”,添加以下命名空间:
using Microsoft.SharePoint; using Microsoft.SharePoint.Workflow; using Microsoft.SharePoint.WorkflowActions;将模板创建的CreateEvent类的父类从SequenceActivity更改为Activity。CreateEvent.cs类的初始实现如下:
using System; using System.ComponentModel; using System.ComponentModel.Design; using System.Collections; using System.Linq; using System.Workflow.ComponentModel.Compiler; using System.Workflow.ComponentModel.Serialization; using System.Workflow.ComponentModel; using