使用C#代码审批/转签K2 Blackpearl流程
转:http://www.cnblogs.com/dannyli/archive/2011/08/02/2125302.html
以下是使用代码审批、转签k2 blackpearl流程,初探K2 Blackpearl,望高人多多包涵、指点.

//执行动作
private void MyAction(string argAction)
{
//创建连接对象
SourceCode.Workflow.Client.Connection wfcon = new SourceCode.Workflow.Client.Connection();
//打开K2连接
string k2Server = System.Configuration.ConfigurationManager.AppSettings["K2Server"];
string workflowServicePort = System.Configuration.ConfigurationManager.AppSettings["WorkflowServicePort"];
wfcon.Open(k2Server + ":" + workflowServicePort); //当前用户打开
wfcon.ImpersonateUser(HttpContext.Current.User.Identity.Name); //获取流程列表
SourceCode.Workflow.Client.WorklistItem worklistitem = wfcon.OpenWorklistItem(SN); /*
//获取流程实例编号
string[] _SN = SN.Split('_');
int _ID = int.Parse(_SN[0]);
//获取流程实例
SourceCode.Workflow.Client.ProcessInstance proInst = wfcon.OpenProcessInstance(_ID);
//DataFields赋值
proInst.DataFields["TaskUsers"].Value = ddlTaskUsers.SelectedValue;
//更新DataFields
procinst.Update();
*/ //查找action(执行动作)
foreach (SourceCode.Workflow.Client.Action action in worklistitem.Actions)
{
if (action.Name.Equals(argAction))
{
//执行动作
action.Execute();
}
}
wfcon.Dispose();
} //转签
protected void ProcRedirect(string argEmpName)
{
//创建连接对象
SourceCode.Workflow.Client.Connection wfcon = new SourceCode.Workflow.Client.Connection(); //打开K2连接
string k2Server = System.Configuration.ConfigurationManager.AppSettings["K2Server"];
string workflowServicePort = System.Configuration.ConfigurationManager.AppSettings["WorkflowServicePort"];
wfcon.Open(k2Server + ":" + workflowServicePort); wfcon.ImpersonateUser(HttpContext.Current.User.Identity.Name); //获取流程列表
SourceCode.Workflow.Client.WorklistItem worklistitem = wfcon.OpenWorklistItem(SN);
//转签
worklistitem.Redirect(argEmpName);
//释放资源
wfcon.Dispose();
}

流程图如下:
使用C#代码审批/转签K2 Blackpearl流程的更多相关文章
- 使用C#代码发起K2 Blackpearl流程
转:http://www.cnblogs.com/dannyli/archive/2011/08/02/2125285.html 使用C#代码,发起一个K2的流程,其形式和链接SQL Server数据 ...
- 部署K2 Blackpearl流程时出错(由于目标计算机积极拒绝,无法连接)
转:http://www.cnblogs.com/dannyli/archive/2011/12/01/2270118.html 亲,如果你也遇到过这个问题,就请继续往下看哦 在部署K2 Blackp ...
- K2 blackpearl 流程开发(二)
转:http://blog.csdn.net/gxiangzi/article/details/8444590 本来想一篇文章把流程开发介绍完的,后来发现实在是太多了,只好分成两部分了.上一篇很简单的 ...
- K2 blackpearl 流程开发(一)
转:http://blog.csdn.net/gxiangzi/article/details/8444060 郁闷,今天K2的license过期了,很多东西都没法用了,还得去找PM大大帮忙申请一个. ...
- 部署K2 Blackpearl流程时出错(与基础事务管理器的通信失败或Communication with the underlying transaction manager has failed.
转:http://www.cnblogs.com/dannyli/archive/2011/12/01/2270222.html 亲,在部署K2流程是,是否遇到这个错误(以下是中.英文错误信息) 中文 ...
- K2 Blackpearl开发技术要点(Part2)
转:http://www.cnblogs.com/dannyli/archive/2012/09/14/2685282.html K2 Blackpearl开发技术要点(Part2)
- K2 Blackpearl开发技术要点(Part1)
转:http://www.cnblogs.com/dannyli/archive/2012/09/14/2685260.html K2 Blackpearl开发技术要点(Part1) 预知后事如何,请 ...
- K2 blackpearl 安装
转:http://blog.csdn.net/gxiangzi/article/details/8432188 K2是国外的一款BPM引擎,基于MS的Workflow,关于它的详细介绍在我之前一片博客 ...
- K2 Blackpearl 4.6.8 安装步骤详解
由于某些原因,我幼小的心灵受到了很大的创伤,倍感世态之炎凉,久久不能愈合,也因此很久没再接触K2 Blackpearl了.偶然来了兴趣,想整个K2的环境,闲暇之余了解其新功能,温故知新,也希望从中能讨 ...
随机推荐
- hdu 1567 2006 (题意理解容易出错)
#include<stdio.h> #include<vector> #include<algorithm> using namespace std; struct ...
- 分布式 Key-Value 存储系统:Cassandra 入门
Apache Cassandra 是一套开源分布式 Key-Value 存储系统.它最初由 Facebook 开发,用于储存特别大的数据. Cassandra 不是一个数据库,它是一个混合型的非关系的 ...
- jQuery deferred when用法
一.什么是deferred对象? 开发网站的过程中,我们经常遇到某些耗时很长的javascript操作.其中,既有异步的操作(比如ajax读取服务器数据),也有同步的操作(比如遍历一个大型数组),它们 ...
- php静态
static 是定义一个静态对象或静态变量,关于static 定义的变量或类方法有什么特性我们看完本文章的相关实例后就见分晓了. 1. 创建对象$object = new Class(),然后使用”- ...
- Codecademy For Python学习笔记
一.Python Lists and Dictionaries: 1. 2.
- vmware 虚拟机 桥接 设置静态 IP
最简单的方式: 图形界面下,进入设置IP的地方,设置一个静态IP. 然后再转入命令行继续工作.. 不行就 重启
- PowerDesigner15.1创建模型及生成带注释sql操作手册
转自:http://blog.csdn.net/huiwenjie168/article/details/7824029 一.创建模型 操作:file-->new Model… 快捷键:ctrl ...
- 《c程序设计语言》读书笔记--首次输入不能是空符;最多10个字符
#include <stdio.h> #define Num 10 int main() { int wor = 0; int arr[Num] = {0}; int c,count = ...
- pyhton小方法
import osa = os.walk('.') for i in a: print(i)
- 下拉刷新控件(4)SwipeRefreshLayout官方教程(上)如何在应用中使用它
http://developer.android.com/training/swipe/add-swipe-interface.html 1,在布局xml和代码中使用它 2,在menu中添加它 The ...