CustomShadowVariable未在optaplanner java中调用侦听器方法 @Getter @塞特 @规划实体 公开课比赛{ 私人SimpleScore评分; 私有int-id; @CustomShadowVariable(variableListenerClass=MatchVariableListner.class,sources=@PlanningVariableReference(entityClass=Team.class,variableName=“match”)) 私人名单小组; 私人法庭; 提供私人日期; }

CustomShadowVariable未在optaplanner java中调用侦听器方法 @Getter @塞特 @规划实体 公开课比赛{ 私人SimpleScore评分; 私有int-id; @CustomShadowVariable(variableListenerClass=MatchVariableListner.class,sources=@PlanningVariableReference(entityClass=Team.class,variableName=“match”)) 私人名单小组; 私人法庭; 提供私人日期; },java,optaplanner,Java,Optaplanner,这是比赛课 @Getter @塞特 @规划实体 公开课小组{ 私家职系; 私人法庭; @规划变量(valueRangeProviderRefs={“匹配”}) 私人比赛; 私人会所; 私人除数除数; 可用的私有列表; 私有字符串名称; 私有字符串id; 私有列表序列; } 这是团体课 公共类MatchVariableListner实现VariableListener{ 受保护的无效更新匹配(ScoreDirector ScoreDirector团队){ System.out.println(“

这是比赛课

@Getter
@塞特
@规划实体
公开课小组{
私家职系;
私人法庭;
@规划变量(valueRangeProviderRefs={“匹配”})
私人比赛;
私人会所;
私人除数除数;
可用的私有列表;
私有字符串名称;
私有字符串id;
私有列表序列;
}
这是团体课

公共类MatchVariableListner实现VariableListener{
受保护的无效更新匹配(ScoreDirector ScoreDirector团队){
System.out.println(“你好”);
}
@凌驾
添加实体之前的公共无效(ScoreDirector ScoreDirector团队){
}
@凌驾
添加了公共无效后实体(ScoreDirector ScoreDirector团队){
更新匹配(计分主任、团队);
}
@凌驾
更改前的公共无效变量(ScoreDirector ScoreDirector团队){
System.out.println(“呵呵”);
}
@凌驾
更改后的公共无效变量(ScoreDirector ScoreDirector团队){
更新匹配(计分主任、团队);
}
@凌驾
删除实体之前的公共无效(计分主任计分主任,团队){
System.out.println(“呵呵”);
}
@凌驾
移除EntityRemoved后公共无效(ScoreDirector ScoreDirector团队){
System.out.println(“呵呵”);
}
}
这是listner

@Getter
@塞特
@诺尔格构装师
@AllArgsConstructor
@规划解决方案
公共类WSA解决方案{
@PlanningEntityCollectionProperty
列出小组名单;
@问题FactCollectionProperty
@ValueRangeProvider(id=“匹配”)
列出匹配项;
@问题FactCollectionProperty
名单法院;
公共WSA解决方案(名单球队、名单比赛、名单球场){
这个。团队=团队;
this.matches=匹配项;
这个。法院=法院;
}
@计划分数
私人硬软件评分;
}
这是规划解决方案实体,通过向每个团队添加匹配项,它运行良好,但反向阴影变量未调用侦听器方法,我希望通过该方法进行一些操作。但侦听器未获得对接口重写方法的调用。
请提前帮助感谢

为什么不使用
@InverseRelationShadowVariable
(参见文档)?是的,你可以有一个影子变量(另一个字段),这个变量的监听器有“匹配项”作为源