Skip to main content

Hi,

I want to overtake a method with additional parameters in the method signature. But when I do, getting this below shown error during code generation,

Method xxxx___ in layer Cust overtakes Core, but no matching method or function signature was found.

And we must overtake (cannot Override) this method since we have to replace some code segments in the body.

How can we proceed with this?

 

Thanks,

Hasith

Hi @HasithM 

When overtaking and overriding , you can't change the method signature. Signature should be as it is. That is the reason of getting the error  “Method signature not found”. If you want to change the method body completely you can overtake the method and change the content of the body but should not change the method signature. 

 

If you need to add new parameters, implement a new method. 

 

/Harshini


As far as know you can add parameters in overtake and override but only with default value.

@Overtake Core
FUNCTION Get_Description (
contract_ IN VARCHAR2,
new_param_ IN VARCHAR2 DEFAULT NULL) RETURN VARCHAR2

For me requirement of default value makes sense because we need to assure the existing core code still works without knowing about this new parameter.

But as far as I know you cannot change or remove existing parameters. In this part I agree with Harshini.

/Tomasz


Thank you both @hamalk & @dokladny,

 

Yes, the issue was that we have missed to add a default value for the parameter.

In the F1 doc, it says that only method override can add new parameters. But in developer studio we can add new parameters via both override & overtake (with default value).


https://docs.ifs.com/techdocs/22r1/060_development/027_base_server_dev/010_model/900_base-serv-mod-ref/120_plsql_source/700_annotations/100_override.htm

https://docs.ifs.com/techdocs/22r1/060_development/027_base_server_dev/010_model/900_base-serv-mod-ref/120_plsql_source/700_annotations/100_overtake.htm

 

Hope this will help to someone in future. Cheers!


Thank you both @hamalk & @dokladny,

 

Yes, the issue was that we have missed to add a default value for the parameter.

In the F1 doc, it says that only method override can add new parameters. But in developer studio we can add new parameters via both override & overtake (with default value).


https://docs.ifs.com/techdocs/22r1/060_development/027_base_server_dev/010_model/900_base-serv-mod-ref/120_plsql_source/700_annotations/100_override.htm

https://docs.ifs.com/techdocs/22r1/060_development/027_base_server_dev/010_model/900_base-serv-mod-ref/120_plsql_source/700_annotations/100_overtake.htm

 

Hope this will help to someone in future. Cheers!

 

Please note that this default value is only applicable for “IN” type parameters. Default value of parameter is not eligible for “IN OUT & OUT” type parameters. If there is a INOUT or OUT type parameters needs to be added, we have to write a new method logic to handle.


Please note that this default value is only applicable for “IN” type parameters. Default value of parameter is not eligible for “IN OUT & OUT” type parameters. If there is a INOUT or OUT type parameters needs to be added, we have to write a new method logic to handle.

 

As far as I’m concerned lack of possibility of adding OUT parameters in overtakes and overrides is reasonable. Otherwise it would harm existing Core code in places where Core calls this overtaken/overridden method. In Core it would be lack of variable to receive information from this new OUT parameters. And it would generate compilation error.

Fortunately, there is workaround for this problem. You can try to use App_Context_SYS.Set_Value() App_Context_SYS.Find_Value() to indirectly pass the value between procedures/functions. To my mind, we should use this technique carefully because in my opinion it works as a sort of “global variable” and sometimes makes code less readable.

/Tomasz


Reply