cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting process instances

rodiaz
Champ in-the-making
Champ in-the-making
Hi there,

when I try to delete process instances through runtimeService I get the error Error parsing XML. The process instance failed serializating the variable instances, so when activiti try to deploy it for removing, it fails again…

Is there any way to delete this kind of processes??

Thanks in advanced
8 REPLIES 8

rodiaz
Champ in-the-making
Champ in-the-making
Hi there,

when I try to delete process instances through runtimeService I get the error Error parsing XML. The process instance failed serializating the variable instances, so when activiti try to deploy it for removing, it fails again…

Is there any way to delete this kind of processes??

Thanks in advanced

jbarrez
Star Contributor
Star Contributor
Can you paste your whole stacktrace? How did you add the variable instance n the first place without having the serialization exception?

rodiaz
Champ in-the-making
Champ in-the-making
Updating to the version 5.12.1 some of my problems are resolved.
Now I don't get Error parsing XML but is still imposible to delete some process instances. For example I have processes that failled because some exception in my own ExecutionListener like this:

org.activiti.engine.ActivitiException at com.ptb.clerk.core.bpm.activiti.bpm.delegate.CommandExecutorService.execute(CommandExecutorService.java:122) at org.activiti.engine.impl.delegate.JavaDelegateInvocation.invoke(JavaDelegateInvocation.java:34) at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37) at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25) at org.activiti.engine.impl.bpmn.behavior.ServiceTaskJavaDelegateActivityBehavior.execute(ServiceTaskJavaDelegateActivityBehavior.java:49) at org.activiti.engine.impl.bpmn.behavior.ServiceTaskJavaDelegateActivityBehavior.execute(ServiceTaskJavaDelegateActivityBehavior.java:40) at org.activiti.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:115) at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:85) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:535) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:530) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:85) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:535) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:530) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:85) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:535) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:530) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:85) at org.activiti.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:36) at org.activiti.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:80) at org.activiti.engine.impl.persistence.entity.MessageEntity.execute(MessageEntity.java:29) at org.activiti.engine.impl.cmd.ExecuteJobsCmd.execute(ExecuteJobsCmd.java:68) at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:60) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32) at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Caused by: javax.ws.rs.InternalServerErrorException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(AbstractClient.java:426) at org.apache.cxf.jaxrs.client.ClientProxyImpl.checkResponse(ClientProxyImpl.java:290) at org.apache.cxf.jaxrs.client.ClientProxyImpl.handleResponse(ClientProxyImpl.java:585) at org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:551) at org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:205) at $Proxy52.report(Unknown Source) at com.ptb.clerk.core.bpm.activiti.bpm.command.report.PrintTemplate.executeCommand(PrintTemplate.java:67) at com.ptb.clerk.core.bpm.activiti.bpm.command.UpdaterAbstractCommand.execute(UpdaterAbstractCommand.java:55) at com.ptb.clerk.core.bpm.activiti.bpm.delegate.CommandExecutorService.execute(

Throws a exception bacause get an error invoking a rest service form my own Execution Listener. So is there a way to delete this process instances??because when I try it, fails in the same point every time.

Thank you very much

frederikherema1
Star Contributor
Star Contributor
When you delete a process explicitly, the end-execution-listeners of the process are called (with possibly a deleteReason filled in, so the process can do some cleanup in case it didn't end gracefully). This cannot be disabled. Just a hunch, but I'm not sure the "delete" of a deployment with cascade=true can help you.

Is there a way you can make the execution-listener succeed without deleting the process? Last resort is editing the XML in the database (in ACT_GE_BYTEARRAY) that corresponds to this process-definition and remove the listener XML-element. This should be done while the engine is turned off.

rodiaz
Champ in-the-making
Champ in-the-making
I tried delete of a deployment with cascade= true but throws the same exception. Is there a way to know in the ExecutionListener that come from deleting a process? I can see a property deleteReason in the ExecutionEntity but itś null although I filled it.

Thanks again

frederikherema1
Star Contributor
Star Contributor
The delete-reason should be non-null when provided when deleting a process-instance. on ExecutionEntity:


public void deleteCascade(String deleteReason) {
    this.deleteReason = deleteReason;
    this.deleteRoot = true;
    performOperation(AtomicOperation.DELETE_CASCADE);
  }

The delete-reason is also exposed on the ExecutionListenerExecution (which ExecutionEntity implements). What call do you do when you say the deleteReason is not propagated?

rodiaz
Champ in-the-making
Champ in-the-making
Yes, you are ok. I could not have the deleate reason in the current execution but yes in its parent. I will check that there is not deleate reason before to do nothing.

Thank you very much again

edsonrichter
Confirmed Champ
Confirmed Champ
I've similar problem:
- I've my own functions library
- I've changed method signature for one function
- Now, whenever I try to delete or change a process, I get a parse XML error.

How can I delete a process instance that is invalid and will always be?

Regards,

Edson.