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

Null Pointer error when setting map variable after conditional event

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: