3 Replies Latest reply on Jul 5, 2006 9:15 AM by cpob

    Task Management Definition maps tasks by name

    cpob

      In our web application, we are digesting the process definition to manipulate it to our liking before we deploy it.

      We take the .par file from the user, we go through the ProcessDefinition object to add our events/actions/assignment handlers/etc, and then deploy that.

      I ran into a problem today, which I think is a bug, but I wanted to get a feeling out there if anyone has any insight.

      When you do

      processDefinition.getTaskMgmtDefinition().getTasks()

      it returns a MAP of tasks for the entire process definition.

      By default, the GPD creates all tasks as "task1" when it is the first task on a task node. I created a quick test process, and just blindly added tasks to each node without naming them. They were all named as 'task1' by default.

      Now, instead of seeing the 6 tasks when I getTaskMgmtDefinition().getTasks(), I get one because the map is keyed by the name of the task.

      I know I could just query the database to get all the tasks, but this just seems like a glaring issue. I know people should rename tasks, but what if someone has two task-nodes in a huge process, and they both have tasks called "Send Message". Everything kinda falls apart there.

      Is there another way in the API to get tasks for a given task-node that I'm missing, or a way (besides the obvious hibernate query) to get a list of tasks for a process definition? If not, that's fine, I'll just use a hibernate query, but I wanted something in the API.