Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-8799

Unable to auto Assigning user tasks using a Business rules strategy with task input variables

    Details

    • Steps to Reproduce:
      Hide

      Create a new Business rules strategy and use the following rule to print the task input variables. You will notice that the Map returned has a value of null.

      rule "Sample rule"
      when
      $task: Task()
      then
      System.err.println("Found task with name ("+ $task.getName() +") to be assigned, task: " + $task);

      // this returns null
      Map<String, Object> inputVariables = $task.getTaskData().getTaskInputVariables();
      System.err.println("task input variables: " + inputVariables);

      insert(new Assignment("senior"));
      end

      Show
      Create a new Business rules strategy and use the following rule to print the task input variables. You will notice that the Map returned has a value of null. rule "Sample rule" when $task: Task() then System.err.println("Found task with name ("+ $task.getName() +") to be assigned, task: " + $task); // this returns null Map<String, Object> inputVariables = $task.getTaskData().getTaskInputVariables(); System.err.println("task input variables: " + inputVariables); insert(new Assignment("senior")); end
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      Unable to use the Business rules strategy to auto-assign a user task to a given user by using task input variables in the assignment rules.

      I tried to get the input variables but when I called "$task.getTaskData().getTaskInputVariables()" it returned a Map with a value of null.

      My task has multiple input variables set, so it appears that the input variables are not loaded before the assignment rules are firing.

      See my sample rule below:

      rule "Sample rule"
      when
      $task: Task()
      then
      System.err.println("Found task with name ("+ $task.getName() +") to be assigned, task: " + $task);

      // this returns null
      Map<String, Object> inputVariables = $task.getTaskData().getTaskInputVariables();
      System.err.println("task input variables: " + inputVariables);

      insert(new Assignment("senior"));
      end

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swiderski.maciej Maciej Swiderski
                Reporter:
                bvanderwalt Ben-Johan van der Walt
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: