Loosely Coupling Modules

Loosely Coupling Modules

  

https://success.outsystems.com/Support/Enterprise_Customers/Maintenance_and_Operations/Designing_the_architecture_of_your_OutSystems_applications/05_Service_architecture_patterns/02_Loosely_coupling_modules


See this article. On the bottom it says:


"The recommended solution is to include a Customer_Event entity in Customer_CS, exposingBPT events. When a customer is updated, a new event with the Customer_Id is added.Customer_CS does not need to know who will be listening to that event, keeping its isolation.Contract_CS can have an automatic process reacting to such event."


Now, how does this work exactly? 

How kan the Contract_CS react on the inserts of Customer_CS BPT events?

Can anyone give a concrete example?

Cheers,

Patrice

Hi Patrice,

When creating the Customer_Event in Customer_CS and exposing the BPT events, on the database a table is created with triggers.

When you then create an automatic process in Contract_CS that is started on the trigger in the database, you have two loosely coupled modules.

For instance, you need to create a new contract for every new customer. When the customer is created, the database trigger with the new customer Id starts the automatic process that creates the contract for that new customer.

Kind regards,

Remco Dekkinga

Hi Remco,

Thanks for the insight. I understand now how to expose BPT events, by checking 'Expose Process Events' in the advanced tab of the Customer_Events Entity.

But now in the Contract_CS, where or how to tell this module to 'receive' the events.
Do I have to reference the Customer_Events table from the Contract_CS module? And how to exactly start the Process, is it with the 'Launch On' property?


Cheers,

Patrice

Solution

Hi Patrice,

Yes, the table needs to be referenced and the Launch On property is indeed the location where you can set the trigger.

If the entity (Create only) is not available, click the option 'Another Event' and the entity should become visible in this popup.

If you need to trrigger on Updated records, you can use the Conditional Start. This is a little more tricky, because you should have a process per customer to trigger the correct process.

Kind regards,

Remco Dekkinga

Solution