SharePoint 2013 工作流的新增功能What's new in workflows for SharePoint 2013

了解 SharePoint Server 2013 中的工作流的新增功能和特性。SharePoint 中的工作流框架与早期版本相比有了明显的改变。以下各节提供了有关工作流基础结构的最重要的更新和增强功能的概要说明。Learn about the capabilities and features that are new to workflows in SharePoint Server 2013. The workflow framework in SharePoint is significantly changed from previous versions. The following sections provide brief summaries of the most significant updates and enhancements to the workflow infrastructure.

完全重新设计的工作流基础结构Completely redesigned workflow infrastructure

SharePoint 工作流由 Windows Workflow Foundation 4 (WF) 提供支持,它实际上是基于早期版本重新设计的版本。反过来说,Windows Workflow Foundation 是基于由 Windows Communication Foundation (WCF) 提供的消息功能构建的。SharePoint workflows are powered by Windows Workflow Foundation 4 (WF), which was substantially redesigned from previous versions. Windows Workflow Foundation, in turn, is built on the messaging functionality that is provided by Windows Communication Foundation (WCF).

新的工作流基础结构的最突出的功能可能是将 Microsoft Azure 作为新的工作流执行主机引入。工作流执行引擎现在位于 SharePoint 的外部(在 Microsoft Azure 中)。图 1 提供了新的工作流基础结构的通用高级视图。有关图 1 中呈现的概念的更全面的讨论,请参阅 SharePoint 工作流基础Perhaps the most prominent feature of the new workflow infrastructure is the introduction of Microsoft Azure as the new workflow execution host. The workflow execution engine now lives outside of SharePoint, in Microsoft Azure. Figure 1 provides a generalized, high-level view of the new workflow infrastructure. For a more thorough discussion of the concepts presented in Figure 1, see SharePoint workflow fundamentals.

图 1. 工作流基础结构的高级体系结构Figure 1. High-level architecture of the workflow infrastructure

高级工作流体系结构

完全声明性的无代码创作环境Fully declarative, no-code authoring environment

另一项显著的更改是,WF 4 平台上的工作流是完全声明性的。也就是说,不再将工作流编译为托管程序集和部署到程序集缓存。相反,XAML 文件将定义您的工作流并设计其执行。Another of the prominent changes is that workflows on the WF 4 platform are fully declarative. That is, workflows are no longer compiled into managed assemblies and deployed to an assembly cache. Instead, XAML files define your workflows and frame their execution.

增强的 SharePoint Designer 2013 创作支持Enhanced SharePoint Designer 2013 authoring support

已对 SharePoint Designer 2013 进行更新,旨在使其成为用于创作 SharePoint 工作流的可选创作环境。SharePoint Designer 2013 为工作流作者提供了设计器图面和基于文本的工作流创作环境。此外,您可以在 Visual Studio 2008 中开发工作流自定义操作,然后将这些操作部署到 SharePoint Designer 2013 中,随后可以从 Workflow Designer 访问它们。SharePoint Designer 2013 has been updated with the goal of making it the authoring environment of choice for authoring SharePoint workflows. SharePoint Designer 2013 provides workflow authors with both a designer surface and a text-based workflow authoring environment. Additionally, you can develop workflow custom actions in Visual Studio 2012 and then import them into SharePoint Designer 2013, where they can then be accessed from the Workflow Designer.

简而言之,SharePoint 工作流创作和开发环境足以满足信息工作者(“高级用户”)和开发人员的需求。In short, the needs of both the information worker (the "power user") and the developer have been harnessed in SharePoint workflow authoring and development environments.

Visual Studio 2008 工作流项目类型支持Visual Studio 2012 workflow project type support

为了使信息工作者与软件开发人员之间能够更轻松地协作,Visual Studio 2008 提供了 SharePoint 工作流项目类型和工作流自定义操作项类型。有关使用 Visual Studio 2008 开发工作流的详细信息,以及有关在工作流开发中区分 SharePoint Designer 2013 和 Visual Studio 2008 的信息,请参阅 使用 Visual Studio 开发 SharePoint 工作流To make collaboration easier between information worker and software developer, Visual Studio 2012 provides SharePoint workflow project types and a workflow custom action-item type. For more information about developing workflows by using Visual Studio 2012, and for information about differentiating between SharePoint Designer 2013 and Visual Studio 2012 in workflow development, see Develop SharePoint workflows using Visual Studio.

针对创建自定义操作的支持Support for creating custom actions

为了满足工作流作者的业务要求,我们已做了大量工作过,包括在 SharePoint Designer 2013 和 Visual Studio 2008 中提供工作流模板、操作和活动。但我们也知道,我们无法满足每个人的特定需求。为此,Visual Studio 2008 提供了工作流自定义操作项类型,开发人员可使用此类型创建自定义操作。有关工作流自定义操作的详细信息,请参阅 如何:生成和部署工作流自定义操作A lot of effort has gone into anticipating the business requirements of workflow authors in the providing of workflow templates, actions, and activities in SharePoint Designer 2013 and in Visual Studio 2012. However, we also know that we cannot anticipate each person's specific needs. For this reason, Visual Studio 2012 provides a workflow custom action-item type that lets developers create custom actions. For more information about workflow custom actions, see How to: Build and deploy workflow custom actions.

针对 SharePoint 工作流的工具支持Tools support for SharePoint workflows

Visual Studio 2008 提供了用于在 SharePoint 工作流框架上创建工作流的模板和支持。SharePoint 工作流与早期版本的工作流类似,只不过它们由 WF 4 提供支持并运行于 Microsoft Azure 中。此外,它们是仅声明性的 (XAML),旨在与云进行交互并与 SharePoint 外接程序一起使用。其主要好处之一是,使您能够在 SharePoint Server 外部远程承载和运行工作流。Visual Studio 2012 provides templates and support for creating workflows on the SharePoint workflow framework. SharePoint workflows are similar to previous versions of workflows except that they are powered by WF 4 and run in Microsoft Azure. They are also declarative-only (XAML) and designed to interact with the cloud and work with SharePoint Add-ins. One of their primary benefits is that they enable you to remotely host and run workflows outside SharePoint Server.

新工作流操作New workflow actions

以下是 SharePoint 中提供的新工作流操作。有关新的和弃用的操作的详细信息,请参阅 SharePoint 的工作流操作和活动引用。SharePoint 中的工作流的新增内容是一组工作流操作,允许您与 Project 2013 集成和创建基于 Project 的工作流。Following are new workflow actions that are provided in SharePoint. For a full detailing of both new and deprecated actions, see Workflow actions and activities reference for SharePoint. New to workflows in SharePoint are a set of workflow actions that allow you to integrate with Project 2013 and let you create Project-based workflows.

表 1. SharePoint 中的新工作流操作Table 1. New workflow actions in SharePoint

操作Action 说明Description
分配任务Assign a Task
向用户或组分配单个工作流任务。Assigns a single workflow task to a user or group.
启动任务流程Start a Task Process
启动任务流程的执行。Initiates execution of a task process.
转到此阶段Go to This Stage
指定应将流控制提交到的工作流中的下一个阶段。Specifies the next stage in a workflow to which flow control should be handed.
调用 HTTP Web 服务Call HTTP Web Service
与针对代表性状态传输 (REST) 终结点的方法调用的功能类似。Functions as a method call to a Representational State Transfer (REST) endpoint.
启动列表工作流Start a List Workflow
启动列表范围内的工作流。Starts a list-scoped workflow.
启动网站工作流Start a Site Workflow
启动网站范围内的工作流。Starts a site-scoped workflow.
生成 DynamicValueBuild DynamicValue
创建类型为 DynamicValue 的新变量。Creates a new variable of type DynamicValue.
从 DynamicValue 中获取属性Get Property from DynamicValue
从类型为 DynamicValue 的指定变量检索属性值。Retrieves a property value from a specified variable of type DynamicValue.
对 DynamicValue 中的项数计数Count Items in DynamicValue
返回类型为 DynamicValue 的变量中的行数。Returns the number of rows in a variable of type DynamicValue.
修整字符串Trim String
删除当前字符串中的所有前导和尾随空白字符。Removes all leading and trailing white-space characters from the current string.
在字符串中查找子字符串Find Substring in String
返回字符串中的一个或多个字符的第一个出现位置的从 1 开始的索引,或字符串的第一个出现位置。Returns 1-based index of the first occurrence of one or more characters, or the first occurrence of a string, within a string.
替换字符串中的子字符串Replace Substring in String
返回指定字符或字符串的所有出现位置在其中替换为另一个指定字符或字符串的新字符串。Returns a new string in which all occurrences of a specified character or string are replaced with another specified character or string.
翻译文档Translate Document
与围绕调用同步翻译 API 的 HTTP 活动的包装的功能类似。您必须为运行工作流的 SharePoint 网站配置机器翻译服务应用程序。Functions as a wrapper around the HTTP activity that calls the synchronous translation API. You must configure a Machine Translation Service Application for the SharePoint site on which you run the workflow.
设置工作流状态Set Workflow Status
更新消息字符串中指定的工作流状态。Updates workflow status as specified in message string.
从当前项创建项目 [Microsoft Project]Create a Project from Current Item [Microsoft Project]
创建基于当前项的 Project Server 项目。Creates a Project Server project based on the current item.
将当前项目阶段状态设置为此值 [Microsoft Project]Set the current project stage status to this value [Microsoft Project]
在项目的当前阶段中设置两个状态域。Sets the two status fields within the current stage of the project.
将理想列表项中的状态域设置为此值 [Microsoft Project]Set the status field in the idea list item to this value [Microsoft Project]
更新原始 SharePoint 列表项的状态域。Updates the status field of the original SharePoint list item.
等待 Project 事件 [Microsoft Project]Wait for Project Event [Microsoft Project]
暂停工作流的当前实例以等待指定的 Project 事件:Project 签入、Project 委托、Project 提交。Pauses the current instance of the workflow to await a specified Project event: Project checked in, Project committed, Project submitted.
将项目中的此域设置为此值 [Microsoft Project]Set this field in the project to this value [Microsoft Project]
设置指定项目的企业自定义域的值。Sets the value for the enterprise custom field for a specified project.

另请参阅See also