camunda-consulting / camunda-7-code-examples

Examples and demo applications built by the camunda consulting team
http://camunda.org
Apache License 2.0
601 stars 999 forks source link

camunda-example-invoice-cmis: Logic issue "The case execution is already in state 'completed'." #41

Open mathiasconradt opened 6 years ago

mathiasconradt commented 6 years ago

I think there is some logic issue in the workflow of the camunda-example-invoice-cmis:

  1. Start Process: > create a new "Inovice Receipt CMIS" process, claim the task for yourself
  2. Approve Invoice: > do NOT check "Do you approve" > click 'Complete'
  3. Assign Reviewer: > Assign to yourself / demo > click 'Complete'
  4. Review Invoice: > check "Could you clarifiy the invoice" > click 'Complete'

An error message appears:

An error happend while submitting the task form :
Cannot submit task form 3d5c5eb4-02c0-11e8-aeba-cc3d82aa16df: ENGINE-05010 Could not perform transition 'complete on case execution with id '34d4af39-02c0-11e8-aeba-cc3d82aa16df'.Reason: The case execution is already in state 'completed'.

image

Environment:

Error Log:

2018-01-30 15:49:11,222 ERROR [org.camunda.bpm.engine.context] (default task-4) ENGINE-16004 Exception while closing command context: ENGINE-05010 Could not perform transition 'complete on case execution with id 'b2ac665a-05cc-11e8-a447-0a0027000000'.Reason: The case execution is already in state 'completed'.: org.camunda.bpm.engine.exception.cmmn.CaseIllegalStateTransitionException: ENGINE-05010 Could not perform transition 'complete on case execution with id 'b2ac665a-05cc-11e8-a447-0a0027000000'.Reason: The case execution is already in state 'completed'.
    at org.camunda.bpm.engine.impl.cmmn.behavior.CmmnBehaviorLogger.isAlreadyInStateException(CmmnBehaviorLogger.java:165)
    at org.camunda.bpm.engine.impl.cmmn.behavior.PlanItemDefinitionActivityBehavior.ensureTransitionAllowed(PlanItemDefinitionActivityBehavior.java:226)
    at org.camunda.bpm.engine.impl.cmmn.behavior.StageOrTaskActivityBehavior.onManualCompletion(StageOrTaskActivityBehavior.java:103)
    at org.camunda.bpm.engine.impl.cmmn.operation.AtomicOperationCaseExecutionManualComplete.triggerBehavior(AtomicOperationCaseExecutionManualComplete.java:29)
    at org.camunda.bpm.engine.impl.cmmn.operation.AbstractAtomicOperationCaseExecutionComplete.eventNotificationsStarted(AbstractAtomicOperationCaseExecutionComplete.java:43)
    at org.camunda.bpm.engine.impl.cmmn.operation.AbstractAtomicOperationCaseExecutionComplete.eventNotificationsStarted(AbstractAtomicOperationCaseExecutionComplete.java:33)
    at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:41)
    at org.camunda.bpm.engine.impl.cmmn.operation.AbstractCmmnEventAtomicOperation.execute(AbstractCmmnEventAtomicOperation.java:26)
    at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:145)
    at org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity.performOperationSync(CaseExecutionEntity.java:863)
    at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:58)
    at org.camunda.bpm.engine.impl.cmmn.operation.AbstractCmmnEventAtomicOperation.execute(AbstractCmmnEventAtomicOperation.java:26)
    at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:145)
    at org.camunda.bpm.engine.impl.interceptor.CommandContext$1.call(CommandContext.java:134)
    at org.camunda.bpm.engine.impl.interceptor.CommandContext$1.call(CommandContext.java:132)
    at org.camunda.bpm.engine.impl.context.ProcessApplicationClassloaderInterceptor.call(ProcessApplicationClassloaderInterceptor.java:44)
    at org.camunda.bpm.application.AbstractProcessApplication.execute(AbstractProcessApplication.java:114)
    at org.camunda.bpm.application.AbstractProcessApplication.execute(AbstractProcessApplication.java:125)
    at org.camunda.bpm.engine.impl.context.Context.executeWithinProcessApplication(Context.java:192)
    at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
    at org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity.performOperation(CaseExecutionEntity.java:858)
    at org.camunda.bpm.engine.impl.cmmn.execution.CmmnExecution.manualComplete(CmmnExecution.java:986)
    at org.camunda.bpm.engine.impl.persistence.entity.TaskEntity.complete(TaskEntity.java:289)
    at org.camunda.bpm.engine.impl.cmd.SubmitTaskFormCmd.execute(SubmitTaskFormCmd.java:74)
    at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
    at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104)
    at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:58)
    at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66)
    at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
    at org.camunda.bpm.engine.impl.FormServiceImpl.submitTaskForm(FormServiceImpl.java:86)
    at org.camunda.bpm.engine.rest.sub.task.impl.TaskResourceImpl.submit(TaskResourceImpl.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
    at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:138)
    at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:107)
    at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:133)
    at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:101)
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:402)
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:209)
    at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
    at org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:41)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilterSecure(SecurityFilter.java:67)
    at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilter(SecurityFilter.java:51)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:59)
    at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:56)
    at org.camunda.bpm.webapp.impl.security.SecurityActions.runWithAuthentications(SecurityActions.java:38)
    at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:56)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
mathiasconradt commented 6 years ago

The problem does not appear in camunda-bpm-wildfly10-7.5.0, just from 7.6.0+ onwards. I think it's related to https://app.camunda.com/jira/browse/CAM-7032