Cook Book:
1. Install from forge https://www.outsystems.com/forge/component-overview/10975/sse-push-event-hub-o11
:
2. Create A Service Module, for example: SSE_Sample_Refresh
3. Manage Dependency the library:
4. Create a Service Action, for example: Broadcast2HellowWorld , with input parameter Message:
5. Drag the action Broadcast from SSE_IS to the Broadcast2HellowWorld's action flow
6. Assign the property Channel to "HelloWorld" and property Message to input parameter Message:
7. Up to this step, the Broadcast action is completed. Next we create the event subscribe REST API
8. Create a REST API to subscribe: SSESubscribe
9. Put a REST API Method to expose: HelloWorldChannel
10. Drag server action OpenStream from SSE_IS to the flow:
11. Note its URL to be used in the client side: /SSE_Sample_Refresh/rest/SSESubscribe/HelloWorldChannel
12. The subcription rest api to an event is done, now create a Reactive client module, for example: SSE_ClientReactive
13. Install from forge:
https://www.outsystems.com/forge/component-overview/13709/sse-reactive-client-o11
14. Manage Dependency the library to the SSE_ClientReactive:
15. Create a screen - Screen1 - and drag the block SSE\EventSource to the screen
16. Assign the block property SSESubscribeURL to the URL taken on before: "/SSE_Sample_Refresh/rest/SSESubscribe/HelloWorldChannel"
17. For the event section, add the handler -EventSourceMessageReceived- for the event MessageReceived:
18. Drag a widget Table to list entity -for example: ArchitectureSpecialist - in your screen:
19. Inside the event handler EventSourceMessageReceived, just refresh the aggregate:
20. Up to now the list screen is ready to get an event notification. Next Create a screen to raise the event and broadcast
21. Create a new screen -ArchitectureSpecialistDetail- to insert a record to the ArchitectureSpecialist entity:
22. On Save, insert the new record and Broadcast that event to subscriber that in this case will refresh its list:
23. If we open two screen - ArchitectureSpecialistDetail and Screen1 - when we insert the entiity record in the ArchitectureSpecialistDetail , the list in Screen1 will auto refresh automatically