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

JPDL : Missing name on a transition in a decision make the conditions fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • jBPM 3.1.1
    • Runtime Engine
    • None
    • Documentation (Ref Guide, User Guide, etc.)
    • Low
    • Workaround Exists
    • Hide

      Always give a name to transition in decision nodes.

      Show
      Always give a name to transition in decision nodes.

      Inside a decision node, if a transition has not a name attribute, the condition is not evaluated as expected.
      For exemple, the following lines work :

      <decision name="decision-x">
      <transition name="t1" to="node-a" />
      <transition name="t2" to="node-b">
      <condition expression="#

      {...}" />
      </transition>
      </decision>

      If the condition in the second transition matches, this transition is selected as expected.

      But if the name of the transition is removed, the condition result is not correct :

      <decision name="decision-x">
      <transition name="t1" to="node-a" />
      <transition to="node-b">
      <condition expression="#{...}

      " />
      </transition>
      </decision>

      In this case, the first transition seems to be always selected as default choice...

      The name attribute of a transition seems optional, and no error is produced if it is not present : the conditional transition seems to be simply ignored...

      Perhaps the following code excerpt from the class org.jbpm.graph.node.Decision is implied :

      Iterator iter = decisionElement.elementIterator("transition");
      while (iter.hasNext()) {
      Element transitionElement = (Element) iter.next();
      Element conditionElement = transitionElement.element("condition");
      if (conditionElement!=null) {
      String conditionExpression = getConditionExpression(conditionElement);
      if (conditionExpression!=null) {
      String transitionName = transitionElement.attributeValue("name");
      if (decisionConditions==null)

      { decisionConditions = new ArrayList(); }

      decisionConditions.add(new DecisionCondition(transitionName, conditionExpression));
      }
      }
      }
      }

      What occurs if the transition has no name attribute value ?

            tom.baeyens Tom Baeyens (Inactive)
            ephemeris-lappis_jira Ephemeris Lappis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: