Microlow Call from JavaAction

I am getting below error when casting microflow call result into an object which the called microflow returns:   java.lang.ClassCastException: class com.mendix.basis.objectmanagement.MendixObjectImpl cannot be cast to class “MyObject”   How to cast MendixObjectImpl into my Object which the called microflow returns but not here. I am using this code: MyObject var = Core.microflowCall("module.DS_RetreiveLocationForLT").withParam("Project", __Project).execute(getContext());   Please help.
1 answers

You can access the object that is returned by the microflow like this (don't forget to use the fully qualified name for your parameter entity):

IMendixObject object =  Core.microflowCall("module.DS_RetreiveLocationForLT").withParam("<ModuleName>.Project", __Project).execute(getContext());