Action 元素 (WorkflowActions)
上次修改时间: 2015年3月9日
适用范围: SharePoint Foundation 2010
本文内容
属性
子元素
父元素
包含工作流引擎处理工作流活动所需的信息,在 Microsoft SharePoint Foundation 2010 中该活动称为操作。工作流 Action 元素表示工作流活动,如发送电子邮件通知、更新 SharePoint Foundation 2010 列表项、创建和分配任务,以及许多其他活动。
默认情况下,SharePoint Foundation 2010 提供 23 个内置工作流操作。这些操作在 WSS.ACTIONS 文件中定义。
<Actions>
<Action>
</Action>
</Actions>
属性
属性 |
说明 |
---|---|
Name |
必需属性,类型为 text。表示在工作流编辑器中显示的工作流操作的说明。 |
ClassName |
必需属性,类型为 text。实现工作流操作的类的完全限定名。例如:Microsoft.SharePoint.WorkflowActions.EmailActivity。 |
Assembly |
必需属性,类型为 text。包含实现 Action 元素的说明的 .NET 程序集名称。文本应包含 PublicKeyToken、Version 和 Culture。 |
Category |
可选属性,类型为 text。提供工作流操作的类别。此 text 用于筛选可用操作的列表。 |
CreatesTask |
可选属性,类型为 Boolean。如果设置为 true,则会在工作流中创建任务列表项。如果保留为空,则假定设置为 false,并且不会创建任务列表项。 |
CreatesInList |
可选属性,类型为 text。如果为此属性设置一个值,则工作流会在列表中创建项。值必须映射到包含列表或文档库的 ID 的参数名称。 |
AppliesTo |
必需属性,类型为 text。指示此工作流操作是否可用于列表和/或文档库。有效值包括 list、doclib 和 all。 |
ListModeration |
可选属性,类型为 Boolean。如果设置为 true,则此 Action 元素适用于已启用内容审批的列表或文档库。如果保留为空,则假定为 false。 |
UsesCurrentItem |
可选属性,类型为 Boolean。如果设置为 true,则指示应使用或修改当前项。如果设置为 false 或保留为空,则此 Action 元素仅使用已指定的 SharePoint 列表或文档库。 |
子元素
父元素
示例
下面的代码示例演示如何构造 Action 元素,以便在工作流编辑器中显示该元素。请注意,为了提高可读性,已对此 XML 代码进行了修改。
<WorkflowInfo>
<Conditions>…</Conditions>
<Actions Sequential="then" Parallel="and">
<Action Name="Update my custom SharePoint list"
ClassName="CustomActivities.OrderListFunctions"
Assembly="CustomActivities,
PublicKeyToken=b03f5f7f11d50a3a,
Version=1.0.0.0,
Culture=neutral"
Category="My Custom Actions"
CreatesTask="true"
CreatesInList="UpdateList"
AppliesTo="all"
ListModeration="false"
UsesCurrentItem="true">
<RuleDesigner Sentence="Update %1">
<FieldBind Field="UpdateList"
Function="UpdateOrderList"
DesignerType="ChooseListItem"
ID="1"
Text="My Custom List">
</FieldBind>
</RuleDesigner>
<Parameters>
<Parameter Type="System.String, mscorlib"
Direction="In"
Name="UpdateList"
</Parameters>
</Action>
</Actions>
</WorkflowInfo>