MessageAction

Interface

The interface for all message actions. A message action is a piece of code that executes when a matched message is received.

Properties

destroy

destroy: function

When a widget is removed, actions provided by this widget will be destroyed.

Type declaration
    (): void
    Returns 
    void

filterMessage

filterMessage: function

Whether a specific message will trigger this action. This method will be used to filter messages in message manager.

Type declaration
    (messageMessage): boolean
    Parameters
    Returns 
    boolean

filterMessageType

filterMessageType: function

Whether the type of message can trigger this action. This method will be used in builder to filter the available actions.

Type declaration
    (messageTypeMessageType, messageWidgetId?string): boolean
    Parameters
    • messageTypeMessageType
    • messageWidgetIdstringoptional 
    Returns 
    boolean

getSettingComponentUri optional

getSettingComponentUri: function

This component is used to configure the action according to the message.

Type declaration
    (messageTypeMessageType, messageWidgetId?string): string
    Parameters
    • messageTypeMessageType
    • messageWidgetIdstringoptional 
    Returns 
    string

id

id: string

The unique id. For actions provided by a widget, the id is: widgetId + actionName.

onExecute

onExecute: function

This is what the action actually does when the message is matched.

Type declaration
    (messageMessage, actionConfig?any): boolean | Promise<boolean>
    Parameters
    • messageMessage
    • actionConfiganyoptional 
    Returns 
    boolean | Promise<boolean>

onRemoveListen

onRemoveListen: function

When an action is removed from a message's listener, this function will be invoked.

Type declaration
    (messageTypeMessageType, messageWidgetId?string): void
    Parameters
    • messageTypeMessageType
    • messageWidgetIdstringoptional 
    Returns 
    void

widgetId optional

widgetId: string

The widget id that provides the action. No widget id means the actions is provided by jimu.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.