K2.ActivityInstanceDestination.User is NULL
his one caught me by surprise! I needed to build up a CSV list of email addresses for all previous task owners for an activity, so the simplest way would be to just append the email address each time we get to the task, right? Apparently not.
Here’s my code:
K2.ProcessInstance.DataFields["AllApproversEmailAddresses"].Value = K2.ActivityInstanceDestination.User.Email;
Nothing too complicated. However, running it gave me the dreaded (and oh so informative) “Object reference not set to an instance of an object”. So what’s happening?
Well, it’s actually not that complicated. Basically when you create any activity the default destination rule is “Plan Just Once” (in fact you don’t even have the option of choosing anything else unless you run the Activity wizard in advanced mode.) Anyway, when this option is chosen the destination instance isn’t actually created, which means that K2.ActivityInstanceDestination will always return null.
To get around this issue you will need to do the following:
- Right-click the activity to open the activity properties.
- Click on the Destination Rule Options tab, and then click the ‘Back’ button on the wizard.
- Check the box which says “Run this wizard in advanced mode”, then click “Next”.
- You’ll see that “Plan per slot (no destinations)” is selected. Choose “All at once” and then click through the rest of the wizard.
- Deploy and test.
That’s it. Hope that helps someone!
K2.ActivityInstanceDestination.User is NULL的更多相关文章
- K2工作流引擎Demo
---恢复内容开始--- 以前的工作都是电商网站形式的,从未接触过工作流相关工作,新公司是传统制造业行业,我进的这个组又是做工作流这块相关工作的,所以避免不了和工作流打交道. 这边工作流主要用K2来做 ...
- 求两条直线相交点 AS3代码
,); ,); ,); ,); var p:Point = new Point(); trace(checkPoint()) function checkPoint() { if (p1Start.x ...
- Java集合容器简介
Java集合容器主要有以下几类: 1,内置容器:数组 2,list容器:Vetor,Stack,ArrayList,LinkedList, CopyOnWriteArrayList(1.5),Attr ...
- AS3 求两条直线的交点
//粘贴到帧上运行即可 var p1Start:Point = new Point(0,0); var p1End:Point = new Point(50,50); var p2Start:Poin ...
- php版的求表达式的真值表-TrueValueTable
贴上代码: <?php error_reporting(E_ALL & ~E_NOTICE); $expression=$_GET['TrueTable']; //读取输入框数据 if( ...
- Java集合框架类
java集合框架类图 Collection接口(List.Set.Queue.Stack):
- java容器类
一. 容器类: 下图摘自<Java编程思想>,很好地展示了整个容器类的结构. 由上图可知,容器类库可分为两大类,各自实现了Collection接口和Map接口,下面就常见的类进行一下分类 ...
- java集合框架容器 java框架层级 继承图结构 集合框架的抽象类 集合框架主要实现类
本文关键词: java集合框架 框架设计理念 容器 继承层级结构 继承图 集合框架中的抽象类 主要的实现类 实现类特性 集合框架分类 集合框架并发包 并发实现类 什么是容器? 由一个或多个确 ...
- 【BZOJ 4605】崂山白花蛇草水 替罪羊树套线段树
外层是借鉴了kd-tree的替罪羊里层是线段树,插入就是正常插入+拍扁重建,查询的时候,我们就像树状数组套线段树一样操作在替罪羊中找到的线段树根节点,但是对于在kd-tree查找过程中遇到的单点,我们 ...
随机推荐
- VSM Import Cluster功能验证一(准备篇)
一.概述 本文档记录了VSM Import Cluster功能验证过程及过程中遇到的问题. 二.准备 2.1.网络规划 1) Management Network:VSM控制节点对其他节点的管理网络, ...
- POJ - 2387 Til the Cows Come Home (最短路Dijkstra+优先队列)
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before ...
- linux下的常用指令
1,在vim中查找字符段 :1?字段名,此方式可以从开始向下查询字段了. :?字段名 ,查询字都段: 2,修改某个文件夹用户和组 修改文件所属用户:chown [-R] 用户 文件或目录 如:chow ...
- docker kafka 修改hostname导致的问题
昨天发现开发环境的3台kafka无法消费,所以今日kafka的容器执行如下语句 bash-4.4# ./kafka-topics.sh --describe --zookeeper 192.168.0 ...
- Chrome插件下载和安装方法
http://jingyan.baidu.com/article/e4511cf35c2df92b845eafb3.html 扩展程序的下载方法 1 每个 Chrome 扩展程序 都有一个固定的 ...
- QQ第三方登陆示例
先上图 若想实现QQ登录,需要成为QQ互联的开发者,审核通过才可实现.注册方法可参考链接http://wiki.connect.qq.com/%E6%88%90%E4%B8%BA%E5%BC%80%E ...
- ES6(二) 函数
箭头函数 是简写,不要function 1.如果有且仅有一个参数,()可以不写 2.如果有且仅有一条语句,而且是return,{}也可以不写 let arr=[12,23,5,6] // arr.so ...
- 高阶篇:4.1)QFD质量功能展开-总章
本章目的:了解QFD概念和作用,为FMEA打下基础. 1.QFD定义 质量功能展开QFD(Quality Function Deployment),是把顾客或市场的要求转化为设计要求.零部件特性.工艺 ...
- 洛谷 P4248 / loj 2377 [AHOI2013] 差异 题解【后缀自动机】【树形DP】
可能是一个 SAM 常用技巧?感觉 SAM 的基础题好多啊.. 题目描述 给定一个长度为 \(n\) 的字符串 \(S\) ,令 \(T_i\) 表示它从第 \(i\) 个字符开始的后缀,求: \[ ...
- linux 系统管理(2) 文件或目录数量统计
统计某文件夹下文件的个数 ls -l |grep "^-"|wc -l 统计某文件夹下目录的个数 ls -l |grep "^d"|wc -l 统计文件夹下文件 ...