SharePoint2010QuickFlow安装及使用
一:QuickFlow的安装
1,从http://quickflow.codeplex.com/下载解决方案包以及设计器。
2,将QuickFlow.dll以及QuickFlow.UI.dll添加到程序集引用。
3,将QuickFlow2010.wsp部署到站点上并激活。
4,创建一个任务列表,用来存储工作流运行后的历史。
二:QuickFlow的使用
1,发布工作流;
选择File—Publish to SharePoint—
2,创建变量;
3,给变量赋值;
在开始节点的AfterRule里面给该变量赋值
4,搜集了一些工作流中常用到的代码。
//获取列表项的Id
string itemId =this.GetVariable("ListitemID").ToString();
//获取列表
SPList cfgList = this.Web.Lists["项目备案信息"];
//获取一条数据
var cfgItem = cfgList.GetItemById(Convert.ToInt32(itemId));
//给申请人变量赋值
SPFieldUserValue ProjectUser= cfgItem.Fields.GetField("ProjectUser").GetFieldValue(cfgItem["ProjectUser"].ToString()) as SPFieldUserValue;
//this.SetVariable("人员", ProjectUser.User.LoginName);
//给项目区域赋值
SPFieldLookupValue proprovince=cfgItem.Fields.GetField("ProjectProvince").GetFieldValue(cfgItem["ProjectProvince"].ToString()) as SPFieldLookupValue ;
this.SetVariable("项目区域",proprovince.LookupValue);
//给项目大区赋值
SPFieldLookupValue probigZone=cfgItem.Fields.GetField("BigZone").GetFieldValue(cfgItem["BigZone"].ToString()) as SPFieldLookupValue ;
this.SetVariable("项目大区",probigZone.LookupValue);
//给项目战区赋值
SPFieldLookupValue proWarZone=cfgItem.Fields.GetField("WarZone").GetFieldValue(cfgItem["WarZone"].ToString()) as SPFieldLookupValue ;
this.SetVariable("项目战区",proWarZone.LookupValue); //到员工信息表中查询总经理
QueryField qfloginname=new QueryField("LoginName");
QueryField headManager=new QueryField("Role"); SPList cfgListEmploy = this.Web.Lists["员工信息"];
//获取一条数据
SPListItemCollection cfgItemhead=ListQuery.From(cfgListEmploy).Where(headManager=="总经理").GetItems(); if(cfgItemhead.Count>)
{
this.SetVariable("总经理",cfgItemhead[]["LoginName"]);
} //获取一条数据
var cfgItemEmploy = ListQuery.From(cfgListEmploy).Where(qfloginname==ProjectUser.User.LoginName).GetItems()[];
if(cfgItemEmploy!=null)
{ this.SetVariable("人员",cfgItemEmploy["Title"]); //给人员区域赋值
SPFieldLookupValue provinceEmploy=cfgItemEmploy.Fields.GetField("Province").GetFieldValue(cfgItemEmploy["Province"].ToString()) as SPFieldLookupValue;
this.SetVariable("人员区域",provinceEmploy.LookupValue); //给人员大区赋值
SPFieldLookupValue BigZoneEmploy=cfgItemEmploy.Fields.GetField("BigZone").GetFieldValue(cfgItemEmploy["BigZone"].ToString()) as SPFieldLookupValue;
this.SetVariable("人员大区",BigZoneEmploy.LookupValue); //给人员战区赋值
SPFieldLookupValue WarZoneEmploy=cfgItemEmploy.Fields.GetField("WarZone").GetFieldValue(cfgItemEmploy["WarZone"].ToString()) as SPFieldLookupValue;
this.SetVariable("人员战区",WarZoneEmploy.LookupValue);
//给申请人上级经理赋值
SPFieldUserValue TopManager= cfgItemEmploy.Fields.GetField("Manager").GetFieldValue(cfgItemEmploy["Manager"].ToString()) as SPFieldUserValue;
this.SetVariable("申请人上级经理", TopManager.User.LoginName); //到大区表中查询数据
SPList cfgListBigZone = this.Web.Lists["大区"];
//获取一条数据 var cfgItemUserBigZone = cfgListBigZone.GetItemById(BigZoneEmploy.LookupId);
var cfgItemProBigZone = cfgListBigZone.GetItemById(probigZone.LookupId);
//给申请人大区经理赋值
if(cfgItemUserBigZone!=null)
{
SPFieldUserValue UserBigZoneManager= cfgItemUserBigZone.Fields.GetField("Manager").GetFieldValue(cfgItemUserBigZone["Manager"].ToString()) as SPFieldUserValue;
this.SetVariable("申请人大区经理",UserBigZoneManager.User.LoginName); }
//给项目大区经理赋值
if(cfgItemProBigZone!=null)
{
SPFieldUserValue ProBigZoneManager= cfgItemProBigZone.Fields.GetField("Manager").GetFieldValue(cfgItemProBigZone["Manager"].ToString()) as SPFieldUserValue;
this.SetVariable("项目大区经理", ProBigZoneManager.User.LoginName); }
//到战区表中查询数据
SPList cfgListwarZone = this.Web.Lists["战区"]; //获取一条数据
var cfgItemUserWarZone=cfgListwarZone.GetItemById(WarZoneEmploy.LookupId);
var cfgItemProWarZone=cfgListwarZone.GetItemById(proWarZone.LookupId); if(cfgItemUserWarZone!=null)
{
//给申请人战区经理赋值
SPFieldUserValue UserWarZoneManager= cfgItemUserWarZone.Fields.GetField("Manager").GetFieldValue(cfgItemUserWarZone["Manager"].ToString()) as SPFieldUserValue;
this.SetVariable("申请人战区经理", UserWarZoneManager.User.LoginName);
}
if(cfgItemProWarZone!=null)
{
//给项目战区经理赋值
SPFieldUserValue ProWarZoneManager= cfgItemProWarZone.Fields.GetField("Manager").GetFieldValue(cfgItemProWarZone["Manager"].ToString()) as SPFieldUserValue;
this.SetVariable("项目战区经理", ProWarZoneManager.User.LoginName);
} }
SharePoint2010QuickFlow安装及使用的更多相关文章
- docker——容器安装tomcat
写在前面: 继续docker的学习,学习了docker的基本常用命令之后,我在docker上安装jdk,tomcat两个基本的java web工具,这里对操作流程记录一下. 软件准备: 1.jdk-7 ...
- 网络原因导致 npm 软件包 node-sass / gulp-sass 安装失败的处理办法
如果你正在构建一个基于 gulp 的前端自动化开发环境,那么极有可能会用到 gulp-sass ,由于网络原因你可能会安装失败,因为安装过程中部分细节会到亚马逊云服务器上获取文件.本文主要讨论在不变更 ...
- Sublime Text3安装JsHint
介绍 Sublime Text3使用jshint依赖Nodejs,SublimeLinter和Sublimelinter-jshint. NodeJs的安装省略. 安装SublimeLinter Su ...
- Fabio 安装和简单使用
Fabio(Go 语言):https://github.com/eBay/fabio Fabio 是一个快速.现代.zero-conf 负载均衡 HTTP(S) 路由器,用于部署 Consul 管理的 ...
- gentoo 安装
加载完光驱后 1进行ping命令查看网络是否通畅 2设置硬盘的标识为GPT(主要用于64位且启动模式为UEFI,还有一个是MBR,主要用于32位且启动模式为bois) parted -a optima ...
- Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级
Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 5.安装Database软件 5. ...
- Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作
Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 1.实施前准备工作 1.1 服务器安装操 ...
- 【原】nodejs全局安装和本地安装的区别
来微信支付有2年多了,从2年前的互联网模式转变为O2O模式,主要的场景是跟线下的商户去打交道,不像以往的互联网模式,有产品经理提需求,我们帮忙去解决问题. 转型后是这样的,团队成员更多需要去寻找业务的 ...
- tLinux 2.2下安装Mono 4.8
Tlinux2.2发行版基于CentOS 7.2.1511研发而成,内核版本与Tlinux2.0发行版保持完全一致,更加稳定,并保持对Tlinux2.0的完全兼容.Mono 4版本要求CentOS 7 ...
随机推荐
- DOM基础操作(三)
DOM剩余的两个操作一并带来! 1.删除操作 removeChild 这个方法依然是父级调用的,参数就是要删除的子节点,其实实际上是剪切,这个方法会把我们删除掉的元素给返回,我们可以用一个变量去保存这 ...
- 关于js的两个函数
注:这两个函数结合其他主要实现异步的默认checkbox选中和其他选中,从php页面穿过来已经选中的值,用jQuery 回绑:关键点在于$.each(),遍历,再用$.attr() 回绑:第二步关键点 ...
- (PowerShell) 重命名文件
Get-ChildItem -Path C:\temp\test -Filter *.txt | Rename-Item -NewName {$_.Basename.Replace("Old ...
- C++ 多线程编程实例【2个线程模拟卖火车票的小程序】
原文:http://blog.csdn.net/chen825919148/article/details/7904219 核心提示:从网上搜集来的非常基础的C++多线程实例,刚入门的可以看看,希望能 ...
- 安卓app开发-03-项目的基本开发步骤
android项目的基本开发步骤 这里分享一下开发 安卓 app 的流程,当然有些感觉不必要,其实不然,前期工作也是极为重要的额,就像开发的时候如果目标不对的话,到后期后很迷的,所以一定要提前做好规划 ...
- 基于Vue的WebApp项目开发(四)
实现新闻咨询页面 目录结构 步骤一:创建newslist.vue文件 <template> <div id="tml"> <!--使用mui框架,实现 ...
- pytorch 文本输入处理
https://blog.csdn.net/nlpuser/article/details/88067167 https://blog.csdn.net/u012436149/article/deta ...
- DHCP服务搭建
DHCP(Dynamic Host Configuration Protocol,动态主机配置协议)是一个局域网的网络协议,使用UDP协议工作, 主要有两个用途:给内部网络或网络服务供应商自动分配IP ...
- linux 下的python的最佳打开方式, you know?
IPython install IPython是Python的交互式Shell,提供了代码自动补完,自动缩进,高亮显示,执行Shell命令等非常有用的特性.特别是它的代码补完功能,例如:在输入zlib ...
- 避免jar依赖冲突的一种办法
java中的依赖冲突问题一直比较头疼,特别是做公用包给其他系统用的时候,现在都不敢引入太多的依赖,基本上每次都要帮别人解决依赖冲突的问题,非常麻烦. 特别是碰到一些老系统还不是用maven管理的,人家 ...