RuntimeEvent
Internal event definitions and decorators
A RuntimeEvent is the internal definition of an event. It holds the identifier, signature, and settings that the
platform uses to route and configure event triggers. Unlike RuntimeFunctions, RuntimeEvents have no run() method —
they are purely declarative.
import { Identifier, Signature, Name, EventSetting } from '@code0-tech/hercules';Overview
RuntimeEvents are the internal counterpart to public-facing Events. Your action fires them explicitly
via action.fire().
@Identifier('user_created')
@Signature('(userId: number): void')
@Name({ code: 'en-US', content: 'User Created' })
@EventSetting({
identifier: 'FILTER_ROLE',
name: [{ code: 'en-US', content: 'Role Filter' }],
optional: true,
})
export class UserCreatedRuntimeEvent {}The descriptor stored in action.runtimeEvents is documented on the
RuntimeEventManager page.
RuntimeEventClass
type RuntimeEventClass = new () => RuntimeEventRunnable;The constructor type accepted by action.registerRuntimeEventClass() and action.fire().
Firing
await action.fire(UserCreatedRuntimeEvent, projectId, { userId: 42 });See action.fire() for the full reference.
Decorators
| Decorator | Description |
|---|---|
@Identifier | Sets the unique runtime identifier |
@Name | Sets the localised display name |
@Description | Sets a short localised description |
@Documentation | Sets long-form documentation text |
@DisplayMessage | Sets the summary text shown in the flow UI |
@Alias | Sets alternative search terms |
@Signature | Sets the TypeScript-like signature string |
@DisplayIcon | Sets the icon shown in the flow UI |
@Editable | Controls editability in the platform UI |
@EventSetting | Adds a configurable setting |
@OmitEvent | Prevents auto-generation of a public event definition |