File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd
flowable-engine/src/main/java/org/flowable/engine/impl/cmd Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1717
1818import org .flowable .cmmn .api .history .HistoricCaseInstance ;
1919import org .flowable .cmmn .engine .CmmnEngineConfiguration ;
20+ import org .flowable .cmmn .engine .impl .persistence .entity .HistoricCaseInstanceEntity ;
2021import org .flowable .cmmn .engine .impl .util .CommandContextUtil ;
2122import org .flowable .common .engine .api .FlowableException ;
2223import org .flowable .common .engine .api .FlowableIllegalArgumentException ;
@@ -44,11 +45,16 @@ public Object execute(CommandContext commandContext) {
4445 }
4546 // Check if case instance is still running
4647 CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil .getCmmnEngineConfiguration (commandContext );
47- HistoricCaseInstance instance = cmmnEngineConfiguration .getHistoricCaseInstanceEntityManager ().findById (caseInstanceId );
48+ HistoricCaseInstanceEntity instance = cmmnEngineConfiguration .getHistoricCaseInstanceEntityManager ().findById (caseInstanceId );
4849
4950 if (instance == null ) {
5051 throw new FlowableObjectNotFoundException ("No historic case instance found with id: " + caseInstanceId , HistoricCaseInstance .class );
5152 }
53+ if (instance .isDeleted ()) {
54+ return null ;
55+ }
56+
57+
5258 if (instance .getEndTime () == null ) {
5359 throw new FlowableException ("Case instance is still running, cannot delete " + instance );
5460 }
Original file line number Diff line number Diff line change 2222import org .flowable .common .engine .impl .interceptor .CommandContext ;
2323import org .flowable .engine .compatibility .Flowable5CompatibilityHandler ;
2424import org .flowable .engine .history .HistoricProcessInstance ;
25+ import org .flowable .engine .impl .persistence .entity .HistoricProcessInstanceEntity ;
2526import org .flowable .engine .impl .util .CommandContextUtil ;
2627import org .flowable .engine .impl .util .Flowable5Util ;
2728
@@ -43,11 +44,14 @@ public Object execute(CommandContext commandContext) {
4344 throw new FlowableIllegalArgumentException ("processInstanceId is null" );
4445 }
4546 // Check if process instance is still running
46- HistoricProcessInstance instance = CommandContextUtil .getHistoricProcessInstanceEntityManager (commandContext ).findById (processInstanceId );
47+ HistoricProcessInstanceEntity instance = CommandContextUtil .getHistoricProcessInstanceEntityManager (commandContext ).findById (processInstanceId );
4748
4849 if (instance == null ) {
4950 throw new FlowableObjectNotFoundException ("No historic process instance found with id: " + processInstanceId , HistoricProcessInstance .class );
5051 }
52+ if (instance .isDeleted ()) {
53+ return null ;
54+ }
5155 if (instance .getEndTime () == null ) {
5256 throw new FlowableException ("Process instance is still running, cannot delete " + instance );
5357 }
You can’t perform that action at this time.
0 commit comments