Show Table of Contents
Chapter 18. Migration Guide
18.1. About the Business Resource Planner Migration
From Red Hat JBoss BRMS and Red Hat JBoss BPM Suite 6.1 onwards, Business Resource Planner is fully supported. Business Resource Planner is a lightweight, embeddable constraint satisfaction engine that is able to solve planning problems. Business Resource Planner includes a public API, which will be backwards compatible in later versions such as 6.2 and 6. For more information, see the Business Resource Planner documentation.
The following changes should be noted for implementation in JBoss BPM Suite/JBoss BRMS 6.1 onwards:
- Simulated Annealing now uses the time gradient of the current step instead of the time gradient of the last step. The impact of this change is negligible.
- On AbstractScore, the methods
parseLevelStrings(...)andbuildScorePattern(...)have been changed from public to protected. It is highly unlikely that this affects your code. - The
*Descriptorclasses have been moved into a descriptor package.SolutionDescriptor.isInitialized(Solution)now requires aScoreDirectorparameter. - There is now a better alternative to Brute Force: Branch And Bound, see docs for more information.
InverseRelationShadowVariableListenerhas been renamed toSingletonInverseVariableListener. It, andInverseRelationShadowVariableDescriptorhave moved to the package...impl.domain.variable.inverserelation.- The
ConstraintOccurrenceclasses (which were deprecated) have been remove, and should be switched to theConstraintMatchsystem. - The interface
Solutionhas been promoted to the public API. It has also moved package fromimpl.solutiontoapi.domain.solution.Previously in*.java:import org.optaplanner.core.impl.solution.Solution;
Now in*.java:import org.optaplanner.core.api.domain.solution.Solution;
- All classes in the package
impl.movehave been moved toimpl.heuristic.move. None of them are future-proof enough at this time to be added the public API. Prefer generic moves whenever possible.Previously in*.java:import org.optaplanner.core.impl.move.Move; import org.optaplanner.core.impl.move.CompositeMove; import org.optaplanner.core.impl.move.NoChangeMove;
Now in*.java:import org.optaplanner.core.impl.heuristic.move.Move; import org.optaplanner.core.impl.heuristic.move.CompositeMove; import org.optaplanner.core.impl.heuristic.move.NoChangeMove;
- All classpath resources must lose their leading slash, because Business Resource Planner now expects them to adhere to
ClassLoader.getResource(String)instead ofClass.getResource(String).- The
SolverFactory.createFromXmlResource(String)parameter must lose its leading slash.Previously in*.java:... = SolverFactory.createFromXmlResource( "/org/optaplanner/examples/cloudbalancing/solver/cloudBalancingSolverConfig.xml");
Now in*.java:... = SolverFactory.createFromXmlResource( "org/optaplanner/examples/cloudbalancing/solver/cloudBalancingSolverConfig.xml");
- All elements
<scoreDrl>must lose their leading slash.Previously in*SolverConfig.xmland*BenchmarkConfig.xml:<scoreDrl>/org/optaplanner/examples/cloudbalancing/solver/cloudBalancingScoreRules.drl</scoreDrl>
Now in*SolverConfig.xmland*BenchmarkConfig.xml:<scoreDrl>org/optaplanner/examples/cloudbalancing/solver/cloudBalancingScoreRules.drl</scoreDrl>
- The
PlannerBenchmarkFactory.createFromXmlResource(String)parameter must lose its leading slash.Previously in*.java:... = PlannerBenchmarkFactory.createFromXmlResource( "/org/optaplanner/examples/cloudbalancing/benchmark/cloudBalancingBenchmarkConfig.xml");Now in*.java:... = PlannerBenchmarkFactory.createFromXmlResource( "org/optaplanner/examples/cloudbalancing/benchmark/cloudBalancingBenchmarkConfig.xml"); - The
PlannerBenchmarkFactory.createFromFreemarkerXmlResource(String)parameter must lose its leading slash.Previously in*.java:... = PlannerBenchmarkFactory.createFromFreemarkerXmlResource( "/org/optaplanner/examples/cloudbalancing/benchmark/cloudBalancingBenchmarkConfigTemplate.xml.ftl");
Now in*.java:... = PlannerBenchmarkFactory.createFromFreemarkerXmlResource( "org/optaplanner/examples/cloudbalancing/benchmark/cloudBalancingBenchmarkConfigTemplate.xml.ftl");
- The @PlanningVariable property chained has been refactored to
graphType. This is to allow support for other graph types (such as TREE) in the future.Previously in*.java:@PlanningVariable(chained = true, ...) public Standstill getPreviousStandstill() { return previousStandstill; }Now in*.java:@PlanningVariable(graphType = PlanningVariableGraphType.CHAINED, ...) public Standstill getPreviousStandstill() { return previousStandstill; } - The
constructionHeuristicTypeBEST_FIThas been renamed intoWEAKEST_FIT. The terminology "Best Fit" was not correct and did not allow forSTRONGEST_FIT.Previously in*SolverConfig.xmland*BenchmarkConfig.xml:<constructionHeuristic> <constructionHeuristicType>BEST_FIT</constructionHeuristicType> </constructionHeuristic>Now in*SolverConfig.xmland*BenchmarkConfig.xml:<constructionHeuristic> <constructionHeuristicType>WEAKEST_FIT</constructionHeuristicType> </constructionHeuristic> - The
constructionHeuristicTypeBEST_FIT_DECREASINGhas been renamed intoWEAKEST_FIT_DECREASING. The terminology "Best Fit" was not correct and did not allow forSTRONGEST_FIT_DECREASING.Previously in*SolverConfig.xmland*BenchmarkConfig.xml:<constructionHeuristic> <constructionHeuristicType>BEST_FIT_DECREASING</constructionHeuristicType> </constructionHeuristic>
Now in*SolverConfig.xmland*BenchmarkConfig.xml:<constructionHeuristic> <constructionHeuristicType>WEAKEST_FIT_DECREASING</constructionHeuristicType> </constructionHeuristic>
- For the shadow variable of a bi-directional relationship, the declaration has changed from @PlanningVariable(mappedBy) to @InverseRelationShadowVariable(sourceVariableName).Previously in
*.java:@PlanningVariable(mappedBy = "previousStandstill") Customer getNextCustomer(); void setNextCustomer(Customer nextCustomer);
Now in*.java:@InverseRelationShadowVariable(sourceVariableName = "previousStandstill") Customer getNextCustomer(); void setNextCustomer(Customer nextCustomer);
- Multiple
<planningEntityClass>elements now need to be ordered by superclasses (and superinterfaces) first, instead of superclasses (and superinterfaces) last.Previously in*SolverConfig.xmland*BenchmarkConfig.xml:<planningEntityClass>...TimeWindowedCustomer</planningEntityClass> <planningEntityClass>...Customer</planningEntityClass> <planningEntityClass>...Standstill</planningEntityClass>
Now in*SolverConfig.xmland*BenchmarkConfig.xml:<planningEntityClass>...Standstill</planningEntityClass> <planningEntityClass>...Customer</planningEntityClass> <planningEntityClass>...TimeWindowedCustomer</planningEntityClass>
- The element
<planningEntityClass>has been renamed to<entityClass>.Previously in*SolverConfig.xmland*BenchmarkConfig.xml:<planningEntityClass>org.optaplanner.examples.cloudbalancing.domain.CloudProcess</planningEntityClass>
Now in*SolverConfig.xmland*BenchmarkConfig.xml:<entityClass>org.optaplanner.examples.cloudbalancing.domain.CloudProcess</entityClass>
XStreamScoreConverterandXStreamBendableScoreConverterhave moved package.Previously in*.java:import org.optaplanner.persistence.xstream.XStreamScoreConverter;
Now in*.java:import org.optaplanner.persistence.xstream.impl.score.XStreamScoreConverter;
Previously in*.java:import org.optaplanner.persistence.xstream.XStreamBendableScoreConverter;
Now in*.java:import org.optaplanner.persistence.xstream.impl.score.XStreamBendableScoreConverter;
- If you have a custom Move implementation, now extract
AbstractMove.Previously in*.java:public class CloudComputerChangeMove implements Move {...}Now in*.java:public class CloudComputerChangeMove extends AbstractMove {...}

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.