使用findExecutionById()的疑问

LieZueYang 2010-03-19
说实话,我还是觉得这个 id 有问题,你有空的话可以建一个测试的工程试一下
xyz20003 2010-03-19
    public void testFindExecutionById() {
        ProcessEngine processEngine = new Configuration()
            .buildProcessEngine();
        RepositoryService repositoryService = processEngine
            .getRepositoryService();
        String str = "<process name='hello' xmlns='http://jbpm.org/4.2/jpdl'>"
            + "<start>" + "<transition to='task'/>" + "</start>"
            + "<task name='task' assignee='lingo'>"
            + "<transition to='end'/>" + "</task>" + "<end name='end'/>"
            + "</process>";

        String deploymentDbid = repositoryService.createDeployment()
                                                 .addResourceFromString("process.jpdl.xml",
                str).deploy();



        ExecutionService executionService = processEngine
            .getExecutionService();

        ProcessInstance processInstance = executionService
            .startProcessInstanceByKey("hello");
        String piId = processInstance.getId();

        Execution execution = executionService.findExecutionById(piId);
        assertNotNull(execution);
    }

该单元测试可以成功运行,没有异常。

实际上应该是由你来提交测试用例才对,因为只有你才能重现这个问题。
LieZueYang 2010-03-19
为知你 String piId = processInstance.getId();的值是什么?
LieZueYang 2010-03-19
如果刚好也是一个 id 值那就不会有这样的问题,如果是流程name+id值 就会报错了
卡拉阿风 2010-03-19
xyz20003 写道
xxxx.jsp?id=xxx

可以参考jsp-2.0支持的el表达式。

原来是手动输入。。。
~(@^_^@)~
xyz20003 2010-03-19
id即为name+dbid

有问题需要拿出可以重现情况的测试用例来,空对空没什么意义。
LieZueYang 2010-03-19
数据库表:

2 testid numeric 9 0
1 testname varchar 50 1


hbm文件:
    <class name="Test" table="test" schema="dbo" catalog="testjbpm">
        <id name="testid" type="java.lang.Long">
            <column name="testid" precision="18" scale="0" />
            <generator class="assigned" />
        </id>
        <property name="id" type="java.lang.String">
            <column name="testname" length="50" />
        </property>
    </class>


HQL语句:Query query=session.createQuery("from Test t where t.id=:id");

最后它调用的还是 testid,  我现在不是说是jbpm的问题, 我是想问这是不是hibernate的问题

xyz20003 2010-03-20
我们论坛这边也有一个人遇到了一样的问题。

http://old.family168.com/bbs/dispbbs.asp?boardid=6&Id=1186

看看是不是因为驱动问题,或者依赖版本问题造成的吧。
卡拉阿风 2010-03-22
xyz20003 写道
我们论坛这边也有一个人遇到了一样的问题。

http://old.family168.com/bbs/dispbbs.asp?boardid=6&Id=1186

看看是不是因为驱动问题,或者依赖版本问题造成的吧。

TaskService taskService = processEngine.getTaskService();
ExecutionService executionService = processEngine.getExecutionService();
Task task = taskService.getTask(taskId);
String excutionId = task.getExecutionId();
executionService.findExecutionById(excutionId);

//taskId有值。能正常取出task。但为什么excutionId的值取不到?
谢谢临远大哥了!!


卡拉阿风 2010-03-22
我是mysql得数据库。同样遇到了这个问题- -
Global site tag (gtag.js) - Google Analytics