Announcement

Collapse
No announcement yet.

BPM: Howto access user tasks in a multi-instance subprocess?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BPM: Howto access user tasks in a multi-instance subprocess?

    How could I access the outcome of a user task in a following script task? In a normal process I found a work around to run a sub-process to get the resolution or resolutionnote from it's parent but in a multi-instance process I can not create a new sub-process.
    Maybe there is a more straight forward way to get a user task and it's outcome within a script task or do I need to hassle with something like record\findOne to get a task of the current process?

  • #2
    As an option, you can diverge flows based on resolution right after the user-task node (no formula needed). Then in diverged flows you can set a variable, then converge.

    Comment


    • #3
      Thanks yuri. The task is available in a gateway decision, but how would i get access to the task resolutionNode later in the flow? I would like to post this on the entity stream and make it available as a variable in the email notification​ ...

      Comment


      • #4
        Right click on the User Task node > Inspect. Copy its ID. See the screenshot. Then in formula:

        Code:
        $resolutionNote = bpm\createdEntity\attribute('e6cmwnd894', 'resolutionNote');

        Click image for larger version  Name:	1.png Views:	0 Size:	23.8 KB ID:	89757
        Last edited by yuri; 03-21-2023, 03:23 PM.

        Comment


        • rabii
          rabii commented
          Editing a comment
          what if the system would generate an ID for a created Task User just like when creating a new record the system append an identifier to the new crated record. would that work so this way later in the flow if i want to access the data of the User Task i would just provide id to the formula function and i can get any attribute of the Task User, also this will be helpful if a flow chart has more than 1 User Task.

        • yuri
          yuri commented
          Editing a comment
          The current functionality works, values can be obtained. No need to change here, as it will cause problems.

      • #5
        cool - thanks yuri! (I was just trying something similar by getting the id directly from the db and then querying the task record ...)

        Comment


        • #6
          I can confirm: the trick with bpm\createdEntity\attribute works like a charme.

          Thanks again!​

          Comment


          • #7
            I'll make this ID available on the UI (for User Task and for Send Message Task).

            Comment


            • rabii
              rabii commented
              Editing a comment
              Thanks that would be really helpful
          Working...
          X