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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.29.0.Final
    • 7.23.0.Final
    • None
    • Using JBoss 7.2 and PAM 7.4 (7.23.0.Final-redhat-00002)

    • NEW
    • NEW
    • 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

      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

              swiderski.maciej Maciej Swiderski (Inactive)
              bvanderwalt@vizuri.com Ben-Johan van der Walt (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: