pubsubevents
Reactive icon

PubSubEvents

version 1.0.1 (Compatible with OutSystems 11)
Uploaded
 on 27 Aug
 by 
0.0
 (0 ratings)
pubsubevents

PubSubEvents

Details
A core utility application providing highly decoupled communication between client-side blocks and screens. It implements the Publish/Subscribe pattern to enable targeted UI state synchronization, effectively replacing complex event bubbling and the reliance on OnParametersChanged for client-side data updates. Use this component to build more modular, maintainable, and responsive user interfaces.
Read more

PubSubEvents is a client-side utility for enabling highly decoupled communication between blocks and screens in OutSystems applications. It implements the Publish/Subscribe (Pub/Sub) pattern to streamline UI state synchronization, eliminating the need for complex event bubbling or reliance on OnParametersChanged.

This component is designed to help developers build modular, maintainable, and responsive user interfaces by allowing blocks to react to events without direct dependencies.

Key Features

  • EventSubscriber Block A lightweight block that listens for a specific event channel (EventId). When an event is received, it automatically triggers a built-in OutSystems event called NotifySubscriber, which bubbles up to the parent block or screen. No manual subscription or unsubscription is required—lifecycle management is handled internally.

  • PublishEvent Client Action Broadcasts a message to all subscribers of a given channel. Accepts an EventId and an optional Payload, allowing for targeted, cross-component communication.

Usage Overview

  1. Subscribing to Events

    • Drag the EventSubscriber block into your UI.

    • Set the EventId input to the name of the channel you want to listen to.

    • Handle the NotifySubscriber event in the parent block or screen to respond to published messages.

  2. Publishing Events

    • Use the PublishEvent client action to send a message to a specific channel.

    • Provide the same EventId used by subscribers and a lightweight Payload (e.g., a record ID or status flag).

Security Consideration

All communication occurs on the client side and is accessible to the end user. Do not transmit sensitive or secure data through the event bus. Any Server Actions triggered by a published event must revalidate user roles and permissions to ensure proper access control.

Release notes (1.0.1)

What's New

  • New EventSubscriber Block  Introduced a reusable block that simplifies event subscription. Just drop it into your UI and configure the EventId and OnEvent—no need to manually call SubscribeToEvent.

  • Automatic Unsubscription  The EventSubscriber block now handles cleanup automatically via OnDestroy, preventing memory leaks and reducing boilerplate code.

  • Improved Documentation & Developer Experience  Updated descriptions, usage examples, and Forge listing to reflect the new block-based architecture. Easier onboarding for new developers.


Enhancements

  • Refactored internal logic for better performance and maintainability.

  • Improved naming conventions and input validation for EventId and Payload.

  • Added comments and structure to client actions for easier customization.


Breaking Changes

  • If you previously used only the SubscribeToEvent client action, consider migrating to the new EventSubscriber block for better lifecycle management.

  • Deprecated manual unsubscription patterns—these are now handled automatically.


Security Reminder

Events are transmitted entirely on the client side. Do not send sensitive data through the Payload. Always validate permissions and roles server-side before executing any critical logic.

License (1.0.1)
Reviews (0)
Team
Other assets in this category