I am not sure about SDE or not. If the UDF isn't properly installed, then the UDF isn't available for the DFDL schema to use; hence, the DFDL schema is in error...? maybe ?
For example, suppose the UDF is in a jar, but that jar isn't on the classpath, nor supplied in any way via CLI arguments. Then an SDE that says "Function pre:myFunc is not defined nor supplied as a User-Defined Function." seems like a legitimate SDE. After all, the user may have the namespace or function name wrong. If there are no UDFs with that namespace at all, then a further diagnostic indicating this would be helpful, and if there are UDFs in that namespace, then a list of them might be useful in the diagnostic message unless there are too many to list. I'd err on the side of listing them. ________________________________ From: Kilo, Olabusayo <ok...@tresys.com> Sent: Friday, September 6, 2019 2:25 PM To: dev@daffodil.apache.org <dev@daffodil.apache.org> Subject: Re: [DISCUSS] User Defined Functions Capability Sounds great. I do like the idea of including official UDFs with actual functionality that we currently don't support, so it'd useful in that sense, but could also act as a model to follow for implementing UDFs with Daffodil. For testing though, I agree with putting stuff in src/test as we can have good UDFs, bad UDFs and everything in between in a consistent manner. Re errors, there was some chatter during the planning phase that wasn't in favor of using SDE & SDWs, so would the Daffodil-defined exception objects you referenced be specific to User Defined Functions? On 9/6/19 11:38 AM, Steve Lawrence wrote: > Completely agreed. > > Regarding test UDF's, we should be able to create custom test UDF's in > src/test/{scala,java} which will get compiled into jars and put on the > class path only during testing. Daffodil should be able to find them > just like it would find any other jar on the classpath, allowing us to > fully exercise UDF capabilities (including broken UDFs) without > polluting daffodil proper. > > On 9/6/19 11:31 AM, Beckerle, Mike wrote: >> re: Design-for-Test for UDF facility >> >> >> When this code gets to code review with tests one of the key things will be >> that we get decent diagnostics from this for all the things users can do >> wrong in creating the UDF jar, such as not having it be found, not having >> all the classes in it, not having them named right or derived properly, etc. >> etc. First cut is errors should be throwing a Daffodil-defined exception >> object, which encapsulates whatever exception object the actual underlying >> UDF reflection code or Service API call throws. >> >> >> Regression testing this UDF facility will require some trickery, as some >> tests will not be ordinary JUnit-style tests, as incorrectly-constructed >> jars have to be created and used. >> >> >> I recommend that we add some "official" UDFs to daffodil that are always >> part of the standard build, not because they are useful, but because they >> allow us to test the UDF system. >> >> >> An important test case is also to define such a UDF which throws an >> exception, so that we can have tests that verify the exception is properly >> caught and reported. >> >> ________________________________ >> From: Kilo, Olabusayo <ok...@tresys.com> >> Sent: Friday, September 6, 2019 10:30 AM >> To: dev@daffodil.apache.org <dev@daffodil.apache.org> >> Subject: [DISCUSS] User Defined Functions Capability >> >> I'm requesting a discussion on the addition of the User Defined Functions >> capability to daffodil. The proposal referenced below provides a possible >> solution for Daffodil to be able to process and use User Defined Functions >> referenced in the DFDL Schema. >> >> The original request can be found at >> https://issues.apache.org/jira/browse/DAFFODIL-2186 and the proposal can be >> found >> https://cwiki.apache.org/confluence/display/DAFFODIL/Proposal%3A+User+Defined+Functions. >> -- Best Regards Lola K.