Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

疑问急 #11

Open
longxiangtest opened this issue Mar 9, 2018 · 4 comments
Open

疑问急 #11

longxiangtest opened this issue Mar 9, 2018 · 4 comments

Comments

@longxiangtest
Copy link

测试后加签
Assert.assertEquals("step2", taskService.createTaskQuery().singleResult().getTaskDefinitionKey());
返回报错,报错原因taskService.createTaskQuery().singleResult() 不址一条数据,这块是什么原因导致,我直接运行所有test就报这个,请帮忙

@longxiangtest
Copy link
Author

主要错误
org.activiti.engine.ActivitiException: Query return 43 results instead of max 1
at org.activiti.engine.impl.AbstractQuery.executeSingleResult(AbstractQuery.java:187)

@aizya
Copy link

aizya commented Mar 19, 2018

@longxiangtest 你改了代码么? 这里的问题是singleResult() 取到了多条数据,换成list(),然后在get(0).
这种方式很蠢。。。具体出现的原因不是很清楚。

 @SuppressWarnings("unchecked")
  public U singleResult() {
    this.resultType = ResultType.SINGLE_RESULT;
    if (commandExecutor!=null) {
      return (U) commandExecutor.execute(this);
    }
    // 你的commandExecutor为空,但是我不知道为什么会空。。。
    return executeSingleResult(Context.getCommandContext());
  }

@yuyi2015
Copy link

yuyi2015 commented Apr 4, 2018

应该是用户自己执行的时候没把任务结束掉 结果好多就会出这个错误啦

@hwfy
Copy link

hwfy commented Aug 9, 2018

我也碰到这样问题,原因是在bin目录下生成的任务节点错误,请检查下流程图

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants