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查找过程中遇到的单点,我们 ...
随机推荐
- centos7 修改网卡eth0 关闭ipv6 问题总结
1. 首先关闭"NetworkManager" 服务. 然后编辑网卡的配置文件将里面的NAME DEVICE项修改为eth0 vim /etc/sysconfig/network- ...
- 三,PHP中错误日志display_errors与error_reporting配置
1,display_errors display_errors 错误回显,一般常用语开发模式,但是很多应用在正式环境中也忘记了关闭此选项.错误回显可以暴露出非常多的敏感信息,为攻击者下一步攻击提供便利 ...
- linux awk 文本分析实例 [视频]
实例: 点我打开哔哩哔哩 实战: 点我打开哔哩哔哩 以下是一个分享: ➜ log Time Now 16:23:35 > awk '/Installed/' yum.log* | awk -F ...
- JPush Android 推送如何区分开发、生产环境
我们 Android 开发者在使用极光推送时可能会发现,在通过官方控制台进行推送时.只有 iOS 区分了开发和生产环境,而 Android 则没有.但实际开发中又确实经常需要针对开发和生产环境分别来推 ...
- CF1097D Makoto and a Blackboard(期望)
link 题目大意:给您一个数 n, 每次从n的所有约数(包含1.n)中等概率选出一个约数替换n,重复操作k次,求最后结果期望值%1e9+7. 题解:考虑暴力,我们设f(n,k)代表答案,则有f(n, ...
- leetcode-821-Shortest Distance to a Character
题目描述: Given a string S and a character C, return an array of integers representing the shortest dist ...
- flask内置函数 send_static_file(filename)
内部使用的函数将静态文件从静态文件夹发送到浏览器. current_app.send_static_file(filename)
- Win10远程连接,出现身份验证错误。远程计算机要求的函数不受支持 这可能是由于CredSSP加密Oracle修正 。
问题: 升级至win10 最新版本10.0.17134,安装最新补丁后无法远程win server 2016服务器,报错信息如下: 出现身份验证错误,要求的函数不正确,这可能是由于CredSSP加密O ...
- C# 连接Oracle 11g 无需安装Oracle客户端
1.首先到Oracle网站上下载ODAC 下载地址1:http://download.csdn.net/detail/easyboot/9456476 下载地址2:http://www.oracle. ...
- mysql安装启动 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
首次安装mysql 启动 mysql -uroot 以下错误: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using ...