The docs were wrong. Docs fixed for 6.1.0.CR1: http://github.com/droolsjbpm/optaplanner/commit/496ef134b
On 06-06-14 16:15, Geoffrey De Smet wrote: > On 06-06-14 14:13, dBijkoo wrote: >> when I use this code: >> <subChainChangeMoveSelector> >> <subChainSelector> >> <entitySelector> > <subChainSelector> doesn't supports an <entitySelector> element, > only a <valueSelector> element. > > See > https://github.com/droolsjbpm/optaplanner/blob/master/optaplanner-core/src/main/java/org/optaplanner/core/config/heuristic/selector/value/chained/SubChainSelectorConfig.java#L38-38 > > but <subChainChangeMoveSelector> does supports a <entityClass>, which is > probably what you want to do: > > <subChainChangeMoveSelector> > <entityClass>model.ScheduleBlockPeriod</entityClass> > <subChainSelector> > <minimumSubChainSize>2</minimumSubChainSize> > ... > > > See > https://github.com/droolsjbpm/optaplanner/blob/master/optaplanner-core/src/main/java/org/optaplanner/core/config/heuristic/selector/move/generic/chained/SubChainChangeMoveSelectorConfig.java#L36-36 > > >> >> <entityClass>model.ScheduleBlockPeriod</entityClass> >> >> </entitySelector> >> <minimumSubChainSize>2</minimumSubChainSize> >> <maximumSubChainSize>40</maximumSubChainSize> >> </subChainSelector> >> <valueSelector> >> <variableName>nextScheduleBlockPeriod</variableName> >> </valueSelector> >> >> <selectReversingMoveToo>true</selectReversingMoveToo> >> >> </subChainChangeMoveSelector> >> >> I get the following error: >> /com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$UnknownFieldException: >> No such field >> org.optaplanner.core.config.heuristic.selector.value.chained.SubChainSelectorConfig.entitySelector >> ---- Debugging information ---- >> field : entitySelector >> class : >> org.optaplanner.core.config.heuristic.selector.value.chained.SubChainSelectorConfig >> required-type : >> org.optaplanner.core.config.heuristic.selector.value.chained.SubChainSelectorConfig >> converter-type : >> com.thoughtworks.xstream.converters.reflection.ReflectionConverter >> line number : 57 >> class[1] : >> org.optaplanner.core.config.heuristic.selector.move.generic.chained.SubChainChangeMoveSelectorConfig >> class[2] : >> org.optaplanner.core.config.heuristic.selector.move.composite.CartesianProductMoveSelectorConfig >> class[3] : >> org.optaplanner.core.config.localsearch.LocalSearchSolverPhaseConfig >> class[4] : org.optaplanner.core.config.solver.SolverConfig >> version : 1.4.7 >> ------------------------------- >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.handleUnknownField(AbstractReflectionConverter.java:495) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:351) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) >> at >> com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:474) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:406) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) >> at >> com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:377) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) >> at >> com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:377) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) >> at >> com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:377) >> at >> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) >> at >> com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) >> at >> com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) >> at >> com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) >> at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1185) >> at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1169) >> at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1040) >> at >> org.optaplanner.core.config.solver.XmlSolverFactory.configure(XmlSolverFactory.java:84) >> at >> org.optaplanner.core.config.solver.XmlSolverFactory.configure(XmlSolverFactory.java:74) >> at >> org.optaplanner.core.config.solver.XmlSolverFactory.configure(XmlSolverFactory.java:67) >> at >> org.optaplanner.core.config.solver.XmlSolverFactory.<init>(XmlSolverFactory.java:51) >> at AgendaTest.before(AgendaTest.java:29) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at >> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) >> at >> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) >> at >> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) >> at >> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) >> at >> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) >> at >> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) >> at >> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) >> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) >> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) >> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) >> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) >> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) >> at org.junit.runners.ParentRunner.run(ParentRunner.java:236) >> at org.junit.runner.JUnitCore.run(JUnitCore.java:157) >> at >> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) >> at >> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) >> at >> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) >> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)/ >> >> Even though it is besides naming the same xml code as it shows on the >> website here: >> http://docs.jboss.org/drools/release/6.0.1.Final/optaplanner-docs/html_single/index.html#subChainChangeMoveSelector >> >> My goal is to select a specific chained variable from a planningEntity >> >> >> >> -- >> View this message in context: >> http://drools.46999.n3.nabble.com/No-such-field-org-optaplanner-core-config-heuristic-selector-value-chained-SubChainSelectorConfig-enr-tp4029905.html >> Sent from the Drools: User forum mailing list archive at Nabble.com. >> _______________________________________________ >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users >> > _______________________________________________ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users