-2

I'm new to Ballerina. When I try to execute "ballerina run MainService.bal" I'm getting an error saying undefined function retreiveAllPatientDetails. This function is defined in another ballerina file which is in the same module as the MainService.bal.Following are the files.

PatientService.bal enter image description here

MainService.bal enter image description here

What are the possible causes for this and how can I resolve this?

1 Answers1

2

Here, you are trying to run only MainService.bal but retreiveAllPatientDetails function is defined at the PatientService.bal. So, when compiling the MainService.bal, that function is not visible.

The solution is that, you have to run the module as $ ballerina run patient. This command should be executed from inside of MEDICALINFOSYSTEM directory.

Please refer to https://ballerina.io/learn/structuring-ballerina-code/ for more information on how to structure Ballerina code.

dropbear
  • 1,510
  • 1
  • 12
  • 21
Chanaka Lakmal
  • 1,112
  • 9
  • 19