Creating UDF in VDB is same in embedded and Server versions. You need to define the UDF on a View/Virtual model along with its required see https://docs.jboss.org/author/display/TEIID/Support+for+User-Defined+Functions+%28Non-Pushdown%29
The only difference is, the JAR file for UDF needs to be in classpath in embedded, where as in Server it needs to be defined in "lib" or module.
Thanks for the reply.
I was looking for a programmatic way to register non-pushdown functions as we are not using XML descriptor to descibe VDB. Maybe I am doing something wrong but we are using VDB registration as outlined here on this page - https://docs.jboss.org/author/display/TEIID/Embedded+Guide
On further inspection I can see I can register the function as a FunctionMethod using MetadataFactory.addFunction and this seems to be working fine for me.