AbstractMessageAction

Class

AbstractMessageAction

Implements

Constructors

Properties

id

id: string

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

widgetId optional

widgetId: string

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

Methods

destroy

destroy(): void

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

Returns 
void

filterMessage abstract

filterMessage(messageMessage): boolean

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

Parameters
Returns 
boolean

filterMessageType abstract

filterMessageType(messageTypeMessageType, messageWidgetId?string): boolean

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

Parameters
  • messageTypeMessageType
  • messageWidgetIdstringoptional 
Returns 
boolean

onExecute abstract

onExecute(messageMessage, actionConfig?any): boolean | Promise<boolean>

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

Parameters
  • messageMessage
  • actionConfiganyoptional 
Returns 
boolean | Promise<boolean>

onRemoveListen

onRemoveListen(messageTypeMessageType, messageWidgetId?string): void

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

Parameters
  • messageTypeMessageType
  • messageWidgetIdstringoptional 
Returns 
void

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