This morning I needed to add a new business rule method to the User entity for team inclusion. I followed all of the regular steps such as create the functionality in my external library, create the new business rule method on the user entity, ensure the new assembly was in the VFS, build interfaces, and build the web application. When I compiled and deployed I was getting an error that the method was not within the User entity (was in the interface correctly) but not the actual user entity. 

When you declare an business rule it does a few things (hopefully I get this right)

1. Update the entity interface with a method signature that matches the new rule

2. Adds a method to the entity that dispatches the call for the business rule. The actual rule is not contained within the entity but within one of the appropriate external assembly.

3. Adds a method entry to the dynamicmethods.xml . This file is the mapping file for the dynamic invocation of method. You can see the assembly, type and method that will be invoked.

So, extending the User entity does not work the same way as the assembly is really a support assembly and is not generated at compile time. To get around this limitation I more specifically just called into my rule directly instead of using the infrastructure. This is another example where external development comes in handy.

– Mark

Leave a Reply