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

Null Pointer error when setting map variable after conditional event

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jBPM 6.3.0.Final
    • jBPM 6.2.0.Final
    • Runtime Engine
    • None
    • NEW
    • NEW

      I am having a problem when setting a process variable on a script task after a conditional event. I have tried placing the script task before the conditional event and it worked however when I placed it back after the conditional event it returned a null pointer exception on the kcontext.setVariable call.

      Error occurs when script is placed in the onEntry event of a user Task as well.

      The model

      The Script on Prepare Data

      java.util.Map map = new java.util.HashMap<String, String>();
      map.put(" melissa", "melissa");
      map.put(" dan", "dan");
      map.put("alex", "alex");
      
      
      
      java.util.List<String> keys = new java.util.ArrayList<String>(map.keySet());
      for (String key: keys) {
          System.out.println(key + ": " + map.get(key));
      }
      kcontext.setVariable("myMap",map);
      //kcontext.setVariable("abc",new java.util.HashMap());
      
      System.out.println(">>>>>> finished");
      

      I have attached a copy of the error log.

        1. model.jpg
          model.jpg
          8 kB
        2. log.txt
          56 kB

              swiderski.maciej Maciej Swiderski (Inactive)
              melissa.ferenal Melissa Ferenal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: