Open gene-pavlovsky opened 6 years ago
Another workaround is to pass an object that contains the function, and call it as
object.function()
.
I suspect this might be already working in 0.35?
Thanks for the report. Can I see the original call (from the DSL) please?
It was like this
@context(
params = {
externalInterfaceProviderWrapper: memberapplet.ExternalInterfaceProviderWrapper
externalInterfaceProvider: memberapplet.service.externalinterface.IExternalInterfaceProvider,
setExternalInterface: com.transport.externalinterface.IExternalInterface->Void
}
)
{
@map_type("memberapplet.service.externalinterface.IMemberAppletExternalInterfaceService")
memberAppletExternalInterfaceService = new js.memberapplet.service.externalinterface.MemberAppletExternalInterfaceService();
memberAppletExternalInterfaceService.init(externalInterfaceProvider);
setExternalInterface(memberAppletExternalInterfaceService.externalInterface);
The last line is the problem :)
Current workaround:
I pass this param externalInterfaceProviderWrapper: memberapplet.ExternalInterfaceProviderWrapper
And then the last two lines are:
memberAppletExternalInterfaceService.init(externalInterfaceProviderWrapper.externalInterfaceProvider);
externalInterfaceProviderWrapper.setExternalInterface(memberAppletExternalInterfaceService.externalInterface);
This works.
I will try to see if we can update to 0.35 and maybe it's already working there. In any case if you don't already have a test case like this, makes sense to add one.
I've added a function param to my flow file (it's intended as a callback). I then try to call it in flow. It throws an exception:
As a workaround I pass that function to an initialization controller, which then calls it.