[
https://jira.jboss.org/jira/browse/JBPM-2755?page=com.atlassian.jira.plug...
]
Ronald van Kuijk commented on JBPM-2755:
----------------------------------------
I created a small test to see if this works and it partly seems to... The expression is
being recognized but once it should be actually parse, an error is thrown:
org.jbpm.api.JbpmException: no scripting engine configured for language uel
at org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:111)
at org.jbpm.pvm.internal.script.ScriptManager.evaluateExpression(ScriptManager.java:88)
at org.jbpm.pvm.internal.el.ScriptExpression.evaluateInScope(ScriptExpression.java:45)
at org.jbpm.pvm.internal.el.Expression.evaluate(Expression.java:102)
at
org.jbpm.pvm.internal.expr.UelExpressionTest.testUelExpression(UelExpressionTest.java:56)
Testcase:
import org.jbpm.pvm.activities.WaitState;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.el.Expression;
import org.jbpm.pvm.internal.el.ScriptExpression;
import org.jbpm.pvm.internal.el.UelValueExpression;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.test.JbpmTestCase;
public class ExpressionTest extends JbpmTestCase {
public void testUelExpression() {
ExecutionImpl execution = (ExecutionImpl) ProcessDefinitionBuilder
.startProcess()
.startActivity("initial", new WaitState())
.initial()
.endActivity()
.endProcess()
.startProcessInstance();
execution.setVariable("pv", "MyTest");
Expression expression = Expression.create("#{pv}",
Expression.LANGUAGE_UEL_VALUE);
UelValueExpression uve = ((UelValueExpression) expression);
assertEquals("MyTest", uve.evaluate(execution));
Expression expression = Expression.create("#{pv}",
Expression.LANGUAGE_UEL);
ScriptExpression se = ((ScriptExpression) expression);
assertEquals("MyTest", se.evaluate(execution));
}
}
The first one (UEL_VALUE) works and the second (UEL) not. I cannot seem to find the reason
why there is no scripting engine. The way the second expression is constructed is the same
as is done for the description. So I tried changing this in the parser (UEL
->UEL_VALUE) and the description could be parsed to (full test of task with description
is attached)
Index: src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java (revision 6150)
+++ src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java (working copy)
@@ -493,7 +493,7 @@
Element descriptionElement = XmlUtil.element(element, "description");
if (descriptionElement!=null) {
String descriptionText = XmlUtil.getContentText(descriptionElement);
- Expression descriptionExpression = Expression.create(descriptionText,
Expression.LANGUAGE_UEL);
+ Expression descriptionExpression = Expression.create(descriptionText,
Expression.LANGUAGE_UEL_VALUE);
assignableDefinition.setDescription(descriptionExpression);
}
Fixes the problem...
Any ideas?
EL support in task's <description> tag
--------------------------------------
Key: JBPM-2755
URL:
https://jira.jboss.org/jira/browse/JBPM-2755
Project: jBPM
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Affects Versions: jBPM 4.3
Reporter: henry donnell
Assignee: Tom Baeyens
Fix For: jBPM 4.4
it would be helpful to be able to use EL in the <description> tag of the (human)
task node.
This will allow to create dynamical task descriptions based on the process variables.
Example:
<task name="review_task">
<description>Review order nr.#{order.nr} from customer
#{order.customer.name}</description>
</task>
The main purpose is to make human task descriptions in the task list more readable and
user-friendly.
Because if you have 20 task instances of the same task and they are all called
"Review order from customer" it is really hard to see at a first glance which
task is related to which customer.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira