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

Exception handling of KnowledgeBuilder .add for ruleflows should report compilation errors, not null-pointer exception

    XMLWordPrintable

Details

    • Release Notes
    • Low
    • 0
    • 0% 0%

    Description

      Compiling and adding a ruleflow via KnowledgeBuilder's add method often returns a simple null-pointer exception when information about the actual node that did not compile is available. While one can make a work-around using:

                  try

      {                 kbuilder.add(workFlow, workFlowtype);             }

      catch(Exception t)

      {                 KnowledgeBuilderErrors errors = kbuilder.getErrors();                if (errors.size() > 0)                   for (KnowledgeBuilderError error: errors)                       System.err.println(error);                   }

                    }
                        throw new IllegalArgumentException("Could not parse knowledge.");
                  }
      ...
            }

      throwing an exception with the actual build problem in the message seems appropriate so that users see an error describing the build problem when using traditional exception handling:

      try

      { kbuilder.add(workFlow, workFlowtype); }

      catch (Exception t)

      { t.printStackTrace() }

      Attachments

        Activity

          People

            kverlaen@redhat.com Kris Verlaenen
            drdaveg_jira David Goldstein (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified