工作流问题:实现TaskListener接口,不能继承Controller。

异常:

严重: Error while closing command context

org.activiti.engine.ActivitiException: Exception while invoking TaskListener: Exception while invoking TaskListener: null

at org.activiti.engine.impl.persistence.entity.TaskEntity.fireEvent(TaskEntity.java:742)

at org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior.execute(UserTaskActivityBehavior.java:212)

at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60)

代码:

public class ManagerTaskHandler extends Controller  implements TaskListener {   //不能extends session  controller这种东西。  

private static final long serialVersionUID = 1L;

@Override

public void notify(DelegateTask delegateTask) {

    Record adminUser = CNSessionManage.getAdminSessionAttr(this);

System.out.println("userName   "+ adminUser.get("userName"));

delegateTask.setAssignee(adminUser.get("userName"));

}

}

请问:jfinal不通过Controller,怎么获取session


评论区

JFinal

2019-06-03 19:25

试试这个 JFinal.me().getServletContexnt().getSession();

映玥无痕

2019-06-10 10:10

@JFinal 大佬,我只能用人世间最庸俗的东西表示感谢。

JFinal

2019-06-10 10:12

@映玥无痕 感谢你对社区的支持

热门反馈

扫码入社