When starting a case definition instance i am receiving the following error:
2019-12-19 12:19:18,530 ERROR [user=,ip=][org.springframework.boot.web.servlet.support.ErrorPageFilter] (default task-1) Forwarding to error page from request [/cmmn/instances/start] due to exception [
Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table “act_ru_identitylink” violates foreign key constraint “act_fk_tskass_task”
Detail: Key (task_id_)=(65df7578-2251-11ea-990a-0242ac140009) is not present in table “act_ru_task”.
The error may exist in org/flowable/identitylink/service/db/mapping/entity/IdentityLink.xml
The error may involve org.flowable.identitylink.service.impl.persistence.entity.IdentityLinkEntityImpl.insertIdentityLink-Inline
Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table “act_ru_identitylink” violates foreign key constraint “act_fk_tskass_task”
Detail: Key (task_id_)=(65df7578-2251-11ea-990a-0242ac140009) is not present in table “act_ru_task”.]: org.apache.ibatis.exceptions.PersistenceException:
Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table “act_ru_identitylink” violates foreign key constraint “act_fk_tskass_task”
Detail: Key (task_id_)=(65df7578-2251-11ea-990a-0242ac140009) is not present in table “act_ru_task”.
The error may exist in org/flowable/identitylink/service/db/mapping/entity/IdentityLink.xml
The error may involve org.flowable.identitylink.service.impl.persistence.entity.IdentityLinkEntityImpl.insertIdentityLink-Inline
Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table “act_ru_identitylink” violates foreign key constraint “act_fk_tskass_task”
Detail: Key (task_id_)=(65df7578-2251-11ea-990a-0242ac140009) is not present in table “act_ru_task”.
The cmmn model is a single human task with the candidate groups set to admin. If I remove the candidate groups attribute the instance starts. Any pointers available why this constraint is met?
Additional background:
Database is freshly created or on an existing database.
Used both the spring boot starter and the manual spring setup
Tested on Postgres versions 9, 10
Endpoint is a simple spring controller calling the caseinstancebuilder start method.
case definition model was designed trough using the flowable-modeler.
I changed the project dependencies to spring boot starters and it now successful starts the instance. The only noticeable differences is that the priority of the engines in comparison to when manually creating the beans.
14:26:30,039 INFO [org.flowable.spring.boot.ProcessEngineAutoConfiguration$$EnhancerBySpringCGLIB$$f7e5801d] (ServerService Thread Pool – 113) No deployment resources were found for autodeployment
14:26:30,122 INFO [org.flowable.spring.SpringProcessEngineConfiguration] (ServerService Thread Pool – 113) Found 2 Engine Configurators in total:
14:26:30,122 INFO [org.flowable.spring.SpringProcessEngineConfiguration] (ServerService Thread Pool – 113) class org.flowable.idm.engine.configurator.IdmEngineConfigurator (priority:100000)
14:26:30,123 INFO [org.flowable.spring.SpringProcessEngineConfiguration] (ServerService Thread Pool – 113) class org.flowable.cmmn.spring.configurator.SpringCmmnEngineConfigurator (priority:500000)
14:26:30,123 INFO [org.flowable.spring.SpringProcessEngineConfiguration] (ServerService Thread Pool – 113) Executing beforeInit() of class org.flowable.idm.engine.configurator.IdmEngineConfigurator (priority:100000)
14:26:30,126 INFO [org.flowable.spring.SpringProcessEngineConfiguration] (ServerService Thread Pool – 113) Executing beforeInit() of class org.flowable.cmmn.spring.configurator.SpringCmmnEngineConfigurator (priority:500000)
14:26:31,510 INFO [org.flowable.spring.SpringProcessEngineConfiguration] (ServerService Thread Pool – 113) Found compatibility handler instance : class org.activiti.compatibility.spring.DefaultFlowable5SpringCompatibilityHandler
14:26:31,563 INFO [org.flowable.spring.SpringProcessEngineConfiguration] (ServerService Thread Pool – 113) Executing configure() of class org.flowable.idm.engine.configurator.IdmEngineConfigurator (priority:100000)
14:26:31,587 INFO [org.flowable.spring.SpringProcessEngineConfiguration] (ServerService Thread Pool – 113) Executing configure() of class org.flowable.cmmn.spring.configurator.SpringCmmnEngineConfigurator (priority:500000)
14:26:31,657 INFO [org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor] (ServerService Thread Pool – 113) Starting up the async job executor [org.flowable.spring.job.service.SpringAsyncExecutor].
14:26:31,658 INFO [org.flowable.job.service.impl.asyncexecutor.AcquireAsyncJobsDueRunnable] (Thread-153) starting to acquire async jobs due
14:26:31,659 INFO [org.flowable.job.service.impl.asyncexecutor.AcquireTimerJobsRunnable] (Thread-154) starting to acquire async jobs due
14:26:31,659 INFO [org.flowable.cmmn.engine.impl.CmmnEngineImpl] (ServerService Thread Pool – 113) CmmnEngine default created
14:26:31,664 INFO [org.flowable.job.service.impl.asyncexecutor.ResetExpiredJobsRunnable] (Thread-155) starting to reset expired jobs for engine cmmn
14:26:31,673 INFO [org.flowable.engine.impl.ProcessEngineImpl] (ServerService Thread Pool – 113) ProcessEngine default created
14:26:31,682 INFO [org.flowable.job.service.impl.asyncexecutor.AbstractAsyncExecutor] (ServerService Thread Pool – 113) Starting up the async job executor [org.flowable.spring.job.service.SpringAsyncExecutor].
14:26:31,684 INFO [org.flowable.job.service.impl.asyncexecutor.AcquireAsyncJobsDueRunnable] (Thread-156) starting to acquire async jobs due
Also another question:
Is it still possible to use a JTA datasource (ex. managed by wildfly) in combination with schemaupdate set to true / false? The current implementation commits the transaction resulting in “java.sql.SQLException: IJ031019: You cannot commit during a managed transaction”.
Do you still have the way you had set them up before? The cmmn engine should indeed go after the bpmn engine (and if the app engine is used, they both should go after that one), so maybe that was the problem.
Which database are you using? Do you have a stacktrace? We’re not committing during schema creation (I think), so not sure what’s going on here.
You can find a slim downed version here: https://github.com/ddpardo/flowable-engine-order-prototype
It uses spring boot to start datasource & tomcat.The engines are manually created. Additional instructions in the readme how to create the error.
For the JTA issue, the error is caused by the commit call, when deploying the engine on a wildfly where the datasource is managed by wildfly itself. I have only tested with postgresql:
Thanks for the excellent example app, this made testing it a breeze!
I did encounter the same problem. However, just for testing I upgraded to the 6.5.0-SNAPSHOT (latest build done from master) and the problem is gone. Most likely it has been fixed on master.
Can you try building the latest version (clone the repo and then do mvn -Pdistro clean install -DskipTests) and giving it a go to double check?