Results 1 to 4 of 4

Thread: decision-state null test

  1. #1
    Join Date
    Mar 2008
    Posts
    170

    Default decision-state null test

    Hi all,

    I like to check in a flow if a not mandatory input is provided and dependedon the result I like to continue on different states.

    I have tried to use a <decision-state> but the null check does not work. I have also tried to put ${} around the evaluation and different commands (empty, == null, is null)

    Code:
        <input name="businessClassAttribute" value="flowScope.businessClassAttribute" required="false"/>
    
    	<decision-state id="singleOrMultiView.decision">
    		<if test="businessClassAttribute == null" then="viewBusinessClassAttributes.action" else="viewBusinessClassAttribute.view" />
    	</decision-state>
    Any ideas?

    - Peter

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Hmmm, interesting - your first attempt should work as far as I can tell. I assume you are using the Unified EL right, therefore JBoss EL?

    We do have a basic test case for null in our ELExpressionParserTests:

    public void testParseNull() {
    Expression exp = parser.parseExpression("null", null);
    assertEquals(null, exp.getValue(null));
    }

    What is the error you are getting exactly?

    Keith
    Keith Donald
    Core Spring Development Team

  3. #3
    Join Date
    Mar 2008
    Posts
    170

    Default

    Thanks for the quick reply Keith!

    Quote Originally Posted by Keith Donald View Post
    I assume you are using the Unified EL right, therefore JBoss EL?
    I use the el-api shipped with the Tomcat 6 (located in TOMCAT_HOME/lib).

    We do have a basic test case for null in our ELExpressionParserTests:
    I have executed them without any error (with the el-api used from (TOMCAT_HOME/lib).

    What is the error you are getting exactly?
    Sorry that was bad explained in my initial post. I do not get an error message, the expression is never evaluated to true (always goes to the else case).

    An input parameter of a flow is null in case not passed as a parameter? I do not have an object called ''businessClassAttribute" in conversation scope so the input param should be null!?
    What would be the best point to debugg an enty into a subflow?

    - Peter
    Last edited by iwtolall; May 18th, 2008 at 02:03 AM.

  4. #4
    Join Date
    Mar 2008
    Posts
    170

    Default

    I have done some cleanup of my flows (regarding inheritance) and now the problem is gone

    Unfortunately I do not know why the error happened but probably due to an mistake of mine.

    - Peter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •