Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-758

GuidedDecisionTreeModelUnmarshallingVisitor doesn't support unmarshalling of oneline rules

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 6.3.0.Beta1
    • None
    • None

      Method visit() from GuidedDecisionTreeModelUnmarshallingVisitor doesn't support rules, that are written in one line (so it doesn't unmarshall them correctly). According to documentation [1] (Block 7.1.2), rule can be written without line separators. Also depending on line separators introduce problems with rules from DRL files that are written on operating systems with different line separator that is on a system where drools engine runs (this can be seen running GuidedDecisionTreeDRLPersistenceUnmarshallingMessagesTest in Windows environment).

      The problematic part of the code: [2]
      But there are also other places, where there is parsing line by line used. I.e. [3].

      Rules should be parsed by keywords without depending on line separator or generally on lines.

      [1] https://docs.jboss.org/drools/release/6.1.0.Final/drools-docs/html_single/#d0e5357
      [2] https://github.com/droolsjbpm/drools/blob/007148f6e910a4706f6a20862abc002f4eef8c78/drools-workbench-models/drools-workbench-models-guided-dtree/src/main/java/org/drools/workbench/models/guided/dtree/backend/GuidedDecisionTreeModelUnmarshallingVisitor.java#L138
      [3] https://github.com/droolsjbpm/drools/blob/9019854d3427a6079eeea19f548a102a2353276b/drools-workbench-models/drools-workbench-models-commons/src/main/java/org/drools/workbench/models/commons/backend/rule/RuleModelDRLPersistenceImpl.java#L1953

              manstis@redhat.com Michael Anstis
              tzimanyi@redhat.com Tibor Zimányi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: