How to iterate through the map variable "doc" in user task's notification

Solution Verified - Updated -

Environment

  • Red Hat JBoss BPM Suite
    • 6.x

Issue

  • I am trying the example code Example A.8. Body of notification with variables in this document page to setup an email notification for user task, how can I print all the entries inside this map variable: doc: map that contains regular task variables.
  • How can I list out all the key, values in doc? I want to see what is available in the doc object.

Resolution

You can use entrySet to get all the entries from a map variable then iterate over each entry inside it, for example, add these lines below in the html mail notification in the example code:

        <ul>
        $foreach{entry : doc.entrySet}
            <li>${entry.key} = ${entry.value}</li>
        $end{}
        </ul>

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.