Pre & Post Processors are hook-able logic that would help you to execute before or after certain actions executed by Cello. For example, When creating a Tenant, Cello first makes an entry in the Tenant Details Entity then creates an entry in Contact details entity etc, so in certain scenarios where you want to execute some other logic before creating the tenant you could use Pre-Processor to hook it, similarly if you want execute anything after the flow you could utilize Post Processor.

Please follow the below procedure, to define Pre/Post Processor

1) Implement Pre/Post processor classes that inherits from IPreProcessorProvider/IPostProcessorProvider.


Refer : TenantValidationPreProcessor.cs &

   TenantValidationPostProcessor.cs (Attached files)

2) Register the Pre/Post processor classes in Web.Config file.



<add name="TenantValidationPreProcessor" assembly="WebApplication" type="WebApplication.Models.TenantValidationPreProcessor"/>
<add name="TenantValidationPostProcessor" assembly="WebApplication" type="WebApplication.Models.TenantValidationPostProcessor"/>



3) If you want to run the pre/post processors while tenant creation then add the above configuration under Tenant Provision Setting section.



<TenantProvisionSetting defaultProvider="Default">
<add name="Default" assembly="WebApplication" type="WebApplication.Models.TenantValidationPreProcessor" />
<add name="Default" assembly="CelloSaaS.Services" type="CelloSaaS.Services.TenantManagement.DefaultScriptPostProcess"/>



For more details please refer : How-To-Guide