Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-9704

Creating fast stored procedure including parent-child status for pgsql

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 7.57.0.Final
    • None
    • None
    • None
    • False
    • False
    • NEW
    • NEW
    • Undefined

      The idea is to create an efficient way to clean up audit tables based on deployment id, process finished older than from jbpm schema taking into account parent-child where a child cannot be deleted if the parent is still active.

      Name IN/OUT TYPE Description
      deploymentId IN VARCHAR name of the deployment to be considered for deletion
      days IN INT number of days where the process instances end date is older. e.g: end_date < NOW() - days)
      dryRun IN BOOL if we just simulate = true or not
      - OUT TABLE list of process instances id that were deleted

      Examples

      SELECT select audit_cleanup('my-kjar-v1', 0, true); 
      

      this will show the list of process instances ids from the deployment my-kjar-v1 that were finished at least 2 days ago.

      SELECT select audit_cleanup('my-kjar-v1', 0, false); 
      

      this will show and delete the list of process instances ids from the deployment my-kjar-v1 that were finished at least 2 days ago.

       

      attached stored_procedure.txtthe stored prodcdure

        1. stored_procedure.txt
          2 kB
          Enrique González Martínez

              elguardian@gmail.com Enrique González Martínez (Inactive)
              elguardian@gmail.com Enrique González Martínez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: