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查找过程中遇到的单点,我们 ...
随机推荐
- Django-05模型层之单表操作1
7.1 ORM简介 MVC或者MVC框架中包括一个重要的部分,就是ORM,它实现了数据模型与数据库的解耦,即数据模型的设计不需要依赖于特定的数据库,通过简单的配置就可以轻松更换数据库,这极大的减轻了开 ...
- [AGC003F] Fraction of Fractal 矩阵快速幂
Description SnukeSnuke从他的母亲那里得到了生日礼物--一个网格.网格有HH行WW列.每个单元格都是黑色或白色.所有黑色单元格都是四联通的,也就是说,只做水平或垂直移动且只经过 ...
- 【sonar-block】Use try-with-resources or close this "BufferedInputStream" in a "finally" clause.
自己的理解: try-with-resources是JDK7的新语法结构,主要功能是自动关闭资源而不需要在finally里面手动close()关闭, 而且最重要的是,try块中的异常不会被close( ...
- bzoj 2780: [Spoj]8093 Sevenk Love Oimaster(广义SAM)
题目大意:给出n个原串,再给出m个查询串.求每个查询串出现在了多少原串中. 题解 直接对原串建一个广义SAM,然后把每一个原串放到SAM上跑一跑,记录一下每一个状态属于多少个原串,用$size$表示. ...
- [转]IOS UIView 之属性篇
[转载自:IOS UIView 之属性篇 From CSDN] UIView 继承于UIResponder 所遵守的协议有 NSCoding .UIAppearance. UI ...
- 04. prosition 的值都有哪些,其最本质的区别在哪里?
4.prosition 的值都有哪些,其最本质的区别在哪里? position:relative 相对定位 position:fixed 相对浏览器定位 position:absolute 绝对定位 ...
- vue-devtools 必备开发工具
转载自:http://blog.csdn.net/sinat_17775997/article/details/70224280 最近在研究vue单页面应用,一步一步用上全家桶,开发避免不了的就是调试 ...
- python全栈开发_day11_作用域,函数嵌套和闭包
一:作用域 1)什么是作用域 作用域是规定一个变量可以作用的范围,运行和销毁的范围 2)作用域的分类 1.内置作用域built_in:随着解释器的运行而产生,解释器运行的终止而销毁. 2.全局作用域g ...
- sql拼接列字符串
1.使用函数(sql2000以上) )) ) AS BEGIN ) select @v = isnull(@v + ',','')+code FROM dict WHERE type=@filter ...
- HDFS 删除大量文件
hdfs dfs -find <path> | xargs -n 1000 hdfs dfs -rm -skipTrash