Module Creation - Off the wall questions

Questions about and code samples for custom order rules and validation within Select.
Post Reply
B_Hinote
Posts: 41
Joined: Tue Jan 08, 2019 7:20 pm

Module Creation - Off the wall questions

Post by B_Hinote » Wed Jul 17, 2019 9:36 pm

I have a couple off the wall question regarding the recommended approach for the creation of COR Modules.
  1. The Development Studio does not restrict Module Creation to only a Single Module, however, I have not found anywhere that indicates if we should just create one or if we should create several. Is there a recommendation on this?
  2. If multiple modules are expected/allowed, are there any guidelines or recommendations that should be considered when establishing more than one?
Thank you

BobRichards
Posts: 1009
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Module Creation - Off the wall questions

Post by BobRichards » Thu Jul 18, 2019 2:53 pm

These are good questions. It is up to the developer(s) at your shop to determine how to handle this. Our guidance is as follows:
  • Modules should alway have a comment header at the top to clearly explain the logic of the rule. The value of this will sink in a year after you create the rule, need to make a change and have no clue what/why you did.
  • Modules names should reflect the logic in the modules so others can reasonably guess the purpose of the module. (i.e. "RequireUnderwriter", "AddInvoiceNumber")
  • That being said, if you have several very short CORs, there is no reason you can't combine them into a single module.
  • Modules should alway have a comment header at the top to clearly explain the logic of the rule. The value of this will sink in a year after you create the rule, need to make a change and have no clue what/why you did. (This is not a duplicate.)
Other things to be aware of is that all the modules can call functions (def ...) in other modules. When the order is loaded, all the modules are compiled and made part of the order logic. This also means that if two CORs override the same aspect (i.e. two functions named "def Order_IsRush_Value(args)), then only one of the CORs will ever be called and the other will be ignored. It is up to the developer/administrator to ensure there is no collision of function names. If this does occur, we do not guarantee which function will be called.

If you have common code that is used in multiple modules, you can create a module (maybe called "CommonDefs") to hold these so you only have to edit a single module.
Bob Richards, Software Developer, SoftPro

B_Hinote
Posts: 41
Joined: Tue Jan 08, 2019 7:20 pm

Re: Module Creation - Off the wall questions

Post by B_Hinote » Thu Jul 18, 2019 8:36 pm

Thank you for providing this information, as it has definitely shed so light on a few questions I have had.

I was never sure if the recommendation was to create a Module per Field/Rule or if we were to build one overall Super Module that housed all the rules being applied. I assume there may be some type of resource tradeoff based on the objects being referenced unless this is consolidated when the individual modules are compiled into the orders.

Anyway, Thank you again for your response and the information provided.

Post Reply