Concordion > Commands > Expressions >

Complex Expressions

Concordion uses OGNL (Object Graph Notation Language) to reference fields and call methods of the corresponding test fixture and to set specification variables.

By default, Concordion deliberately restricts the expression format that is allowed.

However, if you really want to remove this restriction you can apply the annotation @FullOGNL to your fixture class to allow complex expressions. This would allow you to do things like pass property values of Java beans into methods , or use constant values in concordion:execute commands.

Complex expressions should be used with caution in order to keep your specifications simple.

Examples

The Default column shows whether the Expression is valid by default in Concordion. The @FullOGNL column checks that the Expression is valid when you apply the annotation @FullOGNL to your fixture class.

Expression Default @FullOGNL
#variable yes yes
#arrayVariable[0] no yes
#mapVariable['key'] no yes
#mapVariable.key yes yes
#complexVariable.nestedProperty yes yes
#complexVariable.nestedMethod() yes yes
#complexVariable.nestedMethodWithArg(#arg1) yes yes
#complexVariable.nestedMethodWithArgs(#arg1, #arg2) yes yes
#chainVariable.chain.nestedProperty yes yes
#chainVariable.chain.nestedMethod() no yes
#chainVariable.chain.nestedMethodWithArg(#arg1) no yes
#chainVariable.chain.nestedMethodWithArgs(#arg1, #arg2) no yes
#chainVariable.chain().nestedProperty no yes
#chainVariable.chain().nestedMethod() no yes
#chainVariable.chain().nestedMethodWithArg(#arg1) no yes
#chainVariable.chain().nestedMethodWithArgs(#arg1, #arg2) no yes
#chainVariable.chainWithArg(#arg1).nestedProperty no yes
#chainVariable.chainWithArg(#arg1).nestedMethod() no yes
#chainVariable.chainWithArg(#arg1).nestedMethodWithArg(#arg1) no yes
#chainVariable.chainWithArg(#arg1).nestedMethodWithArgs(#arg1, #arg2) no yes
#chainVariable.chainWithArgs(#arg1, #arg2).nestedProperty no yes
#chainVariable.chainWithArgs(#arg1, #arg2).nestedMethod() no yes
#chainVariable.chainWithArgs(#arg1, #arg2).nestedMethodWithArg(#arg1) no yes
#chainVariable.chainWithArgs(#arg1, #arg2).nestedMethodWithArgs(#arg1, #arg2) no yes
property yes yes
arrayProperty[0] no yes
mapProperty['key'] no yes
mapProperty.key no yes
complexProperty.nestedProperty no yes
complexProperty.nestedMethod() no yes
complexProperty.nestedMethodWithArg(#arg1) no yes
complexProperty.nestedMethodWithArgs(#arg1, #arg2) no yes
chainProperty.chain.nestedProperty no yes
chainProperty.chain.nestedMethod() no yes
chainProperty.chain.nestedMethodWithArg(#arg1) no yes
chainProperty.chain.nestedMethodWithArgs(#arg1, #arg2) no yes
chainProperty.chain().nestedProperty no yes
chainProperty.chain().nestedMethod() no yes
chainProperty.chain().nestedMethodWithArg(#arg1) no yes
chainProperty.chain().nestedMethodWithArgs(#arg1, #arg2) no yes
chainProperty.chainWithArg(#arg1).nestedProperty no yes
chainProperty.chainWithArg(#arg1).nestedMethod() no yes
chainProperty.chainWithArg(#arg1).nestedMethodWithArg(#arg1) no yes
chainProperty.chainWithArg(#arg1).nestedMethodWithArgs(#arg1, #arg2) no yes
chainProperty.chainWithArgs(#arg1, #arg2).nestedProperty no yes
chainProperty.chainWithArgs(#arg1, #arg2).nestedMethod() no yes
chainProperty.chainWithArgs(#arg1, #arg2).nestedMethodWithArg(#arg1) no yes
chainProperty.chainWithArgs(#arg1, #arg2).nestedMethodWithArgs(#arg1, #arg2) no yes
property="value" no yes
property=#arg1 no yes
method() yes yes
methodWithArg(#arg1) yes yes
methodWithArgs(#arg1, #arg2) yes yes
methodReturningArray()[0] no yes
methodReturningMap()['key'] no yes
methodReturningMap().key no yes
methodReturningComplex().nestedProperty no yes
methodReturningComplex().nestedMethod() no yes
methodReturningComplex().nestedMethodWithArg(#arg1) no yes
methodReturningComplex().nestedMethodWithArgs(#arg1, #arg2) no yes
methodReturningChain().chain.nestedProperty no yes
methodReturningChain().chain.nestedMethod() no yes
methodReturningChain().chain.nestedMethodWithArg(#arg1) no yes
methodReturningChain().chain.nestedMethodWithArgs(#arg1, #arg2) no yes
methodReturningChain().chain().nestedProperty no yes
methodReturningChain().chain().nestedMethod() no yes
methodReturningChain().chain().nestedMethodWithArg(#arg1) no yes
methodReturningChain().chain().nestedMethodWithArgs(#arg1, #arg2) no yes
methodReturningChain().chainWithArg(#arg1).nestedProperty no yes
methodReturningChain().chainWithArg(#arg1).nestedMethod() no yes
methodReturningChain().chainWithArg(#arg1).nestedMethodWithArg(#arg1) no yes
methodReturningChain().chainWithArg(#arg1).nestedMethodWithArgs(#arg1, #arg2) no yes
methodReturningChain().chainWithArgs(#arg1, #arg2).nestedProperty no yes
methodReturningChain().chainWithArgs(#arg1, #arg2).nestedMethod() no yes
methodReturningChain().chainWithArgs(#arg1, #arg2).nestedMethodWithArg(#arg1) no yes
methodReturningChain().chainWithArgs(#arg1, #arg2).nestedMethodWithArgs(#arg1, #arg2) no yes