设为首页收藏本站

JEECG官方网站-企业级JAVA快速开发平台

 找回密码
 立即注册

关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 最新动态 - 技术支持 - 师徒架构班

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务 QQ: 3102411850、418799587 商务热线: 18611788525 客服电话: 010-64808099 官方邮箱: jeecgos@163.com

查看: 2300|回复: 1

新人求助:不能用参数指定任务参与者

[复制链接]

1

主题

0

好友

20

积分

新手上路

Rank: 2

发表于 2016-12-27 00:45:09 |显示全部楼层
我的意图是用applyUserId表示当前发起流程者,用变量${deptLeaderId}指定部门领导,用变量${hrGroupId}指定人事审批参与组。
leave.bpmn20.xml的相关代码如下
<startEvent id="startevent1" name="开始" activiti:initiator="applyUserId"></startEvent>
    <userTask id="deptLeaderAudit" name="部门领导审批" activiti:assignee="${deptLeaderId}">
      <documentation>deptLeader.jsp</documentation>
    </userTask>
    ...
    <userTask id="hrAudit" name="人事审批" activiti:candidateGroups="${hrGroupId}">
      <documentation>hr.jsp</documentation>
    </userTask>
    ...
   
Java代码如下:
identityService.setAuthenticatedUserId(userId);//将用户ID设置到当前的线程中
Map<String,Object> variableMap = new HashMap<String,Object>();
variableMap.put("deptLeaderId","40284681575cbfbd01575cd505070012");
variableMap.put("hrGroupId","40284681575cbfbd01575cd21a18000c");
processInstance = this.runtimeService.startProcessInstanceById("leave:5:18713", businessKey, variableMap);

报错如下:
DEBUG- insert HistoricVariableInstanceEntity[id=26258, name=applyUserId, revision=0, type=string, textValue=8a8ab0b246dc81120146dc8181950052]
DEBUG- insert HistoricVariableInstanceEntity[id=26262, name=attendanceGroupId, revision=0, type=string, textValue=40284681575cbfbd01575cd21a18000c]
DEBUG- insert HistoricVariableInstanceEntity[id=26264, name=deptLeaderId, revision=0, type=string, textValue=40284681575cbfbd01575cd505070012]
00:28:09.577 [http-bio-8087-exec-8] DEBUG o.a.e.i.interceptor.CommandContext - Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
### The error may involve org.activiti.engine.impl.persistence.entity.HistoricDetailEntity.bulkInsertHistoricDetailVariableInstanceUpdate-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_HI_DETAIL (ID_, TYPE_, PROC_INST_ID_, EXECUTION_ID_, ACT_INST_ID_, TASK_ID_, NAME_, REV_, VAR_TYPE_, TIME_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_)     values                   (?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?)        ,          (?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?)        ,          (?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?,          ?)
### Cause: java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) ~[mybatis-3.1.1.jar:3.1.1]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147) ~[mybatis-3.1.1.jar:3.1.1]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134) ~[mybatis-3.1.1.jar:3.1.1]
    at org.activiti.engine.impl.db.DbSqlSession.flushBulkInsert(DbSqlSession.java:850) ~[activiti-engine-5.21.0.jar:5.21.0]
    at org.activiti.engine.impl.db.DbSqlSession.flushPersistentObjects(DbSqlSession.java:820) ~[activiti-engine-5.21.0.jar:5.21.0]
    at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:797) ~[activiti-engine-5.21.0.jar:5.21.0]
    at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:618) ~[activiti-engine-5.21.0.jar:5.21.0]
    at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:212) ~[activiti-engine-5.21.0.jar:5.21.0]
    at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:138) ~[activiti-engine-5.21.0.jar:5.21.0]
    at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66) [activiti-engine-5.21.0.jar:5.21.0]
    at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) [activiti-spring-5.21.0.jar:5.21.0]
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [spring-tx-4.0.9.RELEASE.jar:4.0.9.RELEASE]
    at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) [activiti-spring-5.21.0.jar:5.21.0]
    at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37) [activiti-engine-5.21.0.jar:5.21.0]
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) [activiti-engine-5.21.0.jar:5.21.0]
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35) [activiti-engine-5.21.0.jar:5.21.0]
    at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceById(RuntimeServiceImpl.java:118) [activiti-engine-5.21.0.jar:5.21.0]
    at org.jeecgframework.web.activiti.service.impl.LeaveServiceImpl.leaveWorkFlowStart(LeaveServiceImpl.java:60) [LeaveServiceImpl.class:na]
    ...
Caused by: java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) ~[mysql-connector-java-5.1.40.jar:5.1.40]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897) ~[mysql-connector-java-5.1.40.jar:5.1.40]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886) ~[mysql-connector-java-5.1.40.jar:5.1.40]
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860) ~[mysql-connector-java-5.1.40.jar:5.1.40]
    at com.mysql.jdbc.PreparedStatement.setSerializableObject(PreparedStatement.java:3829) ~[mysql-connector-java-5.1.40.jar:5.1.40]
    at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:3559) ~[mysql-connector-java-5.1.40.jar:5.1.40]
    ... 75 common frames omitted
Caused by: java.io.NotSerializableException: org.activiti.engine.impl.variable.StringType
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) ~[na:1.6.0_39]
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) ~[na:1.6.0_39]
    at com.mysql.jdbc.PreparedStatement.setSerializableObject(PreparedStatement.java:3818) ~[mysql-connector-java-5.1.40.jar:5.1.40]
    ... 99 common frames omitted
我用的环境是jdk1.6,mysql数据库,mysql-connector-java-5.1.40.jar驱动,activiti-engine-5.21.0版本。

这个问题困扰我好几天了,万能的互联网,请显灵吧!!!!

3

主题

0

好友

102

积分

注册会员

Rank: 3Rank: 3

发表于 2017-5-1 23:47:30 |显示全部楼层
是mybatis.version版本的问题。调整成3.2.5版本即可
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

Archiver|手机版|JEECG官方网站-企业级JAVA快速开发平台 ( 京ICP备12013567号-3 )  

GMT+8, 2019-1-23 23:56 , Processed in 2.262004 second(s), 19 queries , Gzip On, Memcache On.

JEECG Open Source

© 2001-2012 Comsenz Inc.

回顶部