Class Alert

  • All Implemented Interfaces:
    java.io.Serializable

    public class Alert
    extends java.lang.Object
    implements java.io.Serializable

    Workflow alert management

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Alert​(java.lang.String id, java.lang.String name, int quantity, int delay, java.lang.String action, int type)
      Constructor
    • Method Summary

      Modifier and Type Method Description
      void addContent​(java.lang.String lang, java.lang.String subject, java.lang.String content)
      Add a content (HTML body)
      void addMedia​(char media)
      Add a media
      void addRecipient​(java.lang.String email, char type)
      Add a recipient
      java.lang.String getContent​(java.lang.String lang)  
      int getDelay()
      Delay between 2 retry in minutes
      java.lang.String getId()
      Alert id
      java.lang.String getName()
      Alert name
      int getQuantity()
      Alert quantity
      java.util.ArrayList<java.lang.String> getRecipentBCC()  
      java.util.ArrayList<java.lang.String> getRecipentCC()  
      java.util.ArrayList<java.lang.String> getRecipentTO()  
      java.lang.String getSubject​(java.lang.String lang)  
      int getType()
      Alert type
      boolean hasRecipient​(java.lang.String email, char type)
      Has a recipient
      boolean isActivityCancelEnabled()  
      boolean isCompensationEnabled()  
      boolean isMessageEnabled()  
      boolean isProcessCancelEnabled()  
      java.lang.String prepareText​(java.lang.String text, ObjectDB obj)  
      void removeRecipient​(java.lang.String email)
      Remove a recipient
      void send​(ActivityFile context, Grant g)
      Activity transition callback
      void send​(Processus p, java.lang.String pid, java.lang.String serial, Activity a, java.lang.String step, java.lang.String actName, java.lang.String aid, java.lang.String actSerial, Grant g)
      Activity timeout
      void send​(Processus p, java.lang.String pid, java.lang.String serial, Grant g)
      Process timeout
      void send​(ObjectDB obj)
      Send the alert from an object.
      void send​(ObjectDB obj, java.util.List<DocumentDB> docs)
      Send the alert with additional attachments
      void send​(java.lang.String subject, java.lang.String body, Grant grant, java.util.List<DocumentDB> docs)
      Send the alert on each medias
      void setContent​(java.lang.String lang, java.lang.String text)  
      void setRecipentBCC​(java.util.ArrayList<java.lang.String> bcc)  
      void setRecipentCC​(java.util.ArrayList<java.lang.String> cc)  
      void setRecipentTO​(java.util.ArrayList<java.lang.String> to)  
      void setSubject​(java.lang.String lang, java.lang.String subject)  
      void setType​(int type)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Alert

        public Alert​(java.lang.String id,
                     java.lang.String name,
                     int quantity,
                     int delay,
                     java.lang.String action,
                     int type)
        Constructor
        Parameters:
        id - Alert id
        name - Alert name
        quantity - Quantity of retry
        delay - Delay between two retry
        action - Mutlivalued actions (ex: M;P)
        type - Info or Warning
    • Method Detail

      • isMessageEnabled

        public boolean isMessageEnabled()
      • isProcessCancelEnabled

        public boolean isProcessCancelEnabled()
      • isActivityCancelEnabled

        public boolean isActivityCancelEnabled()
      • isCompensationEnabled

        public boolean isCompensationEnabled()
      • getId

        public java.lang.String getId()
        Alert id
        Returns:
        id
      • getName

        public java.lang.String getName()
        Alert name
        Returns:
        name
      • getType

        public int getType()
        Alert type
        Returns:
        type
      • setType

        public void setType​(int type)
      • getQuantity

        public int getQuantity()
        Alert quantity
        Returns:
        quantity
      • getDelay

        public int getDelay()
        Delay between 2 retry in minutes
        Returns:
        Delay
      • getRecipentTO

        public java.util.ArrayList<java.lang.String> getRecipentTO()
      • getRecipentCC

        public java.util.ArrayList<java.lang.String> getRecipentCC()
      • getRecipentBCC

        public java.util.ArrayList<java.lang.String> getRecipentBCC()
      • setRecipentTO

        public void setRecipentTO​(java.util.ArrayList<java.lang.String> to)
      • setRecipentCC

        public void setRecipentCC​(java.util.ArrayList<java.lang.String> cc)
      • setRecipentBCC

        public void setRecipentBCC​(java.util.ArrayList<java.lang.String> bcc)
      • hasRecipient

        public boolean hasRecipient​(java.lang.String email,
                                    char type)
        Has a recipient
        Parameters:
        email - user email
        type - RECIP_TO, RECIP_CC or RECIP_BCC
        Returns:
        Has Recipient
      • addRecipient

        public void addRecipient​(java.lang.String email,
                                 char type)
        Add a recipient
        Parameters:
        email - user email
        type - RECIP_TO, RECIP_CC or RECIP_BCC
      • removeRecipient

        public void removeRecipient​(java.lang.String email)
        Remove a recipient
        Parameters:
        email - user email
      • addMedia

        public void addMedia​(char media)
        Add a media
        Parameters:
        media - media type
      • addContent

        public void addContent​(java.lang.String lang,
                               java.lang.String subject,
                               java.lang.String content)
        Add a content (HTML body)
        Parameters:
        lang - Lang
        subject - Subject
        content - Content
      • getSubject

        public java.lang.String getSubject​(java.lang.String lang)
      • setSubject

        public void setSubject​(java.lang.String lang,
                               java.lang.String subject)
      • getContent

        public java.lang.String getContent​(java.lang.String lang)
      • setContent

        public void setContent​(java.lang.String lang,
                               java.lang.String text)
      • send

        public void send​(Processus p,
                         java.lang.String pid,
                         java.lang.String serial,
                         Grant g)
        Process timeout
        Parameters:
        p - Processus
        pid - Processus id
        serial - serial
        g - Grant
      • send

        public void send​(Processus p,
                         java.lang.String pid,
                         java.lang.String serial,
                         Activity a,
                         java.lang.String step,
                         java.lang.String actName,
                         java.lang.String aid,
                         java.lang.String actSerial,
                         Grant g)
        Activity timeout
        Parameters:
        p - processus
        pid - id
        serial - serial
        a - Activity
        step - Step
        actName - Activity Name
        aid - Activity Id
        actSerial - Activity Serial
        g - Grant
      • prepareText

        public java.lang.String prepareText​(java.lang.String text,
                                            ObjectDB obj)
      • send

        public void send​(ObjectDB obj)
        Send the alert from an object. State transition callback, State timeout or specific usage.
        Parameters:
        obj - Selected business object
      • send

        public void send​(ObjectDB obj,
                         java.util.List<DocumentDB> docs)
        Send the alert with additional attachments
        Parameters:
        obj - Selected business object
        docs - Optional additional documents
      • send

        public void send​(ActivityFile context,
                         Grant g)
        Activity transition callback
        Parameters:
        context - ActivityFile
        g - Grant
      • send

        public void send​(java.lang.String subject,
                         java.lang.String body,
                         Grant grant,
                         java.util.List<DocumentDB> docs)

        Send the alert on each medias

        Parameters:
        subject - Main subject
        body - Alert content
        grant - User rights
        docs - Attachments