使用VS2012 开发SharePoint 2013 声明式的action(activity) 综合实例
2013-10-15 18:22
337 查看
本文讲述使用VS2012 开发SharePoint 2013 声明式的action 综合实例。
需求同: /article/1786641.html
基本操作参考: /article/1786640.html
实现步聚 :
1.新建SharePoint 2013 empty solution(选择farm solution或sandbox solution均可)
2. 新建Custom action(命名为 SendTopNNews)
3. 添加Try catch activity 和 定义输入输出参数
4. 定义内部变量
5. 使用Build Dynamic Value构建requestHeader
6. 使用 httpsend activity 调用web service 返回jsonResult
7. 使用If分支 activity (如果 responsecode 为 OK, 开始构建MailBody, 否则输出错误)
8. 否定分支
9. 条件成立分支
a. 获取记录条数并初始 MailBody
b.添加循环While activity 拼接Mailbody
b.1 条件为“loopIndex < itemsCount”
b.2 循环体内容
10.在循环体外结束Mailbody
11. 将是否成功的信号变量设置为ture
12. 收起Try-Catch 的 Try 部分,设置Catch部分的异常 处理
13. 更新 SendTopNNews.actions4
14. 部署解决方案 (action4会被部署到 ~ProgramFiles\Common Files\microsoft shared\Web ServerExtensions\15\TEMPLATE\FEATURES\SendTopNNews_Feature1\SendTopNNews\SendTopNNews.actions4 , Xaml将会被部署到 ProgramFiles\Common Files\microsoft shared\Web ServerExtensions\15\TEMPLATE\FEATURES\SendTopNNews_Feature1\SendTopNNews\SendTopNNews.xaml)
15. 清空 SharePoint designer 2013的缓存 C:\Users\alias\AppData\Local\Microsoft\WebsiteCache
16. 启动 SharePoint designer 2013,创建测试工作流
17.发布工作流 ,启动工作流测试并查看结果:
需求同: /article/1786641.html
基本操作参考: /article/1786640.html
实现步聚 :
1.新建SharePoint 2013 empty solution(选择farm solution或sandbox solution均可)
2. 新建Custom action(命名为 SendTopNNews)
3. 添加Try catch activity 和 定义输入输出参数
4. 定义内部变量
5. 使用Build Dynamic Value构建requestHeader
6. 使用 httpsend activity 调用web service 返回jsonResult
7. 使用If分支 activity (如果 responsecode 为 OK, 开始构建MailBody, 否则输出错误)
8. 否定分支
9. 条件成立分支
a. 获取记录条数并初始 MailBody
b.添加循环While activity 拼接Mailbody
b.1 条件为“loopIndex < itemsCount”
b.2 循环体内容
10.在循环体外结束Mailbody
11. 将是否成功的信号变量设置为ture
12. 收起Try-Catch 的 Try 部分,设置Catch部分的异常 处理
13. 更新 SendTopNNews.actions4
<Action Name="SendTopNNews" ClassName="SendTopNNews.SendTopNNews" Category="Custom" AppliesTo="all"> <RuleDesigner Sentence="Web service adress is %1, out put mail body to %2, out put result code to %3"> <!-- Define the UI widgets SharePoint designer should use for configuring this action --> <FieldBind Field="WebServiceUrl" Text="Web service url" Id="1" DesignerType="TextOnly" DisplayName="Web service url" /> <FieldBind Field="MailBody" Text="return MailBody" Id="2" DesignerType="ParameterNames" DisplayName="return MailBody" /> <FieldBind Field="Successed" Text="resultCode" Id="3" DesignerType="ParameterNames" DisplayName="resultCode" /> </RuleDesigner> <Parameters> <Parameter Name="WebServiceUrl" Type="System.String, mscorlib" Direction="In" DesignerType="TextOnly" Description="Set the WebServiceUrl" /> <Parameter Name="MailBody" Type="System.String, mscorlib" Direction="Out" DesignerType="ParameterNames" Description="return MailBody" /> <Parameter Name="Successed" Type="System.Boolean, mscorlib" Direction="Out" DesignerType="ParameterNames" Description="resultCode" /> </Parameters> </Action>
14. 部署解决方案 (action4会被部署到 ~ProgramFiles\Common Files\microsoft shared\Web ServerExtensions\15\TEMPLATE\FEATURES\SendTopNNews_Feature1\SendTopNNews\SendTopNNews.actions4 , Xaml将会被部署到 ProgramFiles\Common Files\microsoft shared\Web ServerExtensions\15\TEMPLATE\FEATURES\SendTopNNews_Feature1\SendTopNNews\SendTopNNews.xaml)
15. 清空 SharePoint designer 2013的缓存 C:\Users\alias\AppData\Local\Microsoft\WebsiteCache
16. 启动 SharePoint designer 2013,创建测试工作流
17.发布工作流 ,启动工作流测试并查看结果:
相关文章推荐
- 使用VS2012 开发SharePoint 2013 声明式的action(activity) 综合实例
- 使用VS2012 开发SharePoint 2013 客户化的action (代码)
- SharePoint 2013 SharePoint designer 2013 workflow开发综合实例
- SharePoint 2013 配置开发环境,需安装VS2012插件
- VLC详细的使用说明以及配置说明综合示范实例精通VLC开发
- VLC详细的使用说明以及配置说明综合示范实例精通VLC开发
- android开发(26) 和其他应用交换数据方式一,使用intent指定自定义action调用其他程序里的activity,并获得其返回的结果
- VS2012 开发SharePoint 2013 声明式workflow action(activity)之 HelloWorld
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序 Excel Services中新功能
- VLC详细的使用说明以及配置说明综合示范实例精通VLC开发
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序 WORD自动服务和新的PowerPoint自动服务
- VLC详细的使用说明以及配置说明综合示范实例精通VLC开发
- VLC详细的使用说明以及配置说明综合示范实例精通VLC开发
- VLC详细的使用说明以及配置说明综合示范实例精通VLC开发
- SharePoint 2013 配置开发环境,需安装VS2012插件
- VLC详细的使用说明以及配置说明综合示范实例精通VLC开发
- android开发(26) 和其他应用交换数据方式一,使用intent指定自定义action调用其他程序里的activity,并获得其返回的结果
- VLC详细的使用说明以及配置说明综合示范实例精通VLC开发
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第3章节--SharePoint 2013 开发者工具 使用Napa开发SharePoint应用程序
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第3章节--SharePoint 2013 开发人员工具 使用Napa开发SharePoint应用程序