Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-14497

Rest API 'history/detail' with query parameters userOperationId, variableUpdates throws syntax error exception

    XMLWordPrintable

Details

    Description

      Environment:

      • Camunda spring boot 7.16.0 camunda version with Rest API enabled

      Description:

      When we try try to access endpoint: GET /history/detail with query parameters: userOperationId, variableUpdates , there is syntax error in a DB query.

      Steps to reproduce:

      1. Start Camunda Platfrom 7.16.0 or higher.
      2. If the Invoice Example is used, access the endpoint: http://localhost:8080/engine-rest/history/detail?userOperationId=<USER_OPERATION_ID>&variableUpdates=true

      Observed behavior:

      The following exception can be seen in the logs:

      Rest endpoint is: engine-rest/history/detail?userOperationId=*******************************&variableUpdates=true
      
      Exception when we call history/details rest end point is:
      h3. SQL: select * from ( select a.{_}, ROWNUM rnum from ( select distinct RES.{_} from ACT_HI_DETAIL RES left join ( SELECT A.* FROM ACT_RU_AUTHORIZATION A WHERE A.TYPE_ < 2 AND ( A.USER_ID_ in ( ?, '{_}') OR A.GROUP_ID_ IN ( ? ) ) AND ( ( A.RESOURCE_TYPE_ = ? AND BITAND(A.PERMS_,?) = ? ) ) ) AUTH ON (AUTH.RESOURCE_ID_ in ( RES.PROC_DEF_KEY_, '{_}' )) WHERE *RES.TYPE_ = ? RES.OPERATION_ID_ = ?* and ( (RES.EXECUTION_ID_ is not null AND AUTH.RESOURCE_ID_ IS NOT NULL ) or RES.EXECUTION_ID_ is null ) order by RES.ID_ asc ) a where ROWNUM < ?) where rnum >= ?
      
      *### Cause: java.sql.SQLSyntaxErrorException: ORA-00907: missing right parenthesis*
      

      Expected behavior:

      No exception is thrown.

      Root cause:

      After investigation, we found that there is AND keyword missing at the highlighted point in above query. Also after checking HistoricDetail.xml at org/camunda/bpm/engine/impl/mapping/entity/HistoricDetail.xml, we could see same issue:

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              nikola.koevski Nikola Koevski
              joshila Lakhan Joshi
              Nikola Koevski Nikola Koevski
              Tobias Metzke-Bernstein Tobias Metzke-Bernstein
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Salesforce