Intermadiate Catch Event Triggering

Hi all,

I am trying to notify a process instance waiting for an intermediate catch event.
As explained in docs, messge correlation is constructed as below.

MessageCorrelationResult messageCorrelationResult = runtimeService.createMessageCorrelation(“proposalsGatheredMessage”).processInstanceId(processId).correlateWithResult();

However, at run time I keep getting below exception (please see ‘order by’ statements)

Can you help me to figure out what is wrong?

Thanks in advance

Ali

 ### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/Execution.xml
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.selectExecutionsByQueryCriteria-Inline
### The error occurred while setting parameters
### SQL: select distinct RES.*                                from ACT_RU_EXECUTION RES                 inner join ACT_RE_PROCDEF P on RES.PROC_DEF_ID_ = P.ID_              WHERE  RES.PROC_INST_ID_ = ?                                     and RES.SUSPENSION_STATE_ = ?                                                       and exists (select ID_ from ACT_RU_EVENT_SUBSCR EVT where           EVT.EXECUTION_ID_ = RES.ID_ and           EVT.EVENT_TYPE_ = ?                        and EVT.EVENT_NAME_ = ?                      )           order by  order by RES.ID_ asc       LIMIT ? OFFSET ?
### Cause: org.postgresql.util.PSQLException: ERROR: syntax error at or near "order"
  Position: 538
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.selectList(DbSqlSession.java:87)
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectListWithRawParameter(DbEntityManager.java:166)
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:158)

Hey Ali,

Is it possible that you create an unit test so that we can reproduce your problem? See for reference this example repository.

Best regards,
Chris

Hi Chris,

Thank you for the prompt response.

I created the test case using the same process definition I have and called the above code.
However, it worked. Both test case and JEE application (embedded engine running on Glassfish 4.1) are using camunda v.7.6.0.
I am using camunda CDI interation. Another difference is the database. At run time query is executed on PostGres database. Do you have any idea what can cause such an exception?

Regards

Ali

Hi Chris,

I believe I found the reason. In my project, I have dependency for mybatis v.3.4.1 whereas unit test project is using v. 3.2.8.
Camunda is having problem when mybatis v.3.4.1 is in the classpath instead of v.3.2.8.
When I replace 3.4.1, it worked. I do not know what has changed between 3.4.1 and 3.2.8 but it creates issues with camunda queries.

Regards

Hey Ali,

sorry for my late response. I’m glad that you found the problem.

Best regards,
Chris