[QUESTION] Will I still be able to use these methods from business rules without the [ Final ]?
I'm working on some custom utility functions that I can utilize in Business Rules as well as other places. I saw this line in the docs:
For each function you wish to define, add a class method to your new function set class. There is no support for polymorphism, so to be precise, you must mark these class methods as final.
but I didn't really know what it meant. I didn't run into any problems until I tried calling one of my new methods from another method. Removing the [ Final ]
fixed the issue, but I'm guessing that means I can't call them from Business Rules now?
Any clarification would be appreciated. And just in case, here are the two methods in question:
{
if $FIND($ZCONVERT(iString,"U"),"-T") {
set iString = $PIECE(iString,"-T",1)
set iString = $PIECE(iString,"-t",1)
}
q iString
}
/// Returns the participant code based on MSH-4
ClassMethod getParticipant(iSendingFacility As %String) As %String
{
set a = ..stripTestFlag($PIECE(iSendingFacility,"^",1))
set b = ..stripTestFlag($PIECE(iSendingFacility,"^",2))
set sc1 = ..Lookup("ParticipantCodeMap",a)
if sc1 = "" {
set sc1 = ..Lookup("ParticipantCodeMap",b)
}
q sc1
}
Again, when I had [ Final ]
and tried to call getParticipant()
it threw an error on the q iString
line of the stripTestFlag()
method. Once I removed [ Final ]
from both it worked fine.