Skip to content

feat: allow sourcing of declarative variables on values inside @PlanningListVariable and @InverseRelationShadowVariable #2009

@Christopher-Chianelli

Description

@Christopher-Chianelli

Is your feature request related to a problem? Please describe.
Currently the following is invalid to do since a variable cannot be used as a group source:

@PlanningListVariable
List<Value> values;

@ShadowSources("values[].declarativeVariable")
public Integer maxDeclarativeVariableSupplier() {
    return values.stream().map(Value::getDeclarativeVariable).max(Comparator.naturalOrder()).orElse(null);
} 

Describe the solution you'd like
@PlanningListVariable and @InverseRelationShadowVariable should be able to be used as a group source.

Describe alternatives you've considered
Calling the method inside a constraint (although that loses caching).

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions