Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-18222

Cannot delete specific process model in Activiti MS-MT mode

    Details

    • Bug Priority:
      Category 2
    • ACT Numbers:

      00781609

    • Testcase ID:
      Hide

      00781609

      Show
      00781609
    • Sprint:
      Docs Sprint 18

      Description

      [Description]:

      • Cannot delete parent process model in MS-MT mode

      [Steps to reproduce]:
      1.) Using Activiti in MS-MT mode, log in as tenant admin and go to kickstart / Apps
      2.) Click on "Import App" and import attached application
      3.) Delete the application
      4.) Go to Processes, select "Stroke Respond" and select delete. Nothing happens and the process remains
      Browser developer tool network trace shows:

      DELETE http://<Activiti_Host>:<tomcat_port>/activiti-app/app/rest/models/1043?cascade=false
      {"message":"Model cannot be deleted: 1043","messageKey":"GENERAL.ERROR.BAD-REQUEST"}
      

      Logs show (show_sql enabled):

      Hibernate: delete from MODEL_RELATION where parent_model_id=?
      Hibernate: insert into MODEL_HISTORY (model_comment, created, created_by, description, last_updated, last_updated_by, model_editor_json, model_type, name, reference_id, stencil_set_id, tenant_id, version, model_id, removal_date, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      Hibernate: insert into MODEL_HISTORY (model_comment, created, created_by, description, last_updated, last_updated_by, model_editor_json, model_type, name, reference_id, stencil_set_id, tenant_id, version, model_id, removal_date, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      Hibernate: insert into MODEL_HISTORY (model_comment, created, created_by, description, last_updated, last_updated_by, model_editor_json, model_type, name, reference_id, stencil_set_id, tenant_id, version, model_id, removal_date, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      Hibernate: insert into MODEL_HISTORY (model_comment, created, created_by, description, last_updated, last_updated_by, model_editor_json, model_type, name, reference_id, stencil_set_id, tenant_id, version, model_id, removal_date, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      Hibernate: insert into MODEL_HISTORY (model_comment, created, created_by, description, last_updated, last_updated_by, model_editor_json, model_type, name, reference_id, stencil_set_id, tenant_id, version, model_id, removal_date, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      Hibernate: delete from MODEL where id=?
      12:00:35,227 [http-nio-8080-exec-6] WARN  org.hibernate.engine.jdbc.spi.SqlExceptionHelper  - SQL Error: 0, SQLState: 23503
      12:00:35,228 [http-nio-8080-exec-6] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper  - ERROR: update or delete on table "model" violates foreign key constraint "fk_relation_child" on table "model_relation"
        Detail: Key (id)=(1026) is still referenced from table "model_relation".
      12:00:35,229 [http-nio-8080-exec-6] ERROR com.activiti.service.editor.AlfrescoModelService  - Error while deleting: 
      org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [fk_relation_child]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
      

      [Expected Behaviour]:

      • The Business Process Model should be deleted, or a meaningful error should appear

      [Observed Behaviour]:

      • Nothing happens in the UI.

      [Analysis to date]:

      • Tracing show database constraint caused a delete statement to fail although running the same two statements from database work:
           delete from MODEL_RELATION where parent_model_id=<modelToDelete_ID>;
           delete from MODEL where id=<modelToDelete_ID>;
           

        Attachments

          Structure

            Activity

              People

              • Assignee:
                mhowarth Mark Howarth
                Reporter:
                jguay Julien Guay [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Structure Helper Panel