]
Tom Baeyens closed JBPM-853.
----------------------------
Fix Version/s: jBPM jPDL 3.2.1
Resolution: Done
thanks for letting us know !
Attribute 'expression' not taken from Condition element
-------------------------------------------------------
Key: JBPM-853
URL:
http://jira.jboss.com/jira/browse/JBPM-853
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM jPDL 3.2 beta 2
Environment: All
Reporter: Arjan van Bentem
Assigned To: Tom Baeyens
Fix For: jBPM jPDL 3.2.1
Original Estimate: 30 minutes
Remaining Estimate: 30 minutes
The <condition> element allows for either specifying an attribute
'expression', or for giving the expression as the text of the element itself. So,
both
<condition>#{true}</condition>
and
<condition expression="#{true}"/>
should work. However, the latter expression is ignored (and does not get stored in the
database but results in a zero-length (non-null) value in column DECISION_ in
JBPM_TRANSITIONS instead). This is caused by org.dom4j.Element#getTextTrim() returning en
empty String rather than null.
Fix: replace line 745 of JpdlXmlReader (version 1.7)
http://fisheye.jboss.com/browse/JBPM/jbpm.3/jpdl/jar/src/main/java/org/jb...
739 String condition = transitionElement.attributeValue("condition");
740 if (condition==null) {
741 Element conditionElement = transitionElement.element("condition");
742 if (conditionElement!=null) {
743 condition = conditionElement.getTextTrim();
744 // for backwards compatibility
745 if (condition==null) {
746 condition = conditionElement.attributeValue("expression");
747 }
748 }
749 }
with
745 if (condition==null || condition.length()==0) {
In the DecisionConditionsTest Unit test one could change one (and ONLY one) of the
conditions to use the attribute rather than the element text. Like on line 42 of
DecisionConditionsTest (version 1.1) replace
http://fisheye.jboss.com/browse/JBPM/jbpm.3/jpdl/jar/src/test/java/org/jb...
41 " <transition name='lead' to='put it in the lead
db'>" +
42 " <condition>#{budget > 100}</condition>" +
43 " </transition>" +
with
42 " <condition expression='#{budget > 100}'/>"
+
Thanks to cdart_rrr for pointing this out in the forums.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: