Class AlertWorkflowUnit

  • All Implemented Interfaces:
    com.qfs.snl.workflows.units.IWorkflowUnit, com.quartetfs.fwk.types.IExtendedPluginValue, Serializable

    @QuartetExtendedPluginValue(intf=com.qfs.snl.workflows.units.IWorkflowUnit.class,
                                key="AlertWorkflowUnit")
    public class AlertWorkflowUnit
    extends Object
    implements com.qfs.snl.workflows.units.IWorkflowUnit
    Basic workflow class to work on alerts.

    This provides helper methods to create a message for the alert.

    Author:
    QuartetFS
    See Also:
    Serialized Form
    • Constructor Detail

      • AlertWorkflowUnit

        public AlertWorkflowUnit()
    • Method Detail

      • process

        public void process​(com.qfs.snl.workflows.IWorkflowPayload payload)
        Specified by:
        process in interface com.qfs.snl.workflows.units.IWorkflowUnit
      • getType

        public String getType()
        Specified by:
        getType in interface com.quartetfs.fwk.types.IExtendedPluginValue
      • createMessage

        protected com.qfs.snl.messages.IMessage createMessage​(com.qfs.snl.messages.ITemplateEngine templateEngine,
                                                              String template)
        Parameters:
        templateEngine - template engine to use to render content
        template - path to the template to use
        Returns:
        the create message
      • sendMessage

        public void sendMessage​(com.qfs.snl.messages.IMessageService messageService,
                                com.qfs.snl.messages.ITemplateEngine templateEngine,
                                String template)
        Sends a message about the alert.

        The message has level MessageLevel.DANGER, a default title and a content generated from a given template.

        Parameters:
        messageService - message service used to send messages
        templateEngine - template engine to use to render content
        template - path to the template to use