-1

not in drools project, just in Optaplanner planning project. Optaplanner with drools engine!!! use spring boot service classs in drools project

here more info about this question code structure

here service's function in drl file

rule "RuleLimosis"
when
    ViewPatient($RevId:Id,$PatientID:PatientID, PatientID != null)
then
    boolean limosisFlag = viewPatientService.getChecklistLimosis($RevId);
    System.out.println("empty stomach status: " + limosisFlag);

end

runtime info use @ProblemFactProperty in planning solution class

1 System.out.println("in java file viewPatientService is: " + viewPatientService);

2 System.out.println("in drl one file viewPatientService is: " + viewPatientService);

code 1 have correct value code 2 null

1 Answers1

0

You could wrap the service in a class and create a @ProblemFactProperty field of that wrapper class in the planning solution.

But your constraints shouldn't be calling remote services as that will cripple your score calculation speed.

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
  • I edited my question, my code structure and part of my drl file were posted. this question disturbed me all day. lol – zhang ming Mar 11 '21 at 14:33