BPM, Workflow, and Case

 View Only

Generate Unique Reference Number for each instance in specific format

  • 1.  Generate Unique Reference Number for each instance in specific format

    Posted Thu April 04, 2024 07:45 AM

    Hi All,

    Problem Statement :- There is field on UI which is read only and whenever and instance is launched this field has to have a value in an incrementing order and in a specific format such as POL/2024/0001, now when next case is triggered, it should be POL/2024/0002.

    Here the BPD can be called in 2 ways, 1) Exposed to process portal as startable service 2) Whenever an email is sent in a case gets triggered.

    The problem that is being encountered is, the cases can come as a batch from email service and by the time it is getting processed the reference numbers are getting duplicated also if multiple users are launching service from portal with minimal time difference it is leading to duplication.

    Current Solution

    1) A base value is set in ENV such as 0001, now assuming that this is the first time the case Reference numbers is set to POL/2024/0001 and now this value is used in saved search, so that next time a new case is created a TWSEARCH is performed to retrieve the current value and it is incremented. By the time a TWSearch return result a new case is again created leading to duplication.

    2) Tried creating a an EPV which has a default value set and each time updating it once the number is incremented, the case is the same here, when requests are incoming too fast, duplication is taking place.

    Any thoughts would be helpful. Thanks.



    ------------------------------
    Raghu Ram
    ------------------------------