Class ExpressionObject

java.lang.Object
org.bgerp.plugin.msg.max.ExpressionObject
All Implemented Interfaces:
ExpressionObject

public class ExpressionObject extends Object implements ExpressionObject
MAX JEXL API for sending messages to chats. Same API structure as telegram ExpressionObject. Usage in doExpression:
   max.sendMessage(chatId, "Hello")
   max.sendMessage(process, "Status changed")
   max.sendMessage(userIds, "Hello")
   max.sendMessageForProcess(process, "Hello")
 
  • Constructor Details

    • ExpressionObject

      public ExpressionObject()
  • Method Details

    • toContext

      public void toContext(Map<String,Object> context)
      Specified by:
      toContext in interface ExpressionObject
    • sendMessage

      public boolean sendMessage(String chatId, String text)
      Send a plain text message to a chat.
      Parameters:
      chatId - the chat ID
      text - the message
      Returns:
      true if sent successfully
    • sendMessage

      public boolean sendMessage(String chatId, String text, String parseMode)
      Send a message to a chat with a specific format.
      Parameters:
      chatId - the chat ID
      text - the message
      parseMode - the format: null - plain text, MarkdownV2, HTML
      Returns:
      true if sent successfully
    • sendMessage

      public boolean sendMessage(Collection<Integer> userIds, String text)
      Send a plain text message to users.
      Parameters:
      userIds - the user IDs
      text - the message
    • sendMessage

      public boolean sendMessage(Collection<Integer> userIds, String text, String parseMode)
      Send a message with a specific format to users.
      Parameters:
      userIds - the user IDs
      text - the message
      parseMode - the format
    • sendMessage

      public boolean sendMessage(Process process, String text)
      Send a plain text message to process executors.
      Parameters:
      process - the process
      text - the message
      Returns:
      true if all messages sent successfully
    • sendMessage

      public boolean sendMessage(Process process, String text, String parseMode)
      Send a message with a specific format to process executors.
      Parameters:
      process - the process
      text - the message
      parseMode - the format
      Returns:
      true if all messages sent successfully
    • sendMessageForProcess

      public boolean sendMessageForProcess(Process process, String text)
      Send a plain text message to a process by process chatId.
      Parameters:
      process - the process
      text - the message
      Returns:
      true if sent successfully