BPM, Workflow, and Case

 View Only
  • 1.  Deleting a Case using new CASEREST API

    Posted Wed September 14, 2022 02:02 PM
    Hi,

    I've tried to delete a Case using new POST method in CASEREST API i.e., /CASEREST/v1/deletecase. Documentation can be found here > deleting a case. BAW version is 21.0.3 and attaching request body and response.
    //Request body
    {
        "connectionpoint""TOS_Default_ConnPt",
        "casetype""KYC1_KVK"
        "caseid""{20D13B83-0000-C816-9A2C-E6D9273CF3B6}",
        "tos""tos"
    }

    //Response
    {
        "errormessage""Validation Error. Incorrect parameters for delete case. Either the name of casetype or the id of the case instance should be provided",
        "deletecaseresult""failed"
    }

    I appreciate if anybody test in your environment and let me know.

    Regards,
    Ramesh Bhat
    ​​

    ------------------------------
    Ramesh Bhat
    ------------------------------


  • 2.  RE: Deleting a Case using new CASEREST API

    Posted Thu September 15, 2022 09:51 AM
    Edited by Michael Kirchner Thu September 15, 2022 09:51 AM
    Hi Ramesh,

    I haven't tested it myself but I'd assume that you either provide a dedicated caseid as parameter or a casetype in case you want to delete all cases of that type.
    Can you test with the following payload:
    {
    "connectionpoint": "TOS_Default_ConnPt",
    "caseid": "{20D13B83-0000-C816-9A2C-E6D9273CF3B6}",
    "tos": "tos"
    }

    Best regards,
    Michael

    ------------------------------
    Michael Kirchner
    Leading Technical Specialist - Digital Business Automation
    IBM Technology
    Germany
    ------------------------------



  • 3.  RE: Deleting a Case using new CASEREST API

    Posted Thu September 15, 2022 09:59 AM
    Thanks Michael!

    I didn't notice one of them is needed in parameters. By the way there is risk of getting deleted all the cases by using Case type name, if not intended to do so, it would be more meaningful if we could pass an optional filter expression just like we do it for Sweeps.

    Regards,
    Ramesh Bhat

    ------------------------------
    Ramesh Bhat
    ------------------------------



  • 4.  RE: Deleting a Case using new CASEREST API

    Posted Thu October 13, 2022 10:16 AM

    Hi,

     I got same error message and also solve it by giving only casetype or caseid but not both.

     i.e. I'm able to call with :

    {

    connectionpoint:'mxConnPt',

    caseid: 'XXXXXXXXX-9999-XXXX-XXXX-XXXXXXXXXX',

    tos: 'myTargetObjectSTore'

    }

    and I get : 

    {"deletecaseresult":"success"}

    But, it turns out that the case still exist i.e. it has not been deleted.

    Were you able to actually delete the case ?

    Thanks,
    Damien

     



    ------------------------------
    DAMIEN SINARDET
    ------------------------------



  • 5.  RE: Deleting a Case using new CASEREST API

    Posted Fri October 14, 2022 07:07 AM
    Edited by Ramesh Bhat Fri October 14, 2022 07:10 AM
    Hi Damien,

    CASEREST response will be always successful irrespective of any exception in the FileNet. If request is successful (if it goes through irrespective of the result) then we get this response.
    Yes, that's not a proper response. It should be bug of CASEREST response. I too have noticed that. I was able to delete the cases after I updated the access in the Rosters.

    Check your access to Case and Rosters. Probably there is FileNet exception in the logs. Reply if you need any help.

    ------------------------------
    Ramesh Bhat
    ------------------------------



  • 6.  RE: Deleting a Case using new CASEREST API

    Posted Thu September 22, 2022 05:04 AM
    Additional questions. What is actually deleted?

    1. The case folder and any documents in it?
    2.A. The process instances implementing activities, using internal process application?
    2.B. The process instances implementing activities, using existing/external process application?

    For our pure (non-BAW) case solutions with P8 workflows, we have a somewhat complicated nightly job deleting old, closed cases including workflows and documents ("everything"). We also have one new BAW solution complemented by an external process application (external, so that we can migrate instance between snapshots); this one is not yet included in the cleanup job. It would be very nice if there was an all-in-one REST operation. If not, I have an additional question.

    4. For a case where the activities are implemented by external processes, should the process instances or the case be deleted first? I am unsure which of them keeps track of the relation.

    ------------------------------
    Mattias Edling
    ------------------------------



  • 7.  RE: Deleting a Case using new CASEREST API

    Posted Fri October 14, 2022 06:57 AM
    Hi Mattias,

    Please find the answers below:

    1. The case folder and any documents in it? > Yes, Case Folder, Case sub folders, Documents in the Case and Case sub folders will be deleted.
    2.A. The process instances implementing activities, using internal process application? > Yes, process instances will be deleted, including the tasks as well.
    2.B. The process instances implementing activities, using existing/external process application? > Yes, process instances will be deleted, including the tasks as well.

    4. For a case where the activities are implemented by external processes, should the process instances or the case be deleted first? I am unsure which of them keeps track of the relation. > Don't worry, CASEREST takes care of these.


    ------------------------------
    Ramesh Bhat
    ------------------------------



  • 8.  RE: Deleting a Case using new CASEREST API

    Posted Mon October 17, 2022 05:02 AM
    Question 4 (which should have been 3) is still interesting, because we might have to delete instances before the parent cases are deleted, in order to delete snapshots. Will the case take this gracefully? What happens when you later want to delete the case (after the retention period is over)?

    With multiple applications sharing the same process server, the 125 snapshot limit eventually becomes a problem if/when process instances are long-running (longer than the release intervals for features and fixes). I would prefer having multiple process servers, but it is not a perfect world.

    ------------------------------
    Mattias Edling
    ------------------------------



  • 9.  RE: Deleting a Case using new CASEREST API

    Posted Fri October 28, 2022 05:38 AM
    Edited by Ramesh Bhat Fri October 28, 2022 05:38 AM
    Hi Mattias,

    As per my understanding, when you delete the Case with CASEREST, it also deletes the process instances from external process app. Suppose if you delete the Process Instances from Process Inspector/by script/Rest API in Process server context, parent Case is unaffected and in future you can delete the Case safely. Actually relation between Case and Process Instance is like  Case > CaseTask > Process Instance > Process Task Instances. So for every Process instance there will be a parent Case task in Case Manager.


    ------------------------------
    Ramesh Bhat
    ------------------------------