状況は簡単です。ルール ファイルを作成しました。
package org.domain.rules;
dialect "mvel"
import eu.ohim.fsp.core.configuration.domain.xsd.Section;
global java.lang.String sectionName;
rule "rule 1"
salience 1000
when
Section($name : nameOfTheSection)
eval(sectionName == null)
then
System.out.println("Section: " + $name+ "("+$name.length()+")");
System.out.println("Section Name: " + sectionName + "("+sectionName.length()+")");
System.out.println("Mark Details: " + sectionName.equals(null));
end
ルールを実行する前に、セクション オブジェクトに有効なcoreName
グローバルオブジェクトを追加しました。
public void fireInserted(Section section1) {
kstateful.insert(section1);
kstateful.setGlobal("sectionName", new String("markudetails"));
kstateful.fireAllRules();
}
結果は次のとおりです。
Section: markudetails(12)
Section Name: markudetails(12)
Mark Details: false
質問: どうすればそれが可能になりますか? 部分がnullの場合、および部分がnullでない場合!!!