BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
Expand all | Collapse all

Exception occurred during deletion of ProcessInstance Trying to delete tasks first

  • 1.  Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Thu February 24, 2022 01:10 PM
    I have a BPM 8.5.6 in in production since 2015 without never doing housekeeping.
    I am doing it now using the command:
    AdminTask.BPMProcessInstancesCleanup('[-containerAcronym MBCPCMP -containerSnapshotAcronym SM.0_16 -instanceStatus COMPLETED -outputFile Z://trace_20220224.log -endedBeforeLocal 2019-08-05T23:59:59]')

    This has been working for all the days before 2019-08-04, for this particular command with -endedBeforeLocal 2019-08-05T23:59:59 I receive a message:

    [2/24/22 16:18:25:648 WET] 0000046b Log I PAL: Exception occurred during deletion of ProcessInstance with ID = 8,476,975. Trying to delete tasks first."
    [2/24/22 16:18:25:663 WET] 0000046b Log I PAL: The BPMProcessInstancesCleanup job is running. Progress: Deleted 0 task(s).

    After this I executed:

    AdminTask.BPMTasksCleanup('[-containerAcronym MBCPCMP -containerSnapshotAcronym SM.0_16 -taskStatus ALL_COMPLETED -outputFile Z://trace_20220218.log]')

    [2/18/22 21:27:39:589 WET] 0000026f CommandServic I PALAdminCommands otherDeleteCompletedTasks Entering
    [2/18/22 21:27:39:604 WET] 0000026f Log I PAL: Starting the BPMTasksCleanup command with the following parameters: -taskStatus ALL_COMPLETED -taskType ALL -containerAcronym Millennium BCP Claims Management -containerSnapshotAcronym SM.0_16 -maximumDuration 0 -transactionSlice 100 -outputFile Z://trace_20220218.log
    [2/18/22 21:27:39:682 WET] 0000026f Log I PAL: Because no tasks fulfilled the specified parameters, no tasks were deleted.
    [2/18/22 21:27:39:682 WET] 0000026f Log I PAL: The BPMTasksCleanup command has finished.
    [2/18/22 21:27:39:682 WET] 0000026f CommandServic I PALAdminCommands otherDeleteCompletedTasks Exiting

    Despite it says there are no tasks to delete I continue to receive the same error message when I try to
    AdminTask.BPMTasksCleanup('[-containerAcronym MBCPCMP -containerSnapshotAcronym SM.0_16 -taskStatus ALL_COMPLETED -outputFile Z://trace_20220224.log]')

    What can I do to solve this?

    ------------------------------
    JOAO PEDRO ALEXANDRE
    ------------------------------


  • 2.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Fri February 25, 2022 08:01 AM
    Hi Joao Pedro!

    Try to run this sequence of commands:

    AdminTask.BPMStop('[-containerAcronym $app -containerSnapshotAcronym $snapshot]')
    AdminTask.BPMDeactivate('[-containerAcronym $app -containerSnapshotAcronym [$snapshot] -force]')
    AdminTask.BPMTasksCleanup('[-containerAcronym $app -containerSnapshotAcronym $snapshot -taskStatus ALL_COMPLETED]')
    AdminTask.BPMDeleteSnapshot('[-containerAcronym $app -containerSnapshotAcronyms [$snapshot] -force]')


    If does not work, try analyse what these tasks are, using this sql command:

    select TSK.*
    from
    lsw_project PRJ,
    lsw_snapshot SNP,
    lsw_task TSK
    where SNP.name is NOT NULL
    and PRJ.PROJECT_ID = SNP.PROJECT_ID
    and SNP.SNAPSHOT_ID = TSK.SNAPSHOT_ID
    and PRJ.name = <project_name>
    and SNP.name = <snapshot_name>


    So... if necessary use this sql procedure to delete some tasks

    LSW_ERASE_TASK
    https://www.ibm.com/support/pages/records-exist-lswtask-table-are-not-associated-bpd-instance-id-ibm-business-process-manager-bpm


    Guilherme

    ------------------------------
    Carlos Guilherme Do Nascimento Arantes
    ------------------------------



  • 3.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Fri February 25, 2022 09:45 AM
    Hello Carlos,

    the first swquence of commands you mentioned I have already tried and did not solve the issue.

    I will try the SQL statement in conjunction with the LSW_ERASE_TASK.

    Thanks very much for your help.

    Muito obrigado.

    ------------------------------
    JOAO PEDRO ALEXANDRE
    ------------------------------



  • 4.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Fri February 25, 2022 01:05 PM
    Hello again,
    in the link you post I do not find information about how to execute the storage procedure LSW_ERASE_TASK. Is it documented somewhere else?!

    ------------------------------
    JOAO PEDRO ALEXANDRE
    ------------------------------



  • 5.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Fri February 25, 2022 02:12 PM
    Hi João!

    CALL LSW_ERASE_TASK( <task_id> )

    Att,

    ------------------------------
    Carlos Guilherme Do Nascimento Arantes
    ------------------------------



  • 6.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Mon February 28, 2022 04:29 AM
    Edited by JOAO PEDRO ALEXANDRE Mon February 28, 2022 04:29 AM
    Thank you very much.
    Best regards,
    João Pedro Alexandre

    ------------------------------
    JOAO PEDRO ALEXANDRE
    ------------------------------



  • 7.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Thu March 03, 2022 11:22 AM
    Hello again,
    during the execution of the query statements I did not get any result:

    So I can I justify the erro message  Exception occurred during deletion of ProcessInstance with ID = 8,476,975. Trying to delete tasks first." ???
    And how can I continue to clean my process instances? It seems it got stuck on this exception and do not carry on with the cleaning.


    ------------------------------
    JOAO PEDRO ALEXANDRE
    ------------------------------



  • 8.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Thu March 03, 2022 11:39 AM
    Oi João! 

    This case is getting complicated... rsrsrs

    Try to delete the instance using SQL:

    db2inst.LSW_BPD_INSTANCE_DELETE(IN bpdInstanceId DECIMAL(12,0))
    -- This procedure deletes a BPD instance and its dependent entries, as well as tasks that are part of this instance and temporary groups. --
    OR
    db2inst.LSW_ERASE_BPD_INSTANCE(IN bpdInstanceId DECIMAL(12,0))
    LANGUAGE SQL
    -- This procedure deletes a BPD instance and its dependent entries, including temporary groups. --

    If this does not work... I advise you to open a pmr (case).

    Regards,

    ------------------------------
    Carlos Guilherme Do Nascimento Arantes
    ------------------------------



  • 9.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Thu March 03, 2022 12:16 PM
    Thanks again it was a great help.
    I will try and if didn't work, I will open a Case.

    ------------------------------
    JOAO PEDRO ALEXANDRE
    ------------------------------



  • 10.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Wed December 20, 2023 05:46 AM

    Hello Joao-

    I've just run into the same issue you saw of receiving the below error message when performing instance cleanup:

    PAL: Exception occurred during deletion of ProcessInstance with ID = <ProcessInstanceId>. Trying to delete tasks first."

    I wanted to follow-up with you and see if you - or anyone else in the community - ever came up with a solution for this or obtained guidance from IBM on how to resolve this.

    Thanks in advance -Don



    ------------------------------
    Don Williams
    ------------------------------



  • 11.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Wed December 20, 2023 06:15 AM

    Hello Don,

    I did not get support from IBM, because my customer was out of support, I am not 100% sure, but I believe the last suggestion from Carlos, solved my problem:

    Try to delete the instance using SQL:

    db2inst.LSW_BPD_INSTANCE_DELETE(IN bpdInstanceId DECIMAL(12,0))
    -- This procedure deletes a BPD instance and its dependent entries, as well as tasks that are part of this instance and temporary groups. --
    OR
    db2inst.LSW_ERASE_BPD_INSTANCE(IN bpdInstanceId DECIMAL(12,0))
    LANGUAGE SQL
    -- This procedure deletes a BPD instance and its dependent entries, including temporary groups. --



    ------------------------------
    JOAO PEDRO ALEXANDRE
    ------------------------------



  • 12.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Wed December 20, 2023 06:20 AM

    Thanks for the quick reply, Joao.  Unfortunately I tried both of those and it didn't help for my situation.  I suspect a database lock and am asking the DBAs to cycle the database services today - hopefully that helps otherwise we'll be submitting an IBM support ticket and I will post the results back here for anyone else who comes across this in the future.

    Thanks again -Don



    ------------------------------
    Don Williams
    ------------------------------



  • 13.  RE: Exception occurred during deletion of ProcessInstance Trying to delete tasks first

    Posted Thu March 03, 2022 11:45 AM
    Using the LSW_BPD_INSTANCE_DELETE stored procedure
    https://www.ibm.com/docs/en/integration-designer/8.5.0?topic=database-using-lsw-bpd-instance-delete-stored-procedure

    ------------------------------
    Carlos Guilherme Do Nascimento Arantes
    ------------------------------