BPM, Workflow, and Case

BPM, Workflow, and Case

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

 View Only
  • 1.  Get the scheduled date of a timer event?

    Posted Wed February 08, 2023 08:22 AM
    How can one programmatically find out the scheduled date of a timer (IME) in a process instance?

    As an admin user, I can use the Process Inspector to see timers (with a token) and fire them manually, but not see when they are scheduled. I can also use the Event Manager->Monitor in Process Admin to find the scheduled event, unless there are to many of them there to list.

    I have looked at the REST API and the JavaScript API, but so far I have not found any method to get timer events either via the instance or via the common event queues. Have I overlooked something?

    The usecase of letting endusers, applications administrators or other systems/applications interacting with the process know when a timer is scheduled seems like a reasonable one.

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


  • 2.  RE: Get the scheduled date of a timer event?

    Posted Tue March 07, 2023 04:19 AM
    Edited by Mattias Edling Tue March 07, 2023 04:21 AM

    I think I found an operation in the new REST API. Before I was looking at the classic one via REST API Tester UI:

    https://MY_SERVER_AND_PORT/bpm/explorer/?url=/ops/docs#/Event%20Manager%20Tasks/getEventManagerTasks

    Then we need to check the event description which will contain the name of the timer in the process diagram.

    {
      "event_manager_tasks": [
        {
          "id": "FOO",
          "description": "Notify process instance 15716 to run the 'Reminder' timer",
          "state": "scheduled",
          "job_queue": "BPD Queue",
          "scheduled_time": "2023-03-10T13:50:17.755Z"
        },
        {
          "id": "BAR",
          "description": "Notify process instance 15716 to run the 'Deadline' timer",
          "state": "scheduled",
          "job_queue": "BPD Queue",
          "scheduled_time": "2023-04-02T12:50:16.755Z"
        }
      ]
    }



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



  • 3.  RE: Get the scheduled date of a timer event?

    Posted Mon April 17, 2023 10:30 AM

    Just now, I noticed that one must be a BAW admin to call this operation. I can understand it, but it might be showstopper for our intended implementation, unless we can build some intermediate layer that enforces per-application restrictions.



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



  • 4.  RE: Get the scheduled date of a timer event?

    Posted Tue April 18, 2023 03:01 PM
    Edited by Rex Townsend Tue April 18, 2023 03:01 PM

    Mattias,

    I see two options for you:

    1) If you use a date variable to bind to the Timer instead of setting hours/days with a magic number, you could then expose that variable at the process level. So if your private "dueDate (Date)" was used to set the Timer, exposing that variable would give you the same date as the schedule_time you are trying to get from the admin only API call. Then, your users could see it from the Process Portal or process instance related API calls.

    2) While the Event Manager Tasks call is admin only, you can make a Service Flow that makes the REST call (server side) as an admin and provides that information in turn to the user. You would of course be responsible for the security of it at that point, but it's not a wholly different concept from calling your database with an admin account and presenting your users with information from it: your users aren't using their account to directly query your database.



    ------------------------------
    Rex Townsend
    Salient Process
    ------------------------------