cancel
Showing results for 
Search instead for 
Did you mean: 

Exception in flow when using UserTasks in b/w ServiceTasks

basu
Champ in-the-making
Champ in-the-making
Hi,
I created an activiti process with around 40 service tasks and in between I placed some user tasks as shown below.

Start  —>UserTask1 —> SerTask1 –> SerTask2—-> SerTask3 –>SerTask4 —>UserTask2 –> SerTask5 –>               SerTask6 –> SerTask7 –> SerTask8—>SerTask9 —> UserTask3 –>SerTask10 –> SerTask11 –………………… END

For every user task defined its prompting to complete the process with complete button on activiti-explorer UI page. Most of the times I am getting below exception when I click on COMPLETE button and some times not. When there is no exception process is  successfully completed from Start to End. Please help me by suggesting what could be the issue ?


11:42:10,288 SEVERE [org.activiti.engine.impl.interceptor.CommandContext] Error while closing command context: org.activiti.engine.ActivitiException: No task found for taskId '531' at org.activiti.engine.impl.cmd.GetTaskFormCmd.execute(GetTaskFormCmd.java:40) [:5.3]  at org.activiti.engine.impl.cmd.GetTaskFormCmd.execute(GetTaskFormCmd.java:28) [:5.3]  at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) [:5.3] at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42) [:5.3] at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) [:5.3] at org.activiti.engine.impl.FormServiceImpl.getTaskFormData(FormServiceImpl.java:56) [:5.3] at org.activiti.rest.api.task.TasksGet.executeWebScript(TasksGet.java:84) [:] at org.activiti.rest.util.ActivitiWebScript.executeImpl(ActivitiWebScript.java:68) [:]  at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64) [:]  at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69) [:]  at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333) [:]  at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189) [:]   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118) [:]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]  at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]        at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]        at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]    at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
11:42:10,398 INFO  [STDOUT] 11:42:10,398  ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 03110000 Wrapped Exception (with status template): No task found for taskId '531'
11:42:10,398 INFO  [STDOUT] org.springframework.extensions.webscripts.WebScriptException: 03110000 Wrapped Exception (with status template): No task found for taskId '531'
11:42:10,398 INFO  [STDOUT]     at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:742)
11:42:10,413 INFO  [STDOUT]     at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:167)
11:42:10,413 INFO  [STDOUT]     at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
11:42:10,413 INFO  [STDOUT]     at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
11:42:10,413 INFO  [STDOUT]     at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
11:42:10,413 INFO  [STDOUT]     at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
11:42:10,429 INFO  [STDOUT]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
11:42:10,429 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
11:42:10,429 INFO  [STDOUT]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
11:42:10,429 INFO  [STDOUT]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
11:42:10,429 INFO  [STDOUT]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
11:42:10,429 INFO  [STDOUT]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
11:42:10,445 INFO  [STDOUT]     at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
11:42:10,445 INFO  [STDOUT]     at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
11:42:10,445 INFO  [STDOUT]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
11:42:10,445 INFO  [STDOUT]     at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
11:42:10,445 INFO  [STDOUT]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
11:42:10,460 INFO  [STDOUT]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
11:42:10,460 INFO  [STDOUT]     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
11:42:10,460 INFO  [STDOUT]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
11:42:10,460 INFO  [STDOUT]     at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
11:42:10,460 INFO  [STDOUT]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
11:42:10,460 INFO  [STDOUT]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
11:42:10,476 INFO  [STDOUT]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
11:42:10,476 INFO  [STDOUT]     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
11:42:10,476 INFO  [STDOUT]     at java.lang.Thread.run(Thread.java:662)
11:42:10,476 INFO  [STDOUT] Caused by: org.activiti.engine.ActivitiException: No task found for taskId '531'
11:42:10,476 INFO  [STDOUT]     at org.activiti.engine.impl.cmd.GetTaskFormCmd.execute(GetTaskFormCmd.java:40)
11:42:10,476 INFO  [STDOUT]     at org.activiti.engine.impl.cmd.GetTaskFormCmd.execute(GetTaskFormCmd.java:28)
11:42:10,492 INFO  [STDOUT]     at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
11:42:10,492 INFO  [STDOUT]     at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
11:42:10,492 INFO  [STDOUT]     at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
11:42:10,492 INFO  [STDOUT]     at org.activiti.engine.impl.FormServiceImpl.getTaskFormData(FormServiceImpl.java:56)
11:42:10,492 INFO  [STDOUT]     at org.activiti.rest.api.task.TasksGet.executeWebScript(TasksGet.java:84)
11:42:10,507 INFO  [STDOUT]     at org.activiti.rest.util.ActivitiWebScript.executeImpl(ActivitiWebScript.java:68)
11:42:10,507 INFO  [STDOUT]     at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
11:42:10,507 INFO  [STDOUT]     … 24 more


Thanks,
Basu.
6 REPLIES 6

jbarrez
Star Contributor
Star Contributor
Without the actual service task code, it's impossible to say what's wrong.

But 40 serviceTasks and more? That doesnt sound like a well-designed process to me … Smiley Tongue

basu
Champ in-the-making
Champ in-the-making
Hi,
Thanks you so much for responding to my query. I saw an issue with the activiti-rest api for this issue. When I click on each user task and check the database table act_hi_taskinst in back end  its updating for each and every task. But when I check database table from activiti-probe UI there is a mismatch in the row count(This mismatch is intermittent). Some times its taking one or two hours to sync up even after several page refreshes. Even if I check with activiti-rest api to check the assigned tasks(which were not completed) there is a mismatch and its showing same as the activiti probe database UI is.

Attaching the screen shots for your reference. From the screen shots shown below original database is showing BreakPoint13 is completed but rest API and activiti-probe UI database are showing its not completed. I have to wait untill this table is updated on activit-probe UI and click the next task else if I click with out updating its throwing the below shown exception.

Please suggest me whether any issue in this process.

Thanks,
Sudheer,

frederikherema1
Star Contributor
Star Contributor
What type of database are you using? Since you can see the changes in your DB-tool( commandline) I presume the transaction is commited. Since activiti does no caching in the engine of tasks, a request to the REST-api should load directly from database…

basu
Champ in-the-making
Champ in-the-making
Thank you for your response.
I am using MYSQL database. As I am seeing data in the database means transaction was committed. When I have this mismatch issue, If I restart the server then all three (Database,Activiti-probe UI DB, REST-API Call) were in sync. It seems to be some problem with the caching. Please suggest me what could be the issue ?

Thanks,
Basu.

basu
Champ in-the-making
Champ in-the-making
FYI I am using JBOSS AS…

frederikherema1
Star Contributor
Star Contributor
That's very strange. In activiti, no caches are used. Maybe browser-caching? Tried doing a hard refresh? (Crtl + R or Crtl +F5)