Class MessageUtil


  • public final class MessageUtil
    extends Object
    The message properties
    • Field Detail

      • FAILED_STEP_ERROR_CODE

        public static final String FAILED_STEP_ERROR_CODE
        The constant FAILED_STEP_ERROR_CODE.
        See Also:
        Constant Field Values
      • FAILED_STEP_ERROR_MSG

        public static final String FAILED_STEP_ERROR_MSG
        The constant FAILED_STEP_ERROR_MSG.
        See Also:
        Constant Field Values
      • FAILED_STEP_DEEP_LINK

        public static final String FAILED_STEP_DEEP_LINK
        The constant FAILED_STEP_DEEP_LINK.
        See Also:
        Constant Field Values
      • PROP_PARENT_PROCESS_ID

        public static final String PROP_PARENT_PROCESS_ID
        The constant PROP_PARENT_PROCESS_ID.
        See Also:
        Constant Field Values
      • PROP_TKIT_SUB_PROCESS_ID

        public static final String PROP_TKIT_SUB_PROCESS_ID
        The constant PROP_TKIT_SUB_PROCESS_ID.
        See Also:
        Constant Field Values
      • PROP_PROCESS_INSTANCE_ID

        public static final String PROP_PROCESS_INSTANCE_ID
        The JMS process instance ID property name.
        See Also:
        Constant Field Values
      • PROP_DEPLOYMENT_ID

        public static final String PROP_DEPLOYMENT_ID
        The JMS deployment ID property name.
        See Also:
        Constant Field Values
      • PROP_PROCESS_NAME

        public static final String PROP_PROCESS_NAME
        The process process name message property name.
        See Also:
        Constant Field Values
      • PROP_TKIT_RESOLUTION_STATUS

        public static final String PROP_TKIT_RESOLUTION_STATUS
        The Resolution status property.
        See Also:
        Constant Field Values
      • PROP_TKIT_CORRELATION_ID

        public static final String PROP_TKIT_CORRELATION_ID
        The Correlation id property.
        See Also:
        Constant Field Values
      • PROP_KIE_NODE_ID

        public static final String PROP_KIE_NODE_ID
        The process node ID message property name.
        See Also:
        Constant Field Values
      • PROP_KIE_LISTENER_TYPE

        public static final String PROP_KIE_LISTENER_TYPE
        The process listener type message property name.
        See Also:
        Constant Field Values
      • PROP_KIE_NODE_NAME

        public static final String PROP_KIE_NODE_NAME
        The node name message property name.
        See Also:
        Constant Field Values
      • PROP_KIE_NODE_TYPE

        public static final String PROP_KIE_NODE_TYPE
        The node type message property name.
        See Also:
        Constant Field Values
      • PROP_KIE_EXECUTION_DATE

        public static final String PROP_KIE_EXECUTION_DATE
        The process execution date message property name.
        See Also:
        Constant Field Values
      • PROP_PARENT_PROCESS_INSTANCE_ID

        public static final String PROP_PARENT_PROCESS_INSTANCE_ID
        The process parent process instance ID message property name.
        See Also:
        Constant Field Values
      • PROP_PROCESS_VERSION

        public static final String PROP_PROCESS_VERSION
        The process process version message property name.
        See Also:
        Constant Field Values
      • PROP_KIE_PROCESS_LOG_EVENT

        public static final String PROP_KIE_PROCESS_LOG_EVENT
        The process log event message property.
        See Also:
        Constant Field Values
      • PROP_PROCESS_LOG_GUID

        public static final String PROP_PROCESS_LOG_GUID
        The process log GUID property name.
        See Also:
        Constant Field Values
      • PROP_PROCESS_EXEC_LOG_GUID

        public static final String PROP_PROCESS_EXEC_LOG_GUID
        The process execution log GUID property name.
        See Also:
        Constant Field Values
      • PROP_EXECUTION_ID

        public static final String PROP_EXECUTION_ID
        The execution id message property name.
        See Also:
        Constant Field Values
      • PROP_BOUNDARY_EVENT_ID

        public static final String PROP_BOUNDARY_EVENT_ID
        Key for the boundaryEventId attribute
        See Also:
        Constant Field Values
      • PROP_BEH_REFERENCED_STEP_NAME

        public static final String PROP_BEH_REFERENCED_STEP_NAME
        Business error handlers ref step name
        See Also:
        Constant Field Values
      • PROP_BEH_RESOLUTION_SIGNAL_NAME

        public static final String PROP_BEH_RESOLUTION_SIGNAL_NAME
        Business error handlers signal name
        See Also:
        Constant Field Values
      • PROP_BEH_RESOLUTION_ACTIONS

        public static final String PROP_BEH_RESOLUTION_ACTIONS
        Business error handlers ref resolution options
        See Also:
        Constant Field Values
    • Method Detail

      • getProperty

        public static <T> T getProperty​(org.eclipse.microprofile.reactive.messaging.Message msg,
                                        String name)
        Gets the message property. Check if the property exists.
        Type Parameters:
        T - the property type.
        Parameters:
        msg - the message.
        name - the property name.
        Returns:
        the property value.
      • getStringDateProperty

        public static Date getStringDateProperty​(org.eclipse.microprofile.reactive.messaging.Message<String> msg,
                                                 String name,
                                                 Date defaultDate)
        Gets the message property. Check if the property exists.
        Parameters:
        msg - the message.
        name - the property name.
        defaultDate - the default date.
        Returns:
        the property date.
      • getEnumProperty

        public static <T extends Enum<T>> T getEnumProperty​(org.eclipse.microprofile.reactive.messaging.Message msg,
                                                            String name,
                                                            Class<T> clazz)
        Gets the message enum property. Check if the property exists.
        Type Parameters:
        T - the type parameter
        Parameters:
        msg - the message.
        name - the property name.
        clazz - the property enum type.
        Returns:
        the property value.
      • serializeBody

        public static String serializeBody​(Map<String,​Object> data)
                                    throws IOException
        Serialize the data to string for the TextMessage.
        Parameters:
        data - the data.
        Returns:
        the corresponding string value.
        Throws:
        IOException - if the serialization fails.
      • deserialize

        public static <T> T deserialize​(String data)
        Deserialize the data to string for the database.
        Type Parameters:
        T - type of object to deserialize to
        Parameters:
        data - the data.
        Returns:
        the corresponding string value or null if the data is null.
      • serialize

        public static String serialize​(Object data)
        Serialize the data to string for the database.
        Parameters:
        data - the data.
        Returns:
        the corresponding string value or null if the data is null.
      • deserializeBody

        public static Map<String,​Object> deserializeBody​(org.eclipse.microprofile.reactive.messaging.Message<String> message)
                                                        throws IOException
        Deserialize the message to the map of data.
        Parameters:
        message - the message with the string content.
        Returns:
        the corresponding map of data.
        Throws:
        IOException - if the deserialization of the body fails.
      • stringToDate

        public static Date stringToDate​(String value,
                                        Date defaultValue)
        Converts the string to date.
        Parameters:
        value - the string value.
        defaultValue - the default value.
        Returns:
        the corresponding date value.
      • dateToString

        public static String dateToString​(Date date)
        Date to string string.
        Parameters:
        date - the date
        Returns:
        the string