[
https://jira.jboss.org/jira/browse/JBPM-2679?page=com.atlassian.jira.plug...
]
Peter Horvath updated JBPM-2679:
--------------------------------
Description:
ExecutionService deleteProcessInstance() and deleteProcessInstanceCascade() should throw
an exception if the specified process instance is not found.
Current ExecutionService deleteProcessInstance() and deleteProcessInstanceCascade()
implementations call the method public void deleteProcessInstance(String
processInstanceId, boolean deleteHistory) in DbSessionImpl
The code tries to lookup the process instance, but the deletion is only attempted if the
process instance is found:
ExecutionImpl processInstance = (ExecutionImpl)
findProcessInstanceByIdIgnoreSuspended(processInstanceId);
if (processInstance!=null) {
// delete remaining tasks for this process instance
List<TaskImpl> tasks = findTasks(processInstanceId);
for (TaskImpl task: tasks) {
session.delete(task);
}
// delete remaining jobs for this process instance
JobImpl currentJob = EnvironmentImpl.getFromCurrent(JobImpl.class, false);
List<JobImpl> jobs = findJobs(processInstanceId);
for (JobImpl job: jobs) {
if (job!=currentJob){
session.delete(job);
}
}
if (log.isDebugEnabled()) {
log.debug("deleting process instance "+processInstanceId);
}
session.delete(processInstance);
}
Since not finding a process instance usually indicates an error, the method should throw
an exception to notify caller code.
I think this code should be modified to throw an exception if the process instance is not
found:
ExecutionImpl processInstance = (ExecutionImpl)
findProcessInstanceByIdIgnoreSuspended(processInstanceId);
if (processInstance==null) {
throw new JbpmException("processInstance is not found");
}
...
was:
ExecutionService deleteProcessInstance() and deleteProcessInstanceCascade() should throw
an exception if the specified process instance is not found.
Current ExecutionService deleteProcessInstance() and deleteProcessInstanceCascade()
implementations call the method public void deleteProcessInstance(String
processInstanceId, boolean deleteHistory) in DbSessionImpl
The code tries to lookup the process instance, but the deletion is only attempted if the
process instance is found:
ExecutionImpl processInstance = (ExecutionImpl)
findProcessInstanceByIdIgnoreSuspended(processInstanceId);
if (processInstance!=null) {
// delete remaining tasks for this process instance
List<TaskImpl> tasks = findTasks(processInstanceId);
for (TaskImpl task: tasks) {
session.delete(task);
}
// delete remaining jobs for this process instance
JobImpl currentJob = EnvironmentImpl.getFromCurrent(JobImpl.class, false);
List<JobImpl> jobs = findJobs(processInstanceId);
for (JobImpl job: jobs) {
if (job!=currentJob){
session.delete(job);
}
}
if (log.isDebugEnabled()) {
log.debug("deleting process instance "+processInstanceId);
}
session.delete(processInstance);
}
Since not finding a process instance usually indicates an error, the method should throw
an exception to notify caller code.
I think this code should be modified to throw an exception if the process instance is not
found:
ExecutionImpl processInstance = (ExecutionImpl)
findProcessInstanceByIdIgnoreSuspended(processInstanceId);
if (processInstance==null) {
throw new JbpmException("processInstance is not found");
}
...
ExecutionService deleteProcessInstance() and
deleteProcessInstanceCascade() silently fails if processinstance is not found
--------------------------------------------------------------------------------------------------------------------------
Key: JBPM-2679
URL:
https://jira.jboss.org/jira/browse/JBPM-2679
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: jBPM 4.x
Environment: JBPM 4.2
Reporter: Peter Horvath
ExecutionService deleteProcessInstance() and deleteProcessInstanceCascade() should throw
an exception if the specified process instance is not found.
Current ExecutionService deleteProcessInstance() and deleteProcessInstanceCascade()
implementations call the method public void deleteProcessInstance(String
processInstanceId, boolean deleteHistory) in DbSessionImpl
The code tries to lookup the process instance, but the deletion is only attempted if the
process instance is found:
ExecutionImpl processInstance = (ExecutionImpl)
findProcessInstanceByIdIgnoreSuspended(processInstanceId);
if (processInstance!=null) {
// delete remaining tasks for this process instance
List<TaskImpl> tasks = findTasks(processInstanceId);
for (TaskImpl task: tasks) {
session.delete(task);
}
// delete remaining jobs for this process instance
JobImpl currentJob = EnvironmentImpl.getFromCurrent(JobImpl.class, false);
List<JobImpl> jobs = findJobs(processInstanceId);
for (JobImpl job: jobs) {
if (job!=currentJob){
session.delete(job);
}
}
if (log.isDebugEnabled()) {
log.debug("deleting process instance "+processInstanceId);
}
session.delete(processInstance);
}
Since not finding a process instance usually indicates an error, the method should throw
an exception to notify caller code.
I think this code should be modified to throw an exception if the process instance is not
found:
ExecutionImpl processInstance = (ExecutionImpl)
findProcessInstanceByIdIgnoreSuspended(processInstanceId);
if (processInstance==null) {
throw new JbpmException("processInstance is not found");
}
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira