Community
Participate
Working Groups
Build Identifier: 20100917-0705 Hi, I created a conditional unit which decides by the value of a parameter (set by a previous rule), which of the following rules should be applied. The parameter is either "null" or assigned with an object. The decision, which of the following rules will be applied, is made based on a "empty" rule which has an attribute condition "param == null" to check which value the parameter has. If I create a second conditional unit with the same rules but the condition "param != null" to check the value, I get on both cases the same result, so I assume, the attribute condition resolver works not right when objects are assigned to parameters. I could also provide a sample project with a kind of minimal example. Regards, Johannes Reproducible: Always
Created attachment 193751 [details] The minimal example project mentioned in the description.
Hello, the problem is more general, because only attribute conditions that contain parameters initialized by the rules are checked. To illustrate the problem, assume parameter A which is passed to the rule (for example via parameter mapping), parameter B which is initialized by the rule match and parameter C which is neither passed to the rule nor initialized by the match: A == null: this condition will be checked before the matching starts if A is set A == B: this conditions will be checked as soon as the object containing B is matched B == null: this conditions will be checked as soon as the object containing B is matched C == null: this conditions is not checked because at the end of matching C remains unknown 1+1 == 2: this condition is never checked because it does not contain parameters Parameter mappings always initialize their target variable either with the value of their source parameter or "null" if the source parameter is not initialized. If you use only rules you have to explicitly set a parameter even if you want its value to be "null" e.g. ra.setParameterValue("C",null); Regards, Enrico