cancel
Showing results for 
Search instead for 
Did you mean: 

Error closing a Process

f_lombardo
Champ in-the-making
Champ in-the-making
Hi all.

I'm using Actviti 5.11 via the REST API. Sometimes, when I close a task that triggers the end of a process, I get this error:

3-apr-2013 15.42.31 org.activiti.engine.impl.interceptor.CommandContext close
GRAVE: Error while closing command context
org.activiti.engine.ActivitiException: execution 35910 doesn't exist
   at org.activiti.engine.impl.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:52)
   at org.activiti.engine.impl.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:29)
   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.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
   at org.activiti.engine.impl.RuntimeServiceImpl.getVariables(RuntimeServiceImpl.java:99)
   at org.activiti.rest.api.process.ProcessInstanceResource.addVariableList(ProcessInstanceResource.java:188)
   at org.activiti.rest.api.process.ProcessInstanceResource.getProcessInstance(ProcessInstanceResource.java:80)
   at sun.reflect.GeneratedMethodAccessor160.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.restlet.resource.ServerResource.doHandle(ServerResource.java:452)
   at org.restlet.resource.ServerResource.get(ServerResource.java:648)
   at org.restlet.resource.ServerResource.doHandle(ServerResource.java:530)
   at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:590)
   at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:302)
   at org.restlet.resource.ServerResource.handle(ServerResource.java:849)
   at org.restlet.resource.Finder.handle(Finder.java:513)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Router.doHandle(Router.java:500)
   at org.restlet.routing.Router.handle(Router.java:740)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:155)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.engine.ChainHelper.handle(ChainHelper.java:114)
   at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:75)
   at org.restlet.Application.handle(Application.java:391)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Router.doHandle(Router.java:500)
   at org.restlet.routing.Router.handle(Router.java:740)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.routing.Router.doHandle(Router.java:500)
   at org.restlet.routing.Router.handle(Router.java:740)
   at org.restlet.routing.Filter.doHandle(Filter.java:159)
   at org.restlet.routing.Filter.handle(Filter.java:206)
   at org.restlet.engine.ChainHelper.handle(ChainHelper.java:114)
   at org.restlet.Component.handle(Component.java:391)
   at org.restlet.Server.handle(Server.java:491)
   at org.restlet.engine.ServerHelper.handle(ServerHelper.java:74)
   at org.restlet.engine.http.HttpServerHelper.handle(HttpServerHelper.java:153)
   at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1031)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:662)
3-apr-2013 15.42.31 org.restlet.engine.log.LogFilter afterHandle
INFO: 2013-04-03   15:42:31   192.168.x.y    PIPPO    192.168.x.y   8099   GET   /activiti-rest/service/process-instance/35910   -   200   -   0   31   http://192.168.x.y:8099   Restlet-Framework/2.0.14   -

Any hint?

Thanks in advance.

Bye

Franco
16 REPLIES 16

f_lombardo
Champ in-the-making
Champ in-the-making
Here is a little history of my process:

http://forums.activiti.org/content/activityexecutiontakeall-what-2nd-parameter

Why am I calling "inactivate"? Well, I just copied an pasted ParallelGatewayActivityBehavior: I saw that without that method the whole machinery didn't work, so….
Anyway, I'd appreciate your explanations about that gateway 🙂

Thanks a lot.

Bye

Franco

trademak
Star Contributor
Star Contributor
Hi Franco,

Thanks for the background, that explains it a bit more for me.
Could you add some details what's behind the calculateTheRightPaths method call? Because that's where the magic happens to see which paths should be taken.

Best regards,

f_lombardo
Champ in-the-making
Champ in-the-making
Well, there is nothing magic, but something convoluted 🙂
In the "Scelta uffici" ("Offices choice") task the user can decide which of the next 3 phases he wants to activate (at least 1). The process does that setting 3 variables, tested by the calculateTheRightPaths  methods. If the right variable is setted and the task is not already activated, it adds the corrisponding path to the PvmTransition List. If the user chooses less than 3 paths, and the process is still going, calculateTheRightPaths method adds the path to "Scelta uffici" task too, so that the user has the chance to activtate the remaining paths while the other are already activated.
If it's all done, the method sends to the final step.

Sorry, it's a bit obscure…

Thanks.

Bye

Franco

trademak
Star Contributor
Star Contributor
Ok, do let's go back to the original question of this post. You get an exception while retrieving the process instance details via the REST API right? So you complete a user task that eventually ends the process instance right? Then you do another REST call to retrieve the details about that process instance and you get this exception?

The following code is in that REST service implementation:

<blockcode>
Map<String, Object> variableMap = ActivitiUtil.getRuntimeService()
          .getVariables(processInstanceId);
</blockcode>

This is returning that exception because the process has been completed. That's a bug because the variables should be retrieved from the HistoryService. Could you create a JIRA for this?

Thanks,

f_lombardo
Champ in-the-making
Champ in-the-making
Uhm, there's something I can't understand. Here https://github.com/Activiti/Activiti/blob/master/modules/activiti-rest/src/main/java/org/activiti/re...

you can see:
<java>
  try {
      Map<String, Object> variableMap = ActivitiUtil.getRuntimeService()
          .getVariables(processInstanceId);
     

    } catch(Exception e) {
      // Absorb possible error that the execution could not be found
    }
   
    List<HistoricDetail> historyVariableList = ActivitiUtil.getHistoryService()
        .createHistoricDetailQuery()
        .processInstanceId(processInstanceId)
        .variableUpdates()
        .orderByTime()
        .desc()
        .list();
  …
</java>

So the error should be catched! Is this stack trace simply a log (but I didn't find where it should be printed to the log file), while my problem isn't really generated here but in another point of the application?

Thanks a lot.

Bye

Franco

trademak
Star Contributor
Star Contributor
Hi Franco,

You are right, that is strange. If you create a JIRA I'll do some more digging.

Best regards,

f_lombardo
Champ in-the-making
Champ in-the-making
Here it is: https://jira.codehaus.org/browse/ACT-1677

Thanks a lot.

Bye

Franco