JBPM executionService.deleteProcessInstanceCascade(id)报错
生活随笔
收集整理的這篇文章主要介紹了
JBPM executionService.deleteProcessInstanceCascade(id)报错
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
JBPM版本4.3?
?
代碼:?
?
。。。ExecutionService executionService = processEngine.getExecutionService();
ProcessInstance pi = executionService.startProcessInstanceByKey("workflowXX");
String exId = pi.findActiveExecutionIn("XXState").getId();
executionService.signalExecutionById(exId);//拋出ORA-01722: 無效數字"異常
。。。
?
?
?
?
跟蹤后發現時在執行jbpm.execution.hbm.xml文件中的命名查詢findExecutionById時引發的異常,?
最終生成的sql中將execution.id映射成了execution.dbId(生成sql的片段:where executioni0_.DBID_=?)?
由于dbId是long型,而id是String型,所以導致了該異常。?
?
<query name="findExecutionById"><![CDATA[
select execution
from org.jbpm.pvm.internal.model.ExecutionImpl as execution
where execution.id = :id
]]>
</query>
<class name="ExecutionImpl"
table="JBPM4_EXECUTION"
discriminator-value="pvm">
<id name="dbid" column="DBID_">
<generator class="assigned" />
</id>
<discriminator><column name="CLASS_" /></discriminator>
<version name="dbversion" column="DBVERSION_" />
<property name="activityName" column="ACTIVITYNAME_" />
<property name="processDefinitionId" column="PROCDEFID_" />
<property name="hasVariables" column="HASVARS_" />
<map name="variables"
cascade="all-delete-orphan">
<key foreign-key="FK_VAR_EXECUTION">
<column name="EXECUTION_" index="IDX_VAR_EXECUTION"/>
</key>
<map-key type="string" column="KEY_" />
<one-to-many class="org.jbpm.pvm.internal.type.Variable" />
</map>
<map name="systemVariables"
cascade="all-delete-orphan">
<key foreign-key="FK_VAR_EXESYS">
<column name="EXESYS_" index="IDX_VAR_EXESYS"/>
</key>
<map-key type="string" column="KEY_" />
<one-to-many class="org.jbpm.pvm.internal.type.Variable" />
</map>
<property name="name" column="NAME_" />
<property name="key" column="KEY_" />
<property name="id" column="ID_" unique="true" />
試過刪除對id屬性的映射,發現都不會報錯~~
<property name="state" column="STATE_" />
<property name="suspendHistoryState" column="SUSPHISTSTATE_" />
<property name="priority" column="PRIORITY_" />
<property name="historyActivityInstanceDbid" column="HISACTINST_" />
<list name="executions"
cascade="all-delete-orphan"
inverse="false"
lazy="false">
<key column="PARENT_" foreign-key="FK_EXEC_PARENT" />
<list-index column="PARENT_IDX_" />
<one-to-many class="ExecutionImpl" />
</list>
<map name="swimlanes"
cascade="all-delete-orphan">
<key foreign-key="FK_SWIMLANE_EXEC">
<column name="EXECUTION_" index="IDX_SWIMLANE_EXEC"/>
</key>
<map-key type="string" column="NAME_" />
<one-to-many class="org.jbpm.pvm.internal.task.SwimlaneImpl" />
</map>
<many-to-one name="parent"
column="PARENT_"
class="ExecutionImpl"
foreign-key="FK_EXEC_PARENT"
index="IDX_EXEC_PARENT"
lazy="false" />
<many-to-one name="processInstance"
class="ExecutionImpl"
column="INSTANCE_"
foreign-key="FK_EXEC_INSTANCE"
index="IDX_EXEC_INSTANCE"
lazy="false" />
<many-to-one name="superProcessExecution"
column="SUPEREXEC_"
class="ExecutionImpl"
foreign-key="FK_EXEC_SUPEREXEC"
index="IDX_EXEC_SUPEREXEC" />
<many-to-one name="subProcessInstance"
column="SUBPROCINST_"
class="ExecutionImpl"
foreign-key="FK_EXEC_SUBPI"
index="IDX_EXEC_SUBPI" />
</class>
?
這個問題是由于hibernate版本的問題導致的,使用jbpm包里面自帶的hibernate后就沒有問題了
轉載于:https://www.cnblogs.com/gaoyoubo/articles/1837757.html
總結
以上是生活随笔為你收集整理的JBPM executionService.deleteProcessInstanceCascade(id)报错的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 遭遇奸商(主板篇)
- 下一篇: SQL Server 2005中创建CL