This content has been marked as final.
Show 2 replies
-
1. Re: API access to decision node's expression
tansdale Apr 26, 2006 2:42 AM (in response to kv)yes you can do that.
first, get List decisionConditions from decision(Decision' object)
second, get DecisionCondition's expression and transitionName
by calling
DecisionCondition.getExpression();
getTransitionName()
the following code can help you to understand what DecisionCondition is.//// public class DecisionCondition implements Serializable { private static final long serialVersionUID = 1L; String transitionName; String expression; public DecisionCondition() { } public DecisionCondition(String transitionName, String expression) { this.transitionName = transitionName; this.expression = expression; } public String getExpression() { return expression; } public String getTransitionName() { return transitionName; } }
-
2. Re: API access to decision node's expression
kv Apr 26, 2006 5:36 AM (in response to kv)Sorry if I was not clear enough. I do not need to get expression. I need to set it. So instead of getExpression I need something like setExpression. I could use public constructor of DecisionCondition maybe but when I do something like this:
Decision decision1 = (Decision) procDef.getNode("decision1"); decision1.getDecisionConditions().add(new DecisionCondition("one", "#{money==\"one\"}"));
I get NullPointerException cause getDecisionConditions() returns null and not empty list.
Another thing is Decision class has decisionExpression fieldpublic class Decision extends Node implements Parsable { ... String decisionExpression = null;
And again there is no way to set it programmaticaly.
Any suggestions?